aws_sdk_apigateway/operation/put_integration/
_put_integration_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents an <code>HTTP</code>, <code>HTTP_PROXY</code>, <code>AWS</code>, <code>AWS_PROXY</code>, or Mock integration.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutIntegrationOutput {
7    /// <p>Specifies an API method integration type. The valid value is one of the following:</p>
8    /// <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>
9    pub r#type: ::std::option::Option<crate::types::IntegrationType>,
10    /// <p>Specifies the integration's HTTP method type. For the Type property, if you specify <code>MOCK</code>, this property is optional. For Lambda integrations, you must set the integration method to <code>POST</code>. For all other types, you must specify this property.</p>
11    pub http_method: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p>
13    /// <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification for standard integrations. If <code>connectionType</code> is <code>VPC_LINK</code> specify the Network Load Balancer DNS name. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code></p>
14    pub uri: ::std::option::Option<::std::string::String>,
15    /// <p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>
16    pub connection_type: ::std::option::Option<crate::types::ConnectionType>,
17    /// <p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>
18    pub connection_id: ::std::option::Option<::std::string::String>,
19    /// <p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string <code>arn:aws:iam::\*:user/\*</code>. To use resource-based permissions on supported Amazon Web Services services, specify null.</p>
20    pub credentials: ::std::option::Option<::std::string::String>,
21    /// <p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>
22    pub request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
23    /// <p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>
24    pub request_templates: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
25    /// <p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>
26    pub passthrough_behavior: ::std::option::Option<::std::string::String>,
27    /// <p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p>
28    /// <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>
29    pub content_handling: ::std::option::Option<crate::types::ContentHandlingStrategy>,
30    /// <p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.</p>
31    pub timeout_in_millis: i32,
32    /// <p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>
33    pub cache_namespace: ::std::option::Option<::std::string::String>,
34    /// <p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>
35    pub cache_key_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36    /// <p>Specifies the integration's responses.</p>
37    pub integration_responses: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IntegrationResponse>>,
38    /// <p>Specifies the TLS configuration for an integration.</p>
39    pub tls_config: ::std::option::Option<crate::types::TlsConfig>,
40    /// <p>The response transfer mode of the integration.</p>
41    pub response_transfer_mode: ::std::option::Option<crate::types::ResponseTransferMode>,
42    /// <p>The ALB or NLB listener to send the request to.</p>
43    pub integration_target: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl PutIntegrationOutput {
47    /// <p>Specifies an API method integration type. The valid value is one of the following:</p>
48    /// <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>
49    pub fn r#type(&self) -> ::std::option::Option<&crate::types::IntegrationType> {
50        self.r#type.as_ref()
51    }
52    /// <p>Specifies the integration's HTTP method type. For the Type property, if you specify <code>MOCK</code>, this property is optional. For Lambda integrations, you must set the integration method to <code>POST</code>. For all other types, you must specify this property.</p>
53    pub fn http_method(&self) -> ::std::option::Option<&str> {
54        self.http_method.as_deref()
55    }
56    /// <p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p>
57    /// <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification for standard integrations. If <code>connectionType</code> is <code>VPC_LINK</code> specify the Network Load Balancer DNS name. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code></p>
58    pub fn uri(&self) -> ::std::option::Option<&str> {
59        self.uri.as_deref()
60    }
61    /// <p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>
62    pub fn connection_type(&self) -> ::std::option::Option<&crate::types::ConnectionType> {
63        self.connection_type.as_ref()
64    }
65    /// <p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>
66    pub fn connection_id(&self) -> ::std::option::Option<&str> {
67        self.connection_id.as_deref()
68    }
69    /// <p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string <code>arn:aws:iam::\*:user/\*</code>. To use resource-based permissions on supported Amazon Web Services services, specify null.</p>
70    pub fn credentials(&self) -> ::std::option::Option<&str> {
71        self.credentials.as_deref()
72    }
73    /// <p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>
74    pub fn request_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
75        self.request_parameters.as_ref()
76    }
77    /// <p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>
78    pub fn request_templates(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
79        self.request_templates.as_ref()
80    }
81    /// <p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>
82    pub fn passthrough_behavior(&self) -> ::std::option::Option<&str> {
83        self.passthrough_behavior.as_deref()
84    }
85    /// <p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p>
86    /// <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>
87    pub fn content_handling(&self) -> ::std::option::Option<&crate::types::ContentHandlingStrategy> {
88        self.content_handling.as_ref()
89    }
90    /// <p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.</p>
91    pub fn timeout_in_millis(&self) -> i32 {
92        self.timeout_in_millis
93    }
94    /// <p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>
95    pub fn cache_namespace(&self) -> ::std::option::Option<&str> {
96        self.cache_namespace.as_deref()
97    }
98    /// <p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>
99    ///
100    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cache_key_parameters.is_none()`.
101    pub fn cache_key_parameters(&self) -> &[::std::string::String] {
102        self.cache_key_parameters.as_deref().unwrap_or_default()
103    }
104    /// <p>Specifies the integration's responses.</p>
105    pub fn integration_responses(
106        &self,
107    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::IntegrationResponse>> {
108        self.integration_responses.as_ref()
109    }
110    /// <p>Specifies the TLS configuration for an integration.</p>
111    pub fn tls_config(&self) -> ::std::option::Option<&crate::types::TlsConfig> {
112        self.tls_config.as_ref()
113    }
114    /// <p>The response transfer mode of the integration.</p>
115    pub fn response_transfer_mode(&self) -> ::std::option::Option<&crate::types::ResponseTransferMode> {
116        self.response_transfer_mode.as_ref()
117    }
118    /// <p>The ALB or NLB listener to send the request to.</p>
119    pub fn integration_target(&self) -> ::std::option::Option<&str> {
120        self.integration_target.as_deref()
121    }
122}
123impl ::aws_types::request_id::RequestId for PutIntegrationOutput {
124    fn request_id(&self) -> Option<&str> {
125        self._request_id.as_deref()
126    }
127}
128impl PutIntegrationOutput {
129    /// Creates a new builder-style object to manufacture [`PutIntegrationOutput`](crate::operation::put_integration::PutIntegrationOutput).
130    pub fn builder() -> crate::operation::put_integration::builders::PutIntegrationOutputBuilder {
131        crate::operation::put_integration::builders::PutIntegrationOutputBuilder::default()
132    }
133}
134
135/// A builder for [`PutIntegrationOutput`](crate::operation::put_integration::PutIntegrationOutput).
136#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
137#[non_exhaustive]
138pub struct PutIntegrationOutputBuilder {
139    pub(crate) r#type: ::std::option::Option<crate::types::IntegrationType>,
140    pub(crate) http_method: ::std::option::Option<::std::string::String>,
141    pub(crate) uri: ::std::option::Option<::std::string::String>,
142    pub(crate) connection_type: ::std::option::Option<crate::types::ConnectionType>,
143    pub(crate) connection_id: ::std::option::Option<::std::string::String>,
144    pub(crate) credentials: ::std::option::Option<::std::string::String>,
145    pub(crate) request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
146    pub(crate) request_templates: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
147    pub(crate) passthrough_behavior: ::std::option::Option<::std::string::String>,
148    pub(crate) content_handling: ::std::option::Option<crate::types::ContentHandlingStrategy>,
149    pub(crate) timeout_in_millis: ::std::option::Option<i32>,
150    pub(crate) cache_namespace: ::std::option::Option<::std::string::String>,
151    pub(crate) cache_key_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
152    pub(crate) integration_responses: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IntegrationResponse>>,
153    pub(crate) tls_config: ::std::option::Option<crate::types::TlsConfig>,
154    pub(crate) response_transfer_mode: ::std::option::Option<crate::types::ResponseTransferMode>,
155    pub(crate) integration_target: ::std::option::Option<::std::string::String>,
156    _request_id: Option<String>,
157}
158impl PutIntegrationOutputBuilder {
159    /// <p>Specifies an API method integration type. The valid value is one of the following:</p>
160    /// <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>
161    pub fn r#type(mut self, input: crate::types::IntegrationType) -> Self {
162        self.r#type = ::std::option::Option::Some(input);
163        self
164    }
165    /// <p>Specifies an API method integration type. The valid value is one of the following:</p>
166    /// <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>
167    pub fn set_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
168        self.r#type = input;
169        self
170    }
171    /// <p>Specifies an API method integration type. The valid value is one of the following:</p>
172    /// <p>For the HTTP and HTTP proxy integrations, each integration can specify a protocol (<code>http/https</code>), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a <code>connectionType</code> of <code>VPC_LINK</code> is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.</p>
173    pub fn get_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
174        &self.r#type
175    }
176    /// <p>Specifies the integration's HTTP method type. For the Type property, if you specify <code>MOCK</code>, this property is optional. For Lambda integrations, you must set the integration method to <code>POST</code>. For all other types, you must specify this property.</p>
177    pub fn http_method(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.http_method = ::std::option::Option::Some(input.into());
179        self
180    }
181    /// <p>Specifies the integration's HTTP method type. For the Type property, if you specify <code>MOCK</code>, this property is optional. For Lambda integrations, you must set the integration method to <code>POST</code>. For all other types, you must specify this property.</p>
182    pub fn set_http_method(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.http_method = input;
184        self
185    }
186    /// <p>Specifies the integration's HTTP method type. For the Type property, if you specify <code>MOCK</code>, this property is optional. For Lambda integrations, you must set the integration method to <code>POST</code>. For all other types, you must specify this property.</p>
187    pub fn get_http_method(&self) -> &::std::option::Option<::std::string::String> {
188        &self.http_method
189    }
190    /// <p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p>
191    /// <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification for standard integrations. If <code>connectionType</code> is <code>VPC_LINK</code> specify the Network Load Balancer DNS name. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code></p>
192    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.uri = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p>
197    /// <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification for standard integrations. If <code>connectionType</code> is <code>VPC_LINK</code> specify the Network Load Balancer DNS name. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code></p>
198    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.uri = input;
200        self
201    }
202    /// <p>Specifies Uniform Resource Identifier (URI) of the integration endpoint.</p>
203    /// <p>For <code>HTTP</code> or <code>HTTP_PROXY</code> integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification for standard integrations. If <code>connectionType</code> is <code>VPC_LINK</code> specify the Network Load Balancer DNS name. For <code>AWS</code> or <code>AWS_PROXY</code> integrations, the URI is of the form <code>arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}</code>. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&amp;{p1}={v1}&amp;p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject, the uri can be either <code>arn:aws:apigateway:us-west-2:s3:action/GetObject&amp;Bucket={bucket}&amp;Key={key}</code> or <code>arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}</code></p>
204    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
205        &self.uri
206    }
207    /// <p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>
208    pub fn connection_type(mut self, input: crate::types::ConnectionType) -> Self {
209        self.connection_type = ::std::option::Option::Some(input);
210        self
211    }
212    /// <p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>
213    pub fn set_connection_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
214        self.connection_type = input;
215        self
216    }
217    /// <p>The type of the network connection to the integration endpoint. The valid value is <code>INTERNET</code> for connections through the public routable internet or <code>VPC_LINK</code> for private connections between API Gateway and a network load balancer in a VPC. The default value is <code>INTERNET</code>.</p>
218    pub fn get_connection_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
219        &self.connection_type
220    }
221    /// <p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>
222    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.connection_id = ::std::option::Option::Some(input.into());
224        self
225    }
226    /// <p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>
227    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.connection_id = input;
229        self
230    }
231    /// <p>The ID of the VpcLink used for the integration when <code>connectionType=VPC_LINK</code> and undefined, otherwise.</p>
232    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
233        &self.connection_id
234    }
235    /// <p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string <code>arn:aws:iam::\*:user/\*</code>. To use resource-based permissions on supported Amazon Web Services services, specify null.</p>
236    pub fn credentials(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237        self.credentials = ::std::option::Option::Some(input.into());
238        self
239    }
240    /// <p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string <code>arn:aws:iam::\*:user/\*</code>. To use resource-based permissions on supported Amazon Web Services services, specify null.</p>
241    pub fn set_credentials(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.credentials = input;
243        self
244    }
245    /// <p>Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string <code>arn:aws:iam::\*:user/\*</code>. To use resource-based permissions on supported Amazon Web Services services, specify null.</p>
246    pub fn get_credentials(&self) -> &::std::option::Option<::std::string::String> {
247        &self.credentials
248    }
249    /// Adds a key-value pair to `request_parameters`.
250    ///
251    /// To override the contents of this collection use [`set_request_parameters`](Self::set_request_parameters).
252    ///
253    /// <p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>
254    pub fn request_parameters(
255        mut self,
256        k: impl ::std::convert::Into<::std::string::String>,
257        v: impl ::std::convert::Into<::std::string::String>,
258    ) -> Self {
259        let mut hash_map = self.request_parameters.unwrap_or_default();
260        hash_map.insert(k.into(), v.into());
261        self.request_parameters = ::std::option::Option::Some(hash_map);
262        self
263    }
264    /// <p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>
265    pub fn set_request_parameters(
266        mut self,
267        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
268    ) -> Self {
269        self.request_parameters = input;
270        self
271    }
272    /// <p>A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of <code>method.request.{location}.{name}</code>, where <code>location</code> is <code>querystring</code>, <code>path</code>, or <code>header</code> and <code>name</code> must be a valid and unique method request parameter name.</p>
273    pub fn get_request_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
274        &self.request_parameters
275    }
276    /// Adds a key-value pair to `request_templates`.
277    ///
278    /// To override the contents of this collection use [`set_request_templates`](Self::set_request_templates).
279    ///
280    /// <p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>
281    pub fn request_templates(
282        mut self,
283        k: impl ::std::convert::Into<::std::string::String>,
284        v: impl ::std::convert::Into<::std::string::String>,
285    ) -> Self {
286        let mut hash_map = self.request_templates.unwrap_or_default();
287        hash_map.insert(k.into(), v.into());
288        self.request_templates = ::std::option::Option::Some(hash_map);
289        self
290    }
291    /// <p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>
292    pub fn set_request_templates(
293        mut self,
294        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
295    ) -> Self {
296        self.request_templates = input;
297        self
298    }
299    /// <p>Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.</p>
300    pub fn get_request_templates(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301        &self.request_templates
302    }
303    /// <p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>
304    pub fn passthrough_behavior(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.passthrough_behavior = ::std::option::Option::Some(input.into());
306        self
307    }
308    /// <p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>
309    pub fn set_passthrough_behavior(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310        self.passthrough_behavior = input;
311        self
312    }
313    /// <p>Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in <code>requestTemplates</code>. The valid value is one of the following: <code>WHEN_NO_MATCH</code>: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. <code>WHEN_NO_TEMPLATES</code>: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. <code>NEVER</code>: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.</p>
314    pub fn get_passthrough_behavior(&self) -> &::std::option::Option<::std::string::String> {
315        &self.passthrough_behavior
316    }
317    /// <p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p>
318    /// <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>
319    pub fn content_handling(mut self, input: crate::types::ContentHandlingStrategy) -> Self {
320        self.content_handling = ::std::option::Option::Some(input);
321        self
322    }
323    /// <p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p>
324    /// <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>
325    pub fn set_content_handling(mut self, input: ::std::option::Option<crate::types::ContentHandlingStrategy>) -> Self {
326        self.content_handling = input;
327        self
328    }
329    /// <p>Specifies how to handle request payload content type conversions. Supported values are <code>CONVERT_TO_BINARY</code> and <code>CONVERT_TO_TEXT</code>, with the following behaviors:</p>
330    /// <p>If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the <code>passthroughBehavior</code> is configured to support payload pass-through.</p>
331    pub fn get_content_handling(&self) -> &::std::option::Option<crate::types::ContentHandlingStrategy> {
332        &self.content_handling
333    }
334    /// <p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.</p>
335    pub fn timeout_in_millis(mut self, input: i32) -> Self {
336        self.timeout_in_millis = ::std::option::Option::Some(input);
337        self
338    }
339    /// <p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.</p>
340    pub fn set_timeout_in_millis(mut self, input: ::std::option::Option<i32>) -> Self {
341        self.timeout_in_millis = input;
342        self
343    }
344    /// <p>Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.</p>
345    pub fn get_timeout_in_millis(&self) -> &::std::option::Option<i32> {
346        &self.timeout_in_millis
347    }
348    /// <p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>
349    pub fn cache_namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
350        self.cache_namespace = ::std::option::Option::Some(input.into());
351        self
352    }
353    /// <p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>
354    pub fn set_cache_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
355        self.cache_namespace = input;
356        self
357    }
358    /// <p>Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the <code>cacheNamespace</code>. You can specify the same <code>cacheNamespace</code> across resources to return the same cached data for requests to different resources.</p>
359    pub fn get_cache_namespace(&self) -> &::std::option::Option<::std::string::String> {
360        &self.cache_namespace
361    }
362    /// Appends an item to `cache_key_parameters`.
363    ///
364    /// To override the contents of this collection use [`set_cache_key_parameters`](Self::set_cache_key_parameters).
365    ///
366    /// <p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>
367    pub fn cache_key_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
368        let mut v = self.cache_key_parameters.unwrap_or_default();
369        v.push(input.into());
370        self.cache_key_parameters = ::std::option::Option::Some(v);
371        self
372    }
373    /// <p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>
374    pub fn set_cache_key_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
375        self.cache_key_parameters = input;
376        self
377    }
378    /// <p>A list of request parameters whose values API Gateway caches. To be valid values for <code>cacheKeyParameters</code>, these parameters must also be specified for Method <code>requestParameters</code>.</p>
379    pub fn get_cache_key_parameters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
380        &self.cache_key_parameters
381    }
382    /// Adds a key-value pair to `integration_responses`.
383    ///
384    /// To override the contents of this collection use [`set_integration_responses`](Self::set_integration_responses).
385    ///
386    /// <p>Specifies the integration's responses.</p>
387    pub fn integration_responses(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::IntegrationResponse) -> Self {
388        let mut hash_map = self.integration_responses.unwrap_or_default();
389        hash_map.insert(k.into(), v);
390        self.integration_responses = ::std::option::Option::Some(hash_map);
391        self
392    }
393    /// <p>Specifies the integration's responses.</p>
394    pub fn set_integration_responses(
395        mut self,
396        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IntegrationResponse>>,
397    ) -> Self {
398        self.integration_responses = input;
399        self
400    }
401    /// <p>Specifies the integration's responses.</p>
402    pub fn get_integration_responses(
403        &self,
404    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IntegrationResponse>> {
405        &self.integration_responses
406    }
407    /// <p>Specifies the TLS configuration for an integration.</p>
408    pub fn tls_config(mut self, input: crate::types::TlsConfig) -> Self {
409        self.tls_config = ::std::option::Option::Some(input);
410        self
411    }
412    /// <p>Specifies the TLS configuration for an integration.</p>
413    pub fn set_tls_config(mut self, input: ::std::option::Option<crate::types::TlsConfig>) -> Self {
414        self.tls_config = input;
415        self
416    }
417    /// <p>Specifies the TLS configuration for an integration.</p>
418    pub fn get_tls_config(&self) -> &::std::option::Option<crate::types::TlsConfig> {
419        &self.tls_config
420    }
421    /// <p>The response transfer mode of the integration.</p>
422    pub fn response_transfer_mode(mut self, input: crate::types::ResponseTransferMode) -> Self {
423        self.response_transfer_mode = ::std::option::Option::Some(input);
424        self
425    }
426    /// <p>The response transfer mode of the integration.</p>
427    pub fn set_response_transfer_mode(mut self, input: ::std::option::Option<crate::types::ResponseTransferMode>) -> Self {
428        self.response_transfer_mode = input;
429        self
430    }
431    /// <p>The response transfer mode of the integration.</p>
432    pub fn get_response_transfer_mode(&self) -> &::std::option::Option<crate::types::ResponseTransferMode> {
433        &self.response_transfer_mode
434    }
435    /// <p>The ALB or NLB listener to send the request to.</p>
436    pub fn integration_target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
437        self.integration_target = ::std::option::Option::Some(input.into());
438        self
439    }
440    /// <p>The ALB or NLB listener to send the request to.</p>
441    pub fn set_integration_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
442        self.integration_target = input;
443        self
444    }
445    /// <p>The ALB or NLB listener to send the request to.</p>
446    pub fn get_integration_target(&self) -> &::std::option::Option<::std::string::String> {
447        &self.integration_target
448    }
449    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
450        self._request_id = Some(request_id.into());
451        self
452    }
453
454    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
455        self._request_id = request_id;
456        self
457    }
458    /// Consumes the builder and constructs a [`PutIntegrationOutput`](crate::operation::put_integration::PutIntegrationOutput).
459    pub fn build(self) -> crate::operation::put_integration::PutIntegrationOutput {
460        crate::operation::put_integration::PutIntegrationOutput {
461            r#type: self.r#type,
462            http_method: self.http_method,
463            uri: self.uri,
464            connection_type: self.connection_type,
465            connection_id: self.connection_id,
466            credentials: self.credentials,
467            request_parameters: self.request_parameters,
468            request_templates: self.request_templates,
469            passthrough_behavior: self.passthrough_behavior,
470            content_handling: self.content_handling,
471            timeout_in_millis: self.timeout_in_millis.unwrap_or_default(),
472            cache_namespace: self.cache_namespace,
473            cache_key_parameters: self.cache_key_parameters,
474            integration_responses: self.integration_responses,
475            tls_config: self.tls_config,
476            response_transfer_mode: self.response_transfer_mode,
477            integration_target: self.integration_target,
478            _request_id: self._request_id,
479        }
480    }
481}