Skip to content

Commit

Permalink
feat: adds v1::types::responses::task::View
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Sep 23, 2024
1 parent 9813cbc commit d5fd2e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- Adds `v1::types::responses::task::View` so it can be accepted as a query
parameter in downstream crates.

### Changed

- Promotes the `v1::types::responses::service` module to public.
Expand Down
18 changes: 18 additions & 0 deletions src/v1/types/responses/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
use crate::v1::types::Task;
use crate::v1::types::task::State;

/// A requested view of tasks.
// TODO(clay): this is duplicated with some functionality of [`Response`]
// below—can it be deduplicated?
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(untagged, rename_all = "UPPERCASE"))]
#[cfg_attr(feature = "ord", derive(Ord, PartialOrd))]
pub enum View {
/// The `MINIMAL` view.
Minimal,

/// The `BASIC` view.
Basic,

/// The `FULL` view.
Full,
}

/// A response for when `?view=MINIMAL` in a task endpoint.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down

0 comments on commit d5fd2e1

Please sign in to comment.