aws-sdk-abusesignal 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.
@@ -0,0 +1,202 @@
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::AbuseSignal
12
+ # @api private
13
+ module ClientApi
14
+
15
+ include Seahorse::Model
16
+
17
+ AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
18
+ ClientToken = Shapes::StringShape.new(name: 'ClientToken')
19
+ ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
20
+ CorrelationId = Shapes::StringShape.new(name: 'CorrelationId')
21
+ CreateAbuseReportRequest = Shapes::StructureShape.new(name: 'CreateAbuseReportRequest')
22
+ CreateAbuseReportResponse = Shapes::StructureShape.new(name: 'CreateAbuseReportResponse')
23
+ Document = Shapes::DocumentShape.new(name: 'Document', document: true)
24
+ GetAbuseReportStatusRequest = Shapes::StructureShape.new(name: 'GetAbuseReportStatusRequest')
25
+ GetAbuseReportStatusResponse = Shapes::StructureShape.new(name: 'GetAbuseReportStatusResponse')
26
+ Integer = Shapes::IntegerShape.new(name: 'Integer')
27
+ InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
28
+ ListAbuseReportStatusesRequest = Shapes::StructureShape.new(name: 'ListAbuseReportStatusesRequest')
29
+ ListAbuseReportStatusesRequestMaxResultsInteger = Shapes::IntegerShape.new(name: 'ListAbuseReportStatusesRequestMaxResultsInteger')
30
+ ListAbuseReportStatusesResponse = Shapes::StructureShape.new(name: 'ListAbuseReportStatusesResponse')
31
+ NextToken = Shapes::StringShape.new(name: 'NextToken')
32
+ ReasonCode = Shapes::StringShape.new(name: 'ReasonCode')
33
+ ReportData = Shapes::UnionShape.new(name: 'ReportData')
34
+ ReportId = Shapes::StringShape.new(name: 'ReportId')
35
+ ReportStatusList = Shapes::ListShape.new(name: 'ReportStatusList')
36
+ ReportStatusListItem = Shapes::StructureShape.new(name: 'ReportStatusListItem')
37
+ ReportSubmissionStatus = Shapes::StringShape.new(name: 'ReportSubmissionStatus')
38
+ ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
39
+ String = Shapes::StringShape.new(name: 'String')
40
+ SubmissionRequirement = Shapes::StructureShape.new(name: 'SubmissionRequirement')
41
+ SubmissionRequirementException = Shapes::StructureShape.new(name: 'SubmissionRequirementException')
42
+ SubmissionRequirementList = Shapes::ListShape.new(name: 'SubmissionRequirementList')
43
+ ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
44
+ Timestamp = Shapes::TimestampShape.new(name: 'Timestamp')
45
+ ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
46
+ ValidationExceptionField = Shapes::StructureShape.new(name: 'ValidationExceptionField')
47
+ ValidationExceptionFieldList = Shapes::ListShape.new(name: 'ValidationExceptionFieldList')
48
+
49
+ AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
50
+ AccessDeniedException.struct_class = Types::AccessDeniedException
51
+
52
+ ConflictException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
53
+ ConflictException.struct_class = Types::ConflictException
54
+
55
+ CreateAbuseReportRequest.add_member(:report, Shapes::ShapeRef.new(shape: ReportData, required: true, location_name: "report"))
56
+ CreateAbuseReportRequest.add_member(:correlation_id, Shapes::ShapeRef.new(shape: CorrelationId, location_name: "correlationId"))
57
+ CreateAbuseReportRequest.add_member(:client_token, Shapes::ShapeRef.new(shape: ClientToken, location_name: "clientToken"))
58
+ CreateAbuseReportRequest.struct_class = Types::CreateAbuseReportRequest
59
+
60
+ CreateAbuseReportResponse.add_member(:report_id, Shapes::ShapeRef.new(shape: ReportId, required: true, location_name: "reportId"))
61
+ CreateAbuseReportResponse.add_member(:correlation_id, Shapes::ShapeRef.new(shape: CorrelationId, location_name: "correlationId"))
62
+ CreateAbuseReportResponse.struct_class = Types::CreateAbuseReportResponse
63
+
64
+ GetAbuseReportStatusRequest.add_member(:report_id, Shapes::ShapeRef.new(shape: ReportId, required: true, location: "uri", location_name: "reportId"))
65
+ GetAbuseReportStatusRequest.struct_class = Types::GetAbuseReportStatusRequest
66
+
67
+ GetAbuseReportStatusResponse.add_member(:report_id, Shapes::ShapeRef.new(shape: ReportId, required: true, location_name: "reportId"))
68
+ GetAbuseReportStatusResponse.add_member(:correlation_id, Shapes::ShapeRef.new(shape: CorrelationId, location_name: "correlationId"))
69
+ GetAbuseReportStatusResponse.add_member(:status, Shapes::ShapeRef.new(shape: ReportSubmissionStatus, required: true, location_name: "status"))
70
+ GetAbuseReportStatusResponse.add_member(:description, Shapes::ShapeRef.new(shape: String, required: true, location_name: "description"))
71
+ GetAbuseReportStatusResponse.add_member(:reason_code, Shapes::ShapeRef.new(shape: ReasonCode, location_name: "reasonCode"))
72
+ GetAbuseReportStatusResponse.add_member(:submitted_at, Shapes::ShapeRef.new(shape: Timestamp, required: true, location_name: "submittedAt"))
73
+ GetAbuseReportStatusResponse.add_member(:last_updated_at, Shapes::ShapeRef.new(shape: Timestamp, location_name: "lastUpdatedAt"))
74
+ GetAbuseReportStatusResponse.struct_class = Types::GetAbuseReportStatusResponse
75
+
76
+ InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
77
+ InternalServerException.add_member(:retry_after_seconds, Shapes::ShapeRef.new(shape: Integer, location: "header", location_name: "Retry-After"))
78
+ InternalServerException.struct_class = Types::InternalServerException
79
+
80
+ ListAbuseReportStatusesRequest.add_member(:correlation_id, Shapes::ShapeRef.new(shape: CorrelationId, location: "querystring", location_name: "correlationId"))
81
+ ListAbuseReportStatusesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location: "querystring", location_name: "nextToken"))
82
+ ListAbuseReportStatusesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: ListAbuseReportStatusesRequestMaxResultsInteger, location: "querystring", location_name: "maxResults"))
83
+ ListAbuseReportStatusesRequest.struct_class = Types::ListAbuseReportStatusesRequest
84
+
85
+ ListAbuseReportStatusesResponse.add_member(:reports, Shapes::ShapeRef.new(shape: ReportStatusList, required: true, location_name: "reports"))
86
+ ListAbuseReportStatusesResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "nextToken"))
87
+ ListAbuseReportStatusesResponse.struct_class = Types::ListAbuseReportStatusesResponse
88
+
89
+ ReportData.add_member(:xarf, Shapes::ShapeRef.new(shape: Document, location_name: "xarf"))
90
+ ReportData.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
91
+ ReportData.add_member_subclass(:xarf, Types::ReportData::Xarf)
92
+ ReportData.add_member_subclass(:unknown, Types::ReportData::Unknown)
93
+ ReportData.struct_class = Types::ReportData
94
+
95
+ ReportStatusList.member = Shapes::ShapeRef.new(shape: ReportStatusListItem)
96
+
97
+ ReportStatusListItem.add_member(:report_id, Shapes::ShapeRef.new(shape: ReportId, required: true, location_name: "reportId"))
98
+ ReportStatusListItem.add_member(:correlation_id, Shapes::ShapeRef.new(shape: CorrelationId, location_name: "correlationId"))
99
+ ReportStatusListItem.add_member(:status, Shapes::ShapeRef.new(shape: ReportSubmissionStatus, required: true, location_name: "status"))
100
+ ReportStatusListItem.add_member(:description, Shapes::ShapeRef.new(shape: String, required: true, location_name: "description"))
101
+ ReportStatusListItem.add_member(:reason_code, Shapes::ShapeRef.new(shape: ReasonCode, location_name: "reasonCode"))
102
+ ReportStatusListItem.struct_class = Types::ReportStatusListItem
103
+
104
+ ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
105
+ ResourceNotFoundException.add_member(:resource_id, Shapes::ShapeRef.new(shape: String, required: true, location_name: "resourceId"))
106
+ ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
107
+
108
+ SubmissionRequirement.add_member(:code, Shapes::ShapeRef.new(shape: String, location_name: "code"))
109
+ SubmissionRequirement.add_member(:path, Shapes::ShapeRef.new(shape: String, required: true, location_name: "path"))
110
+ SubmissionRequirement.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
111
+ SubmissionRequirement.struct_class = Types::SubmissionRequirement
112
+
113
+ SubmissionRequirementException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
114
+ SubmissionRequirementException.add_member(:unmet_requirements, Shapes::ShapeRef.new(shape: SubmissionRequirementList, location_name: "unmetRequirements"))
115
+ SubmissionRequirementException.struct_class = Types::SubmissionRequirementException
116
+
117
+ SubmissionRequirementList.member = Shapes::ShapeRef.new(shape: SubmissionRequirement)
118
+
119
+ ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
120
+ ThrottlingException.add_member(:service_code, Shapes::ShapeRef.new(shape: String, location_name: "serviceCode"))
121
+ ThrottlingException.add_member(:quota_code, Shapes::ShapeRef.new(shape: String, location_name: "quotaCode"))
122
+ ThrottlingException.add_member(:retry_after_seconds, Shapes::ShapeRef.new(shape: Integer, location: "header", location_name: "Retry-After"))
123
+ ThrottlingException.struct_class = Types::ThrottlingException
124
+
125
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
126
+ ValidationException.add_member(:field_list, Shapes::ShapeRef.new(shape: ValidationExceptionFieldList, location_name: "fieldList"))
127
+ ValidationException.struct_class = Types::ValidationException
128
+
129
+ ValidationExceptionField.add_member(:path, Shapes::ShapeRef.new(shape: String, required: true, location_name: "path"))
130
+ ValidationExceptionField.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
131
+ ValidationExceptionField.struct_class = Types::ValidationExceptionField
132
+
133
+ ValidationExceptionFieldList.member = Shapes::ShapeRef.new(shape: ValidationExceptionField)
134
+
135
+
136
+ # @api private
137
+ API = Seahorse::Model::Api.new.tap do |api|
138
+
139
+ api.version = "2026-01-12"
140
+
141
+ api.metadata = {
142
+ "apiVersion" => "2026-01-12",
143
+ "auth" => ["aws.auth#sigv4", "aws.auth#sigv4a"],
144
+ "endpointPrefix" => "abuse",
145
+ "protocol" => "rest-json",
146
+ "protocols" => ["rest-json"],
147
+ "serviceFullName" => "AWS Abuse Signal API",
148
+ "serviceId" => "Abuse Signal",
149
+ "signatureVersion" => "v4",
150
+ "signingName" => "abuse",
151
+ "targetPrefix" => "AbuseReportApi",
152
+ "uid" => "abuse-signal-2026-01-12",
153
+ }
154
+
155
+ api.add_operation(:create_abuse_report, Seahorse::Model::Operation.new.tap do |o|
156
+ o.name = "CreateAbuseReport"
157
+ o.http_method = "POST"
158
+ o.http_request_uri = "/v1/abuse"
159
+ o.input = Shapes::ShapeRef.new(shape: CreateAbuseReportRequest)
160
+ o.output = Shapes::ShapeRef.new(shape: CreateAbuseReportResponse)
161
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
162
+ o.errors << Shapes::ShapeRef.new(shape: SubmissionRequirementException)
163
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
164
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
165
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
166
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
167
+ end)
168
+
169
+ api.add_operation(:get_abuse_report_status, Seahorse::Model::Operation.new.tap do |o|
170
+ o.name = "GetAbuseReportStatus"
171
+ o.http_method = "GET"
172
+ o.http_request_uri = "/v1/abuse/{reportId}"
173
+ o.input = Shapes::ShapeRef.new(shape: GetAbuseReportStatusRequest)
174
+ o.output = Shapes::ShapeRef.new(shape: GetAbuseReportStatusResponse)
175
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
176
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
177
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
178
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
179
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
180
+ end)
181
+
182
+ api.add_operation(:list_abuse_report_statuses, Seahorse::Model::Operation.new.tap do |o|
183
+ o.name = "ListAbuseReportStatuses"
184
+ o.http_method = "GET"
185
+ o.http_request_uri = "/v1/abusestatuses"
186
+ o.input = Shapes::ShapeRef.new(shape: ListAbuseReportStatusesRequest)
187
+ o.output = Shapes::ShapeRef.new(shape: ListAbuseReportStatusesResponse)
188
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
189
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
190
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
191
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
192
+ o[:pager] = Aws::Pager.new(
193
+ limit_key: "max_results",
194
+ tokens: {
195
+ "next_token" => "next_token"
196
+ }
197
+ )
198
+ end)
199
+ end
200
+
201
+ end
202
+ end
File without changes
@@ -0,0 +1,69 @@
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::AbuseSignal
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute use_dual_stack
14
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
15
+ #
16
+ # @return [boolean]
17
+ #
18
+ # @!attribute use_fips
19
+ # 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.
20
+ #
21
+ # @return [boolean]
22
+ #
23
+ # @!attribute endpoint
24
+ # Override the endpoint used to send this request
25
+ #
26
+ # @return [string]
27
+ #
28
+ # @!attribute region
29
+ # The AWS region used to dispatch the request.
30
+ #
31
+ # @return [string]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :use_dual_stack,
35
+ :use_fips,
36
+ :endpoint,
37
+ :region,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'UseDualStack' => :use_dual_stack,
45
+ 'UseFIPS' => :use_fips,
46
+ 'Endpoint' => :endpoint,
47
+ 'Region' => :region,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:use_dual_stack] = options[:use_dual_stack]
53
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
54
+ self[:use_fips] = options[:use_fips]
55
+ self[:use_fips] = false if self[:use_fips].nil?
56
+ self[:endpoint] = options[:endpoint]
57
+ self[:region] = options[:region]
58
+ end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ use_dual_stack: config.use_dualstack_endpoint,
63
+ use_fips: config.use_fips_endpoint,
64
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
65
+ region: config.region,
66
+ }.merge(options))
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,50 @@
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::AbuseSignal
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ if Aws::Endpoints::Matchers.set?(parameters.endpoint)
14
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
15
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
16
+ end
17
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
18
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
19
+ end
20
+ return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
21
+ end
22
+ if Aws::Endpoints::Matchers.set?(parameters.region)
23
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
24
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
25
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
26
+ return Aws::Endpoints::Endpoint.new(url: "https://abuse-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
27
+ end
28
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
29
+ end
30
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
31
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
32
+ return Aws::Endpoints::Endpoint.new(url: "https://abuse-fips.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
33
+ end
34
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
35
+ end
36
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
37
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
38
+ return Aws::Endpoints::Endpoint.new(url: "https://abuse.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
39
+ end
40
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
41
+ end
42
+ return Aws::Endpoints::Endpoint.new(url: "https://abuse.#{parameters.region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ end
45
+ raise ArgumentError, "Invalid Configuration: Missing Region"
46
+ raise ArgumentError, 'No endpoint could be resolved'
47
+
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,20 @@
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::AbuseSignal
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::AbuseSignal::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,197 @@
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::AbuseSignal
11
+
12
+ # When AbuseSignal returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::AbuseSignal::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all AbuseSignal errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::AbuseSignal::Errors::ServiceError
20
+ # # rescues all AbuseSignal 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
+ # * {InternalServerException}
33
+ # * {ResourceNotFoundException}
34
+ # * {SubmissionRequirementException}
35
+ # * {ThrottlingException}
36
+ # * {ValidationException}
37
+ #
38
+ # Additionally, error classes are dynamically generated for service errors based on the error code
39
+ # if they are not defined above.
40
+ module Errors
41
+
42
+ extend Aws::Errors::DynamicErrors
43
+
44
+ class AccessDeniedException < ServiceError
45
+
46
+ # @param [Seahorse::Client::RequestContext] context
47
+ # @param [String] message
48
+ # @param [Aws::AbuseSignal::Types::AccessDeniedException] data
49
+ def initialize(context, message, data = Aws::EmptyStructure.new)
50
+ super(context, message, data)
51
+ end
52
+
53
+ # @return [String]
54
+ def message
55
+ @message || @data[:message]
56
+ end
57
+ end
58
+
59
+ class ConflictException < ServiceError
60
+
61
+ # @param [Seahorse::Client::RequestContext] context
62
+ # @param [String] message
63
+ # @param [Aws::AbuseSignal::Types::ConflictException] data
64
+ def initialize(context, message, data = Aws::EmptyStructure.new)
65
+ super(context, message, data)
66
+ end
67
+
68
+ # @return [String]
69
+ def message
70
+ @message || @data[:message]
71
+ end
72
+ end
73
+
74
+ class InternalServerException < ServiceError
75
+
76
+ # @param [Seahorse::Client::RequestContext] context
77
+ # @param [String] message
78
+ # @param [Aws::AbuseSignal::Types::InternalServerException] data
79
+ def initialize(context, message, data = Aws::EmptyStructure.new)
80
+ super(context, message, data)
81
+ end
82
+
83
+ # @return [String]
84
+ def message
85
+ @message || @data[:message]
86
+ end
87
+
88
+ # @return [String]
89
+ def retry_after_seconds
90
+ @data[:retry_after_seconds]
91
+ end
92
+
93
+ def retryable?
94
+ true
95
+ end
96
+ end
97
+
98
+ class ResourceNotFoundException < ServiceError
99
+
100
+ # @param [Seahorse::Client::RequestContext] context
101
+ # @param [String] message
102
+ # @param [Aws::AbuseSignal::Types::ResourceNotFoundException] 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
+
112
+ # @return [String]
113
+ def resource_id
114
+ @data[:resource_id]
115
+ end
116
+ end
117
+
118
+ class SubmissionRequirementException < ServiceError
119
+
120
+ # @param [Seahorse::Client::RequestContext] context
121
+ # @param [String] message
122
+ # @param [Aws::AbuseSignal::Types::SubmissionRequirementException] data
123
+ def initialize(context, message, data = Aws::EmptyStructure.new)
124
+ super(context, message, data)
125
+ end
126
+
127
+ # @return [String]
128
+ def message
129
+ @message || @data[:message]
130
+ end
131
+
132
+ # @return [String]
133
+ def unmet_requirements
134
+ @data[:unmet_requirements]
135
+ end
136
+ end
137
+
138
+ class ThrottlingException < ServiceError
139
+
140
+ # @param [Seahorse::Client::RequestContext] context
141
+ # @param [String] message
142
+ # @param [Aws::AbuseSignal::Types::ThrottlingException] data
143
+ def initialize(context, message, data = Aws::EmptyStructure.new)
144
+ super(context, message, data)
145
+ end
146
+
147
+ # @return [String]
148
+ def message
149
+ @message || @data[:message]
150
+ end
151
+
152
+ # @return [String]
153
+ def service_code
154
+ @data[:service_code]
155
+ end
156
+
157
+ # @return [String]
158
+ def quota_code
159
+ @data[:quota_code]
160
+ end
161
+
162
+ # @return [String]
163
+ def retry_after_seconds
164
+ @data[:retry_after_seconds]
165
+ end
166
+
167
+ def retryable?
168
+ true
169
+ end
170
+
171
+ def throttling?
172
+ true
173
+ end
174
+ end
175
+
176
+ class ValidationException < ServiceError
177
+
178
+ # @param [Seahorse::Client::RequestContext] context
179
+ # @param [String] message
180
+ # @param [Aws::AbuseSignal::Types::ValidationException] data
181
+ def initialize(context, message, data = Aws::EmptyStructure.new)
182
+ super(context, message, data)
183
+ end
184
+
185
+ # @return [String]
186
+ def message
187
+ @message || @data[:message]
188
+ end
189
+
190
+ # @return [String]
191
+ def field_list
192
+ @data[:field_list]
193
+ end
194
+ end
195
+
196
+ end
197
+ end
@@ -0,0 +1,77 @@
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::AbuseSignal
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::AbuseSignal::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::AbuseSignal::EndpointParameters`.
22
+ DOCS
23
+ Aws::AbuseSignal::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 = Aws::AbuseSignal::Endpoints.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
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+ end
71
+
72
+ def add_handlers(handlers, _config)
73
+ handlers.add(Handler, step: :build, priority: 75)
74
+ end
75
+ end
76
+ end
77
+ 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::AbuseSignal
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