aws-sdk-eventbridge 1.39.0 → 1.41.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,180 @@
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::EventBridge
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::EventBridge::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::EventBridge::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::EventBridge::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 :activate_event_source
60
+ Aws::EventBridge::Endpoints::ActivateEventSource.build(context)
61
+ when :cancel_replay
62
+ Aws::EventBridge::Endpoints::CancelReplay.build(context)
63
+ when :create_api_destination
64
+ Aws::EventBridge::Endpoints::CreateApiDestination.build(context)
65
+ when :create_archive
66
+ Aws::EventBridge::Endpoints::CreateArchive.build(context)
67
+ when :create_connection
68
+ Aws::EventBridge::Endpoints::CreateConnection.build(context)
69
+ when :create_endpoint
70
+ Aws::EventBridge::Endpoints::CreateEndpoint.build(context)
71
+ when :create_event_bus
72
+ Aws::EventBridge::Endpoints::CreateEventBus.build(context)
73
+ when :create_partner_event_source
74
+ Aws::EventBridge::Endpoints::CreatePartnerEventSource.build(context)
75
+ when :deactivate_event_source
76
+ Aws::EventBridge::Endpoints::DeactivateEventSource.build(context)
77
+ when :deauthorize_connection
78
+ Aws::EventBridge::Endpoints::DeauthorizeConnection.build(context)
79
+ when :delete_api_destination
80
+ Aws::EventBridge::Endpoints::DeleteApiDestination.build(context)
81
+ when :delete_archive
82
+ Aws::EventBridge::Endpoints::DeleteArchive.build(context)
83
+ when :delete_connection
84
+ Aws::EventBridge::Endpoints::DeleteConnection.build(context)
85
+ when :delete_endpoint
86
+ Aws::EventBridge::Endpoints::DeleteEndpoint.build(context)
87
+ when :delete_event_bus
88
+ Aws::EventBridge::Endpoints::DeleteEventBus.build(context)
89
+ when :delete_partner_event_source
90
+ Aws::EventBridge::Endpoints::DeletePartnerEventSource.build(context)
91
+ when :delete_rule
92
+ Aws::EventBridge::Endpoints::DeleteRule.build(context)
93
+ when :describe_api_destination
94
+ Aws::EventBridge::Endpoints::DescribeApiDestination.build(context)
95
+ when :describe_archive
96
+ Aws::EventBridge::Endpoints::DescribeArchive.build(context)
97
+ when :describe_connection
98
+ Aws::EventBridge::Endpoints::DescribeConnection.build(context)
99
+ when :describe_endpoint
100
+ Aws::EventBridge::Endpoints::DescribeEndpoint.build(context)
101
+ when :describe_event_bus
102
+ Aws::EventBridge::Endpoints::DescribeEventBus.build(context)
103
+ when :describe_event_source
104
+ Aws::EventBridge::Endpoints::DescribeEventSource.build(context)
105
+ when :describe_partner_event_source
106
+ Aws::EventBridge::Endpoints::DescribePartnerEventSource.build(context)
107
+ when :describe_replay
108
+ Aws::EventBridge::Endpoints::DescribeReplay.build(context)
109
+ when :describe_rule
110
+ Aws::EventBridge::Endpoints::DescribeRule.build(context)
111
+ when :disable_rule
112
+ Aws::EventBridge::Endpoints::DisableRule.build(context)
113
+ when :enable_rule
114
+ Aws::EventBridge::Endpoints::EnableRule.build(context)
115
+ when :list_api_destinations
116
+ Aws::EventBridge::Endpoints::ListApiDestinations.build(context)
117
+ when :list_archives
118
+ Aws::EventBridge::Endpoints::ListArchives.build(context)
119
+ when :list_connections
120
+ Aws::EventBridge::Endpoints::ListConnections.build(context)
121
+ when :list_endpoints
122
+ Aws::EventBridge::Endpoints::ListEndpoints.build(context)
123
+ when :list_event_buses
124
+ Aws::EventBridge::Endpoints::ListEventBuses.build(context)
125
+ when :list_event_sources
126
+ Aws::EventBridge::Endpoints::ListEventSources.build(context)
127
+ when :list_partner_event_source_accounts
128
+ Aws::EventBridge::Endpoints::ListPartnerEventSourceAccounts.build(context)
129
+ when :list_partner_event_sources
130
+ Aws::EventBridge::Endpoints::ListPartnerEventSources.build(context)
131
+ when :list_replays
132
+ Aws::EventBridge::Endpoints::ListReplays.build(context)
133
+ when :list_rule_names_by_target
134
+ Aws::EventBridge::Endpoints::ListRuleNamesByTarget.build(context)
135
+ when :list_rules
136
+ Aws::EventBridge::Endpoints::ListRules.build(context)
137
+ when :list_tags_for_resource
138
+ Aws::EventBridge::Endpoints::ListTagsForResource.build(context)
139
+ when :list_targets_by_rule
140
+ Aws::EventBridge::Endpoints::ListTargetsByRule.build(context)
141
+ when :put_events
142
+ Aws::EventBridge::Endpoints::PutEvents.build(context)
143
+ when :put_partner_events
144
+ Aws::EventBridge::Endpoints::PutPartnerEvents.build(context)
145
+ when :put_permission
146
+ Aws::EventBridge::Endpoints::PutPermission.build(context)
147
+ when :put_rule
148
+ Aws::EventBridge::Endpoints::PutRule.build(context)
149
+ when :put_targets
150
+ Aws::EventBridge::Endpoints::PutTargets.build(context)
151
+ when :remove_permission
152
+ Aws::EventBridge::Endpoints::RemovePermission.build(context)
153
+ when :remove_targets
154
+ Aws::EventBridge::Endpoints::RemoveTargets.build(context)
155
+ when :start_replay
156
+ Aws::EventBridge::Endpoints::StartReplay.build(context)
157
+ when :tag_resource
158
+ Aws::EventBridge::Endpoints::TagResource.build(context)
159
+ when :test_event_pattern
160
+ Aws::EventBridge::Endpoints::TestEventPattern.build(context)
161
+ when :untag_resource
162
+ Aws::EventBridge::Endpoints::UntagResource.build(context)
163
+ when :update_api_destination
164
+ Aws::EventBridge::Endpoints::UpdateApiDestination.build(context)
165
+ when :update_archive
166
+ Aws::EventBridge::Endpoints::UpdateArchive.build(context)
167
+ when :update_connection
168
+ Aws::EventBridge::Endpoints::UpdateConnection.build(context)
169
+ when :update_endpoint
170
+ Aws::EventBridge::Endpoints::UpdateEndpoint.build(context)
171
+ end
172
+ end
173
+ end
174
+
175
+ def add_handlers(handlers, _config)
176
+ handlers.add(Handler, step: :build, priority: 75)
177
+ end
178
+ end
179
+ end
180
+ end