aws-sdk-mediaconvert 1.93.0 → 1.95.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,124 @@
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::MediaConvert
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::MediaConvert::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::MediaConvert::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::MediaConvert::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_certificate
60
+ Aws::MediaConvert::Endpoints::AssociateCertificate.build(context)
61
+ when :cancel_job
62
+ Aws::MediaConvert::Endpoints::CancelJob.build(context)
63
+ when :create_job
64
+ Aws::MediaConvert::Endpoints::CreateJob.build(context)
65
+ when :create_job_template
66
+ Aws::MediaConvert::Endpoints::CreateJobTemplate.build(context)
67
+ when :create_preset
68
+ Aws::MediaConvert::Endpoints::CreatePreset.build(context)
69
+ when :create_queue
70
+ Aws::MediaConvert::Endpoints::CreateQueue.build(context)
71
+ when :delete_job_template
72
+ Aws::MediaConvert::Endpoints::DeleteJobTemplate.build(context)
73
+ when :delete_policy
74
+ Aws::MediaConvert::Endpoints::DeletePolicy.build(context)
75
+ when :delete_preset
76
+ Aws::MediaConvert::Endpoints::DeletePreset.build(context)
77
+ when :delete_queue
78
+ Aws::MediaConvert::Endpoints::DeleteQueue.build(context)
79
+ when :describe_endpoints
80
+ Aws::MediaConvert::Endpoints::DescribeEndpoints.build(context)
81
+ when :disassociate_certificate
82
+ Aws::MediaConvert::Endpoints::DisassociateCertificate.build(context)
83
+ when :get_job
84
+ Aws::MediaConvert::Endpoints::GetJob.build(context)
85
+ when :get_job_template
86
+ Aws::MediaConvert::Endpoints::GetJobTemplate.build(context)
87
+ when :get_policy
88
+ Aws::MediaConvert::Endpoints::GetPolicy.build(context)
89
+ when :get_preset
90
+ Aws::MediaConvert::Endpoints::GetPreset.build(context)
91
+ when :get_queue
92
+ Aws::MediaConvert::Endpoints::GetQueue.build(context)
93
+ when :list_job_templates
94
+ Aws::MediaConvert::Endpoints::ListJobTemplates.build(context)
95
+ when :list_jobs
96
+ Aws::MediaConvert::Endpoints::ListJobs.build(context)
97
+ when :list_presets
98
+ Aws::MediaConvert::Endpoints::ListPresets.build(context)
99
+ when :list_queues
100
+ Aws::MediaConvert::Endpoints::ListQueues.build(context)
101
+ when :list_tags_for_resource
102
+ Aws::MediaConvert::Endpoints::ListTagsForResource.build(context)
103
+ when :put_policy
104
+ Aws::MediaConvert::Endpoints::PutPolicy.build(context)
105
+ when :tag_resource
106
+ Aws::MediaConvert::Endpoints::TagResource.build(context)
107
+ when :untag_resource
108
+ Aws::MediaConvert::Endpoints::UntagResource.build(context)
109
+ when :update_job_template
110
+ Aws::MediaConvert::Endpoints::UpdateJobTemplate.build(context)
111
+ when :update_preset
112
+ Aws::MediaConvert::Endpoints::UpdatePreset.build(context)
113
+ when :update_queue
114
+ Aws::MediaConvert::Endpoints::UpdateQueue.build(context)
115
+ end
116
+ end
117
+ end
118
+
119
+ def add_handlers(handlers, _config)
120
+ handlers.add(Handler, step: :build, priority: 75)
121
+ end
122
+ end
123
+ end
124
+ end