1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a REST API.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateRestApiOutput {
/// <p>The API's identifier. This identifier is unique across all of your APIs in API Gateway.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The API's name.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The API's description.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The timestamp when the API was created.</p>
pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>A version identifier for the API.</p>
pub version: ::std::option::Option<::std::string::String>,
/// <p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>
pub warnings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>
pub binary_media_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>
pub minimum_compression_size: ::std::option::Option<i32>,
/// <p>The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>
pub api_key_source: ::std::option::Option<crate::types::ApiKeySourceType>,
/// <p>The endpoint configuration of this RestApi showing the endpoint types of the API.</p>
pub endpoint_configuration: ::std::option::Option<crate::types::EndpointConfiguration>,
/// <p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>
pub policy: ::std::option::Option<::std::string::String>,
/// <p>The collection of tags. Each tag element is associated with a given resource.</p>
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
pub disable_execute_api_endpoint: bool,
/// <p>The API's root resource ID.</p>
pub root_resource_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl UpdateRestApiOutput {
/// <p>The API's identifier. This identifier is unique across all of your APIs in API Gateway.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The API's name.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The API's description.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The timestamp when the API was created.</p>
pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_date.as_ref()
}
/// <p>A version identifier for the API.</p>
pub fn version(&self) -> ::std::option::Option<&str> {
self.version.as_deref()
}
/// <p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.warnings.is_none()`.
pub fn warnings(&self) -> &[::std::string::String] {
self.warnings.as_deref().unwrap_or_default()
}
/// <p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.binary_media_types.is_none()`.
pub fn binary_media_types(&self) -> &[::std::string::String] {
self.binary_media_types.as_deref().unwrap_or_default()
}
/// <p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>
pub fn minimum_compression_size(&self) -> ::std::option::Option<i32> {
self.minimum_compression_size
}
/// <p>The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>
pub fn api_key_source(&self) -> ::std::option::Option<&crate::types::ApiKeySourceType> {
self.api_key_source.as_ref()
}
/// <p>The endpoint configuration of this RestApi showing the endpoint types of the API.</p>
pub fn endpoint_configuration(&self) -> ::std::option::Option<&crate::types::EndpointConfiguration> {
self.endpoint_configuration.as_ref()
}
/// <p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>
pub fn policy(&self) -> ::std::option::Option<&str> {
self.policy.as_deref()
}
/// <p>The collection of tags. Each tag element is associated with a given resource.</p>
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
/// <p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
pub fn disable_execute_api_endpoint(&self) -> bool {
self.disable_execute_api_endpoint
}
/// <p>The API's root resource ID.</p>
pub fn root_resource_id(&self) -> ::std::option::Option<&str> {
self.root_resource_id.as_deref()
}
}
impl ::aws_types::request_id::RequestId for UpdateRestApiOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl UpdateRestApiOutput {
/// Creates a new builder-style object to manufacture [`UpdateRestApiOutput`](crate::operation::update_rest_api::UpdateRestApiOutput).
pub fn builder() -> crate::operation::update_rest_api::builders::UpdateRestApiOutputBuilder {
crate::operation::update_rest_api::builders::UpdateRestApiOutputBuilder::default()
}
}
/// A builder for [`UpdateRestApiOutput`](crate::operation::update_rest_api::UpdateRestApiOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UpdateRestApiOutputBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) version: ::std::option::Option<::std::string::String>,
pub(crate) warnings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) binary_media_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) minimum_compression_size: ::std::option::Option<i32>,
pub(crate) api_key_source: ::std::option::Option<crate::types::ApiKeySourceType>,
pub(crate) endpoint_configuration: ::std::option::Option<crate::types::EndpointConfiguration>,
pub(crate) policy: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) disable_execute_api_endpoint: ::std::option::Option<bool>,
pub(crate) root_resource_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl UpdateRestApiOutputBuilder {
/// <p>The API's identifier. This identifier is unique across all of your APIs in API Gateway.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The API's identifier. This identifier is unique across all of your APIs in API Gateway.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The API's identifier. This identifier is unique across all of your APIs in API Gateway.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The API's name.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The API's name.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The API's name.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The API's description.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The API's description.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The API's description.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The timestamp when the API was created.</p>
pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_date = ::std::option::Option::Some(input);
self
}
/// <p>The timestamp when the API was created.</p>
pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_date = input;
self
}
/// <p>The timestamp when the API was created.</p>
pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_date
}
/// <p>A version identifier for the API.</p>
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version = ::std::option::Option::Some(input.into());
self
}
/// <p>A version identifier for the API.</p>
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version = input;
self
}
/// <p>A version identifier for the API.</p>
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
&self.version
}
/// Appends an item to `warnings`.
///
/// To override the contents of this collection use [`set_warnings`](Self::set_warnings).
///
/// <p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>
pub fn warnings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.warnings.unwrap_or_default();
v.push(input.into());
self.warnings = ::std::option::Option::Some(v);
self
}
/// <p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>
pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.warnings = input;
self
}
/// <p>The warning messages reported when <code>failonwarnings</code> is turned on during API import.</p>
pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.warnings
}
/// Appends an item to `binary_media_types`.
///
/// To override the contents of this collection use [`set_binary_media_types`](Self::set_binary_media_types).
///
/// <p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>
pub fn binary_media_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.binary_media_types.unwrap_or_default();
v.push(input.into());
self.binary_media_types = ::std::option::Option::Some(v);
self
}
/// <p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>
pub fn set_binary_media_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.binary_media_types = input;
self
}
/// <p>The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.</p>
pub fn get_binary_media_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.binary_media_types
}
/// <p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>
pub fn minimum_compression_size(mut self, input: i32) -> Self {
self.minimum_compression_size = ::std::option::Option::Some(input);
self
}
/// <p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>
pub fn set_minimum_compression_size(mut self, input: ::std::option::Option<i32>) -> Self {
self.minimum_compression_size = input;
self
}
/// <p>A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.</p>
pub fn get_minimum_compression_size(&self) -> &::std::option::Option<i32> {
&self.minimum_compression_size
}
/// <p>The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>
pub fn api_key_source(mut self, input: crate::types::ApiKeySourceType) -> Self {
self.api_key_source = ::std::option::Option::Some(input);
self
}
/// <p>The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>
pub fn set_api_key_source(mut self, input: ::std::option::Option<crate::types::ApiKeySourceType>) -> Self {
self.api_key_source = input;
self
}
/// <p>The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.</p>
pub fn get_api_key_source(&self) -> &::std::option::Option<crate::types::ApiKeySourceType> {
&self.api_key_source
}
/// <p>The endpoint configuration of this RestApi showing the endpoint types of the API.</p>
pub fn endpoint_configuration(mut self, input: crate::types::EndpointConfiguration) -> Self {
self.endpoint_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The endpoint configuration of this RestApi showing the endpoint types of the API.</p>
pub fn set_endpoint_configuration(mut self, input: ::std::option::Option<crate::types::EndpointConfiguration>) -> Self {
self.endpoint_configuration = input;
self
}
/// <p>The endpoint configuration of this RestApi showing the endpoint types of the API.</p>
pub fn get_endpoint_configuration(&self) -> &::std::option::Option<crate::types::EndpointConfiguration> {
&self.endpoint_configuration
}
/// <p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>
pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy = ::std::option::Option::Some(input.into());
self
}
/// <p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>
pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy = input;
self
}
/// <p>A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.</p>
pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
&self.policy
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The collection of tags. Each tag element is associated with a given resource.</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 collection of tags. Each tag element is associated with a given resource.</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 collection of tags. Each tag element is associated with a given resource.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// <p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
pub fn disable_execute_api_endpoint(mut self, input: bool) -> Self {
self.disable_execute_api_endpoint = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
pub fn set_disable_execute_api_endpoint(mut self, input: ::std::option::Option<bool>) -> Self {
self.disable_execute_api_endpoint = input;
self
}
/// <p>Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
pub fn get_disable_execute_api_endpoint(&self) -> &::std::option::Option<bool> {
&self.disable_execute_api_endpoint
}
/// <p>The API's root resource ID.</p>
pub fn root_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.root_resource_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The API's root resource ID.</p>
pub fn set_root_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.root_resource_id = input;
self
}
/// <p>The API's root resource ID.</p>
pub fn get_root_resource_id(&self) -> &::std::option::Option<::std::string::String> {
&self.root_resource_id
}
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 [`UpdateRestApiOutput`](crate::operation::update_rest_api::UpdateRestApiOutput).
pub fn build(self) -> crate::operation::update_rest_api::UpdateRestApiOutput {
crate::operation::update_rest_api::UpdateRestApiOutput {
id: self.id,
name: self.name,
description: self.description,
created_date: self.created_date,
version: self.version,
warnings: self.warnings,
binary_media_types: self.binary_media_types,
minimum_compression_size: self.minimum_compression_size,
api_key_source: self.api_key_source,
endpoint_configuration: self.endpoint_configuration,
policy: self.policy,
tags: self.tags,
disable_execute_api_endpoint: self.disable_execute_api_endpoint.unwrap_or_default(),
root_resource_id: self.root_resource_id,
_request_id: self._request_id,
}
}
}