aws-sdk-dataexchange 1.102.0

AWS SDK for AWS Data Exchange
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 SendApiAssetInput {
    /// <p>The request body.</p>
    pub body: ::std::option::Option<::std::string::String>,
    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
    pub query_string_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>Asset ID value for the API request.</p>
    pub asset_id: ::std::option::Option<::std::string::String>,
    /// <p>Data set ID value for the API request.</p>
    pub data_set_id: ::std::option::Option<::std::string::String>,
    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
    pub request_headers: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
    pub method: ::std::option::Option<::std::string::String>,
    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
    pub path: ::std::option::Option<::std::string::String>,
    /// <p>Revision ID value for the API request.</p>
    pub revision_id: ::std::option::Option<::std::string::String>,
}
impl SendApiAssetInput {
    /// <p>The request body.</p>
    pub fn body(&self) -> ::std::option::Option<&str> {
        self.body.as_deref()
    }
    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
    pub fn query_string_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.query_string_parameters.as_ref()
    }
    /// <p>Asset ID value for the API request.</p>
    pub fn asset_id(&self) -> ::std::option::Option<&str> {
        self.asset_id.as_deref()
    }
    /// <p>Data set ID value for the API request.</p>
    pub fn data_set_id(&self) -> ::std::option::Option<&str> {
        self.data_set_id.as_deref()
    }
    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
    pub fn request_headers(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.request_headers.as_ref()
    }
    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
    pub fn method(&self) -> ::std::option::Option<&str> {
        self.method.as_deref()
    }
    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
    pub fn path(&self) -> ::std::option::Option<&str> {
        self.path.as_deref()
    }
    /// <p>Revision ID value for the API request.</p>
    pub fn revision_id(&self) -> ::std::option::Option<&str> {
        self.revision_id.as_deref()
    }
}
impl SendApiAssetInput {
    /// Creates a new builder-style object to manufacture [`SendApiAssetInput`](crate::operation::send_api_asset::SendApiAssetInput).
    pub fn builder() -> crate::operation::send_api_asset::builders::SendApiAssetInputBuilder {
        crate::operation::send_api_asset::builders::SendApiAssetInputBuilder::default()
    }
}

/// A builder for [`SendApiAssetInput`](crate::operation::send_api_asset::SendApiAssetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendApiAssetInputBuilder {
    pub(crate) body: ::std::option::Option<::std::string::String>,
    pub(crate) query_string_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) asset_id: ::std::option::Option<::std::string::String>,
    pub(crate) data_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) request_headers: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) method: ::std::option::Option<::std::string::String>,
    pub(crate) path: ::std::option::Option<::std::string::String>,
    pub(crate) revision_id: ::std::option::Option<::std::string::String>,
}
impl SendApiAssetInputBuilder {
    /// <p>The request body.</p>
    pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.body = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The request body.</p>
    pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.body = input;
        self
    }
    /// <p>The request body.</p>
    pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
        &self.body
    }
    /// Adds a key-value pair to `query_string_parameters`.
    ///
    /// To override the contents of this collection use [`set_query_string_parameters`](Self::set_query_string_parameters).
    ///
    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
    pub fn query_string_parameters(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.query_string_parameters.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.query_string_parameters = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
    pub fn set_query_string_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.query_string_parameters = input;
        self
    }
    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
    pub fn get_query_string_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.query_string_parameters
    }
    /// <p>Asset ID value for the API request.</p>
    /// This field is required.
    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Asset ID value for the API request.</p>
    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_id = input;
        self
    }
    /// <p>Asset ID value for the API request.</p>
    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_id
    }
    /// <p>Data set ID value for the API request.</p>
    /// This field is required.
    pub fn data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Data set ID value for the API request.</p>
    pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_set_id = input;
        self
    }
    /// <p>Data set ID value for the API request.</p>
    pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_set_id
    }
    /// Adds a key-value pair to `request_headers`.
    ///
    /// To override the contents of this collection use [`set_request_headers`](Self::set_request_headers).
    ///
    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
    pub fn request_headers(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.request_headers.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.request_headers = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
    pub fn set_request_headers(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.request_headers = input;
        self
    }
    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
    pub fn get_request_headers(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.request_headers
    }
    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
    pub fn method(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.method = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
    pub fn set_method(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.method = input;
        self
    }
    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
    pub fn get_method(&self) -> &::std::option::Option<::std::string::String> {
        &self.method
    }
    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.path = input;
        self
    }
    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.path
    }
    /// <p>Revision ID value for the API request.</p>
    /// This field is required.
    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.revision_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Revision ID value for the API request.</p>
    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.revision_id = input;
        self
    }
    /// <p>Revision ID value for the API request.</p>
    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.revision_id
    }
    /// Consumes the builder and constructs a [`SendApiAssetInput`](crate::operation::send_api_asset::SendApiAssetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::send_api_asset::SendApiAssetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_api_asset::SendApiAssetInput {
            body: self.body,
            query_string_parameters: self.query_string_parameters,
            asset_id: self.asset_id,
            data_set_id: self.data_set_id,
            request_headers: self.request_headers,
            method: self.method,
            path: self.path,
            revision_id: self.revision_id,
        })
    }
}