aws-sdk-wisdom 1.99.0

AWS SDK for Amazon Connect Wisdom Service
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)]
pub struct StartContentUploadOutput {
    /// <p>The identifier of the upload.</p>
    pub upload_id: ::std::string::String,
    /// <p>The URL of the upload.</p>
    pub url: ::std::string::String,
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub url_expiry: ::aws_smithy_types::DateTime,
    /// <p>The headers to include in the upload.</p>
    pub headers_to_include: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    _request_id: Option<String>,
}
impl StartContentUploadOutput {
    /// <p>The identifier of the upload.</p>
    pub fn upload_id(&self) -> &str {
        use std::ops::Deref;
        self.upload_id.deref()
    }
    /// <p>The URL of the upload.</p>
    pub fn url(&self) -> &str {
        use std::ops::Deref;
        self.url.deref()
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn url_expiry(&self) -> &::aws_smithy_types::DateTime {
        &self.url_expiry
    }
    /// <p>The headers to include in the upload.</p>
    pub fn headers_to_include(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
        &self.headers_to_include
    }
}
impl ::std::fmt::Debug for StartContentUploadOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartContentUploadOutput");
        formatter.field("upload_id", &self.upload_id);
        formatter.field("url", &"*** Sensitive Data Redacted ***");
        formatter.field("url_expiry", &self.url_expiry);
        formatter.field("headers_to_include", &self.headers_to_include);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for StartContentUploadOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl StartContentUploadOutput {
    /// Creates a new builder-style object to manufacture [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
    pub fn builder() -> crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder {
        crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::default()
    }
}

/// A builder for [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct StartContentUploadOutputBuilder {
    pub(crate) upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) url: ::std::option::Option<::std::string::String>,
    pub(crate) url_expiry: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) headers_to_include: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl StartContentUploadOutputBuilder {
    /// <p>The identifier of the upload.</p>
    /// This field is required.
    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.upload_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the upload.</p>
    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.upload_id = input;
        self
    }
    /// <p>The identifier of the upload.</p>
    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.upload_id
    }
    /// <p>The URL of the upload.</p>
    /// This field is required.
    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL of the upload.</p>
    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.url = input;
        self
    }
    /// <p>The URL of the upload.</p>
    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.url
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    /// This field is required.
    pub fn url_expiry(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.url_expiry = ::std::option::Option::Some(input);
        self
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn set_url_expiry(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.url_expiry = input;
        self
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn get_url_expiry(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.url_expiry
    }
    /// Adds a key-value pair to `headers_to_include`.
    ///
    /// To override the contents of this collection use [`set_headers_to_include`](Self::set_headers_to_include).
    ///
    /// <p>The headers to include in the upload.</p>
    pub fn headers_to_include(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.headers_to_include.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.headers_to_include = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The headers to include in the upload.</p>
    pub fn set_headers_to_include(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.headers_to_include = input;
        self
    }
    /// <p>The headers to include in the upload.</p>
    pub fn get_headers_to_include(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.headers_to_include
    }
    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 [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`upload_id`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::upload_id)
    /// - [`url`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::url)
    /// - [`url_expiry`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::url_expiry)
    /// - [`headers_to_include`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::headers_to_include)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_content_upload::StartContentUploadOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_content_upload::StartContentUploadOutput {
            upload_id: self.upload_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "upload_id",
                    "upload_id was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            url: self.url.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "url",
                    "url was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            url_expiry: self.url_expiry.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "url_expiry",
                    "url_expiry was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            headers_to_include: self.headers_to_include.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "headers_to_include",
                    "headers_to_include was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for StartContentUploadOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartContentUploadOutputBuilder");
        formatter.field("upload_id", &self.upload_id);
        formatter.field("url", &"*** Sensitive Data Redacted ***");
        formatter.field("url_expiry", &self.url_expiry);
        formatter.field("headers_to_include", &self.headers_to_include);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}