aws-sdk-backupexternal 1.0.0

AWS SDK for AWS Backup External
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)]
pub struct CreateApplianceOutput {
    /// The Amazon Resource Name (ARN) of the appliance.
    pub appliance_arn: ::std::string::String,
    /// The date and time that the appliance was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The appliance image to deploy: the Amazon Machine Image (AMI) ID for an `EC2` appliance, or the URL to download the Open Virtual Appliance (OVA) image for a `VMWARE` appliance.
    pub image: ::std::option::Option<::std::string::String>,
    /// The URL to download the root certificate for the appliance's Open Virtual Appliance (OVA) image.
    pub aws_ova_image_root_certificate_download_url: ::std::option::Option<::std::string::String>,
    /// The token used to activate the appliance.
    pub activation_token: ::std::string::String,
    /// The date and time that the activation token expires.
    pub activation_token_expires_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateApplianceOutput {
    /// The Amazon Resource Name (ARN) of the appliance.
    pub fn appliance_arn(&self) -> &str {
        use std::ops::Deref;
        self.appliance_arn.deref()
    }
    /// The date and time that the appliance was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The appliance image to deploy: the Amazon Machine Image (AMI) ID for an `EC2` appliance, or the URL to download the Open Virtual Appliance (OVA) image for a `VMWARE` appliance.
    pub fn image(&self) -> ::std::option::Option<&str> {
        self.image.as_deref()
    }
    /// The URL to download the root certificate for the appliance's Open Virtual Appliance (OVA) image.
    pub fn aws_ova_image_root_certificate_download_url(&self) -> ::std::option::Option<&str> {
        self.aws_ova_image_root_certificate_download_url.as_deref()
    }
    /// The token used to activate the appliance.
    pub fn activation_token(&self) -> &str {
        use std::ops::Deref;
        self.activation_token.deref()
    }
    /// The date and time that the activation token expires.
    pub fn activation_token_expires_at(&self) -> &::aws_smithy_types::DateTime {
        &self.activation_token_expires_at
    }
}
impl ::std::fmt::Debug for CreateApplianceOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateApplianceOutput");
        formatter.field("appliance_arn", &self.appliance_arn);
        formatter.field("created_at", &self.created_at);
        formatter.field("image", &"*** Sensitive Data Redacted ***");
        formatter.field("aws_ova_image_root_certificate_download_url", &"*** Sensitive Data Redacted ***");
        formatter.field("activation_token", &"*** Sensitive Data Redacted ***");
        formatter.field("activation_token_expires_at", &self.activation_token_expires_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for CreateApplianceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateApplianceOutput {
    /// Creates a new builder-style object to manufacture [`CreateApplianceOutput`](crate::operation::create_appliance::CreateApplianceOutput).
    pub fn builder() -> crate::operation::create_appliance::builders::CreateApplianceOutputBuilder {
        crate::operation::create_appliance::builders::CreateApplianceOutputBuilder::default()
    }
}

/// A builder for [`CreateApplianceOutput`](crate::operation::create_appliance::CreateApplianceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateApplianceOutputBuilder {
    pub(crate) appliance_arn: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) image: ::std::option::Option<::std::string::String>,
    pub(crate) aws_ova_image_root_certificate_download_url: ::std::option::Option<::std::string::String>,
    pub(crate) activation_token: ::std::option::Option<::std::string::String>,
    pub(crate) activation_token_expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateApplianceOutputBuilder {
    /// The Amazon Resource Name (ARN) of the appliance.
    /// This field is required.
    pub fn appliance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.appliance_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the appliance.
    pub fn set_appliance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.appliance_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the appliance.
    pub fn get_appliance_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.appliance_arn
    }
    /// The date and time that the appliance was created.
    /// 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
    }
    /// The date and time that the appliance was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The date and time that the appliance was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The appliance image to deploy: the Amazon Machine Image (AMI) ID for an `EC2` appliance, or the URL to download the Open Virtual Appliance (OVA) image for a `VMWARE` appliance.
    pub fn image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image = ::std::option::Option::Some(input.into());
        self
    }
    /// The appliance image to deploy: the Amazon Machine Image (AMI) ID for an `EC2` appliance, or the URL to download the Open Virtual Appliance (OVA) image for a `VMWARE` appliance.
    pub fn set_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image = input;
        self
    }
    /// The appliance image to deploy: the Amazon Machine Image (AMI) ID for an `EC2` appliance, or the URL to download the Open Virtual Appliance (OVA) image for a `VMWARE` appliance.
    pub fn get_image(&self) -> &::std::option::Option<::std::string::String> {
        &self.image
    }
    /// The URL to download the root certificate for the appliance's Open Virtual Appliance (OVA) image.
    pub fn aws_ova_image_root_certificate_download_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aws_ova_image_root_certificate_download_url = ::std::option::Option::Some(input.into());
        self
    }
    /// The URL to download the root certificate for the appliance's Open Virtual Appliance (OVA) image.
    pub fn set_aws_ova_image_root_certificate_download_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aws_ova_image_root_certificate_download_url = input;
        self
    }
    /// The URL to download the root certificate for the appliance's Open Virtual Appliance (OVA) image.
    pub fn get_aws_ova_image_root_certificate_download_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.aws_ova_image_root_certificate_download_url
    }
    /// The token used to activate the appliance.
    /// This field is required.
    pub fn activation_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.activation_token = ::std::option::Option::Some(input.into());
        self
    }
    /// The token used to activate the appliance.
    pub fn set_activation_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.activation_token = input;
        self
    }
    /// The token used to activate the appliance.
    pub fn get_activation_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.activation_token
    }
    /// The date and time that the activation token expires.
    /// This field is required.
    pub fn activation_token_expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.activation_token_expires_at = ::std::option::Option::Some(input);
        self
    }
    /// The date and time that the activation token expires.
    pub fn set_activation_token_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.activation_token_expires_at = input;
        self
    }
    /// The date and time that the activation token expires.
    pub fn get_activation_token_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.activation_token_expires_at
    }
    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 [`CreateApplianceOutput`](crate::operation::create_appliance::CreateApplianceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`appliance_arn`](crate::operation::create_appliance::builders::CreateApplianceOutputBuilder::appliance_arn)
    /// - [`created_at`](crate::operation::create_appliance::builders::CreateApplianceOutputBuilder::created_at)
    /// - [`activation_token`](crate::operation::create_appliance::builders::CreateApplianceOutputBuilder::activation_token)
    /// - [`activation_token_expires_at`](crate::operation::create_appliance::builders::CreateApplianceOutputBuilder::activation_token_expires_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_appliance::CreateApplianceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_appliance::CreateApplianceOutput {
            appliance_arn: self.appliance_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "appliance_arn",
                    "appliance_arn was not specified but it is required when building CreateApplianceOutput",
                )
            })?,
            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 CreateApplianceOutput",
                )
            })?,
            image: self.image,
            aws_ova_image_root_certificate_download_url: self.aws_ova_image_root_certificate_download_url,
            activation_token: self.activation_token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "activation_token",
                    "activation_token was not specified but it is required when building CreateApplianceOutput",
                )
            })?,
            activation_token_expires_at: self.activation_token_expires_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "activation_token_expires_at",
                    "activation_token_expires_at was not specified but it is required when building CreateApplianceOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for CreateApplianceOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateApplianceOutputBuilder");
        formatter.field("appliance_arn", &self.appliance_arn);
        formatter.field("created_at", &self.created_at);
        formatter.field("image", &"*** Sensitive Data Redacted ***");
        formatter.field("aws_ova_image_root_certificate_download_url", &"*** Sensitive Data Redacted ***");
        formatter.field("activation_token", &"*** Sensitive Data Redacted ***");
        formatter.field("activation_token_expires_at", &self.activation_token_expires_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}