aws_sdk_amplify/operation/create_deployment/
_create_deployment_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The result structure for the create a new deployment request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentOutput {
7    /// <p>The job ID for this deployment. will supply to start deployment api.</p>
8    pub job_id: ::std::option::Option<::std::string::String>,
9    /// <p>When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs.</p>
10    pub file_upload_urls: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
11    /// <p>When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned.</p>
12    pub zip_upload_url: ::std::string::String,
13    _request_id: Option<String>,
14}
15impl CreateDeploymentOutput {
16    /// <p>The job ID for this deployment. will supply to start deployment api.</p>
17    pub fn job_id(&self) -> ::std::option::Option<&str> {
18        self.job_id.as_deref()
19    }
20    /// <p>When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs.</p>
21    pub fn file_upload_urls(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
22        &self.file_upload_urls
23    }
24    /// <p>When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned.</p>
25    pub fn zip_upload_url(&self) -> &str {
26        use std::ops::Deref;
27        self.zip_upload_url.deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for CreateDeploymentOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl CreateDeploymentOutput {
36    /// Creates a new builder-style object to manufacture [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
37    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder {
38        crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateDeploymentOutputBuilder {
46    pub(crate) job_id: ::std::option::Option<::std::string::String>,
47    pub(crate) file_upload_urls: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48    pub(crate) zip_upload_url: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl CreateDeploymentOutputBuilder {
52    /// <p>The job ID for this deployment. will supply to start deployment api.</p>
53    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.job_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The job ID for this deployment. will supply to start deployment api.</p>
58    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.job_id = input;
60        self
61    }
62    /// <p>The job ID for this deployment. will supply to start deployment api.</p>
63    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.job_id
65    }
66    /// Adds a key-value pair to `file_upload_urls`.
67    ///
68    /// To override the contents of this collection use [`set_file_upload_urls`](Self::set_file_upload_urls).
69    ///
70    /// <p>When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs.</p>
71    pub fn file_upload_urls(
72        mut self,
73        k: impl ::std::convert::Into<::std::string::String>,
74        v: impl ::std::convert::Into<::std::string::String>,
75    ) -> Self {
76        let mut hash_map = self.file_upload_urls.unwrap_or_default();
77        hash_map.insert(k.into(), v.into());
78        self.file_upload_urls = ::std::option::Option::Some(hash_map);
79        self
80    }
81    /// <p>When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs.</p>
82    pub fn set_file_upload_urls(
83        mut self,
84        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
85    ) -> Self {
86        self.file_upload_urls = input;
87        self
88    }
89    /// <p>When the <code>fileMap</code> argument is provided in the request, <code>fileUploadUrls</code> will contain a map of file names to upload URLs.</p>
90    pub fn get_file_upload_urls(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91        &self.file_upload_urls
92    }
93    /// <p>When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned.</p>
94    /// This field is required.
95    pub fn zip_upload_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.zip_upload_url = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned.</p>
100    pub fn set_zip_upload_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.zip_upload_url = input;
102        self
103    }
104    /// <p>When the <code>fileMap</code> argument is not provided in the request, this <code>zipUploadUrl</code> is returned.</p>
105    pub fn get_zip_upload_url(&self) -> &::std::option::Option<::std::string::String> {
106        &self.zip_upload_url
107    }
108    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
109        self._request_id = Some(request_id.into());
110        self
111    }
112
113    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
114        self._request_id = request_id;
115        self
116    }
117    /// Consumes the builder and constructs a [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
118    /// This method will fail if any of the following fields are not set:
119    /// - [`file_upload_urls`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::file_upload_urls)
120    /// - [`zip_upload_url`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::zip_upload_url)
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentOutput, ::aws_smithy_types::error::operation::BuildError> {
124        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentOutput {
125            job_id: self.job_id,
126            file_upload_urls: self.file_upload_urls.ok_or_else(|| {
127                ::aws_smithy_types::error::operation::BuildError::missing_field(
128                    "file_upload_urls",
129                    "file_upload_urls was not specified but it is required when building CreateDeploymentOutput",
130                )
131            })?,
132            zip_upload_url: self.zip_upload_url.ok_or_else(|| {
133                ::aws_smithy_types::error::operation::BuildError::missing_field(
134                    "zip_upload_url",
135                    "zip_upload_url was not specified but it is required when building CreateDeploymentOutput",
136                )
137            })?,
138            _request_id: self._request_id,
139        })
140    }
141}