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.

/// The profile, extension, and configuration for the new entry.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateProfileEntryInput {
    /// The identifier (id or name) of the profile to bind the extension to.
    pub profile_identifier: ::std::option::Option<::std::string::String>,
    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
    pub client_token: ::std::option::Option<::std::string::String>,
    /// The id of the extension to bind, such as aws:secretsmanager.
    pub extension_identifier: ::std::option::Option<::std::string::String>,
    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
    pub name: ::std::option::Option<::std::string::String>,
    /// A description of the entry's purpose.
    pub description: ::std::option::Option<::std::string::String>,
    /// Per-interface options, keyed by the id of an interface the extension declares.
    pub interfaces: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>>,
    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
    pub execution_role: ::std::option::Option<::std::string::String>,
    /// Controls which extension version this entry tracks and how it adopts new releases.
    pub version_policy: ::std::option::Option<crate::types::VersionPolicy>,
    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
    pub settings: ::std::option::Option<::aws_smithy_types::Document>,
    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
    pub approve: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// Tags to assign to the profile entry.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateProfileEntryInput {
    /// The identifier (id or name) of the profile to bind the extension to.
    pub fn profile_identifier(&self) -> ::std::option::Option<&str> {
        self.profile_identifier.as_deref()
    }
    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// The id of the extension to bind, such as aws:secretsmanager.
    pub fn extension_identifier(&self) -> ::std::option::Option<&str> {
        self.extension_identifier.as_deref()
    }
    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// A description of the entry's purpose.
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// Per-interface options, keyed by the id of an interface the extension declares.
    pub fn interfaces(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>> {
        self.interfaces.as_ref()
    }
    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
    pub fn execution_role(&self) -> ::std::option::Option<&str> {
        self.execution_role.as_deref()
    }
    /// Controls which extension version this entry tracks and how it adopts new releases.
    pub fn version_policy(&self) -> ::std::option::Option<&crate::types::VersionPolicy> {
        self.version_policy.as_ref()
    }
    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
    pub fn settings(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.settings.as_ref()
    }
    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.approve.is_none()`.
    pub fn approve(&self) -> &[::std::string::String] {
        self.approve.as_deref().unwrap_or_default()
    }
    /// Tags to assign to the profile entry.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::std::fmt::Debug for CreateProfileEntryInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateProfileEntryInput");
        formatter.field("profile_identifier", &self.profile_identifier);
        formatter.field("client_token", &self.client_token);
        formatter.field("extension_identifier", &self.extension_identifier);
        formatter.field("name", &self.name);
        formatter.field("description", &self.description);
        formatter.field("interfaces", &self.interfaces);
        formatter.field("execution_role", &self.execution_role);
        formatter.field("version_policy", &self.version_policy);
        formatter.field("settings", &"*** Sensitive Data Redacted ***");
        formatter.field("approve", &self.approve);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl CreateProfileEntryInput {
    /// Creates a new builder-style object to manufacture [`CreateProfileEntryInput`](crate::operation::create_profile_entry::CreateProfileEntryInput).
    pub fn builder() -> crate::operation::create_profile_entry::builders::CreateProfileEntryInputBuilder {
        crate::operation::create_profile_entry::builders::CreateProfileEntryInputBuilder::default()
    }
}

/// A builder for [`CreateProfileEntryInput`](crate::operation::create_profile_entry::CreateProfileEntryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateProfileEntryInputBuilder {
    pub(crate) profile_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) extension_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) interfaces: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>>,
    pub(crate) execution_role: ::std::option::Option<::std::string::String>,
    pub(crate) version_policy: ::std::option::Option<crate::types::VersionPolicy>,
    pub(crate) settings: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) approve: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateProfileEntryInputBuilder {
    /// The identifier (id or name) of the profile to bind the extension to.
    /// This field is required.
    pub fn profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.profile_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// The identifier (id or name) of the profile to bind the extension to.
    pub fn set_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.profile_identifier = input;
        self
    }
    /// The identifier (id or name) of the profile to bind the extension to.
    pub fn get_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.profile_identifier
    }
    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// The id of the extension to bind, such as aws:secretsmanager.
    /// This field is required.
    pub fn extension_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.extension_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// The id of the extension to bind, such as aws:secretsmanager.
    pub fn set_extension_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.extension_identifier = input;
        self
    }
    /// The id of the extension to bind, such as aws:secretsmanager.
    pub fn get_extension_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.extension_identifier
    }
    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// A description of the entry's purpose.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// A description of the entry's purpose.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// A description of the entry's purpose.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Adds a key-value pair to `interfaces`.
    ///
    /// To override the contents of this collection use [`set_interfaces`](Self::set_interfaces).
    ///
    /// Per-interface options, keyed by the id of an interface the extension declares.
    pub fn interfaces(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::InterfaceOptions) -> Self {
        let mut hash_map = self.interfaces.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.interfaces = ::std::option::Option::Some(hash_map);
        self
    }
    /// Per-interface options, keyed by the id of an interface the extension declares.
    pub fn set_interfaces(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>>,
    ) -> Self {
        self.interfaces = input;
        self
    }
    /// Per-interface options, keyed by the id of an interface the extension declares.
    pub fn get_interfaces(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>> {
        &self.interfaces
    }
    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
    pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_role = ::std::option::Option::Some(input.into());
        self
    }
    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
    pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_role = input;
        self
    }
    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
    pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_role
    }
    /// Controls which extension version this entry tracks and how it adopts new releases.
    pub fn version_policy(mut self, input: crate::types::VersionPolicy) -> Self {
        self.version_policy = ::std::option::Option::Some(input);
        self
    }
    /// Controls which extension version this entry tracks and how it adopts new releases.
    pub fn set_version_policy(mut self, input: ::std::option::Option<crate::types::VersionPolicy>) -> Self {
        self.version_policy = input;
        self
    }
    /// Controls which extension version this entry tracks and how it adopts new releases.
    pub fn get_version_policy(&self) -> &::std::option::Option<crate::types::VersionPolicy> {
        &self.version_policy
    }
    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
    pub fn settings(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.settings = ::std::option::Option::Some(input);
        self
    }
    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
    pub fn set_settings(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.settings = input;
        self
    }
    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
    pub fn get_settings(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.settings
    }
    /// Appends an item to `approve`.
    ///
    /// To override the contents of this collection use [`set_approve`](Self::set_approve).
    ///
    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
    pub fn approve(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.approve.unwrap_or_default();
        v.push(input.into());
        self.approve = ::std::option::Option::Some(v);
        self
    }
    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
    pub fn set_approve(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.approve = input;
        self
    }
    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
    pub fn get_approve(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.approve
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// Tags to assign to the profile entry.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// Tags to assign to the profile entry.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// Tags to assign to the profile entry.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateProfileEntryInput`](crate::operation::create_profile_entry::CreateProfileEntryInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_profile_entry::CreateProfileEntryInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_profile_entry::CreateProfileEntryInput {
            profile_identifier: self.profile_identifier,
            client_token: self.client_token,
            extension_identifier: self.extension_identifier,
            name: self.name,
            description: self.description,
            interfaces: self.interfaces,
            execution_role: self.execution_role,
            version_policy: self.version_policy,
            settings: self.settings,
            approve: self.approve,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreateProfileEntryInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateProfileEntryInputBuilder");
        formatter.field("profile_identifier", &self.profile_identifier);
        formatter.field("client_token", &self.client_token);
        formatter.field("extension_identifier", &self.extension_identifier);
        formatter.field("name", &self.name);
        formatter.field("description", &self.description);
        formatter.field("interfaces", &self.interfaces);
        formatter.field("execution_role", &self.execution_role);
        formatter.field("version_policy", &self.version_policy);
        formatter.field("settings", &"*** Sensitive Data Redacted ***");
        formatter.field("approve", &self.approve);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}