aws-sdk-connect 1.149.0

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

/// Response from GetAttachedFile API.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetAttachedFileOutput {
    /// <p>The unique identifier of the attached file resource (ARN).</p>
    pub file_arn: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the attached file resource.</p>
    pub file_id: ::std::option::Option<::std::string::String>,
    /// <p>The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: <code>yyyy-MM-ddThh:mm:ss.SSSZ</code>. For example, <code>2024-05-03T02:41:28.172Z</code>.</p>
    pub creation_time: ::std::option::Option<::std::string::String>,
    /// <p>The current status of the attached file.</p>
    pub file_status: ::std::option::Option<crate::types::FileStatusType>,
    /// <p>A case-sensitive name of the attached file being uploaded.</p>
    pub file_name: ::std::option::Option<::std::string::String>,
    /// <p>The size of the attached file in bytes.</p>
    pub file_size_in_bytes: i64,
    /// <p>The resource to which the attached file is (being) uploaded to. <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html">Cases</a> are the only current supported resource.</p>
    pub associated_resource_arn: ::std::option::Option<::std::string::String>,
    /// <p>The use case for the file.</p>
    pub file_use_case_type: ::std::option::Option<crate::types::FileUseCaseType>,
    /// <p>Represents the identity that created the file.</p>
    pub created_by: ::std::option::Option<crate::types::CreatedByInfo>,
    /// <p>URL and expiry to be used when downloading the attached file.</p>
    pub download_url_metadata: ::std::option::Option<crate::types::DownloadUrlMetadata>,
    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl GetAttachedFileOutput {
    /// <p>The unique identifier of the attached file resource (ARN).</p>
    pub fn file_arn(&self) -> ::std::option::Option<&str> {
        self.file_arn.as_deref()
    }
    /// <p>The unique identifier of the attached file resource.</p>
    pub fn file_id(&self) -> ::std::option::Option<&str> {
        self.file_id.as_deref()
    }
    /// <p>The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: <code>yyyy-MM-ddThh:mm:ss.SSSZ</code>. For example, <code>2024-05-03T02:41:28.172Z</code>.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&str> {
        self.creation_time.as_deref()
    }
    /// <p>The current status of the attached file.</p>
    pub fn file_status(&self) -> ::std::option::Option<&crate::types::FileStatusType> {
        self.file_status.as_ref()
    }
    /// <p>A case-sensitive name of the attached file being uploaded.</p>
    pub fn file_name(&self) -> ::std::option::Option<&str> {
        self.file_name.as_deref()
    }
    /// <p>The size of the attached file in bytes.</p>
    pub fn file_size_in_bytes(&self) -> i64 {
        self.file_size_in_bytes
    }
    /// <p>The resource to which the attached file is (being) uploaded to. <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html">Cases</a> are the only current supported resource.</p>
    pub fn associated_resource_arn(&self) -> ::std::option::Option<&str> {
        self.associated_resource_arn.as_deref()
    }
    /// <p>The use case for the file.</p>
    pub fn file_use_case_type(&self) -> ::std::option::Option<&crate::types::FileUseCaseType> {
        self.file_use_case_type.as_ref()
    }
    /// <p>Represents the identity that created the file.</p>
    pub fn created_by(&self) -> ::std::option::Option<&crate::types::CreatedByInfo> {
        self.created_by.as_ref()
    }
    /// <p>URL and expiry to be used when downloading the attached file.</p>
    pub fn download_url_metadata(&self) -> ::std::option::Option<&crate::types::DownloadUrlMetadata> {
        self.download_url_metadata.as_ref()
    }
    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetAttachedFileOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAttachedFileOutput {
    /// Creates a new builder-style object to manufacture [`GetAttachedFileOutput`](crate::operation::get_attached_file::GetAttachedFileOutput).
    pub fn builder() -> crate::operation::get_attached_file::builders::GetAttachedFileOutputBuilder {
        crate::operation::get_attached_file::builders::GetAttachedFileOutputBuilder::default()
    }
}

/// A builder for [`GetAttachedFileOutput`](crate::operation::get_attached_file::GetAttachedFileOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAttachedFileOutputBuilder {
    pub(crate) file_arn: ::std::option::Option<::std::string::String>,
    pub(crate) file_id: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::std::string::String>,
    pub(crate) file_status: ::std::option::Option<crate::types::FileStatusType>,
    pub(crate) file_name: ::std::option::Option<::std::string::String>,
    pub(crate) file_size_in_bytes: ::std::option::Option<i64>,
    pub(crate) associated_resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) file_use_case_type: ::std::option::Option<crate::types::FileUseCaseType>,
    pub(crate) created_by: ::std::option::Option<crate::types::CreatedByInfo>,
    pub(crate) download_url_metadata: ::std::option::Option<crate::types::DownloadUrlMetadata>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl GetAttachedFileOutputBuilder {
    /// <p>The unique identifier of the attached file resource (ARN).</p>
    pub fn file_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the attached file resource (ARN).</p>
    pub fn set_file_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_arn = input;
        self
    }
    /// <p>The unique identifier of the attached file resource (ARN).</p>
    pub fn get_file_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_arn
    }
    /// <p>The unique identifier of the attached file resource.</p>
    pub fn file_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the attached file resource.</p>
    pub fn set_file_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_id = input;
        self
    }
    /// <p>The unique identifier of the attached file resource.</p>
    pub fn get_file_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_id
    }
    /// <p>The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: <code>yyyy-MM-ddThh:mm:ss.SSSZ</code>. For example, <code>2024-05-03T02:41:28.172Z</code>.</p>
    pub fn creation_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.creation_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: <code>yyyy-MM-ddThh:mm:ss.SSSZ</code>. For example, <code>2024-05-03T02:41:28.172Z</code>.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The time of Creation of the file resource as an ISO timestamp. It's specified in ISO 8601 format: <code>yyyy-MM-ddThh:mm:ss.SSSZ</code>. For example, <code>2024-05-03T02:41:28.172Z</code>.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.creation_time
    }
    /// <p>The current status of the attached file.</p>
    pub fn file_status(mut self, input: crate::types::FileStatusType) -> Self {
        self.file_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the attached file.</p>
    pub fn set_file_status(mut self, input: ::std::option::Option<crate::types::FileStatusType>) -> Self {
        self.file_status = input;
        self
    }
    /// <p>The current status of the attached file.</p>
    pub fn get_file_status(&self) -> &::std::option::Option<crate::types::FileStatusType> {
        &self.file_status
    }
    /// <p>A case-sensitive name of the attached file being uploaded.</p>
    pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A case-sensitive name of the attached file being uploaded.</p>
    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_name = input;
        self
    }
    /// <p>A case-sensitive name of the attached file being uploaded.</p>
    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_name
    }
    /// <p>The size of the attached file in bytes.</p>
    /// This field is required.
    pub fn file_size_in_bytes(mut self, input: i64) -> Self {
        self.file_size_in_bytes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the attached file in bytes.</p>
    pub fn set_file_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
        self.file_size_in_bytes = input;
        self
    }
    /// <p>The size of the attached file in bytes.</p>
    pub fn get_file_size_in_bytes(&self) -> &::std::option::Option<i64> {
        &self.file_size_in_bytes
    }
    /// <p>The resource to which the attached file is (being) uploaded to. <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html">Cases</a> are the only current supported resource.</p>
    pub fn associated_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.associated_resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The resource to which the attached file is (being) uploaded to. <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html">Cases</a> are the only current supported resource.</p>
    pub fn set_associated_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.associated_resource_arn = input;
        self
    }
    /// <p>The resource to which the attached file is (being) uploaded to. <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html">Cases</a> are the only current supported resource.</p>
    pub fn get_associated_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.associated_resource_arn
    }
    /// <p>The use case for the file.</p>
    pub fn file_use_case_type(mut self, input: crate::types::FileUseCaseType) -> Self {
        self.file_use_case_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The use case for the file.</p>
    pub fn set_file_use_case_type(mut self, input: ::std::option::Option<crate::types::FileUseCaseType>) -> Self {
        self.file_use_case_type = input;
        self
    }
    /// <p>The use case for the file.</p>
    pub fn get_file_use_case_type(&self) -> &::std::option::Option<crate::types::FileUseCaseType> {
        &self.file_use_case_type
    }
    /// <p>Represents the identity that created the file.</p>
    pub fn created_by(mut self, input: crate::types::CreatedByInfo) -> Self {
        self.created_by = ::std::option::Option::Some(input);
        self
    }
    /// <p>Represents the identity that created the file.</p>
    pub fn set_created_by(mut self, input: ::std::option::Option<crate::types::CreatedByInfo>) -> Self {
        self.created_by = input;
        self
    }
    /// <p>Represents the identity that created the file.</p>
    pub fn get_created_by(&self) -> &::std::option::Option<crate::types::CreatedByInfo> {
        &self.created_by
    }
    /// <p>URL and expiry to be used when downloading the attached file.</p>
    pub fn download_url_metadata(mut self, input: crate::types::DownloadUrlMetadata) -> Self {
        self.download_url_metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>URL and expiry to be used when downloading the attached file.</p>
    pub fn set_download_url_metadata(mut self, input: ::std::option::Option<crate::types::DownloadUrlMetadata>) -> Self {
        self.download_url_metadata = input;
        self
    }
    /// <p>URL and expiry to be used when downloading the attached file.</p>
    pub fn get_download_url_metadata(&self) -> &::std::option::Option<crate::types::DownloadUrlMetadata> {
        &self.download_url_metadata
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    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 [`GetAttachedFileOutput`](crate::operation::get_attached_file::GetAttachedFileOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`file_size_in_bytes`](crate::operation::get_attached_file::builders::GetAttachedFileOutputBuilder::file_size_in_bytes)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_attached_file::GetAttachedFileOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_attached_file::GetAttachedFileOutput {
            file_arn: self.file_arn,
            file_id: self.file_id,
            creation_time: self.creation_time,
            file_status: self.file_status,
            file_name: self.file_name,
            file_size_in_bytes: self.file_size_in_bytes.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_size_in_bytes",
                    "file_size_in_bytes was not specified but it is required when building GetAttachedFileOutput",
                )
            })?,
            associated_resource_arn: self.associated_resource_arn,
            file_use_case_type: self.file_use_case_type,
            created_by: self.created_by,
            download_url_metadata: self.download_url_metadata,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}