aws-sdk-xray 1.4.0 → 1.62.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.
@@ -1,14 +1,208 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::XRay
11
+
12
+ # When XRay returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::XRay::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all XRay errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::XRay::Errors::ServiceError
20
+ # # rescues all XRay 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
+ # * {InvalidPolicyRevisionIdException}
31
+ # * {InvalidRequestException}
32
+ # * {LockoutPreventionException}
33
+ # * {MalformedPolicyDocumentException}
34
+ # * {PolicyCountLimitExceededException}
35
+ # * {PolicySizeLimitExceededException}
36
+ # * {ResourceNotFoundException}
37
+ # * {RuleLimitExceededException}
38
+ # * {ThrottledException}
39
+ # * {TooManyTagsException}
40
+ #
41
+ # Additionally, error classes are dynamically generated for service errors based on the error code
42
+ # if they are not defined above.
9
43
  module Errors
10
44
 
11
45
  extend Aws::Errors::DynamicErrors
12
46
 
47
+ class InvalidPolicyRevisionIdException < ServiceError
48
+
49
+ # @param [Seahorse::Client::RequestContext] context
50
+ # @param [String] message
51
+ # @param [Aws::XRay::Types::InvalidPolicyRevisionIdException] data
52
+ def initialize(context, message, data = Aws::EmptyStructure.new)
53
+ super(context, message, data)
54
+ end
55
+
56
+ # @return [String]
57
+ def message
58
+ @message || @data[:message]
59
+ end
60
+ end
61
+
62
+ class InvalidRequestException < ServiceError
63
+
64
+ # @param [Seahorse::Client::RequestContext] context
65
+ # @param [String] message
66
+ # @param [Aws::XRay::Types::InvalidRequestException] data
67
+ def initialize(context, message, data = Aws::EmptyStructure.new)
68
+ super(context, message, data)
69
+ end
70
+
71
+ # @return [String]
72
+ def message
73
+ @message || @data[:message]
74
+ end
75
+ end
76
+
77
+ class LockoutPreventionException < ServiceError
78
+
79
+ # @param [Seahorse::Client::RequestContext] context
80
+ # @param [String] message
81
+ # @param [Aws::XRay::Types::LockoutPreventionException] data
82
+ def initialize(context, message, data = Aws::EmptyStructure.new)
83
+ super(context, message, data)
84
+ end
85
+
86
+ # @return [String]
87
+ def message
88
+ @message || @data[:message]
89
+ end
90
+ end
91
+
92
+ class MalformedPolicyDocumentException < ServiceError
93
+
94
+ # @param [Seahorse::Client::RequestContext] context
95
+ # @param [String] message
96
+ # @param [Aws::XRay::Types::MalformedPolicyDocumentException] data
97
+ def initialize(context, message, data = Aws::EmptyStructure.new)
98
+ super(context, message, data)
99
+ end
100
+
101
+ # @return [String]
102
+ def message
103
+ @message || @data[:message]
104
+ end
105
+ end
106
+
107
+ class PolicyCountLimitExceededException < ServiceError
108
+
109
+ # @param [Seahorse::Client::RequestContext] context
110
+ # @param [String] message
111
+ # @param [Aws::XRay::Types::PolicyCountLimitExceededException] data
112
+ def initialize(context, message, data = Aws::EmptyStructure.new)
113
+ super(context, message, data)
114
+ end
115
+
116
+ # @return [String]
117
+ def message
118
+ @message || @data[:message]
119
+ end
120
+ end
121
+
122
+ class PolicySizeLimitExceededException < ServiceError
123
+
124
+ # @param [Seahorse::Client::RequestContext] context
125
+ # @param [String] message
126
+ # @param [Aws::XRay::Types::PolicySizeLimitExceededException] data
127
+ def initialize(context, message, data = Aws::EmptyStructure.new)
128
+ super(context, message, data)
129
+ end
130
+
131
+ # @return [String]
132
+ def message
133
+ @message || @data[:message]
134
+ end
135
+ end
136
+
137
+ class ResourceNotFoundException < ServiceError
138
+
139
+ # @param [Seahorse::Client::RequestContext] context
140
+ # @param [String] message
141
+ # @param [Aws::XRay::Types::ResourceNotFoundException] data
142
+ def initialize(context, message, data = Aws::EmptyStructure.new)
143
+ super(context, message, data)
144
+ end
145
+
146
+ # @return [String]
147
+ def message
148
+ @message || @data[:message]
149
+ end
150
+
151
+ # @return [String]
152
+ def resource_name
153
+ @data[:resource_name]
154
+ end
155
+ end
156
+
157
+ class RuleLimitExceededException < ServiceError
158
+
159
+ # @param [Seahorse::Client::RequestContext] context
160
+ # @param [String] message
161
+ # @param [Aws::XRay::Types::RuleLimitExceededException] data
162
+ def initialize(context, message, data = Aws::EmptyStructure.new)
163
+ super(context, message, data)
164
+ end
165
+
166
+ # @return [String]
167
+ def message
168
+ @message || @data[:message]
169
+ end
170
+ end
171
+
172
+ class ThrottledException < ServiceError
173
+
174
+ # @param [Seahorse::Client::RequestContext] context
175
+ # @param [String] message
176
+ # @param [Aws::XRay::Types::ThrottledException] data
177
+ def initialize(context, message, data = Aws::EmptyStructure.new)
178
+ super(context, message, data)
179
+ end
180
+
181
+ # @return [String]
182
+ def message
183
+ @message || @data[:message]
184
+ end
185
+ end
186
+
187
+ class TooManyTagsException < ServiceError
188
+
189
+ # @param [Seahorse::Client::RequestContext] context
190
+ # @param [String] message
191
+ # @param [Aws::XRay::Types::TooManyTagsException] data
192
+ def initialize(context, message, data = Aws::EmptyStructure.new)
193
+ super(context, message, data)
194
+ end
195
+
196
+ # @return [String]
197
+ def message
198
+ @message || @data[:message]
199
+ end
200
+
201
+ # @return [String]
202
+ def resource_name
203
+ @data[:resource_name]
204
+ end
205
+ end
206
+
13
207
  end
14
208
  end
@@ -0,0 +1,129 @@
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::XRay
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::XRay::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::XRay::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::XRay::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 :batch_get_traces
61
+ Aws::XRay::Endpoints::BatchGetTraces.build(context)
62
+ when :create_group
63
+ Aws::XRay::Endpoints::CreateGroup.build(context)
64
+ when :create_sampling_rule
65
+ Aws::XRay::Endpoints::CreateSamplingRule.build(context)
66
+ when :delete_group
67
+ Aws::XRay::Endpoints::DeleteGroup.build(context)
68
+ when :delete_resource_policy
69
+ Aws::XRay::Endpoints::DeleteResourcePolicy.build(context)
70
+ when :delete_sampling_rule
71
+ Aws::XRay::Endpoints::DeleteSamplingRule.build(context)
72
+ when :get_encryption_config
73
+ Aws::XRay::Endpoints::GetEncryptionConfig.build(context)
74
+ when :get_group
75
+ Aws::XRay::Endpoints::GetGroup.build(context)
76
+ when :get_groups
77
+ Aws::XRay::Endpoints::GetGroups.build(context)
78
+ when :get_insight
79
+ Aws::XRay::Endpoints::GetInsight.build(context)
80
+ when :get_insight_events
81
+ Aws::XRay::Endpoints::GetInsightEvents.build(context)
82
+ when :get_insight_impact_graph
83
+ Aws::XRay::Endpoints::GetInsightImpactGraph.build(context)
84
+ when :get_insight_summaries
85
+ Aws::XRay::Endpoints::GetInsightSummaries.build(context)
86
+ when :get_sampling_rules
87
+ Aws::XRay::Endpoints::GetSamplingRules.build(context)
88
+ when :get_sampling_statistic_summaries
89
+ Aws::XRay::Endpoints::GetSamplingStatisticSummaries.build(context)
90
+ when :get_sampling_targets
91
+ Aws::XRay::Endpoints::GetSamplingTargets.build(context)
92
+ when :get_service_graph
93
+ Aws::XRay::Endpoints::GetServiceGraph.build(context)
94
+ when :get_time_series_service_statistics
95
+ Aws::XRay::Endpoints::GetTimeSeriesServiceStatistics.build(context)
96
+ when :get_trace_graph
97
+ Aws::XRay::Endpoints::GetTraceGraph.build(context)
98
+ when :get_trace_summaries
99
+ Aws::XRay::Endpoints::GetTraceSummaries.build(context)
100
+ when :list_resource_policies
101
+ Aws::XRay::Endpoints::ListResourcePolicies.build(context)
102
+ when :list_tags_for_resource
103
+ Aws::XRay::Endpoints::ListTagsForResource.build(context)
104
+ when :put_encryption_config
105
+ Aws::XRay::Endpoints::PutEncryptionConfig.build(context)
106
+ when :put_resource_policy
107
+ Aws::XRay::Endpoints::PutResourcePolicy.build(context)
108
+ when :put_telemetry_records
109
+ Aws::XRay::Endpoints::PutTelemetryRecords.build(context)
110
+ when :put_trace_segments
111
+ Aws::XRay::Endpoints::PutTraceSegments.build(context)
112
+ when :tag_resource
113
+ Aws::XRay::Endpoints::TagResource.build(context)
114
+ when :untag_resource
115
+ Aws::XRay::Endpoints::UntagResource.build(context)
116
+ when :update_group
117
+ Aws::XRay::Endpoints::UpdateGroup.build(context)
118
+ when :update_sampling_rule
119
+ Aws::XRay::Endpoints::UpdateSamplingRule.build(context)
120
+ end
121
+ end
122
+ end
123
+
124
+ def add_handlers(handlers, _config)
125
+ handlers.add(Handler, step: :build, priority: 75)
126
+ end
127
+ end
128
+ end
129
+ end
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::XRay
11
+
9
12
  class Resource
10
13
 
11
14
  # @param options ({})