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