aws-sdk-cleanroomsml 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,119 @@
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::CleanRoomsML
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::CleanRoomsML::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::CleanRoomsML::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::CleanRoomsML::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ unless context[:discovered_endpoint]
29
+ params = parameters_for_operation(context)
30
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
31
+
32
+ context.http_request.endpoint = endpoint.url
33
+ apply_endpoint_headers(context, endpoint.headers)
34
+
35
+ context[:endpoint_params] = params
36
+ context[:endpoint_properties] = endpoint.properties
37
+ end
38
+
39
+ context[:auth_scheme] =
40
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
41
+
42
+ @handler.call(context)
43
+ end
44
+
45
+ private
46
+
47
+ def apply_endpoint_headers(context, headers)
48
+ headers.each do |key, values|
49
+ value = values
50
+ .compact
51
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
52
+ .join(',')
53
+
54
+ context.http_request.headers[key] = value
55
+ end
56
+ end
57
+
58
+ def parameters_for_operation(context)
59
+ case context.operation_name
60
+ when :create_audience_model
61
+ Aws::CleanRoomsML::Endpoints::CreateAudienceModel.build(context)
62
+ when :create_configured_audience_model
63
+ Aws::CleanRoomsML::Endpoints::CreateConfiguredAudienceModel.build(context)
64
+ when :create_training_dataset
65
+ Aws::CleanRoomsML::Endpoints::CreateTrainingDataset.build(context)
66
+ when :delete_audience_generation_job
67
+ Aws::CleanRoomsML::Endpoints::DeleteAudienceGenerationJob.build(context)
68
+ when :delete_audience_model
69
+ Aws::CleanRoomsML::Endpoints::DeleteAudienceModel.build(context)
70
+ when :delete_configured_audience_model
71
+ Aws::CleanRoomsML::Endpoints::DeleteConfiguredAudienceModel.build(context)
72
+ when :delete_configured_audience_model_policy
73
+ Aws::CleanRoomsML::Endpoints::DeleteConfiguredAudienceModelPolicy.build(context)
74
+ when :delete_training_dataset
75
+ Aws::CleanRoomsML::Endpoints::DeleteTrainingDataset.build(context)
76
+ when :get_audience_generation_job
77
+ Aws::CleanRoomsML::Endpoints::GetAudienceGenerationJob.build(context)
78
+ when :get_audience_model
79
+ Aws::CleanRoomsML::Endpoints::GetAudienceModel.build(context)
80
+ when :get_configured_audience_model
81
+ Aws::CleanRoomsML::Endpoints::GetConfiguredAudienceModel.build(context)
82
+ when :get_configured_audience_model_policy
83
+ Aws::CleanRoomsML::Endpoints::GetConfiguredAudienceModelPolicy.build(context)
84
+ when :get_training_dataset
85
+ Aws::CleanRoomsML::Endpoints::GetTrainingDataset.build(context)
86
+ when :list_audience_export_jobs
87
+ Aws::CleanRoomsML::Endpoints::ListAudienceExportJobs.build(context)
88
+ when :list_audience_generation_jobs
89
+ Aws::CleanRoomsML::Endpoints::ListAudienceGenerationJobs.build(context)
90
+ when :list_audience_models
91
+ Aws::CleanRoomsML::Endpoints::ListAudienceModels.build(context)
92
+ when :list_configured_audience_models
93
+ Aws::CleanRoomsML::Endpoints::ListConfiguredAudienceModels.build(context)
94
+ when :list_tags_for_resource
95
+ Aws::CleanRoomsML::Endpoints::ListTagsForResource.build(context)
96
+ when :list_training_datasets
97
+ Aws::CleanRoomsML::Endpoints::ListTrainingDatasets.build(context)
98
+ when :put_configured_audience_model_policy
99
+ Aws::CleanRoomsML::Endpoints::PutConfiguredAudienceModelPolicy.build(context)
100
+ when :start_audience_export_job
101
+ Aws::CleanRoomsML::Endpoints::StartAudienceExportJob.build(context)
102
+ when :start_audience_generation_job
103
+ Aws::CleanRoomsML::Endpoints::StartAudienceGenerationJob.build(context)
104
+ when :tag_resource
105
+ Aws::CleanRoomsML::Endpoints::TagResource.build(context)
106
+ when :untag_resource
107
+ Aws::CleanRoomsML::Endpoints::UntagResource.build(context)
108
+ when :update_configured_audience_model
109
+ Aws::CleanRoomsML::Endpoints::UpdateConfiguredAudienceModel.build(context)
110
+ end
111
+ end
112
+ end
113
+
114
+ def add_handlers(handlers, _config)
115
+ handlers.add(Handler, step: :build, priority: 75)
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,26 @@
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
+ module Aws::CleanRoomsML
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end