aws-sdk-context 1.0.0

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

/// <p>The members that CreateChangeSet takes.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateChangeSetInput {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token returns the same change set.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>Who can read the nodes that this change set writes. AWS Context refuses it on a change set that only deletes. If you omit it, every reader of the agent context can read a node that the change creates, and every other node keeps its access control. If you specify it, it replaces the access control of every node that the change set writes, and an absent or empty <code>accessControlList</code> lets nobody read them.</p>
    pub access_control_config: ::std::option::Option<crate::types::AccessControlConfig>,
    /// <p>The agent context to change, by its ID or ARN.</p>
    pub agent_context_id: ::std::option::Option<::std::string::String>,
    /// <p>The operations to write, each a <code>ChangeSetOperation</code>, from 1 to 1,000. If the list is empty or names the same entity twice, the request fails with <code>ValidationException</code>.</p>
    pub operations: ::std::option::Option<::std::vec::Vec<crate::types::ChangeSetOperation>>,
}
impl CreateChangeSetInput {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token returns the same change set.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>Who can read the nodes that this change set writes. AWS Context refuses it on a change set that only deletes. If you omit it, every reader of the agent context can read a node that the change creates, and every other node keeps its access control. If you specify it, it replaces the access control of every node that the change set writes, and an absent or empty <code>accessControlList</code> lets nobody read them.</p>
    pub fn access_control_config(&self) -> ::std::option::Option<&crate::types::AccessControlConfig> {
        self.access_control_config.as_ref()
    }
    /// <p>The agent context to change, by its ID or ARN.</p>
    pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
        self.agent_context_id.as_deref()
    }
    /// <p>The operations to write, each a <code>ChangeSetOperation</code>, from 1 to 1,000. If the list is empty or names the same entity twice, the request fails with <code>ValidationException</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.operations.is_none()`.
    pub fn operations(&self) -> &[crate::types::ChangeSetOperation] {
        self.operations.as_deref().unwrap_or_default()
    }
}
impl CreateChangeSetInput {
    /// Creates a new builder-style object to manufacture [`CreateChangeSetInput`](crate::operation::create_change_set::CreateChangeSetInput).
    pub fn builder() -> crate::operation::create_change_set::builders::CreateChangeSetInputBuilder {
        crate::operation::create_change_set::builders::CreateChangeSetInputBuilder::default()
    }
}

/// A builder for [`CreateChangeSetInput`](crate::operation::create_change_set::CreateChangeSetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateChangeSetInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) access_control_config: ::std::option::Option<crate::types::AccessControlConfig>,
    pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
    pub(crate) operations: ::std::option::Option<::std::vec::Vec<crate::types::ChangeSetOperation>>,
}
impl CreateChangeSetInputBuilder {
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token returns the same change set.</p>
    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
    }
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token returns the same change set.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token returns the same change set.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>Who can read the nodes that this change set writes. AWS Context refuses it on a change set that only deletes. If you omit it, every reader of the agent context can read a node that the change creates, and every other node keeps its access control. If you specify it, it replaces the access control of every node that the change set writes, and an absent or empty <code>accessControlList</code> lets nobody read them.</p>
    pub fn access_control_config(mut self, input: crate::types::AccessControlConfig) -> Self {
        self.access_control_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Who can read the nodes that this change set writes. AWS Context refuses it on a change set that only deletes. If you omit it, every reader of the agent context can read a node that the change creates, and every other node keeps its access control. If you specify it, it replaces the access control of every node that the change set writes, and an absent or empty <code>accessControlList</code> lets nobody read them.</p>
    pub fn set_access_control_config(mut self, input: ::std::option::Option<crate::types::AccessControlConfig>) -> Self {
        self.access_control_config = input;
        self
    }
    /// <p>Who can read the nodes that this change set writes. AWS Context refuses it on a change set that only deletes. If you omit it, every reader of the agent context can read a node that the change creates, and every other node keeps its access control. If you specify it, it replaces the access control of every node that the change set writes, and an absent or empty <code>accessControlList</code> lets nobody read them.</p>
    pub fn get_access_control_config(&self) -> &::std::option::Option<crate::types::AccessControlConfig> {
        &self.access_control_config
    }
    /// <p>The agent context to change, by its ID or ARN.</p>
    /// This field is required.
    pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_context_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The agent context to change, by its ID or ARN.</p>
    pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_context_id = input;
        self
    }
    /// <p>The agent context to change, by its ID or ARN.</p>
    pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_context_id
    }
    /// Appends an item to `operations`.
    ///
    /// To override the contents of this collection use [`set_operations`](Self::set_operations).
    ///
    /// <p>The operations to write, each a <code>ChangeSetOperation</code>, from 1 to 1,000. If the list is empty or names the same entity twice, the request fails with <code>ValidationException</code>.</p>
    pub fn operations(mut self, input: crate::types::ChangeSetOperation) -> Self {
        let mut v = self.operations.unwrap_or_default();
        v.push(input);
        self.operations = ::std::option::Option::Some(v);
        self
    }
    /// <p>The operations to write, each a <code>ChangeSetOperation</code>, from 1 to 1,000. If the list is empty or names the same entity twice, the request fails with <code>ValidationException</code>.</p>
    pub fn set_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ChangeSetOperation>>) -> Self {
        self.operations = input;
        self
    }
    /// <p>The operations to write, each a <code>ChangeSetOperation</code>, from 1 to 1,000. If the list is empty or names the same entity twice, the request fails with <code>ValidationException</code>.</p>
    pub fn get_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ChangeSetOperation>> {
        &self.operations
    }
    /// Consumes the builder and constructs a [`CreateChangeSetInput`](crate::operation::create_change_set::CreateChangeSetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_change_set::CreateChangeSetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_change_set::CreateChangeSetInput {
            client_token: self.client_token,
            access_control_config: self.access_control_config,
            agent_context_id: self.agent_context_id,
            operations: self.operations,
        })
    }
}