aws-sdk-applicationsignals 1.0.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.
File without changes
@@ -0,0 +1,54 @@
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::ApplicationSignals
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute use_fips
14
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
15
+ #
16
+ # @return [Boolean]
17
+ #
18
+ # @!attribute endpoint
19
+ # Override the endpoint used to send this request
20
+ #
21
+ # @return [String]
22
+ #
23
+ # @!attribute region
24
+ # The AWS region used to dispatch the request.
25
+ #
26
+ # @return [String]
27
+ #
28
+ EndpointParameters = Struct.new(
29
+ :use_fips,
30
+ :endpoint,
31
+ :region,
32
+ ) do
33
+ include Aws::Structure
34
+
35
+ # @api private
36
+ class << self
37
+ PARAM_MAP = {
38
+ 'UseFIPS' => :use_fips,
39
+ 'Endpoint' => :endpoint,
40
+ 'Region' => :region,
41
+ }.freeze
42
+ end
43
+
44
+ def initialize(options = {})
45
+ self[:use_fips] = options[:use_fips]
46
+ self[:use_fips] = false if self[:use_fips].nil?
47
+ if self[:use_fips].nil?
48
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
49
+ end
50
+ self[:endpoint] = options[:endpoint]
51
+ self[:region] = options[:region]
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,35 @@
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::ApplicationSignals
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ use_fips = parameters.use_fips
14
+ endpoint = parameters.endpoint
15
+ region = parameters.region
16
+ if Aws::Endpoints::Matchers.set?(endpoint)
17
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
18
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
19
+ end
20
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
21
+ end
22
+ if Aws::Endpoints::Matchers.set?(region)
23
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
24
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
25
+ return Aws::Endpoints::Endpoint.new(url: "https://application-signals-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
26
+ end
27
+ return Aws::Endpoints::Endpoint.new(url: "https://application-signals.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
28
+ end
29
+ end
30
+ raise ArgumentError, "Invalid Configuration: Missing Region"
31
+ raise ArgumentError, 'No endpoint could be resolved'
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,211 @@
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::ApplicationSignals
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class BatchGetServiceLevelObjectiveBudgetReport
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::ApplicationSignals::EndpointParameters.new(
21
+ use_fips: context.config.use_fips_endpoint,
22
+ endpoint: endpoint,
23
+ region: context.config.region,
24
+ )
25
+ end
26
+ end
27
+
28
+ class CreateServiceLevelObjective
29
+ def self.build(context)
30
+ unless context.config.regional_endpoint
31
+ endpoint = context.config.endpoint.to_s
32
+ end
33
+ Aws::ApplicationSignals::EndpointParameters.new(
34
+ use_fips: context.config.use_fips_endpoint,
35
+ endpoint: endpoint,
36
+ region: context.config.region,
37
+ )
38
+ end
39
+ end
40
+
41
+ class DeleteServiceLevelObjective
42
+ def self.build(context)
43
+ unless context.config.regional_endpoint
44
+ endpoint = context.config.endpoint.to_s
45
+ end
46
+ Aws::ApplicationSignals::EndpointParameters.new(
47
+ use_fips: context.config.use_fips_endpoint,
48
+ endpoint: endpoint,
49
+ region: context.config.region,
50
+ )
51
+ end
52
+ end
53
+
54
+ class GetService
55
+ def self.build(context)
56
+ unless context.config.regional_endpoint
57
+ endpoint = context.config.endpoint.to_s
58
+ end
59
+ Aws::ApplicationSignals::EndpointParameters.new(
60
+ use_fips: context.config.use_fips_endpoint,
61
+ endpoint: endpoint,
62
+ region: context.config.region,
63
+ )
64
+ end
65
+ end
66
+
67
+ class GetServiceLevelObjective
68
+ def self.build(context)
69
+ unless context.config.regional_endpoint
70
+ endpoint = context.config.endpoint.to_s
71
+ end
72
+ Aws::ApplicationSignals::EndpointParameters.new(
73
+ use_fips: context.config.use_fips_endpoint,
74
+ endpoint: endpoint,
75
+ region: context.config.region,
76
+ )
77
+ end
78
+ end
79
+
80
+ class ListServiceDependencies
81
+ def self.build(context)
82
+ unless context.config.regional_endpoint
83
+ endpoint = context.config.endpoint.to_s
84
+ end
85
+ Aws::ApplicationSignals::EndpointParameters.new(
86
+ use_fips: context.config.use_fips_endpoint,
87
+ endpoint: endpoint,
88
+ region: context.config.region,
89
+ )
90
+ end
91
+ end
92
+
93
+ class ListServiceDependents
94
+ def self.build(context)
95
+ unless context.config.regional_endpoint
96
+ endpoint = context.config.endpoint.to_s
97
+ end
98
+ Aws::ApplicationSignals::EndpointParameters.new(
99
+ use_fips: context.config.use_fips_endpoint,
100
+ endpoint: endpoint,
101
+ region: context.config.region,
102
+ )
103
+ end
104
+ end
105
+
106
+ class ListServiceLevelObjectives
107
+ def self.build(context)
108
+ unless context.config.regional_endpoint
109
+ endpoint = context.config.endpoint.to_s
110
+ end
111
+ Aws::ApplicationSignals::EndpointParameters.new(
112
+ use_fips: context.config.use_fips_endpoint,
113
+ endpoint: endpoint,
114
+ region: context.config.region,
115
+ )
116
+ end
117
+ end
118
+
119
+ class ListServiceOperations
120
+ def self.build(context)
121
+ unless context.config.regional_endpoint
122
+ endpoint = context.config.endpoint.to_s
123
+ end
124
+ Aws::ApplicationSignals::EndpointParameters.new(
125
+ use_fips: context.config.use_fips_endpoint,
126
+ endpoint: endpoint,
127
+ region: context.config.region,
128
+ )
129
+ end
130
+ end
131
+
132
+ class ListServices
133
+ def self.build(context)
134
+ unless context.config.regional_endpoint
135
+ endpoint = context.config.endpoint.to_s
136
+ end
137
+ Aws::ApplicationSignals::EndpointParameters.new(
138
+ use_fips: context.config.use_fips_endpoint,
139
+ endpoint: endpoint,
140
+ region: context.config.region,
141
+ )
142
+ end
143
+ end
144
+
145
+ class ListTagsForResource
146
+ def self.build(context)
147
+ unless context.config.regional_endpoint
148
+ endpoint = context.config.endpoint.to_s
149
+ end
150
+ Aws::ApplicationSignals::EndpointParameters.new(
151
+ use_fips: context.config.use_fips_endpoint,
152
+ endpoint: endpoint,
153
+ region: context.config.region,
154
+ )
155
+ end
156
+ end
157
+
158
+ class StartDiscovery
159
+ def self.build(context)
160
+ unless context.config.regional_endpoint
161
+ endpoint = context.config.endpoint.to_s
162
+ end
163
+ Aws::ApplicationSignals::EndpointParameters.new(
164
+ use_fips: context.config.use_fips_endpoint,
165
+ endpoint: endpoint,
166
+ region: context.config.region,
167
+ )
168
+ end
169
+ end
170
+
171
+ class TagResource
172
+ def self.build(context)
173
+ unless context.config.regional_endpoint
174
+ endpoint = context.config.endpoint.to_s
175
+ end
176
+ Aws::ApplicationSignals::EndpointParameters.new(
177
+ use_fips: context.config.use_fips_endpoint,
178
+ endpoint: endpoint,
179
+ region: context.config.region,
180
+ )
181
+ end
182
+ end
183
+
184
+ class UntagResource
185
+ def self.build(context)
186
+ unless context.config.regional_endpoint
187
+ endpoint = context.config.endpoint.to_s
188
+ end
189
+ Aws::ApplicationSignals::EndpointParameters.new(
190
+ use_fips: context.config.use_fips_endpoint,
191
+ endpoint: endpoint,
192
+ region: context.config.region,
193
+ )
194
+ end
195
+ end
196
+
197
+ class UpdateServiceLevelObjective
198
+ def self.build(context)
199
+ unless context.config.regional_endpoint
200
+ endpoint = context.config.endpoint.to_s
201
+ end
202
+ Aws::ApplicationSignals::EndpointParameters.new(
203
+ use_fips: context.config.use_fips_endpoint,
204
+ endpoint: endpoint,
205
+ region: context.config.region,
206
+ )
207
+ end
208
+ end
209
+
210
+ end
211
+ end
@@ -0,0 +1,144 @@
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::ApplicationSignals
11
+
12
+ # When ApplicationSignals returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::ApplicationSignals::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all ApplicationSignals errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::ApplicationSignals::Errors::ServiceError
20
+ # # rescues all ApplicationSignals API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {ConflictException}
32
+ # * {ResourceNotFoundException}
33
+ # * {ServiceQuotaExceededException}
34
+ # * {ThrottlingException}
35
+ # * {ValidationException}
36
+ #
37
+ # Additionally, error classes are dynamically generated for service errors based on the error code
38
+ # if they are not defined above.
39
+ module Errors
40
+
41
+ extend Aws::Errors::DynamicErrors
42
+
43
+ class AccessDeniedException < ServiceError
44
+
45
+ # @param [Seahorse::Client::RequestContext] context
46
+ # @param [String] message
47
+ # @param [Aws::ApplicationSignals::Types::AccessDeniedException] data
48
+ def initialize(context, message, data = Aws::EmptyStructure.new)
49
+ super(context, message, data)
50
+ end
51
+
52
+ # @return [String]
53
+ def message
54
+ @message || @data[:message]
55
+ end
56
+ end
57
+
58
+ class ConflictException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::ApplicationSignals::Types::ConflictException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+ end
72
+
73
+ class ResourceNotFoundException < ServiceError
74
+
75
+ # @param [Seahorse::Client::RequestContext] context
76
+ # @param [String] message
77
+ # @param [Aws::ApplicationSignals::Types::ResourceNotFoundException] data
78
+ def initialize(context, message, data = Aws::EmptyStructure.new)
79
+ super(context, message, data)
80
+ end
81
+
82
+ # @return [String]
83
+ def resource_type
84
+ @data[:resource_type]
85
+ end
86
+
87
+ # @return [String]
88
+ def resource_id
89
+ @data[:resource_id]
90
+ end
91
+
92
+ # @return [String]
93
+ def message
94
+ @message || @data[:message]
95
+ end
96
+ end
97
+
98
+ class ServiceQuotaExceededException < ServiceError
99
+
100
+ # @param [Seahorse::Client::RequestContext] context
101
+ # @param [String] message
102
+ # @param [Aws::ApplicationSignals::Types::ServiceQuotaExceededException] data
103
+ def initialize(context, message, data = Aws::EmptyStructure.new)
104
+ super(context, message, data)
105
+ end
106
+
107
+ # @return [String]
108
+ def message
109
+ @message || @data[:message]
110
+ end
111
+ end
112
+
113
+ class ThrottlingException < ServiceError
114
+
115
+ # @param [Seahorse::Client::RequestContext] context
116
+ # @param [String] message
117
+ # @param [Aws::ApplicationSignals::Types::ThrottlingException] data
118
+ def initialize(context, message, data = Aws::EmptyStructure.new)
119
+ super(context, message, data)
120
+ end
121
+
122
+ # @return [String]
123
+ def message
124
+ @message || @data[:message]
125
+ end
126
+ end
127
+
128
+ class ValidationException < ServiceError
129
+
130
+ # @param [Seahorse::Client::RequestContext] context
131
+ # @param [String] message
132
+ # @param [Aws::ApplicationSignals::Types::ValidationException] data
133
+ def initialize(context, message, data = Aws::EmptyStructure.new)
134
+ super(context, message, data)
135
+ end
136
+
137
+ # @return [String]
138
+ def message
139
+ @message || @data[:message]
140
+ end
141
+ end
142
+
143
+ end
144
+ end
@@ -0,0 +1,100 @@
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::ApplicationSignals
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::ApplicationSignals::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::ApplicationSignals::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::ApplicationSignals::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
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
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :batch_get_service_level_objective_budget_report
62
+ Aws::ApplicationSignals::Endpoints::BatchGetServiceLevelObjectiveBudgetReport.build(context)
63
+ when :create_service_level_objective
64
+ Aws::ApplicationSignals::Endpoints::CreateServiceLevelObjective.build(context)
65
+ when :delete_service_level_objective
66
+ Aws::ApplicationSignals::Endpoints::DeleteServiceLevelObjective.build(context)
67
+ when :get_service
68
+ Aws::ApplicationSignals::Endpoints::GetService.build(context)
69
+ when :get_service_level_objective
70
+ Aws::ApplicationSignals::Endpoints::GetServiceLevelObjective.build(context)
71
+ when :list_service_dependencies
72
+ Aws::ApplicationSignals::Endpoints::ListServiceDependencies.build(context)
73
+ when :list_service_dependents
74
+ Aws::ApplicationSignals::Endpoints::ListServiceDependents.build(context)
75
+ when :list_service_level_objectives
76
+ Aws::ApplicationSignals::Endpoints::ListServiceLevelObjectives.build(context)
77
+ when :list_service_operations
78
+ Aws::ApplicationSignals::Endpoints::ListServiceOperations.build(context)
79
+ when :list_services
80
+ Aws::ApplicationSignals::Endpoints::ListServices.build(context)
81
+ when :list_tags_for_resource
82
+ Aws::ApplicationSignals::Endpoints::ListTagsForResource.build(context)
83
+ when :start_discovery
84
+ Aws::ApplicationSignals::Endpoints::StartDiscovery.build(context)
85
+ when :tag_resource
86
+ Aws::ApplicationSignals::Endpoints::TagResource.build(context)
87
+ when :untag_resource
88
+ Aws::ApplicationSignals::Endpoints::UntagResource.build(context)
89
+ when :update_service_level_objective
90
+ Aws::ApplicationSignals::Endpoints::UpdateServiceLevelObjective.build(context)
91
+ end
92
+ end
93
+ end
94
+
95
+ def add_handlers(handlers, _config)
96
+ handlers.add(Handler, step: :build, priority: 75)
97
+ end
98
+ end
99
+ end
100
+ 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::ApplicationSignals
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