aws-sdk-pcaconnectorad 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,118 @@
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::PcaConnectorAd
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::PcaConnectorAd::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::PcaConnectorAd::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::PcaConnectorAd::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 :create_connector
60
+ Aws::PcaConnectorAd::Endpoints::CreateConnector.build(context)
61
+ when :create_directory_registration
62
+ Aws::PcaConnectorAd::Endpoints::CreateDirectoryRegistration.build(context)
63
+ when :create_service_principal_name
64
+ Aws::PcaConnectorAd::Endpoints::CreateServicePrincipalName.build(context)
65
+ when :create_template
66
+ Aws::PcaConnectorAd::Endpoints::CreateTemplate.build(context)
67
+ when :create_template_group_access_control_entry
68
+ Aws::PcaConnectorAd::Endpoints::CreateTemplateGroupAccessControlEntry.build(context)
69
+ when :delete_connector
70
+ Aws::PcaConnectorAd::Endpoints::DeleteConnector.build(context)
71
+ when :delete_directory_registration
72
+ Aws::PcaConnectorAd::Endpoints::DeleteDirectoryRegistration.build(context)
73
+ when :delete_service_principal_name
74
+ Aws::PcaConnectorAd::Endpoints::DeleteServicePrincipalName.build(context)
75
+ when :delete_template
76
+ Aws::PcaConnectorAd::Endpoints::DeleteTemplate.build(context)
77
+ when :delete_template_group_access_control_entry
78
+ Aws::PcaConnectorAd::Endpoints::DeleteTemplateGroupAccessControlEntry.build(context)
79
+ when :get_connector
80
+ Aws::PcaConnectorAd::Endpoints::GetConnector.build(context)
81
+ when :get_directory_registration
82
+ Aws::PcaConnectorAd::Endpoints::GetDirectoryRegistration.build(context)
83
+ when :get_service_principal_name
84
+ Aws::PcaConnectorAd::Endpoints::GetServicePrincipalName.build(context)
85
+ when :get_template
86
+ Aws::PcaConnectorAd::Endpoints::GetTemplate.build(context)
87
+ when :get_template_group_access_control_entry
88
+ Aws::PcaConnectorAd::Endpoints::GetTemplateGroupAccessControlEntry.build(context)
89
+ when :list_connectors
90
+ Aws::PcaConnectorAd::Endpoints::ListConnectors.build(context)
91
+ when :list_directory_registrations
92
+ Aws::PcaConnectorAd::Endpoints::ListDirectoryRegistrations.build(context)
93
+ when :list_service_principal_names
94
+ Aws::PcaConnectorAd::Endpoints::ListServicePrincipalNames.build(context)
95
+ when :list_tags_for_resource
96
+ Aws::PcaConnectorAd::Endpoints::ListTagsForResource.build(context)
97
+ when :list_template_group_access_control_entries
98
+ Aws::PcaConnectorAd::Endpoints::ListTemplateGroupAccessControlEntries.build(context)
99
+ when :list_templates
100
+ Aws::PcaConnectorAd::Endpoints::ListTemplates.build(context)
101
+ when :tag_resource
102
+ Aws::PcaConnectorAd::Endpoints::TagResource.build(context)
103
+ when :untag_resource
104
+ Aws::PcaConnectorAd::Endpoints::UntagResource.build(context)
105
+ when :update_template
106
+ Aws::PcaConnectorAd::Endpoints::UpdateTemplate.build(context)
107
+ when :update_template_group_access_control_entry
108
+ Aws::PcaConnectorAd::Endpoints::UpdateTemplateGroupAccessControlEntry.build(context)
109
+ end
110
+ end
111
+ end
112
+
113
+ def add_handlers(handlers, _config)
114
+ handlers.add(Handler, step: :build, priority: 75)
115
+ end
116
+ end
117
+ end
118
+ 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::PcaConnectorAd
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