aws-sdk-billing 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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +8 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-billing/client.rb +585 -0
- data/lib/aws-sdk-billing/client_api.rb +121 -0
- data/lib/aws-sdk-billing/customizations.rb +0 -0
- data/lib/aws-sdk-billing/endpoint_parameters.rb +59 -0
- data/lib/aws-sdk-billing/endpoint_provider.rb +35 -0
- data/lib/aws-sdk-billing/endpoints.rb +20 -0
- data/lib/aws-sdk-billing/errors.rb +112 -0
- data/lib/aws-sdk-billing/plugins/endpoints.rb +77 -0
- data/lib/aws-sdk-billing/resource.rb +26 -0
- data/lib/aws-sdk-billing/types.rb +194 -0
- data/lib/aws-sdk-billing/waiters.rb +15 -0
- data/lib/aws-sdk-billing.rb +62 -0
- data/sig/client.rbs +97 -0
- data/sig/errors.rbs +30 -0
- data/sig/resource.rbs +83 -0
- data/sig/types.rbs +66 -0
- data/sig/waiters.rbs +13 -0
- metadata +100 -0
|
@@ -0,0 +1,121 @@
|
|
|
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::Billing
|
|
12
|
+
# @api private
|
|
13
|
+
module ClientApi
|
|
14
|
+
|
|
15
|
+
include Seahorse::Model
|
|
16
|
+
|
|
17
|
+
AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
|
|
18
|
+
AccountId = Shapes::StringShape.new(name: 'AccountId')
|
|
19
|
+
ActiveTimeRange = Shapes::StructureShape.new(name: 'ActiveTimeRange')
|
|
20
|
+
BillingViewArn = Shapes::StringShape.new(name: 'BillingViewArn')
|
|
21
|
+
BillingViewList = Shapes::ListShape.new(name: 'BillingViewList')
|
|
22
|
+
BillingViewListElement = Shapes::StructureShape.new(name: 'BillingViewListElement')
|
|
23
|
+
BillingViewName = Shapes::StringShape.new(name: 'BillingViewName')
|
|
24
|
+
BillingViewType = Shapes::StringShape.new(name: 'BillingViewType')
|
|
25
|
+
BillingViewsMaxResults = Shapes::IntegerShape.new(name: 'BillingViewsMaxResults')
|
|
26
|
+
ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
|
|
27
|
+
FieldName = Shapes::StringShape.new(name: 'FieldName')
|
|
28
|
+
InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
|
|
29
|
+
ListBillingViewsRequest = Shapes::StructureShape.new(name: 'ListBillingViewsRequest')
|
|
30
|
+
ListBillingViewsResponse = Shapes::StructureShape.new(name: 'ListBillingViewsResponse')
|
|
31
|
+
PageToken = Shapes::StringShape.new(name: 'PageToken')
|
|
32
|
+
ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
|
|
33
|
+
Timestamp = Shapes::TimestampShape.new(name: 'Timestamp')
|
|
34
|
+
ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
|
|
35
|
+
ValidationExceptionField = Shapes::StructureShape.new(name: 'ValidationExceptionField')
|
|
36
|
+
ValidationExceptionFieldList = Shapes::ListShape.new(name: 'ValidationExceptionFieldList')
|
|
37
|
+
ValidationExceptionReason = Shapes::StringShape.new(name: 'ValidationExceptionReason')
|
|
38
|
+
|
|
39
|
+
AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
|
|
40
|
+
AccessDeniedException.struct_class = Types::AccessDeniedException
|
|
41
|
+
|
|
42
|
+
ActiveTimeRange.add_member(:active_after_inclusive, Shapes::ShapeRef.new(shape: Timestamp, required: true, location_name: "activeAfterInclusive"))
|
|
43
|
+
ActiveTimeRange.add_member(:active_before_inclusive, Shapes::ShapeRef.new(shape: Timestamp, required: true, location_name: "activeBeforeInclusive"))
|
|
44
|
+
ActiveTimeRange.struct_class = Types::ActiveTimeRange
|
|
45
|
+
|
|
46
|
+
BillingViewList.member = Shapes::ShapeRef.new(shape: BillingViewListElement)
|
|
47
|
+
|
|
48
|
+
BillingViewListElement.add_member(:arn, Shapes::ShapeRef.new(shape: BillingViewArn, location_name: "arn"))
|
|
49
|
+
BillingViewListElement.add_member(:name, Shapes::ShapeRef.new(shape: BillingViewName, location_name: "name"))
|
|
50
|
+
BillingViewListElement.add_member(:owner_account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "ownerAccountId"))
|
|
51
|
+
BillingViewListElement.add_member(:billing_view_type, Shapes::ShapeRef.new(shape: BillingViewType, location_name: "billingViewType"))
|
|
52
|
+
BillingViewListElement.struct_class = Types::BillingViewListElement
|
|
53
|
+
|
|
54
|
+
InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
|
|
55
|
+
InternalServerException.struct_class = Types::InternalServerException
|
|
56
|
+
|
|
57
|
+
ListBillingViewsRequest.add_member(:active_time_range, Shapes::ShapeRef.new(shape: ActiveTimeRange, required: true, location_name: "activeTimeRange"))
|
|
58
|
+
ListBillingViewsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: BillingViewsMaxResults, location_name: "maxResults"))
|
|
59
|
+
ListBillingViewsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: PageToken, location_name: "nextToken"))
|
|
60
|
+
ListBillingViewsRequest.struct_class = Types::ListBillingViewsRequest
|
|
61
|
+
|
|
62
|
+
ListBillingViewsResponse.add_member(:billing_views, Shapes::ShapeRef.new(shape: BillingViewList, required: true, location_name: "billingViews"))
|
|
63
|
+
ListBillingViewsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: PageToken, location_name: "nextToken"))
|
|
64
|
+
ListBillingViewsResponse.struct_class = Types::ListBillingViewsResponse
|
|
65
|
+
|
|
66
|
+
ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
|
|
67
|
+
ThrottlingException.struct_class = Types::ThrottlingException
|
|
68
|
+
|
|
69
|
+
ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
|
|
70
|
+
ValidationException.add_member(:reason, Shapes::ShapeRef.new(shape: ValidationExceptionReason, required: true, location_name: "reason"))
|
|
71
|
+
ValidationException.add_member(:field_list, Shapes::ShapeRef.new(shape: ValidationExceptionFieldList, location_name: "fieldList"))
|
|
72
|
+
ValidationException.struct_class = Types::ValidationException
|
|
73
|
+
|
|
74
|
+
ValidationExceptionField.add_member(:name, Shapes::ShapeRef.new(shape: FieldName, required: true, location_name: "name"))
|
|
75
|
+
ValidationExceptionField.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, required: true, location_name: "message"))
|
|
76
|
+
ValidationExceptionField.struct_class = Types::ValidationExceptionField
|
|
77
|
+
|
|
78
|
+
ValidationExceptionFieldList.member = Shapes::ShapeRef.new(shape: ValidationExceptionField)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# @api private
|
|
82
|
+
API = Seahorse::Model::Api.new.tap do |api|
|
|
83
|
+
|
|
84
|
+
api.version = "2023-09-07"
|
|
85
|
+
|
|
86
|
+
api.metadata = {
|
|
87
|
+
"apiVersion" => "2023-09-07",
|
|
88
|
+
"auth" => ["aws.auth#sigv4"],
|
|
89
|
+
"endpointPrefix" => "billing",
|
|
90
|
+
"jsonVersion" => "1.0",
|
|
91
|
+
"protocol" => "json",
|
|
92
|
+
"protocols" => ["json"],
|
|
93
|
+
"serviceFullName" => "AWS Billing",
|
|
94
|
+
"serviceId" => "Billing",
|
|
95
|
+
"signatureVersion" => "v4",
|
|
96
|
+
"signingName" => "billing",
|
|
97
|
+
"targetPrefix" => "AWSBilling",
|
|
98
|
+
"uid" => "billing-2023-09-07",
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
api.add_operation(:list_billing_views, Seahorse::Model::Operation.new.tap do |o|
|
|
102
|
+
o.name = "ListBillingViews"
|
|
103
|
+
o.http_method = "POST"
|
|
104
|
+
o.http_request_uri = "/"
|
|
105
|
+
o.input = Shapes::ShapeRef.new(shape: ListBillingViewsRequest)
|
|
106
|
+
o.output = Shapes::ShapeRef.new(shape: ListBillingViewsResponse)
|
|
107
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
|
108
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
|
109
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
|
110
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
|
111
|
+
o[:pager] = Aws::Pager.new(
|
|
112
|
+
limit_key: "max_results",
|
|
113
|
+
tokens: {
|
|
114
|
+
"next_token" => "next_token"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
end)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
end
|
|
121
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
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::Billing
|
|
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
|
+
self[:endpoint] = options[:endpoint]
|
|
48
|
+
self[:region] = options[:region]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def self.create(config, options={})
|
|
52
|
+
new({
|
|
53
|
+
use_fips: config.use_fips_endpoint,
|
|
54
|
+
endpoint: (config.endpoint.to_s unless config.regional_endpoint),
|
|
55
|
+
region: config.region,
|
|
56
|
+
}.merge(options))
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
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::Billing
|
|
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://billing-fips.#{partition_result['implicitGlobalRegion']}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"#{partition_result['implicitGlobalRegion']}"}]})
|
|
26
|
+
end
|
|
27
|
+
return Aws::Endpoints::Endpoint.new(url: "https://billing.#{partition_result['implicitGlobalRegion']}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingRegion"=>"#{partition_result['implicitGlobalRegion']}"}]})
|
|
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,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::Billing
|
|
12
|
+
# @api private
|
|
13
|
+
module Endpoints
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def self.parameters_for_operation(context)
|
|
17
|
+
Aws::Billing::EndpointParameters.create(context.config)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
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::Billing
|
|
11
|
+
|
|
12
|
+
# When Billing returns an error response, the Ruby SDK constructs and raises an error.
|
|
13
|
+
# These errors all extend Aws::Billing::Errors::ServiceError < {Aws::Errors::ServiceError}
|
|
14
|
+
#
|
|
15
|
+
# You can rescue all Billing errors using ServiceError:
|
|
16
|
+
#
|
|
17
|
+
# begin
|
|
18
|
+
# # do stuff
|
|
19
|
+
# rescue Aws::Billing::Errors::ServiceError
|
|
20
|
+
# # rescues all Billing 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
|
+
# * {InternalServerException}
|
|
32
|
+
# * {ThrottlingException}
|
|
33
|
+
# * {ValidationException}
|
|
34
|
+
#
|
|
35
|
+
# Additionally, error classes are dynamically generated for service errors based on the error code
|
|
36
|
+
# if they are not defined above.
|
|
37
|
+
module Errors
|
|
38
|
+
|
|
39
|
+
extend Aws::Errors::DynamicErrors
|
|
40
|
+
|
|
41
|
+
class AccessDeniedException < ServiceError
|
|
42
|
+
|
|
43
|
+
# @param [Seahorse::Client::RequestContext] context
|
|
44
|
+
# @param [String] message
|
|
45
|
+
# @param [Aws::Billing::Types::AccessDeniedException] data
|
|
46
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
|
47
|
+
super(context, message, data)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @return [String]
|
|
51
|
+
def message
|
|
52
|
+
@message || @data[:message]
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
class InternalServerException < ServiceError
|
|
57
|
+
|
|
58
|
+
# @param [Seahorse::Client::RequestContext] context
|
|
59
|
+
# @param [String] message
|
|
60
|
+
# @param [Aws::Billing::Types::InternalServerException] data
|
|
61
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
|
62
|
+
super(context, message, data)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @return [String]
|
|
66
|
+
def message
|
|
67
|
+
@message || @data[:message]
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class ThrottlingException < ServiceError
|
|
72
|
+
|
|
73
|
+
# @param [Seahorse::Client::RequestContext] context
|
|
74
|
+
# @param [String] message
|
|
75
|
+
# @param [Aws::Billing::Types::ThrottlingException] data
|
|
76
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
|
77
|
+
super(context, message, data)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @return [String]
|
|
81
|
+
def message
|
|
82
|
+
@message || @data[:message]
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
class ValidationException < ServiceError
|
|
87
|
+
|
|
88
|
+
# @param [Seahorse::Client::RequestContext] context
|
|
89
|
+
# @param [String] message
|
|
90
|
+
# @param [Aws::Billing::Types::ValidationException] data
|
|
91
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
|
92
|
+
super(context, message, data)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# @return [String]
|
|
96
|
+
def message
|
|
97
|
+
@message || @data[:message]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# @return [String]
|
|
101
|
+
def reason
|
|
102
|
+
@data[:reason]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @return [String]
|
|
106
|
+
def field_list
|
|
107
|
+
@data[:field_list]
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
end
|
|
112
|
+
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::Billing
|
|
12
|
+
module Plugins
|
|
13
|
+
class Endpoints < Seahorse::Client::Plugin
|
|
14
|
+
option(
|
|
15
|
+
:endpoint_provider,
|
|
16
|
+
doc_type: 'Aws::Billing::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::Billing::EndpointParameters`.
|
|
22
|
+
DOCS
|
|
23
|
+
Aws::Billing::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::Billing::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::Billing
|
|
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
|
|
@@ -0,0 +1,194 @@
|
|
|
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::Billing
|
|
11
|
+
module Types
|
|
12
|
+
|
|
13
|
+
# You don't have sufficient access to perform this action.
|
|
14
|
+
#
|
|
15
|
+
# @!attribute [rw] message
|
|
16
|
+
# @return [String]
|
|
17
|
+
#
|
|
18
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/AccessDeniedException AWS API Documentation
|
|
19
|
+
#
|
|
20
|
+
class AccessDeniedException < Struct.new(
|
|
21
|
+
:message)
|
|
22
|
+
SENSITIVE = []
|
|
23
|
+
include Aws::Structure
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# A time range with a start and end time.
|
|
27
|
+
#
|
|
28
|
+
# @!attribute [rw] active_after_inclusive
|
|
29
|
+
# The inclusive time range start date.
|
|
30
|
+
# @return [Time]
|
|
31
|
+
#
|
|
32
|
+
# @!attribute [rw] active_before_inclusive
|
|
33
|
+
# The inclusive time range end date.
|
|
34
|
+
# @return [Time]
|
|
35
|
+
#
|
|
36
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ActiveTimeRange AWS API Documentation
|
|
37
|
+
#
|
|
38
|
+
class ActiveTimeRange < Struct.new(
|
|
39
|
+
:active_after_inclusive,
|
|
40
|
+
:active_before_inclusive)
|
|
41
|
+
SENSITIVE = []
|
|
42
|
+
include Aws::Structure
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# A representation of a billing view.
|
|
46
|
+
#
|
|
47
|
+
# @!attribute [rw] arn
|
|
48
|
+
# The Amazon Resource Name (ARN) that can be used to uniquely identify
|
|
49
|
+
# the billing view.
|
|
50
|
+
# @return [String]
|
|
51
|
+
#
|
|
52
|
+
# @!attribute [rw] name
|
|
53
|
+
# A list of names of the Billing view.
|
|
54
|
+
# @return [String]
|
|
55
|
+
#
|
|
56
|
+
# @!attribute [rw] owner_account_id
|
|
57
|
+
# The list of owners of the Billing view.
|
|
58
|
+
# @return [String]
|
|
59
|
+
#
|
|
60
|
+
# @!attribute [rw] billing_view_type
|
|
61
|
+
# The type of billing view.
|
|
62
|
+
# @return [String]
|
|
63
|
+
#
|
|
64
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/BillingViewListElement AWS API Documentation
|
|
65
|
+
#
|
|
66
|
+
class BillingViewListElement < Struct.new(
|
|
67
|
+
:arn,
|
|
68
|
+
:name,
|
|
69
|
+
:owner_account_id,
|
|
70
|
+
:billing_view_type)
|
|
71
|
+
SENSITIVE = [:name]
|
|
72
|
+
include Aws::Structure
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# The request processing failed because of an unknown error, exception,
|
|
76
|
+
# or failure.
|
|
77
|
+
#
|
|
78
|
+
# @!attribute [rw] message
|
|
79
|
+
# @return [String]
|
|
80
|
+
#
|
|
81
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/InternalServerException AWS API Documentation
|
|
82
|
+
#
|
|
83
|
+
class InternalServerException < Struct.new(
|
|
84
|
+
:message)
|
|
85
|
+
SENSITIVE = []
|
|
86
|
+
include Aws::Structure
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# @!attribute [rw] active_time_range
|
|
90
|
+
# The time range for the billing views listed. `PRIMARY` billing view
|
|
91
|
+
# is always listed. `BILLING_GROUP` billing views are listed for time
|
|
92
|
+
# ranges when the associated billing group resource in Billing
|
|
93
|
+
# Conductor is active. The time range must be within one calendar
|
|
94
|
+
# month.
|
|
95
|
+
# @return [Types::ActiveTimeRange]
|
|
96
|
+
#
|
|
97
|
+
# @!attribute [rw] max_results
|
|
98
|
+
# The maximum number of billing views to retrieve. Default is 100.
|
|
99
|
+
# @return [Integer]
|
|
100
|
+
#
|
|
101
|
+
# @!attribute [rw] next_token
|
|
102
|
+
# The pagination token that is used on subsequent calls to list
|
|
103
|
+
# billing views.
|
|
104
|
+
# @return [String]
|
|
105
|
+
#
|
|
106
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ListBillingViewsRequest AWS API Documentation
|
|
107
|
+
#
|
|
108
|
+
class ListBillingViewsRequest < Struct.new(
|
|
109
|
+
:active_time_range,
|
|
110
|
+
:max_results,
|
|
111
|
+
:next_token)
|
|
112
|
+
SENSITIVE = []
|
|
113
|
+
include Aws::Structure
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @!attribute [rw] billing_views
|
|
117
|
+
# A list of `BillingViewListElement` retrieved.
|
|
118
|
+
# @return [Array<Types::BillingViewListElement>]
|
|
119
|
+
#
|
|
120
|
+
# @!attribute [rw] next_token
|
|
121
|
+
# The pagination token to use on subsequent calls to list billing
|
|
122
|
+
# views.
|
|
123
|
+
# @return [String]
|
|
124
|
+
#
|
|
125
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ListBillingViewsResponse AWS API Documentation
|
|
126
|
+
#
|
|
127
|
+
class ListBillingViewsResponse < Struct.new(
|
|
128
|
+
:billing_views,
|
|
129
|
+
:next_token)
|
|
130
|
+
SENSITIVE = []
|
|
131
|
+
include Aws::Structure
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# The request was denied due to request throttling.
|
|
135
|
+
#
|
|
136
|
+
# @!attribute [rw] message
|
|
137
|
+
# @return [String]
|
|
138
|
+
#
|
|
139
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ThrottlingException AWS API Documentation
|
|
140
|
+
#
|
|
141
|
+
class ThrottlingException < Struct.new(
|
|
142
|
+
:message)
|
|
143
|
+
SENSITIVE = []
|
|
144
|
+
include Aws::Structure
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# The input fails to satisfy the constraints specified by an Amazon Web
|
|
148
|
+
# Services service.
|
|
149
|
+
#
|
|
150
|
+
# @!attribute [rw] message
|
|
151
|
+
# @return [String]
|
|
152
|
+
#
|
|
153
|
+
# @!attribute [rw] reason
|
|
154
|
+
# The input fails to satisfy the constraints specified by an Amazon
|
|
155
|
+
# Web Services service.
|
|
156
|
+
# @return [String]
|
|
157
|
+
#
|
|
158
|
+
# @!attribute [rw] field_list
|
|
159
|
+
# The input fails to satisfy the constraints specified by an Amazon
|
|
160
|
+
# Web Services service.
|
|
161
|
+
# @return [Array<Types::ValidationExceptionField>]
|
|
162
|
+
#
|
|
163
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ValidationException AWS API Documentation
|
|
164
|
+
#
|
|
165
|
+
class ValidationException < Struct.new(
|
|
166
|
+
:message,
|
|
167
|
+
:reason,
|
|
168
|
+
:field_list)
|
|
169
|
+
SENSITIVE = []
|
|
170
|
+
include Aws::Structure
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# The field's information of a request that resulted in an exception.
|
|
174
|
+
#
|
|
175
|
+
# @!attribute [rw] name
|
|
176
|
+
# The name of the field.
|
|
177
|
+
# @return [String]
|
|
178
|
+
#
|
|
179
|
+
# @!attribute [rw] message
|
|
180
|
+
# The message describing why the field failed validation.
|
|
181
|
+
# @return [String]
|
|
182
|
+
#
|
|
183
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/ValidationExceptionField AWS API Documentation
|
|
184
|
+
#
|
|
185
|
+
class ValidationExceptionField < Struct.new(
|
|
186
|
+
:name,
|
|
187
|
+
:message)
|
|
188
|
+
SENSITIVE = []
|
|
189
|
+
include Aws::Structure
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
require 'aws-sdk-core/waiters'
|
|
11
|
+
|
|
12
|
+
module Aws::Billing
|
|
13
|
+
module Waiters
|
|
14
|
+
end
|
|
15
|
+
end
|