aws-sdk-glue 1.149.0

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

/// <p>Specifies the supported authentication types returned by the <code>DescribeConnectionType</code> API.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Capabilities {
    /// <p>A list of supported authentication types.</p>
    pub supported_authentication_types: ::std::vec::Vec<crate::types::AuthenticationType>,
    /// <p>A list of supported data operations.</p>
    pub supported_data_operations: ::std::vec::Vec<crate::types::DataOperation>,
    /// <p>A list of supported compute environments.</p>
    pub supported_compute_environments: ::std::vec::Vec<crate::types::ComputeEnvironment>,
}
impl Capabilities {
    /// <p>A list of supported authentication types.</p>
    pub fn supported_authentication_types(&self) -> &[crate::types::AuthenticationType] {
        use std::ops::Deref;
        self.supported_authentication_types.deref()
    }
    /// <p>A list of supported data operations.</p>
    pub fn supported_data_operations(&self) -> &[crate::types::DataOperation] {
        use std::ops::Deref;
        self.supported_data_operations.deref()
    }
    /// <p>A list of supported compute environments.</p>
    pub fn supported_compute_environments(&self) -> &[crate::types::ComputeEnvironment] {
        use std::ops::Deref;
        self.supported_compute_environments.deref()
    }
}
impl Capabilities {
    /// Creates a new builder-style object to manufacture [`Capabilities`](crate::types::Capabilities).
    pub fn builder() -> crate::types::builders::CapabilitiesBuilder {
        crate::types::builders::CapabilitiesBuilder::default()
    }
}

/// A builder for [`Capabilities`](crate::types::Capabilities).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CapabilitiesBuilder {
    pub(crate) supported_authentication_types: ::std::option::Option<::std::vec::Vec<crate::types::AuthenticationType>>,
    pub(crate) supported_data_operations: ::std::option::Option<::std::vec::Vec<crate::types::DataOperation>>,
    pub(crate) supported_compute_environments: ::std::option::Option<::std::vec::Vec<crate::types::ComputeEnvironment>>,
}
impl CapabilitiesBuilder {
    /// Appends an item to `supported_authentication_types`.
    ///
    /// To override the contents of this collection use [`set_supported_authentication_types`](Self::set_supported_authentication_types).
    ///
    /// <p>A list of supported authentication types.</p>
    pub fn supported_authentication_types(mut self, input: crate::types::AuthenticationType) -> Self {
        let mut v = self.supported_authentication_types.unwrap_or_default();
        v.push(input);
        self.supported_authentication_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of supported authentication types.</p>
    pub fn set_supported_authentication_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AuthenticationType>>) -> Self {
        self.supported_authentication_types = input;
        self
    }
    /// <p>A list of supported authentication types.</p>
    pub fn get_supported_authentication_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AuthenticationType>> {
        &self.supported_authentication_types
    }
    /// Appends an item to `supported_data_operations`.
    ///
    /// To override the contents of this collection use [`set_supported_data_operations`](Self::set_supported_data_operations).
    ///
    /// <p>A list of supported data operations.</p>
    pub fn supported_data_operations(mut self, input: crate::types::DataOperation) -> Self {
        let mut v = self.supported_data_operations.unwrap_or_default();
        v.push(input);
        self.supported_data_operations = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of supported data operations.</p>
    pub fn set_supported_data_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataOperation>>) -> Self {
        self.supported_data_operations = input;
        self
    }
    /// <p>A list of supported data operations.</p>
    pub fn get_supported_data_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataOperation>> {
        &self.supported_data_operations
    }
    /// Appends an item to `supported_compute_environments`.
    ///
    /// To override the contents of this collection use [`set_supported_compute_environments`](Self::set_supported_compute_environments).
    ///
    /// <p>A list of supported compute environments.</p>
    pub fn supported_compute_environments(mut self, input: crate::types::ComputeEnvironment) -> Self {
        let mut v = self.supported_compute_environments.unwrap_or_default();
        v.push(input);
        self.supported_compute_environments = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of supported compute environments.</p>
    pub fn set_supported_compute_environments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComputeEnvironment>>) -> Self {
        self.supported_compute_environments = input;
        self
    }
    /// <p>A list of supported compute environments.</p>
    pub fn get_supported_compute_environments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComputeEnvironment>> {
        &self.supported_compute_environments
    }
    /// Consumes the builder and constructs a [`Capabilities`](crate::types::Capabilities).
    /// This method will fail if any of the following fields are not set:
    /// - [`supported_authentication_types`](crate::types::builders::CapabilitiesBuilder::supported_authentication_types)
    /// - [`supported_data_operations`](crate::types::builders::CapabilitiesBuilder::supported_data_operations)
    /// - [`supported_compute_environments`](crate::types::builders::CapabilitiesBuilder::supported_compute_environments)
    pub fn build(self) -> ::std::result::Result<crate::types::Capabilities, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Capabilities {
            supported_authentication_types: self.supported_authentication_types.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "supported_authentication_types",
                    "supported_authentication_types was not specified but it is required when building Capabilities",
                )
            })?,
            supported_data_operations: self.supported_data_operations.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "supported_data_operations",
                    "supported_data_operations was not specified but it is required when building Capabilities",
                )
            })?,
            supported_compute_environments: self.supported_compute_environments.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "supported_compute_environments",
                    "supported_compute_environments was not specified but it is required when building Capabilities",
                )
            })?,
        })
    }
}