aws-sdk-qapps 1.63.0

AWS SDK for QApps
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 CreatePresignedUrlOutput {
    /// <p>The unique identifier assigned to the file to be uploaded.</p>
    pub file_id: ::std::string::String,
    /// <p>The URL for a presigned S3 POST operation used to upload a file.</p>
    pub presigned_url: ::std::string::String,
    /// <p>The form fields to include in the presigned S3 POST operation used to upload a file.</p>
    pub presigned_url_fields: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    /// <p>The date and time that the presigned URL will expire in ISO 8601 format.</p>
    pub presigned_url_expiration: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreatePresignedUrlOutput {
    /// <p>The unique identifier assigned to the file to be uploaded.</p>
    pub fn file_id(&self) -> &str {
        use std::ops::Deref;
        self.file_id.deref()
    }
    /// <p>The URL for a presigned S3 POST operation used to upload a file.</p>
    pub fn presigned_url(&self) -> &str {
        use std::ops::Deref;
        self.presigned_url.deref()
    }
    /// <p>The form fields to include in the presigned S3 POST operation used to upload a file.</p>
    pub fn presigned_url_fields(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
        &self.presigned_url_fields
    }
    /// <p>The date and time that the presigned URL will expire in ISO 8601 format.</p>
    pub fn presigned_url_expiration(&self) -> &::aws_smithy_types::DateTime {
        &self.presigned_url_expiration
    }
}
impl ::aws_types::request_id::RequestId for CreatePresignedUrlOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreatePresignedUrlOutput {
    /// Creates a new builder-style object to manufacture [`CreatePresignedUrlOutput`](crate::operation::create_presigned_url::CreatePresignedUrlOutput).
    pub fn builder() -> crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder {
        crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::default()
    }
}

/// A builder for [`CreatePresignedUrlOutput`](crate::operation::create_presigned_url::CreatePresignedUrlOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreatePresignedUrlOutputBuilder {
    pub(crate) file_id: ::std::option::Option<::std::string::String>,
    pub(crate) presigned_url: ::std::option::Option<::std::string::String>,
    pub(crate) presigned_url_fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) presigned_url_expiration: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreatePresignedUrlOutputBuilder {
    /// <p>The unique identifier assigned to the file to be uploaded.</p>
    /// This field is required.
    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 assigned to the file to be uploaded.</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 assigned to the file to be uploaded.</p>
    pub fn get_file_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_id
    }
    /// <p>The URL for a presigned S3 POST operation used to upload a file.</p>
    /// This field is required.
    pub fn presigned_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.presigned_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL for a presigned S3 POST operation used to upload a file.</p>
    pub fn set_presigned_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.presigned_url = input;
        self
    }
    /// <p>The URL for a presigned S3 POST operation used to upload a file.</p>
    pub fn get_presigned_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.presigned_url
    }
    /// Adds a key-value pair to `presigned_url_fields`.
    ///
    /// To override the contents of this collection use [`set_presigned_url_fields`](Self::set_presigned_url_fields).
    ///
    /// <p>The form fields to include in the presigned S3 POST operation used to upload a file.</p>
    pub fn presigned_url_fields(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.presigned_url_fields.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.presigned_url_fields = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The form fields to include in the presigned S3 POST operation used to upload a file.</p>
    pub fn set_presigned_url_fields(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.presigned_url_fields = input;
        self
    }
    /// <p>The form fields to include in the presigned S3 POST operation used to upload a file.</p>
    pub fn get_presigned_url_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.presigned_url_fields
    }
    /// <p>The date and time that the presigned URL will expire in ISO 8601 format.</p>
    /// This field is required.
    pub fn presigned_url_expiration(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.presigned_url_expiration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the presigned URL will expire in ISO 8601 format.</p>
    pub fn set_presigned_url_expiration(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.presigned_url_expiration = input;
        self
    }
    /// <p>The date and time that the presigned URL will expire in ISO 8601 format.</p>
    pub fn get_presigned_url_expiration(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.presigned_url_expiration
    }
    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 [`CreatePresignedUrlOutput`](crate::operation::create_presigned_url::CreatePresignedUrlOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`file_id`](crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::file_id)
    /// - [`presigned_url`](crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::presigned_url)
    /// - [`presigned_url_fields`](crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::presigned_url_fields)
    /// - [`presigned_url_expiration`](crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::presigned_url_expiration)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_presigned_url::CreatePresignedUrlOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_presigned_url::CreatePresignedUrlOutput {
            file_id: self.file_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_id",
                    "file_id was not specified but it is required when building CreatePresignedUrlOutput",
                )
            })?,
            presigned_url: self.presigned_url.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "presigned_url",
                    "presigned_url was not specified but it is required when building CreatePresignedUrlOutput",
                )
            })?,
            presigned_url_fields: self.presigned_url_fields.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "presigned_url_fields",
                    "presigned_url_fields was not specified but it is required when building CreatePresignedUrlOutput",
                )
            })?,
            presigned_url_expiration: self.presigned_url_expiration.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "presigned_url_expiration",
                    "presigned_url_expiration was not specified but it is required when building CreatePresignedUrlOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}