aws-sdk-groundstation 1.24.0 → 1.41.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,134 @@
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::GroundStation
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::GroundStation::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::GroundStation::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::GroundStation::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 :cancel_contact
60
+ Aws::GroundStation::Endpoints::CancelContact.build(context)
61
+ when :create_config
62
+ Aws::GroundStation::Endpoints::CreateConfig.build(context)
63
+ when :create_dataflow_endpoint_group
64
+ Aws::GroundStation::Endpoints::CreateDataflowEndpointGroup.build(context)
65
+ when :create_ephemeris
66
+ Aws::GroundStation::Endpoints::CreateEphemeris.build(context)
67
+ when :create_mission_profile
68
+ Aws::GroundStation::Endpoints::CreateMissionProfile.build(context)
69
+ when :delete_config
70
+ Aws::GroundStation::Endpoints::DeleteConfig.build(context)
71
+ when :delete_dataflow_endpoint_group
72
+ Aws::GroundStation::Endpoints::DeleteDataflowEndpointGroup.build(context)
73
+ when :delete_ephemeris
74
+ Aws::GroundStation::Endpoints::DeleteEphemeris.build(context)
75
+ when :delete_mission_profile
76
+ Aws::GroundStation::Endpoints::DeleteMissionProfile.build(context)
77
+ when :describe_contact
78
+ Aws::GroundStation::Endpoints::DescribeContact.build(context)
79
+ when :describe_ephemeris
80
+ Aws::GroundStation::Endpoints::DescribeEphemeris.build(context)
81
+ when :get_agent_configuration
82
+ Aws::GroundStation::Endpoints::GetAgentConfiguration.build(context)
83
+ when :get_config
84
+ Aws::GroundStation::Endpoints::GetConfig.build(context)
85
+ when :get_dataflow_endpoint_group
86
+ Aws::GroundStation::Endpoints::GetDataflowEndpointGroup.build(context)
87
+ when :get_minute_usage
88
+ Aws::GroundStation::Endpoints::GetMinuteUsage.build(context)
89
+ when :get_mission_profile
90
+ Aws::GroundStation::Endpoints::GetMissionProfile.build(context)
91
+ when :get_satellite
92
+ Aws::GroundStation::Endpoints::GetSatellite.build(context)
93
+ when :list_configs
94
+ Aws::GroundStation::Endpoints::ListConfigs.build(context)
95
+ when :list_contacts
96
+ Aws::GroundStation::Endpoints::ListContacts.build(context)
97
+ when :list_dataflow_endpoint_groups
98
+ Aws::GroundStation::Endpoints::ListDataflowEndpointGroups.build(context)
99
+ when :list_ephemerides
100
+ Aws::GroundStation::Endpoints::ListEphemerides.build(context)
101
+ when :list_ground_stations
102
+ Aws::GroundStation::Endpoints::ListGroundStations.build(context)
103
+ when :list_mission_profiles
104
+ Aws::GroundStation::Endpoints::ListMissionProfiles.build(context)
105
+ when :list_satellites
106
+ Aws::GroundStation::Endpoints::ListSatellites.build(context)
107
+ when :list_tags_for_resource
108
+ Aws::GroundStation::Endpoints::ListTagsForResource.build(context)
109
+ when :register_agent
110
+ Aws::GroundStation::Endpoints::RegisterAgent.build(context)
111
+ when :reserve_contact
112
+ Aws::GroundStation::Endpoints::ReserveContact.build(context)
113
+ when :tag_resource
114
+ Aws::GroundStation::Endpoints::TagResource.build(context)
115
+ when :untag_resource
116
+ Aws::GroundStation::Endpoints::UntagResource.build(context)
117
+ when :update_agent_status
118
+ Aws::GroundStation::Endpoints::UpdateAgentStatus.build(context)
119
+ when :update_config
120
+ Aws::GroundStation::Endpoints::UpdateConfig.build(context)
121
+ when :update_ephemeris
122
+ Aws::GroundStation::Endpoints::UpdateEphemeris.build(context)
123
+ when :update_mission_profile
124
+ Aws::GroundStation::Endpoints::UpdateMissionProfile.build(context)
125
+ end
126
+ end
127
+ end
128
+
129
+ def add_handlers(handlers, _config)
130
+ handlers.add(Handler, step: :build, priority: 75)
131
+ end
132
+ end
133
+ end
134
+ end