aws_sdk_geomaps/operation/get_tile/
_get_tile_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetTileOutput {
6    /// <p>The blob represents a vector tile in <code>mvt</code> or a raster tile in an image format.</p>
7    pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
8    /// <p>Header that represents the format of the response. The response returns the following as the HTTP body.</p>
9    pub content_type: ::std::option::Option<::std::string::String>,
10    /// <p>Header that instructs caching configuration for the client.</p>
11    pub cache_control: ::std::option::Option<::std::string::String>,
12    /// <p>The pricing bucket for which the request is charged at.</p>
13    pub e_tag: ::std::option::Option<::std::string::String>,
14    /// <p>The pricing bucket for which the request is charged at.</p>
15    pub pricing_bucket: ::std::string::String,
16    _request_id: Option<String>,
17}
18impl GetTileOutput {
19    /// <p>The blob represents a vector tile in <code>mvt</code> or a raster tile in an image format.</p>
20    pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
21        self.blob.as_ref()
22    }
23    /// <p>Header that represents the format of the response. The response returns the following as the HTTP body.</p>
24    pub fn content_type(&self) -> ::std::option::Option<&str> {
25        self.content_type.as_deref()
26    }
27    /// <p>Header that instructs caching configuration for the client.</p>
28    pub fn cache_control(&self) -> ::std::option::Option<&str> {
29        self.cache_control.as_deref()
30    }
31    /// <p>The pricing bucket for which the request is charged at.</p>
32    pub fn e_tag(&self) -> ::std::option::Option<&str> {
33        self.e_tag.as_deref()
34    }
35    /// <p>The pricing bucket for which the request is charged at.</p>
36    pub fn pricing_bucket(&self) -> &str {
37        use std::ops::Deref;
38        self.pricing_bucket.deref()
39    }
40}
41impl ::aws_types::request_id::RequestId for GetTileOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl GetTileOutput {
47    /// Creates a new builder-style object to manufacture [`GetTileOutput`](crate::operation::get_tile::GetTileOutput).
48    pub fn builder() -> crate::operation::get_tile::builders::GetTileOutputBuilder {
49        crate::operation::get_tile::builders::GetTileOutputBuilder::default()
50    }
51}
52
53/// A builder for [`GetTileOutput`](crate::operation::get_tile::GetTileOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct GetTileOutputBuilder {
57    pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
58    pub(crate) content_type: ::std::option::Option<::std::string::String>,
59    pub(crate) cache_control: ::std::option::Option<::std::string::String>,
60    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
61    pub(crate) pricing_bucket: ::std::option::Option<::std::string::String>,
62    _request_id: Option<String>,
63}
64impl GetTileOutputBuilder {
65    /// <p>The blob represents a vector tile in <code>mvt</code> or a raster tile in an image format.</p>
66    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
67        self.blob = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The blob represents a vector tile in <code>mvt</code> or a raster tile in an image format.</p>
71    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
72        self.blob = input;
73        self
74    }
75    /// <p>The blob represents a vector tile in <code>mvt</code> or a raster tile in an image format.</p>
76    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
77        &self.blob
78    }
79    /// <p>Header that represents the format of the response. The response returns the following as the HTTP body.</p>
80    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.content_type = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>Header that represents the format of the response. The response returns the following as the HTTP body.</p>
85    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.content_type = input;
87        self
88    }
89    /// <p>Header that represents the format of the response. The response returns the following as the HTTP body.</p>
90    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
91        &self.content_type
92    }
93    /// <p>Header that instructs caching configuration for the client.</p>
94    pub fn cache_control(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.cache_control = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>Header that instructs caching configuration for the client.</p>
99    pub fn set_cache_control(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.cache_control = input;
101        self
102    }
103    /// <p>Header that instructs caching configuration for the client.</p>
104    pub fn get_cache_control(&self) -> &::std::option::Option<::std::string::String> {
105        &self.cache_control
106    }
107    /// <p>The pricing bucket for which the request is charged at.</p>
108    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.e_tag = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The pricing bucket for which the request is charged at.</p>
113    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.e_tag = input;
115        self
116    }
117    /// <p>The pricing bucket for which the request is charged at.</p>
118    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
119        &self.e_tag
120    }
121    /// <p>The pricing bucket for which the request is charged at.</p>
122    /// This field is required.
123    pub fn pricing_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.pricing_bucket = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The pricing bucket for which the request is charged at.</p>
128    pub fn set_pricing_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.pricing_bucket = input;
130        self
131    }
132    /// <p>The pricing bucket for which the request is charged at.</p>
133    pub fn get_pricing_bucket(&self) -> &::std::option::Option<::std::string::String> {
134        &self.pricing_bucket
135    }
136    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
137        self._request_id = Some(request_id.into());
138        self
139    }
140
141    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
142        self._request_id = request_id;
143        self
144    }
145    /// Consumes the builder and constructs a [`GetTileOutput`](crate::operation::get_tile::GetTileOutput).
146    /// This method will fail if any of the following fields are not set:
147    /// - [`pricing_bucket`](crate::operation::get_tile::builders::GetTileOutputBuilder::pricing_bucket)
148    pub fn build(self) -> ::std::result::Result<crate::operation::get_tile::GetTileOutput, ::aws_smithy_types::error::operation::BuildError> {
149        ::std::result::Result::Ok(crate::operation::get_tile::GetTileOutput {
150            blob: self.blob,
151            content_type: self.content_type,
152            cache_control: self.cache_control,
153            e_tag: self.e_tag,
154            pricing_bucket: self.pricing_bucket.ok_or_else(|| {
155                ::aws_smithy_types::error::operation::BuildError::missing_field(
156                    "pricing_bucket",
157                    "pricing_bucket was not specified but it is required when building GetTileOutput",
158                )
159            })?,
160            _request_id: self._request_id,
161        })
162    }
163}