aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
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, ::std::fmt::Debug)]
pub struct CreateAccessGrantInput {
    /// The ID of the domain that contains the space.
    pub domain_id: ::std::option::Option<::std::string::String>,
    /// The ID of the space to scope the grant to.
    pub space_id: ::std::option::Option<::std::string::String>,
    /// A name that identifies the access grant.
    pub name: ::std::option::Option<::std::string::String>,
    /// The principal receiving the grant.
    pub principal: ::std::option::Option<crate::types::AccessGrantPrincipal>,
    /// The permission to grant. Exactly one permission is granted per request.
    pub permission: ::std::option::Option<crate::types::AccessGrantPermission>,
    /// Groups of actions to allow, each with the resource scopes and conditions that limit those actions.
    pub scoped_actions: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>,
    /// The tags to associate with the access grant.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAccessGrantInput {
    /// The ID of the domain that contains the space.
    pub fn domain_id(&self) -> ::std::option::Option<&str> {
        self.domain_id.as_deref()
    }
    /// The ID of the space to scope the grant to.
    pub fn space_id(&self) -> ::std::option::Option<&str> {
        self.space_id.as_deref()
    }
    /// A name that identifies the access grant.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The principal receiving the grant.
    pub fn principal(&self) -> ::std::option::Option<&crate::types::AccessGrantPrincipal> {
        self.principal.as_ref()
    }
    /// The permission to grant. Exactly one permission is granted per request.
    pub fn permission(&self) -> ::std::option::Option<&crate::types::AccessGrantPermission> {
        self.permission.as_ref()
    }
    /// Groups of actions to allow, each with the resource scopes and conditions that limit those actions.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.scoped_actions.is_none()`.
    pub fn scoped_actions(&self) -> &[crate::types::ScopedActions] {
        self.scoped_actions.as_deref().unwrap_or_default()
    }
    /// The tags to associate with the access grant.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateAccessGrantInput {
    /// Creates a new builder-style object to manufacture [`CreateAccessGrantInput`](crate::operation::create_access_grant::CreateAccessGrantInput).
    pub fn builder() -> crate::operation::create_access_grant::builders::CreateAccessGrantInputBuilder {
        crate::operation::create_access_grant::builders::CreateAccessGrantInputBuilder::default()
    }
}

/// A builder for [`CreateAccessGrantInput`](crate::operation::create_access_grant::CreateAccessGrantInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAccessGrantInputBuilder {
    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
    pub(crate) space_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) principal: ::std::option::Option<crate::types::AccessGrantPrincipal>,
    pub(crate) permission: ::std::option::Option<crate::types::AccessGrantPermission>,
    pub(crate) scoped_actions: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAccessGrantInputBuilder {
    /// The ID of the domain that contains the space.
    /// This field is required.
    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the domain that contains the space.
    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_id = input;
        self
    }
    /// The ID of the domain that contains the space.
    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_id
    }
    /// The ID of the space to scope the grant to.
    /// This field is required.
    pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the space to scope the grant to.
    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.space_id = input;
        self
    }
    /// The ID of the space to scope the grant to.
    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_id
    }
    /// A name that identifies the access grant.
    /// 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
    }
    /// A name that identifies the access grant.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// A name that identifies the access grant.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The principal receiving the grant.
    /// This field is required.
    pub fn principal(mut self, input: crate::types::AccessGrantPrincipal) -> Self {
        self.principal = ::std::option::Option::Some(input);
        self
    }
    /// The principal receiving the grant.
    pub fn set_principal(mut self, input: ::std::option::Option<crate::types::AccessGrantPrincipal>) -> Self {
        self.principal = input;
        self
    }
    /// The principal receiving the grant.
    pub fn get_principal(&self) -> &::std::option::Option<crate::types::AccessGrantPrincipal> {
        &self.principal
    }
    /// The permission to grant. Exactly one permission is granted per request.
    /// This field is required.
    pub fn permission(mut self, input: crate::types::AccessGrantPermission) -> Self {
        self.permission = ::std::option::Option::Some(input);
        self
    }
    /// The permission to grant. Exactly one permission is granted per request.
    pub fn set_permission(mut self, input: ::std::option::Option<crate::types::AccessGrantPermission>) -> Self {
        self.permission = input;
        self
    }
    /// The permission to grant. Exactly one permission is granted per request.
    pub fn get_permission(&self) -> &::std::option::Option<crate::types::AccessGrantPermission> {
        &self.permission
    }
    /// Appends an item to `scoped_actions`.
    ///
    /// To override the contents of this collection use [`set_scoped_actions`](Self::set_scoped_actions).
    ///
    /// Groups of actions to allow, each with the resource scopes and conditions that limit those actions.
    pub fn scoped_actions(mut self, input: crate::types::ScopedActions) -> Self {
        let mut v = self.scoped_actions.unwrap_or_default();
        v.push(input);
        self.scoped_actions = ::std::option::Option::Some(v);
        self
    }
    /// Groups of actions to allow, each with the resource scopes and conditions that limit those actions.
    pub fn set_scoped_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>) -> Self {
        self.scoped_actions = input;
        self
    }
    /// Groups of actions to allow, each with the resource scopes and conditions that limit those actions.
    pub fn get_scoped_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>> {
        &self.scoped_actions
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// The tags to associate with the access grant.
    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
    }
    /// The tags to associate with the access grant.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// The tags to associate with the access grant.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    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
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateAccessGrantInput`](crate::operation::create_access_grant::CreateAccessGrantInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_access_grant::CreateAccessGrantInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_access_grant::CreateAccessGrantInput {
            domain_id: self.domain_id,
            space_id: self.space_id,
            name: self.name,
            principal: self.principal,
            permission: self.permission,
            scoped_actions: self.scoped_actions,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}