aws_sdk_panorama/types/
_storage_location.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A storage location.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StorageLocation {
7    /// <p>The location's bucket.</p>
8    pub bucket: ::std::string::String,
9    /// <p>The location's repo prefix.</p>
10    pub repo_prefix_location: ::std::string::String,
11    /// <p>The location's generated prefix.</p>
12    pub generated_prefix_location: ::std::string::String,
13    /// <p>The location's binary prefix.</p>
14    pub binary_prefix_location: ::std::string::String,
15    /// <p>The location's manifest prefix.</p>
16    pub manifest_prefix_location: ::std::string::String,
17}
18impl StorageLocation {
19    /// <p>The location's bucket.</p>
20    pub fn bucket(&self) -> &str {
21        use std::ops::Deref;
22        self.bucket.deref()
23    }
24    /// <p>The location's repo prefix.</p>
25    pub fn repo_prefix_location(&self) -> &str {
26        use std::ops::Deref;
27        self.repo_prefix_location.deref()
28    }
29    /// <p>The location's generated prefix.</p>
30    pub fn generated_prefix_location(&self) -> &str {
31        use std::ops::Deref;
32        self.generated_prefix_location.deref()
33    }
34    /// <p>The location's binary prefix.</p>
35    pub fn binary_prefix_location(&self) -> &str {
36        use std::ops::Deref;
37        self.binary_prefix_location.deref()
38    }
39    /// <p>The location's manifest prefix.</p>
40    pub fn manifest_prefix_location(&self) -> &str {
41        use std::ops::Deref;
42        self.manifest_prefix_location.deref()
43    }
44}
45impl StorageLocation {
46    /// Creates a new builder-style object to manufacture [`StorageLocation`](crate::types::StorageLocation).
47    pub fn builder() -> crate::types::builders::StorageLocationBuilder {
48        crate::types::builders::StorageLocationBuilder::default()
49    }
50}
51
52/// A builder for [`StorageLocation`](crate::types::StorageLocation).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct StorageLocationBuilder {
56    pub(crate) bucket: ::std::option::Option<::std::string::String>,
57    pub(crate) repo_prefix_location: ::std::option::Option<::std::string::String>,
58    pub(crate) generated_prefix_location: ::std::option::Option<::std::string::String>,
59    pub(crate) binary_prefix_location: ::std::option::Option<::std::string::String>,
60    pub(crate) manifest_prefix_location: ::std::option::Option<::std::string::String>,
61}
62impl StorageLocationBuilder {
63    /// <p>The location's bucket.</p>
64    /// This field is required.
65    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.bucket = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The location's bucket.</p>
70    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.bucket = input;
72        self
73    }
74    /// <p>The location's bucket.</p>
75    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
76        &self.bucket
77    }
78    /// <p>The location's repo prefix.</p>
79    /// This field is required.
80    pub fn repo_prefix_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.repo_prefix_location = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The location's repo prefix.</p>
85    pub fn set_repo_prefix_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.repo_prefix_location = input;
87        self
88    }
89    /// <p>The location's repo prefix.</p>
90    pub fn get_repo_prefix_location(&self) -> &::std::option::Option<::std::string::String> {
91        &self.repo_prefix_location
92    }
93    /// <p>The location's generated prefix.</p>
94    /// This field is required.
95    pub fn generated_prefix_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.generated_prefix_location = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The location's generated prefix.</p>
100    pub fn set_generated_prefix_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.generated_prefix_location = input;
102        self
103    }
104    /// <p>The location's generated prefix.</p>
105    pub fn get_generated_prefix_location(&self) -> &::std::option::Option<::std::string::String> {
106        &self.generated_prefix_location
107    }
108    /// <p>The location's binary prefix.</p>
109    /// This field is required.
110    pub fn binary_prefix_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.binary_prefix_location = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The location's binary prefix.</p>
115    pub fn set_binary_prefix_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.binary_prefix_location = input;
117        self
118    }
119    /// <p>The location's binary prefix.</p>
120    pub fn get_binary_prefix_location(&self) -> &::std::option::Option<::std::string::String> {
121        &self.binary_prefix_location
122    }
123    /// <p>The location's manifest prefix.</p>
124    /// This field is required.
125    pub fn manifest_prefix_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.manifest_prefix_location = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The location's manifest prefix.</p>
130    pub fn set_manifest_prefix_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.manifest_prefix_location = input;
132        self
133    }
134    /// <p>The location's manifest prefix.</p>
135    pub fn get_manifest_prefix_location(&self) -> &::std::option::Option<::std::string::String> {
136        &self.manifest_prefix_location
137    }
138    /// Consumes the builder and constructs a [`StorageLocation`](crate::types::StorageLocation).
139    /// This method will fail if any of the following fields are not set:
140    /// - [`bucket`](crate::types::builders::StorageLocationBuilder::bucket)
141    /// - [`repo_prefix_location`](crate::types::builders::StorageLocationBuilder::repo_prefix_location)
142    /// - [`generated_prefix_location`](crate::types::builders::StorageLocationBuilder::generated_prefix_location)
143    /// - [`binary_prefix_location`](crate::types::builders::StorageLocationBuilder::binary_prefix_location)
144    /// - [`manifest_prefix_location`](crate::types::builders::StorageLocationBuilder::manifest_prefix_location)
145    pub fn build(self) -> ::std::result::Result<crate::types::StorageLocation, ::aws_smithy_types::error::operation::BuildError> {
146        ::std::result::Result::Ok(crate::types::StorageLocation {
147            bucket: self.bucket.ok_or_else(|| {
148                ::aws_smithy_types::error::operation::BuildError::missing_field(
149                    "bucket",
150                    "bucket was not specified but it is required when building StorageLocation",
151                )
152            })?,
153            repo_prefix_location: self.repo_prefix_location.ok_or_else(|| {
154                ::aws_smithy_types::error::operation::BuildError::missing_field(
155                    "repo_prefix_location",
156                    "repo_prefix_location was not specified but it is required when building StorageLocation",
157                )
158            })?,
159            generated_prefix_location: self.generated_prefix_location.ok_or_else(|| {
160                ::aws_smithy_types::error::operation::BuildError::missing_field(
161                    "generated_prefix_location",
162                    "generated_prefix_location was not specified but it is required when building StorageLocation",
163                )
164            })?,
165            binary_prefix_location: self.binary_prefix_location.ok_or_else(|| {
166                ::aws_smithy_types::error::operation::BuildError::missing_field(
167                    "binary_prefix_location",
168                    "binary_prefix_location was not specified but it is required when building StorageLocation",
169                )
170            })?,
171            manifest_prefix_location: self.manifest_prefix_location.ok_or_else(|| {
172                ::aws_smithy_types::error::operation::BuildError::missing_field(
173                    "manifest_prefix_location",
174                    "manifest_prefix_location was not specified but it is required when building StorageLocation",
175                )
176            })?,
177        })
178    }
179}