aws-sdk-deadline 1.20.0

AWS SDK for AWSDeadlineCloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetWorkerOutput {
    /// <p>The worker ID.</p>
    pub worker_id: ::std::string::String,
    /// <p>The farm ID.</p>
    pub farm_id: ::std::string::String,
    /// <p>The fleet ID.</p>
    pub fleet_id: ::std::string::String,
    /// <p>The host properties for the worker.</p>
    pub host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
    /// <p>The status of the worker.</p>
    pub status: crate::types::WorkerStatus,
    /// <p>The logs for the associated worker.</p>
    pub log: ::std::option::Option<crate::types::LogConfiguration>,
    /// <p>The date and time the resource was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The user or system that created this resource.</p>
    pub created_by: ::std::string::String,
    /// <p>The date and time the resource was updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The user or system that updated this resource.</p>
    pub updated_by: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetWorkerOutput {
    /// <p>The worker ID.</p>
    pub fn worker_id(&self) -> &str {
        use std::ops::Deref;
        self.worker_id.deref()
    }
    /// <p>The farm ID.</p>
    pub fn farm_id(&self) -> &str {
        use std::ops::Deref;
        self.farm_id.deref()
    }
    /// <p>The fleet ID.</p>
    pub fn fleet_id(&self) -> &str {
        use std::ops::Deref;
        self.fleet_id.deref()
    }
    /// <p>The host properties for the worker.</p>
    pub fn host_properties(&self) -> ::std::option::Option<&crate::types::HostPropertiesResponse> {
        self.host_properties.as_ref()
    }
    /// <p>The status of the worker.</p>
    pub fn status(&self) -> &crate::types::WorkerStatus {
        &self.status
    }
    /// <p>The logs for the associated worker.</p>
    pub fn log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
        self.log.as_ref()
    }
    /// <p>The date and time the resource was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The user or system that created this resource.</p>
    pub fn created_by(&self) -> &str {
        use std::ops::Deref;
        self.created_by.deref()
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn updated_by(&self) -> ::std::option::Option<&str> {
        self.updated_by.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetWorkerOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetWorkerOutput {
    /// Creates a new builder-style object to manufacture [`GetWorkerOutput`](crate::operation::get_worker::GetWorkerOutput).
    pub fn builder() -> crate::operation::get_worker::builders::GetWorkerOutputBuilder {
        crate::operation::get_worker::builders::GetWorkerOutputBuilder::default()
    }
}

/// A builder for [`GetWorkerOutput`](crate::operation::get_worker::GetWorkerOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetWorkerOutputBuilder {
    pub(crate) worker_id: ::std::option::Option<::std::string::String>,
    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
    pub(crate) host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
    pub(crate) status: ::std::option::Option<crate::types::WorkerStatus>,
    pub(crate) log: ::std::option::Option<crate::types::LogConfiguration>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_by: ::std::option::Option<::std::string::String>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetWorkerOutputBuilder {
    /// <p>The worker ID.</p>
    /// This field is required.
    pub fn worker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.worker_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The worker ID.</p>
    pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.worker_id = input;
        self
    }
    /// <p>The worker ID.</p>
    pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.worker_id
    }
    /// <p>The farm ID.</p>
    /// This field is required.
    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.farm_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The farm ID.</p>
    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.farm_id = input;
        self
    }
    /// <p>The farm ID.</p>
    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.farm_id
    }
    /// <p>The fleet ID.</p>
    /// This field is required.
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.fleet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fleet ID.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>The fleet ID.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.fleet_id
    }
    /// <p>The host properties for the worker.</p>
    pub fn host_properties(mut self, input: crate::types::HostPropertiesResponse) -> Self {
        self.host_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>The host properties for the worker.</p>
    pub fn set_host_properties(mut self, input: ::std::option::Option<crate::types::HostPropertiesResponse>) -> Self {
        self.host_properties = input;
        self
    }
    /// <p>The host properties for the worker.</p>
    pub fn get_host_properties(&self) -> &::std::option::Option<crate::types::HostPropertiesResponse> {
        &self.host_properties
    }
    /// <p>The status of the worker.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::WorkerStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the worker.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::WorkerStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the worker.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::WorkerStatus> {
        &self.status
    }
    /// <p>The logs for the associated worker.</p>
    pub fn log(mut self, input: crate::types::LogConfiguration) -> Self {
        self.log = ::std::option::Option::Some(input);
        self
    }
    /// <p>The logs for the associated worker.</p>
    pub fn set_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
        self.log = input;
        self
    }
    /// <p>The logs for the associated worker.</p>
    pub fn get_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
        &self.log
    }
    /// <p>The date and time the resource was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time the resource was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The user or system that created this resource.</p>
    /// This field is required.
    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.created_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user or system that created this resource.</p>
    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.created_by = input;
        self
    }
    /// <p>The user or system that created this resource.</p>
    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.created_by
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.updated_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.updated_by = input;
        self
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.updated_by
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetWorkerOutput`](crate::operation::get_worker::GetWorkerOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`worker_id`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::worker_id)
    /// - [`farm_id`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::farm_id)
    /// - [`fleet_id`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::fleet_id)
    /// - [`status`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::status)
    /// - [`created_at`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::created_at)
    /// - [`created_by`](crate::operation::get_worker::builders::GetWorkerOutputBuilder::created_by)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_worker::GetWorkerOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_worker::GetWorkerOutput {
            worker_id: self.worker_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "worker_id",
                    "worker_id was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            farm_id: self.farm_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "farm_id",
                    "farm_id was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            fleet_id: self.fleet_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "fleet_id",
                    "fleet_id was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            host_properties: self.host_properties,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            log: self.log,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            created_by: self.created_by.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_by",
                    "created_by was not specified but it is required when building GetWorkerOutput",
                )
            })?,
            updated_at: self.updated_at,
            updated_by: self.updated_by,
            _request_id: self._request_id,
        })
    }
}