aws-sdk-apprunner 1.7.0 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,142 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::AppRunner
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::AppRunner::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::AppRunner::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::AppRunner::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :associate_custom_domain
60
+ Aws::AppRunner::Endpoints::AssociateCustomDomain.build(context)
61
+ when :create_auto_scaling_configuration
62
+ Aws::AppRunner::Endpoints::CreateAutoScalingConfiguration.build(context)
63
+ when :create_connection
64
+ Aws::AppRunner::Endpoints::CreateConnection.build(context)
65
+ when :create_observability_configuration
66
+ Aws::AppRunner::Endpoints::CreateObservabilityConfiguration.build(context)
67
+ when :create_service
68
+ Aws::AppRunner::Endpoints::CreateService.build(context)
69
+ when :create_vpc_connector
70
+ Aws::AppRunner::Endpoints::CreateVpcConnector.build(context)
71
+ when :create_vpc_ingress_connection
72
+ Aws::AppRunner::Endpoints::CreateVpcIngressConnection.build(context)
73
+ when :delete_auto_scaling_configuration
74
+ Aws::AppRunner::Endpoints::DeleteAutoScalingConfiguration.build(context)
75
+ when :delete_connection
76
+ Aws::AppRunner::Endpoints::DeleteConnection.build(context)
77
+ when :delete_observability_configuration
78
+ Aws::AppRunner::Endpoints::DeleteObservabilityConfiguration.build(context)
79
+ when :delete_service
80
+ Aws::AppRunner::Endpoints::DeleteService.build(context)
81
+ when :delete_vpc_connector
82
+ Aws::AppRunner::Endpoints::DeleteVpcConnector.build(context)
83
+ when :delete_vpc_ingress_connection
84
+ Aws::AppRunner::Endpoints::DeleteVpcIngressConnection.build(context)
85
+ when :describe_auto_scaling_configuration
86
+ Aws::AppRunner::Endpoints::DescribeAutoScalingConfiguration.build(context)
87
+ when :describe_custom_domains
88
+ Aws::AppRunner::Endpoints::DescribeCustomDomains.build(context)
89
+ when :describe_observability_configuration
90
+ Aws::AppRunner::Endpoints::DescribeObservabilityConfiguration.build(context)
91
+ when :describe_service
92
+ Aws::AppRunner::Endpoints::DescribeService.build(context)
93
+ when :describe_vpc_connector
94
+ Aws::AppRunner::Endpoints::DescribeVpcConnector.build(context)
95
+ when :describe_vpc_ingress_connection
96
+ Aws::AppRunner::Endpoints::DescribeVpcIngressConnection.build(context)
97
+ when :disassociate_custom_domain
98
+ Aws::AppRunner::Endpoints::DisassociateCustomDomain.build(context)
99
+ when :list_auto_scaling_configurations
100
+ Aws::AppRunner::Endpoints::ListAutoScalingConfigurations.build(context)
101
+ when :list_connections
102
+ Aws::AppRunner::Endpoints::ListConnections.build(context)
103
+ when :list_observability_configurations
104
+ Aws::AppRunner::Endpoints::ListObservabilityConfigurations.build(context)
105
+ when :list_operations
106
+ Aws::AppRunner::Endpoints::ListOperations.build(context)
107
+ when :list_services
108
+ Aws::AppRunner::Endpoints::ListServices.build(context)
109
+ when :list_services_for_auto_scaling_configuration
110
+ Aws::AppRunner::Endpoints::ListServicesForAutoScalingConfiguration.build(context)
111
+ when :list_tags_for_resource
112
+ Aws::AppRunner::Endpoints::ListTagsForResource.build(context)
113
+ when :list_vpc_connectors
114
+ Aws::AppRunner::Endpoints::ListVpcConnectors.build(context)
115
+ when :list_vpc_ingress_connections
116
+ Aws::AppRunner::Endpoints::ListVpcIngressConnections.build(context)
117
+ when :pause_service
118
+ Aws::AppRunner::Endpoints::PauseService.build(context)
119
+ when :resume_service
120
+ Aws::AppRunner::Endpoints::ResumeService.build(context)
121
+ when :start_deployment
122
+ Aws::AppRunner::Endpoints::StartDeployment.build(context)
123
+ when :tag_resource
124
+ Aws::AppRunner::Endpoints::TagResource.build(context)
125
+ when :untag_resource
126
+ Aws::AppRunner::Endpoints::UntagResource.build(context)
127
+ when :update_default_auto_scaling_configuration
128
+ Aws::AppRunner::Endpoints::UpdateDefaultAutoScalingConfiguration.build(context)
129
+ when :update_service
130
+ Aws::AppRunner::Endpoints::UpdateService.build(context)
131
+ when :update_vpc_ingress_connection
132
+ Aws::AppRunner::Endpoints::UpdateVpcIngressConnection.build(context)
133
+ end
134
+ end
135
+ end
136
+
137
+ def add_handlers(handlers, _config)
138
+ handlers.add(Handler, step: :build, priority: 75)
139
+ end
140
+ end
141
+ end
142
+ end