aws-sdk-devopsagent 1.10.0

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

/// <p>Request structure for creating a new asset</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateAssetInput {
    /// <p>The unique identifier for the agent space where the asset will be created</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>The type of asset to create</p>
    pub asset_type: ::std::option::Option<::std::string::String>,
    /// <p>The metadata describing this asset</p>
    pub metadata: ::std::option::Option<::aws_smithy_types::Document>,
    /// <p>The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external source.</p>
    pub content: ::std::option::Option<crate::types::AssetContent>,
    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAssetInput {
    /// <p>The unique identifier for the agent space where the asset will be created</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>The type of asset to create</p>
    pub fn asset_type(&self) -> ::std::option::Option<&str> {
        self.asset_type.as_deref()
    }
    /// <p>The metadata describing this asset</p>
    pub fn metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.metadata.as_ref()
    }
    /// <p>The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external source.</p>
    pub fn content(&self) -> ::std::option::Option<&crate::types::AssetContent> {
        self.content.as_ref()
    }
    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateAssetInput {
    /// Creates a new builder-style object to manufacture [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
    pub fn builder() -> crate::operation::create_asset::builders::CreateAssetInputBuilder {
        crate::operation::create_asset::builders::CreateAssetInputBuilder::default()
    }
}

/// A builder for [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAssetInputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) asset_type: ::std::option::Option<::std::string::String>,
    pub(crate) metadata: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) content: ::std::option::Option<crate::types::AssetContent>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAssetInputBuilder {
    /// <p>The unique identifier for the agent space where the asset will be created</p>
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the agent space where the asset will be created</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The unique identifier for the agent space where the asset will be created</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>The type of asset to create</p>
    /// This field is required.
    pub fn asset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of asset to create</p>
    pub fn set_asset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_type = input;
        self
    }
    /// <p>The type of asset to create</p>
    pub fn get_asset_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_type
    }
    /// <p>The metadata describing this asset</p>
    pub fn metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>The metadata describing this asset</p>
    pub fn set_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.metadata = input;
        self
    }
    /// <p>The metadata describing this asset</p>
    pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.metadata
    }
    /// <p>The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external source.</p>
    /// This field is required.
    pub fn content(mut self, input: crate::types::AssetContent) -> Self {
        self.content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external source.</p>
    pub fn set_content(mut self, input: ::std::option::Option<crate::types::AssetContent>) -> Self {
        self.content = input;
        self
    }
    /// <p>The content for the asset. Provide a single file, a zip bundle, or a sourceUrl to import from an external source.</p>
    pub fn get_content(&self) -> &::std::option::Option<crate::types::AssetContent> {
        &self.content
    }
    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier used for idempotent asset creation</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateAssetInput`](crate::operation::create_asset::CreateAssetInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_asset::CreateAssetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_asset::CreateAssetInput {
            agent_space_id: self.agent_space_id,
            asset_type: self.asset_type,
            metadata: self.metadata,
            content: self.content,
            client_token: self.client_token,
        })
    }
}