aws-sdk-supportauthz 1.2.0

AWS SDK for SupportAuthZ
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 GetActionOutput {
    /// <p>The name of the support action.</p>
    pub action: ::std::string::String,
    /// <p>The AWS service associated with the support action.</p>
    pub service: ::std::string::String,
    /// <p>A description of what the support action does.</p>
    pub description: ::std::string::String,
    _request_id: Option<String>,
}
impl GetActionOutput {
    /// <p>The name of the support action.</p>
    pub fn action(&self) -> &str {
        use std::ops::Deref;
        self.action.deref()
    }
    /// <p>The AWS service associated with the support action.</p>
    pub fn service(&self) -> &str {
        use std::ops::Deref;
        self.service.deref()
    }
    /// <p>A description of what the support action does.</p>
    pub fn description(&self) -> &str {
        use std::ops::Deref;
        self.description.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetActionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetActionOutput {
    /// Creates a new builder-style object to manufacture [`GetActionOutput`](crate::operation::get_action::GetActionOutput).
    pub fn builder() -> crate::operation::get_action::builders::GetActionOutputBuilder {
        crate::operation::get_action::builders::GetActionOutputBuilder::default()
    }
}

/// A builder for [`GetActionOutput`](crate::operation::get_action::GetActionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetActionOutputBuilder {
    pub(crate) action: ::std::option::Option<::std::string::String>,
    pub(crate) service: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetActionOutputBuilder {
    /// <p>The name of the support action.</p>
    /// This field is required.
    pub fn action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the support action.</p>
    pub fn set_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action = input;
        self
    }
    /// <p>The name of the support action.</p>
    pub fn get_action(&self) -> &::std::option::Option<::std::string::String> {
        &self.action
    }
    /// <p>The AWS service associated with the support action.</p>
    /// This field is required.
    pub fn service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The AWS service associated with the support action.</p>
    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service = input;
        self
    }
    /// <p>The AWS service associated with the support action.</p>
    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> {
        &self.service
    }
    /// <p>A description of what the support action does.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of what the support action does.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of what the support action does.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    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 [`GetActionOutput`](crate::operation::get_action::GetActionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`action`](crate::operation::get_action::builders::GetActionOutputBuilder::action)
    /// - [`service`](crate::operation::get_action::builders::GetActionOutputBuilder::service)
    /// - [`description`](crate::operation::get_action::builders::GetActionOutputBuilder::description)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_action::GetActionOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_action::GetActionOutput {
            action: self.action.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "action",
                    "action was not specified but it is required when building GetActionOutput",
                )
            })?,
            service: self.service.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "service",
                    "service was not specified but it is required when building GetActionOutput",
                )
            })?,
            description: self.description.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "description",
                    "description was not specified but it is required when building GetActionOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}