aws-sdk-cloudextensions 1.0.0

AWS SDK for AWS Cloud Extensions
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// A profile represents a deployment target — the configuration context in which extensions run. Profiles own profile entries that bind specific extensions to the profile's execution environment.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetProfileOutput {
    /// The service-generated id of the profile.
    pub id: ::std::string::String,
    /// The name of the profile.
    pub name: ::std::string::String,
    /// The Amazon Resource Name (ARN) of the profile.
    pub arn: ::std::string::String,
    /// The number of entries in this profile.
    pub entry_count: i32,
    /// When the profile was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// When the profile was last updated. Equal to createdAt until the first update.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// A human-readable description of this profile's purpose or target environment.
    pub description: ::std::option::Option<::std::string::String>,
    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
    pub extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
    _request_id: Option<String>,
}
impl GetProfileOutput {
    /// The service-generated id of the profile.
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// The name of the profile.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The Amazon Resource Name (ARN) of the profile.
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// The number of entries in this profile.
    pub fn entry_count(&self) -> i32 {
        self.entry_count
    }
    /// When the profile was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// When the profile was last updated. Equal to createdAt until the first update.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// A human-readable description of this profile's purpose or target environment.
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
    pub fn extension_defaults(&self) -> ::std::option::Option<&crate::types::ExtensionDefaults> {
        self.extension_defaults.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetProfileOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetProfileOutput {
    /// Creates a new builder-style object to manufacture [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
    pub fn builder() -> crate::operation::get_profile::builders::GetProfileOutputBuilder {
        crate::operation::get_profile::builders::GetProfileOutputBuilder::default()
    }
}

/// A builder for [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetProfileOutputBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) entry_count: ::std::option::Option<i32>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
    _request_id: Option<String>,
}
impl GetProfileOutputBuilder {
    /// The service-generated id of the profile.
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// The service-generated id of the profile.
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// The service-generated id of the profile.
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// The name of the profile.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the profile.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the profile.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The Amazon Resource Name (ARN) of the profile.
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the profile.
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the profile.
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// The number of entries in this profile.
    /// This field is required.
    pub fn entry_count(mut self, input: i32) -> Self {
        self.entry_count = ::std::option::Option::Some(input);
        self
    }
    /// The number of entries in this profile.
    pub fn set_entry_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.entry_count = input;
        self
    }
    /// The number of entries in this profile.
    pub fn get_entry_count(&self) -> &::std::option::Option<i32> {
        &self.entry_count
    }
    /// When the profile 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
    }
    /// When the profile was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// When the profile was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// When the profile was last updated. Equal to createdAt until the first update.
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// When the profile was last updated. Equal to createdAt until the first update.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// When the profile was last updated. Equal to createdAt until the first update.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// A human-readable description of this profile's purpose or target environment.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// A human-readable description of this profile's purpose or target environment.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// A human-readable description of this profile's purpose or target environment.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
    pub fn extension_defaults(mut self, input: crate::types::ExtensionDefaults) -> Self {
        self.extension_defaults = ::std::option::Option::Some(input);
        self
    }
    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
    pub fn set_extension_defaults(mut self, input: ::std::option::Option<crate::types::ExtensionDefaults>) -> Self {
        self.extension_defaults = input;
        self
    }
    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
    pub fn get_extension_defaults(&self) -> &::std::option::Option<crate::types::ExtensionDefaults> {
        &self.extension_defaults
    }
    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 [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`id`](crate::operation::get_profile::builders::GetProfileOutputBuilder::id)
    /// - [`name`](crate::operation::get_profile::builders::GetProfileOutputBuilder::name)
    /// - [`arn`](crate::operation::get_profile::builders::GetProfileOutputBuilder::arn)
    /// - [`entry_count`](crate::operation::get_profile::builders::GetProfileOutputBuilder::entry_count)
    /// - [`created_at`](crate::operation::get_profile::builders::GetProfileOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::get_profile::builders::GetProfileOutputBuilder::updated_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_profile::GetProfileOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_profile::GetProfileOutput {
            id: self.id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "id",
                    "id was not specified but it is required when building GetProfileOutput",
                )
            })?,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building GetProfileOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building GetProfileOutput",
                )
            })?,
            entry_count: self.entry_count.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "entry_count",
                    "entry_count was not specified but it is required when building GetProfileOutput",
                )
            })?,
            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 GetProfileOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building GetProfileOutput",
                )
            })?,
            description: self.description,
            extension_defaults: self.extension_defaults,
            _request_id: self._request_id,
        })
    }
}