aws-sdk-ec2 1.222.0

AWS SDK for Amazon Elastic Compute Cloud
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 CreateSecurityGroupOutput {
    /// <p>The ID of the security group.</p>
    pub group_id: ::std::option::Option<::std::string::String>,
    /// <p>The tags assigned to the security group.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The security group ARN.</p>
    pub security_group_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateSecurityGroupOutput {
    /// <p>The ID of the security group.</p>
    pub fn group_id(&self) -> ::std::option::Option<&str> {
        self.group_id.as_deref()
    }
    /// <p>The tags assigned to the security group.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>The security group ARN.</p>
    pub fn security_group_arn(&self) -> ::std::option::Option<&str> {
        self.security_group_arn.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateSecurityGroupOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateSecurityGroupOutput {
    /// Creates a new builder-style object to manufacture [`CreateSecurityGroupOutput`](crate::operation::create_security_group::CreateSecurityGroupOutput).
    pub fn builder() -> crate::operation::create_security_group::builders::CreateSecurityGroupOutputBuilder {
        crate::operation::create_security_group::builders::CreateSecurityGroupOutputBuilder::default()
    }
}

/// A builder for [`CreateSecurityGroupOutput`](crate::operation::create_security_group::CreateSecurityGroupOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSecurityGroupOutputBuilder {
    pub(crate) group_id: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) security_group_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateSecurityGroupOutputBuilder {
    /// <p>The ID of the security group.</p>
    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the security group.</p>
    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.group_id = input;
        self
    }
    /// <p>The ID of the security group.</p>
    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.group_id
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags assigned to the security group.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tags assigned to the security group.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags assigned to the security group.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The security group ARN.</p>
    pub fn security_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.security_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The security group ARN.</p>
    pub fn set_security_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.security_group_arn = input;
        self
    }
    /// <p>The security group ARN.</p>
    pub fn get_security_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.security_group_arn
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateSecurityGroupOutput`](crate::operation::create_security_group::CreateSecurityGroupOutput).
    pub fn build(self) -> crate::operation::create_security_group::CreateSecurityGroupOutput {
        crate::operation::create_security_group::CreateSecurityGroupOutput {
            group_id: self.group_id,
            tags: self.tags,
            security_group_arn: self.security_group_arn,
            _request_id: self._request_id,
        }
    }
}