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 identifier of the profile entry to update and the fields to change.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct UpdateProfileEntryInput {
    /// The identifier of the profile entry
    pub identifier: ::std::option::Option<::std::string::String>,
    /// The identifier of the owning profile.
    pub profile_identifier: ::std::option::Option<::std::string::String>,
    /// A new name for the entry, unique within the profile.
    pub name: ::std::option::Option<::std::string::String>,
    /// A new description of the entry's purpose. An empty string removes the description.
    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. An empty string removes the entry's role, so the profile's default applies.
    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>,
    /// Changes to the entry's setting values, applied as a JSON merge patch (RFC 7396). An omitted setting is unchanged, null removes a setting so it takes its default if it has one, an object merges into a group's stored values, and any other value replaces the stored one. An array replaces the whole stored array, and a null inside an array is rejected. Keys are the extension's setting ids and the merged values are validated against the extension's settings definitions.
    pub settings: ::std::option::Option<::aws_smithy_types::Document>,
    /// The complete list of capability paths to approve, replacing the entry's current approvals. A capability left out of the list is no longer approved. Omit approve to keep the current approvals.
    pub approve: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateProfileEntryInput {
    /// The identifier of the profile entry
    pub fn identifier(&self) -> ::std::option::Option<&str> {
        self.identifier.as_deref()
    }
    /// The identifier of the owning profile.
    pub fn profile_identifier(&self) -> ::std::option::Option<&str> {
        self.profile_identifier.as_deref()
    }
    /// A new name for the entry, unique within the profile.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// A new description of the entry's purpose. An empty string removes the description.
    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. An empty string removes the entry's role, so the profile's default applies.
    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()
    }
    /// Changes to the entry's setting values, applied as a JSON merge patch (RFC 7396). An omitted setting is unchanged, null removes a setting so it takes its default if it has one, an object merges into a group's stored values, and any other value replaces the stored one. An array replaces the whole stored array, and a null inside an array is rejected. Keys are the extension's setting ids and the merged values are validated against the extension's settings definitions.
    pub fn settings(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.settings.as_ref()
    }
    /// The complete list of capability paths to approve, replacing the entry's current approvals. A capability left out of the list is no longer approved. Omit approve to keep the current approvals.
    ///
    /// 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()
    }
}
impl ::std::fmt::Debug for UpdateProfileEntryInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UpdateProfileEntryInput");
        formatter.field("identifier", &self.identifier);
        formatter.field("profile_identifier", &self.profile_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.finish()
    }
}
impl UpdateProfileEntryInput {
    /// Creates a new builder-style object to manufacture [`UpdateProfileEntryInput`](crate::operation::update_profile_entry::UpdateProfileEntryInput).
    pub fn builder() -> crate::operation::update_profile_entry::builders::UpdateProfileEntryInputBuilder {
        crate::operation::update_profile_entry::builders::UpdateProfileEntryInputBuilder::default()
    }
}

/// A builder for [`UpdateProfileEntryInput`](crate::operation::update_profile_entry::UpdateProfileEntryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct UpdateProfileEntryInputBuilder {
    pub(crate) identifier: ::std::option::Option<::std::string::String>,
    pub(crate) profile_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>>,
}
impl UpdateProfileEntryInputBuilder {
    /// The identifier of the profile entry
    /// This field is required.
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// The identifier of the profile entry
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identifier = input;
        self
    }
    /// The identifier of the profile entry
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// The identifier of the owning profile.
    /// 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 of the owning profile.
    pub fn set_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.profile_identifier = input;
        self
    }
    /// The identifier of the owning profile.
    pub fn get_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.profile_identifier
    }
    /// A new name for the entry, unique within the profile.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// A new name for the entry, unique within the profile.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// A new name for the entry, unique within the profile.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// A new description of the entry's purpose. An empty string removes the description.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// A new description of the entry's purpose. An empty string removes the description.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// A new description of the entry's purpose. An empty string removes the description.
    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. An empty string removes the entry's role, so the profile's default applies.
    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. An empty string removes the entry's role, so the profile's default applies.
    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. An empty string removes the entry's role, so the profile's default applies.
    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
    }
    /// Changes to the entry's setting values, applied as a JSON merge patch (RFC 7396). An omitted setting is unchanged, null removes a setting so it takes its default if it has one, an object merges into a group's stored values, and any other value replaces the stored one. An array replaces the whole stored array, and a null inside an array is rejected. Keys are the extension's setting ids and the merged values are validated against the extension's settings definitions.
    pub fn settings(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.settings = ::std::option::Option::Some(input);
        self
    }
    /// Changes to the entry's setting values, applied as a JSON merge patch (RFC 7396). An omitted setting is unchanged, null removes a setting so it takes its default if it has one, an object merges into a group's stored values, and any other value replaces the stored one. An array replaces the whole stored array, and a null inside an array is rejected. Keys are the extension's setting ids and the merged values are validated against the extension's settings definitions.
    pub fn set_settings(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.settings = input;
        self
    }
    /// Changes to the entry's setting values, applied as a JSON merge patch (RFC 7396). An omitted setting is unchanged, null removes a setting so it takes its default if it has one, an object merges into a group's stored values, and any other value replaces the stored one. An array replaces the whole stored array, and a null inside an array is rejected. Keys are the extension's setting ids and the merged values are validated against the extension's settings definitions.
    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).
    ///
    /// The complete list of capability paths to approve, replacing the entry's current approvals. A capability left out of the list is no longer approved. Omit approve to keep the current approvals.
    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
    }
    /// The complete list of capability paths to approve, replacing the entry's current approvals. A capability left out of the list is no longer approved. Omit approve to keep the current approvals.
    pub fn set_approve(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.approve = input;
        self
    }
    /// The complete list of capability paths to approve, replacing the entry's current approvals. A capability left out of the list is no longer approved. Omit approve to keep the current approvals.
    pub fn get_approve(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.approve
    }
    /// Consumes the builder and constructs a [`UpdateProfileEntryInput`](crate::operation::update_profile_entry::UpdateProfileEntryInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_profile_entry::UpdateProfileEntryInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_profile_entry::UpdateProfileEntryInput {
            identifier: self.identifier,
            profile_identifier: self.profile_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,
        })
    }
}
impl ::std::fmt::Debug for UpdateProfileEntryInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UpdateProfileEntryInputBuilder");
        formatter.field("identifier", &self.identifier);
        formatter.field("profile_identifier", &self.profile_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.finish()
    }
}