aws-sdk-appsync 1.111.0

AWS SDK for AWS AppSync
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 CreateApiKeyInput {
    /// <p>The ID for your GraphQL API.</p>
    pub api_id: ::std::option::Option<::std::string::String>,
    /// <p>A description of the purpose of the API key.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>
    pub expires: ::std::option::Option<i64>,
}
impl CreateApiKeyInput {
    /// <p>The ID for your GraphQL API.</p>
    pub fn api_id(&self) -> ::std::option::Option<&str> {
        self.api_id.as_deref()
    }
    /// <p>A description of the purpose of the API key.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>
    pub fn expires(&self) -> ::std::option::Option<i64> {
        self.expires
    }
}
impl CreateApiKeyInput {
    /// Creates a new builder-style object to manufacture [`CreateApiKeyInput`](crate::operation::create_api_key::CreateApiKeyInput).
    pub fn builder() -> crate::operation::create_api_key::builders::CreateApiKeyInputBuilder {
        crate::operation::create_api_key::builders::CreateApiKeyInputBuilder::default()
    }
}

/// A builder for [`CreateApiKeyInput`](crate::operation::create_api_key::CreateApiKeyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateApiKeyInputBuilder {
    pub(crate) api_id: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) expires: ::std::option::Option<i64>,
}
impl CreateApiKeyInputBuilder {
    /// <p>The ID for your GraphQL API.</p>
    /// This field is required.
    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.api_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for your GraphQL API.</p>
    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.api_id = input;
        self
    }
    /// <p>The ID for your GraphQL API.</p>
    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.api_id
    }
    /// <p>A description of the purpose of the API key.</p>
    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 the purpose of the API key.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the purpose of the API key.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>
    pub fn expires(mut self, input: i64) -> Self {
        self.expires = ::std::option::Option::Some(input);
        self
    }
    /// <p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>
    pub fn set_expires(mut self, input: ::std::option::Option<i64>) -> Self {
        self.expires = input;
        self
    }
    /// <p>From the creation time, the time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time. For more information, see .</p>
    pub fn get_expires(&self) -> &::std::option::Option<i64> {
        &self.expires
    }
    /// Consumes the builder and constructs a [`CreateApiKeyInput`](crate::operation::create_api_key::CreateApiKeyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_api_key::CreateApiKeyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_api_key::CreateApiKeyInput {
            api_id: self.api_id,
            description: self.description,
            expires: self.expires,
        })
    }
}