aws-sdk-mediatailor 1.49.0 → 1.71.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,156 @@
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::MediaTailor
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::MediaTailor::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::MediaTailor::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::MediaTailor::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 :configure_logs_for_channel
60
+ Aws::MediaTailor::Endpoints::ConfigureLogsForChannel.build(context)
61
+ when :configure_logs_for_playback_configuration
62
+ Aws::MediaTailor::Endpoints::ConfigureLogsForPlaybackConfiguration.build(context)
63
+ when :create_channel
64
+ Aws::MediaTailor::Endpoints::CreateChannel.build(context)
65
+ when :create_live_source
66
+ Aws::MediaTailor::Endpoints::CreateLiveSource.build(context)
67
+ when :create_prefetch_schedule
68
+ Aws::MediaTailor::Endpoints::CreatePrefetchSchedule.build(context)
69
+ when :create_program
70
+ Aws::MediaTailor::Endpoints::CreateProgram.build(context)
71
+ when :create_source_location
72
+ Aws::MediaTailor::Endpoints::CreateSourceLocation.build(context)
73
+ when :create_vod_source
74
+ Aws::MediaTailor::Endpoints::CreateVodSource.build(context)
75
+ when :delete_channel
76
+ Aws::MediaTailor::Endpoints::DeleteChannel.build(context)
77
+ when :delete_channel_policy
78
+ Aws::MediaTailor::Endpoints::DeleteChannelPolicy.build(context)
79
+ when :delete_live_source
80
+ Aws::MediaTailor::Endpoints::DeleteLiveSource.build(context)
81
+ when :delete_playback_configuration
82
+ Aws::MediaTailor::Endpoints::DeletePlaybackConfiguration.build(context)
83
+ when :delete_prefetch_schedule
84
+ Aws::MediaTailor::Endpoints::DeletePrefetchSchedule.build(context)
85
+ when :delete_program
86
+ Aws::MediaTailor::Endpoints::DeleteProgram.build(context)
87
+ when :delete_source_location
88
+ Aws::MediaTailor::Endpoints::DeleteSourceLocation.build(context)
89
+ when :delete_vod_source
90
+ Aws::MediaTailor::Endpoints::DeleteVodSource.build(context)
91
+ when :describe_channel
92
+ Aws::MediaTailor::Endpoints::DescribeChannel.build(context)
93
+ when :describe_live_source
94
+ Aws::MediaTailor::Endpoints::DescribeLiveSource.build(context)
95
+ when :describe_program
96
+ Aws::MediaTailor::Endpoints::DescribeProgram.build(context)
97
+ when :describe_source_location
98
+ Aws::MediaTailor::Endpoints::DescribeSourceLocation.build(context)
99
+ when :describe_vod_source
100
+ Aws::MediaTailor::Endpoints::DescribeVodSource.build(context)
101
+ when :get_channel_policy
102
+ Aws::MediaTailor::Endpoints::GetChannelPolicy.build(context)
103
+ when :get_channel_schedule
104
+ Aws::MediaTailor::Endpoints::GetChannelSchedule.build(context)
105
+ when :get_playback_configuration
106
+ Aws::MediaTailor::Endpoints::GetPlaybackConfiguration.build(context)
107
+ when :get_prefetch_schedule
108
+ Aws::MediaTailor::Endpoints::GetPrefetchSchedule.build(context)
109
+ when :list_alerts
110
+ Aws::MediaTailor::Endpoints::ListAlerts.build(context)
111
+ when :list_channels
112
+ Aws::MediaTailor::Endpoints::ListChannels.build(context)
113
+ when :list_live_sources
114
+ Aws::MediaTailor::Endpoints::ListLiveSources.build(context)
115
+ when :list_playback_configurations
116
+ Aws::MediaTailor::Endpoints::ListPlaybackConfigurations.build(context)
117
+ when :list_prefetch_schedules
118
+ Aws::MediaTailor::Endpoints::ListPrefetchSchedules.build(context)
119
+ when :list_source_locations
120
+ Aws::MediaTailor::Endpoints::ListSourceLocations.build(context)
121
+ when :list_tags_for_resource
122
+ Aws::MediaTailor::Endpoints::ListTagsForResource.build(context)
123
+ when :list_vod_sources
124
+ Aws::MediaTailor::Endpoints::ListVodSources.build(context)
125
+ when :put_channel_policy
126
+ Aws::MediaTailor::Endpoints::PutChannelPolicy.build(context)
127
+ when :put_playback_configuration
128
+ Aws::MediaTailor::Endpoints::PutPlaybackConfiguration.build(context)
129
+ when :start_channel
130
+ Aws::MediaTailor::Endpoints::StartChannel.build(context)
131
+ when :stop_channel
132
+ Aws::MediaTailor::Endpoints::StopChannel.build(context)
133
+ when :tag_resource
134
+ Aws::MediaTailor::Endpoints::TagResource.build(context)
135
+ when :untag_resource
136
+ Aws::MediaTailor::Endpoints::UntagResource.build(context)
137
+ when :update_channel
138
+ Aws::MediaTailor::Endpoints::UpdateChannel.build(context)
139
+ when :update_live_source
140
+ Aws::MediaTailor::Endpoints::UpdateLiveSource.build(context)
141
+ when :update_program
142
+ Aws::MediaTailor::Endpoints::UpdateProgram.build(context)
143
+ when :update_source_location
144
+ Aws::MediaTailor::Endpoints::UpdateSourceLocation.build(context)
145
+ when :update_vod_source
146
+ Aws::MediaTailor::Endpoints::UpdateVodSource.build(context)
147
+ end
148
+ end
149
+ end
150
+
151
+ def add_handlers(handlers, _config)
152
+ handlers.add(Handler, step: :build, priority: 75)
153
+ end
154
+ end
155
+ end
156
+ end