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.

/// <p>An ESX host that runs on an Amazon EC2 bare metal instance. Four hosts are created in an Amazon EVS environment during environment creation. You can add hosts to an environment using the <code>CreateEnvironmentHost</code> operation. Amazon EVS supports 4-16 hosts per environment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Host {
    /// <p>The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF.</p>
    pub host_name: ::std::option::Option<::std::string::String>,
    /// <p>The IP address of the host.</p>
    pub ip_address: ::std::option::Option<::std::string::String>,
    /// <p>The name of the SSH key that is used to access the host.</p>
    pub key_name: ::std::option::Option<::std::string::String>,
    /// <p>The EC2 instance type of the host.</p><note>
    /// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
    /// </note>
    pub instance_type: ::std::option::Option<crate::types::InstanceType>,
    /// <p>The unique ID of the placement group where the host is placed.</p>
    pub placement_group_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique ID of the Amazon EC2 Dedicated Host.</p>
    pub dedicated_host_id: ::std::option::Option<::std::string::String>,
    /// <p>The date and time that the host was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time that the host was modified.</p>
    pub modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The state of the host.</p>
    pub host_state: ::std::option::Option<crate::types::HostState>,
    /// <p>A detailed description of the <code>hostState</code> of a host.</p>
    pub state_details: ::std::option::Option<::std::string::String>,
    /// <p>The unique ID of the EC2 instance that represents the host.</p>
    pub ec2_instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The elastic network interfaces that are attached to the host.</p>
    pub network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>,
}
impl Host {
    /// <p>The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF.</p>
    pub fn host_name(&self) -> ::std::option::Option<&str> {
        self.host_name.as_deref()
    }
    /// <p>The IP address of the host.</p>
    pub fn ip_address(&self) -> ::std::option::Option<&str> {
        self.ip_address.as_deref()
    }
    /// <p>The name of the SSH key that is used to access the host.</p>
    pub fn key_name(&self) -> ::std::option::Option<&str> {
        self.key_name.as_deref()
    }
    /// <p>The EC2 instance type of the host.</p><note>
    /// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
    /// </note>
    pub fn instance_type(&self) -> ::std::option::Option<&crate::types::InstanceType> {
        self.instance_type.as_ref()
    }
    /// <p>The unique ID of the placement group where the host is placed.</p>
    pub fn placement_group_id(&self) -> ::std::option::Option<&str> {
        self.placement_group_id.as_deref()
    }
    /// <p>The unique ID of the Amazon EC2 Dedicated Host.</p>
    pub fn dedicated_host_id(&self) -> ::std::option::Option<&str> {
        self.dedicated_host_id.as_deref()
    }
    /// <p>The date and time that the host was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The date and time that the host was modified.</p>
    pub fn modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.modified_at.as_ref()
    }
    /// <p>The state of the host.</p>
    pub fn host_state(&self) -> ::std::option::Option<&crate::types::HostState> {
        self.host_state.as_ref()
    }
    /// <p>A detailed description of the <code>hostState</code> of a host.</p>
    pub fn state_details(&self) -> ::std::option::Option<&str> {
        self.state_details.as_deref()
    }
    /// <p>The unique ID of the EC2 instance that represents the host.</p>
    pub fn ec2_instance_id(&self) -> ::std::option::Option<&str> {
        self.ec2_instance_id.as_deref()
    }
    /// <p>The elastic network interfaces that are attached to the host.</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 `.network_interfaces.is_none()`.
    pub fn network_interfaces(&self) -> &[crate::types::NetworkInterface] {
        self.network_interfaces.as_deref().unwrap_or_default()
    }
}
impl Host {
    /// Creates a new builder-style object to manufacture [`Host`](crate::types::Host).
    pub fn builder() -> crate::types::builders::HostBuilder {
        crate::types::builders::HostBuilder::default()
    }
}

/// A builder for [`Host`](crate::types::Host).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct HostBuilder {
    pub(crate) host_name: ::std::option::Option<::std::string::String>,
    pub(crate) ip_address: ::std::option::Option<::std::string::String>,
    pub(crate) key_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_type: ::std::option::Option<crate::types::InstanceType>,
    pub(crate) placement_group_id: ::std::option::Option<::std::string::String>,
    pub(crate) dedicated_host_id: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) host_state: ::std::option::Option<crate::types::HostState>,
    pub(crate) state_details: ::std::option::Option<::std::string::String>,
    pub(crate) ec2_instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>,
}
impl HostBuilder {
    /// <p>The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF.</p>
    pub fn host_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.host_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF.</p>
    pub fn set_host_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.host_name = input;
        self
    }
    /// <p>The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF.</p>
    pub fn get_host_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.host_name
    }
    /// <p>The IP address of the host.</p>
    pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ip_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address of the host.</p>
    pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ip_address = input;
        self
    }
    /// <p>The IP address of the host.</p>
    pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.ip_address
    }
    /// <p>The name of the SSH key that is used to access the host.</p>
    pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the SSH key that is used to access the host.</p>
    pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_name = input;
        self
    }
    /// <p>The name of the SSH key that is used to access the host.</p>
    pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_name
    }
    /// <p>The EC2 instance type of the host.</p><note>
    /// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
    /// </note>
    pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
        self.instance_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The EC2 instance type of the host.</p><note>
    /// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
    /// </note>
    pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
        self.instance_type = input;
        self
    }
    /// <p>The EC2 instance type of the host.</p><note>
    /// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
    /// </note>
    pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
        &self.instance_type
    }
    /// <p>The unique ID of the placement group where the host is placed.</p>
    pub fn placement_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.placement_group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID of the placement group where the host is placed.</p>
    pub fn set_placement_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.placement_group_id = input;
        self
    }
    /// <p>The unique ID of the placement group where the host is placed.</p>
    pub fn get_placement_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.placement_group_id
    }
    /// <p>The unique ID of the Amazon EC2 Dedicated Host.</p>
    pub fn dedicated_host_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.dedicated_host_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID of the Amazon EC2 Dedicated Host.</p>
    pub fn set_dedicated_host_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dedicated_host_id = input;
        self
    }
    /// <p>The unique ID of the Amazon EC2 Dedicated Host.</p>
    pub fn get_dedicated_host_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.dedicated_host_id
    }
    /// <p>The date and time that the host was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the host was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time that the host was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The date and time that the host was modified.</p>
    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.modified_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the host was modified.</p>
    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.modified_at = input;
        self
    }
    /// <p>The date and time that the host was modified.</p>
    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.modified_at
    }
    /// <p>The state of the host.</p>
    pub fn host_state(mut self, input: crate::types::HostState) -> Self {
        self.host_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the host.</p>
    pub fn set_host_state(mut self, input: ::std::option::Option<crate::types::HostState>) -> Self {
        self.host_state = input;
        self
    }
    /// <p>The state of the host.</p>
    pub fn get_host_state(&self) -> &::std::option::Option<crate::types::HostState> {
        &self.host_state
    }
    /// <p>A detailed description of the <code>hostState</code> of a host.</p>
    pub fn state_details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.state_details = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A detailed description of the <code>hostState</code> of a host.</p>
    pub fn set_state_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_details = input;
        self
    }
    /// <p>A detailed description of the <code>hostState</code> of a host.</p>
    pub fn get_state_details(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_details
    }
    /// <p>The unique ID of the EC2 instance that represents the host.</p>
    pub fn ec2_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ec2_instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID of the EC2 instance that represents the host.</p>
    pub fn set_ec2_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ec2_instance_id = input;
        self
    }
    /// <p>The unique ID of the EC2 instance that represents the host.</p>
    pub fn get_ec2_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ec2_instance_id
    }
    /// Appends an item to `network_interfaces`.
    ///
    /// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
    ///
    /// <p>The elastic network interfaces that are attached to the host.</p>
    pub fn network_interfaces(mut self, input: crate::types::NetworkInterface) -> Self {
        let mut v = self.network_interfaces.unwrap_or_default();
        v.push(input);
        self.network_interfaces = ::std::option::Option::Some(v);
        self
    }
    /// <p>The elastic network interfaces that are attached to the host.</p>
    pub fn set_network_interfaces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>) -> Self {
        self.network_interfaces = input;
        self
    }
    /// <p>The elastic network interfaces that are attached to the host.</p>
    pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>> {
        &self.network_interfaces
    }
    /// Consumes the builder and constructs a [`Host`](crate::types::Host).
    pub fn build(self) -> crate::types::Host {
        crate::types::Host {
            host_name: self.host_name,
            ip_address: self.ip_address,
            key_name: self.key_name,
            instance_type: self.instance_type,
            placement_group_id: self.placement_group_id,
            dedicated_host_id: self.dedicated_host_id,
            created_at: self.created_at,
            modified_at: self.modified_at,
            host_state: self.host_state,
            state_details: self.state_details,
            ec2_instance_id: self.ec2_instance_id,
            network_interfaces: self.network_interfaces,
        }
    }
}