aws-sdk-evs 1.29.0

AWS SDK for Amazon Elastic VMware Service
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 CreateEntitlementInput {
    /// <note>
    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
    /// </note>
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>A unique ID for the environment to create the entitlement in.</p>
    pub environment_id: ::std::option::Option<::std::string::String>,
    /// <p>A unique ID for the connector associated with the entitlement.</p>
    pub connector_id: ::std::option::Option<::std::string::String>,
    /// <p>The type of entitlement to create.</p>
    pub entitlement_type: ::std::option::Option<crate::types::EntitlementType>,
    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
    pub vm_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateEntitlementInput {
    /// <note>
    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
    /// </note>
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>A unique ID for the environment to create the entitlement in.</p>
    pub fn environment_id(&self) -> ::std::option::Option<&str> {
        self.environment_id.as_deref()
    }
    /// <p>A unique ID for the connector associated with the entitlement.</p>
    pub fn connector_id(&self) -> ::std::option::Option<&str> {
        self.connector_id.as_deref()
    }
    /// <p>The type of entitlement to create.</p>
    pub fn entitlement_type(&self) -> ::std::option::Option<&crate::types::EntitlementType> {
        self.entitlement_type.as_ref()
    }
    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</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 `.vm_ids.is_none()`.
    pub fn vm_ids(&self) -> &[::std::string::String] {
        self.vm_ids.as_deref().unwrap_or_default()
    }
}
impl CreateEntitlementInput {
    /// Creates a new builder-style object to manufacture [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
    pub fn builder() -> crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder {
        crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder::default()
    }
}

/// A builder for [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEntitlementInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) connector_id: ::std::option::Option<::std::string::String>,
    pub(crate) entitlement_type: ::std::option::Option<crate::types::EntitlementType>,
    pub(crate) vm_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateEntitlementInputBuilder {
    /// <note>
    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
    /// </note>
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</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
    }
    /// <note>
    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
    /// </note>
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <note>
    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
    /// </note>
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>A unique ID for the environment to create the entitlement in.</p>
    /// This field is required.
    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique ID for the environment to create the entitlement in.</p>
    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_id = input;
        self
    }
    /// <p>A unique ID for the environment to create the entitlement in.</p>
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// <p>A unique ID for the connector associated with the entitlement.</p>
    /// This field is required.
    pub fn connector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.connector_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique ID for the connector associated with the entitlement.</p>
    pub fn set_connector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.connector_id = input;
        self
    }
    /// <p>A unique ID for the connector associated with the entitlement.</p>
    pub fn get_connector_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.connector_id
    }
    /// <p>The type of entitlement to create.</p>
    /// This field is required.
    pub fn entitlement_type(mut self, input: crate::types::EntitlementType) -> Self {
        self.entitlement_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of entitlement to create.</p>
    pub fn set_entitlement_type(mut self, input: ::std::option::Option<crate::types::EntitlementType>) -> Self {
        self.entitlement_type = input;
        self
    }
    /// <p>The type of entitlement to create.</p>
    pub fn get_entitlement_type(&self) -> &::std::option::Option<crate::types::EntitlementType> {
        &self.entitlement_type
    }
    /// Appends an item to `vm_ids`.
    ///
    /// To override the contents of this collection use [`set_vm_ids`](Self::set_vm_ids).
    ///
    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
    pub fn vm_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.vm_ids.unwrap_or_default();
        v.push(input.into());
        self.vm_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
    pub fn set_vm_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.vm_ids = input;
        self
    }
    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
    pub fn get_vm_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.vm_ids
    }
    /// Consumes the builder and constructs a [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_entitlement::CreateEntitlementInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_entitlement::CreateEntitlementInput {
            client_token: self.client_token,
            environment_id: self.environment_id,
            connector_id: self.connector_id,
            entitlement_type: self.entitlement_type,
            vm_ids: self.vm_ids,
        })
    }
}