aws-sdk-emr 1.121.0

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

/// <p>Represents an Amazon EC2 instance provisioned as part of cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Instance {
    /// <p>The unique identifier for the instance in Amazon EMR.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the instance in Amazon EC2.</p>
    pub ec2_instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The public DNS name of the instance.</p>
    pub public_dns_name: ::std::option::Option<::std::string::String>,
    /// <p>The public IP address of the instance.</p>
    pub public_ip_address: ::std::option::Option<::std::string::String>,
    /// <p>The private DNS name of the instance.</p>
    pub private_dns_name: ::std::option::Option<::std::string::String>,
    /// <p>The private IP address of the instance.</p>
    pub private_ip_address: ::std::option::Option<::std::string::String>,
    /// <p>The current status of the instance.</p>
    pub status: ::std::option::Option<crate::types::InstanceStatus>,
    /// <p>The identifier of the instance group to which this instance belongs.</p>
    pub instance_group_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the instance fleet to which an Amazon EC2 instance belongs.</p>
    pub instance_fleet_id: ::std::option::Option<::std::string::String>,
    /// <p>The instance purchasing option. Valid values are <code>ON_DEMAND</code> or <code>SPOT</code>.</p>
    pub market: ::std::option::Option<crate::types::MarketType>,
    /// <p>The Amazon EC2 instance type, for example <code>m3.xlarge</code>.</p>
    pub instance_type: ::std::option::Option<::std::string::String>,
    /// <p>The list of Amazon EBS volumes that are attached to this instance.</p>
    pub ebs_volumes: ::std::option::Option<::std::vec::Vec<crate::types::EbsVolume>>,
}
impl Instance {
    /// <p>The unique identifier for the instance in Amazon EMR.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The unique identifier of the instance in Amazon EC2.</p>
    pub fn ec2_instance_id(&self) -> ::std::option::Option<&str> {
        self.ec2_instance_id.as_deref()
    }
    /// <p>The public DNS name of the instance.</p>
    pub fn public_dns_name(&self) -> ::std::option::Option<&str> {
        self.public_dns_name.as_deref()
    }
    /// <p>The public IP address of the instance.</p>
    pub fn public_ip_address(&self) -> ::std::option::Option<&str> {
        self.public_ip_address.as_deref()
    }
    /// <p>The private DNS name of the instance.</p>
    pub fn private_dns_name(&self) -> ::std::option::Option<&str> {
        self.private_dns_name.as_deref()
    }
    /// <p>The private IP address of the instance.</p>
    pub fn private_ip_address(&self) -> ::std::option::Option<&str> {
        self.private_ip_address.as_deref()
    }
    /// <p>The current status of the instance.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::InstanceStatus> {
        self.status.as_ref()
    }
    /// <p>The identifier of the instance group to which this instance belongs.</p>
    pub fn instance_group_id(&self) -> ::std::option::Option<&str> {
        self.instance_group_id.as_deref()
    }
    /// <p>The unique identifier of the instance fleet to which an Amazon EC2 instance belongs.</p>
    pub fn instance_fleet_id(&self) -> ::std::option::Option<&str> {
        self.instance_fleet_id.as_deref()
    }
    /// <p>The instance purchasing option. Valid values are <code>ON_DEMAND</code> or <code>SPOT</code>.</p>
    pub fn market(&self) -> ::std::option::Option<&crate::types::MarketType> {
        self.market.as_ref()
    }
    /// <p>The Amazon EC2 instance type, for example <code>m3.xlarge</code>.</p>
    pub fn instance_type(&self) -> ::std::option::Option<&str> {
        self.instance_type.as_deref()
    }
    /// <p>The list of Amazon EBS volumes that are attached to this instance.</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 `.ebs_volumes.is_none()`.
    pub fn ebs_volumes(&self) -> &[crate::types::EbsVolume] {
        self.ebs_volumes.as_deref().unwrap_or_default()
    }
}
impl Instance {
    /// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
    pub fn builder() -> crate::types::builders::InstanceBuilder {
        crate::types::builders::InstanceBuilder::default()
    }
}

/// A builder for [`Instance`](crate::types::Instance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InstanceBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) ec2_instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) public_dns_name: ::std::option::Option<::std::string::String>,
    pub(crate) public_ip_address: ::std::option::Option<::std::string::String>,
    pub(crate) private_dns_name: ::std::option::Option<::std::string::String>,
    pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::InstanceStatus>,
    pub(crate) instance_group_id: ::std::option::Option<::std::string::String>,
    pub(crate) instance_fleet_id: ::std::option::Option<::std::string::String>,
    pub(crate) market: ::std::option::Option<crate::types::MarketType>,
    pub(crate) instance_type: ::std::option::Option<::std::string::String>,
    pub(crate) ebs_volumes: ::std::option::Option<::std::vec::Vec<crate::types::EbsVolume>>,
}
impl InstanceBuilder {
    /// <p>The unique identifier for the instance in Amazon EMR.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the instance in Amazon EMR.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The unique identifier for the instance in Amazon EMR.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The unique identifier of the instance in Amazon EC2.</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 identifier of the instance in Amazon EC2.</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 identifier of the instance in Amazon EC2.</p>
    pub fn get_ec2_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ec2_instance_id
    }
    /// <p>The public DNS name of the instance.</p>
    pub fn public_dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.public_dns_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The public DNS name of the instance.</p>
    pub fn set_public_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.public_dns_name = input;
        self
    }
    /// <p>The public DNS name of the instance.</p>
    pub fn get_public_dns_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.public_dns_name
    }
    /// <p>The public IP address of the instance.</p>
    pub fn public_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.public_ip_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The public IP address of the instance.</p>
    pub fn set_public_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.public_ip_address = input;
        self
    }
    /// <p>The public IP address of the instance.</p>
    pub fn get_public_ip_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.public_ip_address
    }
    /// <p>The private DNS name of the instance.</p>
    pub fn private_dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.private_dns_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The private DNS name of the instance.</p>
    pub fn set_private_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.private_dns_name = input;
        self
    }
    /// <p>The private DNS name of the instance.</p>
    pub fn get_private_dns_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.private_dns_name
    }
    /// <p>The private IP address of the instance.</p>
    pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.private_ip_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The private IP address of the instance.</p>
    pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.private_ip_address = input;
        self
    }
    /// <p>The private IP address of the instance.</p>
    pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.private_ip_address
    }
    /// <p>The current status of the instance.</p>
    pub fn status(mut self, input: crate::types::InstanceStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the instance.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::InstanceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the instance.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::InstanceStatus> {
        &self.status
    }
    /// <p>The identifier of the instance group to which this instance belongs.</p>
    pub fn instance_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the instance group to which this instance belongs.</p>
    pub fn set_instance_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_group_id = input;
        self
    }
    /// <p>The identifier of the instance group to which this instance belongs.</p>
    pub fn get_instance_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_group_id
    }
    /// <p>The unique identifier of the instance fleet to which an Amazon EC2 instance belongs.</p>
    pub fn instance_fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_fleet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the instance fleet to which an Amazon EC2 instance belongs.</p>
    pub fn set_instance_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_fleet_id = input;
        self
    }
    /// <p>The unique identifier of the instance fleet to which an Amazon EC2 instance belongs.</p>
    pub fn get_instance_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_fleet_id
    }
    /// <p>The instance purchasing option. Valid values are <code>ON_DEMAND</code> or <code>SPOT</code>.</p>
    pub fn market(mut self, input: crate::types::MarketType) -> Self {
        self.market = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance purchasing option. Valid values are <code>ON_DEMAND</code> or <code>SPOT</code>.</p>
    pub fn set_market(mut self, input: ::std::option::Option<crate::types::MarketType>) -> Self {
        self.market = input;
        self
    }
    /// <p>The instance purchasing option. Valid values are <code>ON_DEMAND</code> or <code>SPOT</code>.</p>
    pub fn get_market(&self) -> &::std::option::Option<crate::types::MarketType> {
        &self.market
    }
    /// <p>The Amazon EC2 instance type, for example <code>m3.xlarge</code>.</p>
    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon EC2 instance type, for example <code>m3.xlarge</code>.</p>
    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_type = input;
        self
    }
    /// <p>The Amazon EC2 instance type, for example <code>m3.xlarge</code>.</p>
    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_type
    }
    /// Appends an item to `ebs_volumes`.
    ///
    /// To override the contents of this collection use [`set_ebs_volumes`](Self::set_ebs_volumes).
    ///
    /// <p>The list of Amazon EBS volumes that are attached to this instance.</p>
    pub fn ebs_volumes(mut self, input: crate::types::EbsVolume) -> Self {
        let mut v = self.ebs_volumes.unwrap_or_default();
        v.push(input);
        self.ebs_volumes = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of Amazon EBS volumes that are attached to this instance.</p>
    pub fn set_ebs_volumes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EbsVolume>>) -> Self {
        self.ebs_volumes = input;
        self
    }
    /// <p>The list of Amazon EBS volumes that are attached to this instance.</p>
    pub fn get_ebs_volumes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EbsVolume>> {
        &self.ebs_volumes
    }
    /// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
    pub fn build(self) -> crate::types::Instance {
        crate::types::Instance {
            id: self.id,
            ec2_instance_id: self.ec2_instance_id,
            public_dns_name: self.public_dns_name,
            public_ip_address: self.public_ip_address,
            private_dns_name: self.private_dns_name,
            private_ip_address: self.private_ip_address,
            status: self.status,
            instance_group_id: self.instance_group_id,
            instance_fleet_id: self.instance_fleet_id,
            market: self.market,
            instance_type: self.instance_type,
            ebs_volumes: self.ebs_volumes,
        }
    }
}