aws-sdk-panorama 1.9.0 → 1.11.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,136 @@
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::Panorama
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Panorama::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::Panorama::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Panorama::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_application_instance
60
+ Aws::Panorama::Endpoints::CreateApplicationInstance.build(context)
61
+ when :create_job_for_devices
62
+ Aws::Panorama::Endpoints::CreateJobForDevices.build(context)
63
+ when :create_node_from_template_job
64
+ Aws::Panorama::Endpoints::CreateNodeFromTemplateJob.build(context)
65
+ when :create_package
66
+ Aws::Panorama::Endpoints::CreatePackage.build(context)
67
+ when :create_package_import_job
68
+ Aws::Panorama::Endpoints::CreatePackageImportJob.build(context)
69
+ when :delete_device
70
+ Aws::Panorama::Endpoints::DeleteDevice.build(context)
71
+ when :delete_package
72
+ Aws::Panorama::Endpoints::DeletePackage.build(context)
73
+ when :deregister_package_version
74
+ Aws::Panorama::Endpoints::DeregisterPackageVersion.build(context)
75
+ when :describe_application_instance
76
+ Aws::Panorama::Endpoints::DescribeApplicationInstance.build(context)
77
+ when :describe_application_instance_details
78
+ Aws::Panorama::Endpoints::DescribeApplicationInstanceDetails.build(context)
79
+ when :describe_device
80
+ Aws::Panorama::Endpoints::DescribeDevice.build(context)
81
+ when :describe_device_job
82
+ Aws::Panorama::Endpoints::DescribeDeviceJob.build(context)
83
+ when :describe_node
84
+ Aws::Panorama::Endpoints::DescribeNode.build(context)
85
+ when :describe_node_from_template_job
86
+ Aws::Panorama::Endpoints::DescribeNodeFromTemplateJob.build(context)
87
+ when :describe_package
88
+ Aws::Panorama::Endpoints::DescribePackage.build(context)
89
+ when :describe_package_import_job
90
+ Aws::Panorama::Endpoints::DescribePackageImportJob.build(context)
91
+ when :describe_package_version
92
+ Aws::Panorama::Endpoints::DescribePackageVersion.build(context)
93
+ when :list_application_instance_dependencies
94
+ Aws::Panorama::Endpoints::ListApplicationInstanceDependencies.build(context)
95
+ when :list_application_instance_node_instances
96
+ Aws::Panorama::Endpoints::ListApplicationInstanceNodeInstances.build(context)
97
+ when :list_application_instances
98
+ Aws::Panorama::Endpoints::ListApplicationInstances.build(context)
99
+ when :list_devices
100
+ Aws::Panorama::Endpoints::ListDevices.build(context)
101
+ when :list_devices_jobs
102
+ Aws::Panorama::Endpoints::ListDevicesJobs.build(context)
103
+ when :list_node_from_template_jobs
104
+ Aws::Panorama::Endpoints::ListNodeFromTemplateJobs.build(context)
105
+ when :list_nodes
106
+ Aws::Panorama::Endpoints::ListNodes.build(context)
107
+ when :list_package_import_jobs
108
+ Aws::Panorama::Endpoints::ListPackageImportJobs.build(context)
109
+ when :list_packages
110
+ Aws::Panorama::Endpoints::ListPackages.build(context)
111
+ when :list_tags_for_resource
112
+ Aws::Panorama::Endpoints::ListTagsForResource.build(context)
113
+ when :provision_device
114
+ Aws::Panorama::Endpoints::ProvisionDevice.build(context)
115
+ when :register_package_version
116
+ Aws::Panorama::Endpoints::RegisterPackageVersion.build(context)
117
+ when :remove_application_instance
118
+ Aws::Panorama::Endpoints::RemoveApplicationInstance.build(context)
119
+ when :signal_application_instance_node_instances
120
+ Aws::Panorama::Endpoints::SignalApplicationInstanceNodeInstances.build(context)
121
+ when :tag_resource
122
+ Aws::Panorama::Endpoints::TagResource.build(context)
123
+ when :untag_resource
124
+ Aws::Panorama::Endpoints::UntagResource.build(context)
125
+ when :update_device_metadata
126
+ Aws::Panorama::Endpoints::UpdateDeviceMetadata.build(context)
127
+ end
128
+ end
129
+ end
130
+
131
+ def add_handlers(handlers, _config)
132
+ handlers.add(Handler, step: :build, priority: 75)
133
+ end
134
+ end
135
+ end
136
+ end