diff --git a/src/v1/client/builder.rs b/src/v1/client/builder.rs index 1b85514..206f508 100644 --- a/src/v1/client/builder.rs +++ b/src/v1/client/builder.rs @@ -36,7 +36,7 @@ impl std::fmt::Display for Error { pub type Result = std::result::Result; /// A builder for a [`Client`](Client). -#[derive(Debug, Default)] +#[derive(Clone, Debug, Default)] pub struct Builder { /// The base URL for the requests. url: Option, diff --git a/src/v1/client/options.rs b/src/v1/client/options.rs index 256a0a4..9a7c650 100644 --- a/src/v1/client/options.rs +++ b/src/v1/client/options.rs @@ -6,7 +6,7 @@ use reqwest::header::HeaderMap; const DEFAULT_RETRIES: u32 = 3; /// Options used within a [`Client`](super::Client). -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct Options { /// Headers to include in each request. pub headers: HeaderMap, diff --git a/src/v1/client/tasks.rs b/src/v1/client/tasks.rs index ef7bccd..8b980fd 100644 --- a/src/v1/client/tasks.rs +++ b/src/v1/client/tasks.rs @@ -3,7 +3,7 @@ /// An argument that affects which fields are returned on certain task-related /// endpoints. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "UPPERCASE"))] pub enum View { diff --git a/src/v1/types/responses.rs b/src/v1/types/responses.rs index 8520e24..076da3b 100644 --- a/src/v1/types/responses.rs +++ b/src/v1/types/responses.rs @@ -6,7 +6,7 @@ pub mod task; pub use service::ServiceInfo; /// A response from `POST /tasks`. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct CreateTask { /// The ID of the created task. @@ -14,7 +14,7 @@ pub struct CreateTask { } /// The response from `GET /tasks`. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct ListTasks { /// The tasks in this page of results. diff --git a/src/v1/types/responses/service.rs b/src/v1/types/responses/service.rs index aafab53..88a4342 100644 --- a/src/v1/types/responses/service.rs +++ b/src/v1/types/responses/service.rs @@ -8,7 +8,7 @@ use url::Url; /// /// Note that, in the case of the Task Execution Service specification, this can /// only be `"tes"` but it's still technically listed as an enum. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Artifact { /// A task execution service. @@ -18,7 +18,7 @@ pub enum Artifact { } /// An organization provided a TES service. -#[derive(Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Organization { /// The organization name. @@ -29,7 +29,7 @@ pub struct Organization { } /// A type of service. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct ServiceType { /// Namespace in reverse domain name format. @@ -43,7 +43,7 @@ pub struct ServiceType { } /// A set of service information for the server. -#[derive(Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct ServiceInfo { diff --git a/src/v1/types/responses/task.rs b/src/v1/types/responses/task.rs index 0c14b79..df21bd8 100644 --- a/src/v1/types/responses/task.rs +++ b/src/v1/types/responses/task.rs @@ -4,7 +4,7 @@ use crate::v1::types::task::State; use crate::v1::types::Task; /// A response for when `?view=MINIMAL` in a task endpoint. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct MinimalTask { /// The ID. @@ -15,7 +15,7 @@ pub struct MinimalTask { } /// A generalized response for getting tasks with the `view` parameter. -#[derive(Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(untagged))] pub enum Response { diff --git a/src/v1/types/task.rs b/src/v1/types/task.rs index d70e476..7549f4a 100644 --- a/src/v1/types/task.rs +++ b/src/v1/types/task.rs @@ -12,7 +12,7 @@ pub mod file; pub use executor::Executor; /// State of TES task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "UPPERCASE"))] pub enum State { @@ -58,7 +58,7 @@ impl State { } /// An input for a TES task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Input { /// An optional name. @@ -82,7 +82,7 @@ pub struct Input { } /// An output for a TES task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Output { /// An optional name. @@ -103,7 +103,7 @@ pub struct Output { } /// Requested resources for a TES task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Resources { /// The number of CPU cores. @@ -123,7 +123,7 @@ pub struct Resources { } /// An output file log. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct OutputFileLog { /// The URL. @@ -137,7 +137,7 @@ pub struct OutputFileLog { } /// A task log. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct TaskLog { /// The executor logs. @@ -157,7 +157,7 @@ pub struct TaskLog { } /// A task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Task { /// The ID. diff --git a/src/v1/types/task/executor.rs b/src/v1/types/task/executor.rs index a27ed6f..ced7c65 100644 --- a/src/v1/types/task/executor.rs +++ b/src/v1/types/task/executor.rs @@ -10,7 +10,7 @@ use chrono::Utc; /// In short, an executor is a single command that is run in a different /// container image. [`Executor`]s are run sequentially as they are specified in /// the task. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Executor { /// The image. @@ -36,7 +36,7 @@ pub struct Executor { } /// A log for an [`Executor`]. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Log { /// The start time. diff --git a/src/v1/types/task/file.rs b/src/v1/types/task/file.rs index 00059b5..56960d3 100644 --- a/src/v1/types/task/file.rs +++ b/src/v1/types/task/file.rs @@ -1,7 +1,7 @@ //! Files declared within tasks. /// A type of file. -#[derive(Debug, Default, Eq, PartialEq)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Type { /// A file.