aws-sdk-marketplacemetering 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f17e523197dfa0a52318c3c2a83b21178fe8a07a
4
+ data.tar.gz: 6518cd539e28ebb194e7bec5faf13a3cc659b9b9
5
+ SHA512:
6
+ metadata.gz: c4f493a4d721b05873c049f3541dce408d65a70a917dc9e91c0d1a40a8e218024c4d6f2bf88694a786985d56752b812bd4942e7021e2fbd250d1649e18182767
7
+ data.tar.gz: 8686541d1d142932536399950379ba59f0fb56623f84b4823df18e711d3d45d973ab8f4412921b1b46cd0aa098de3c62236a4a99815787b3607ac157d71eff09
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-marketplacemetering/types'
12
+ require_relative 'aws-sdk-marketplacemetering/client_api'
13
+ require_relative 'aws-sdk-marketplacemetering/client'
14
+ require_relative 'aws-sdk-marketplacemetering/errors'
15
+ require_relative 'aws-sdk-marketplacemetering/resource'
16
+ require_relative 'aws-sdk-marketplacemetering/customizations'
17
+
18
+ # This module provides support for AWSMarketplace Metering. This module is available in the
19
+ # `aws-sdk-marketplacemetering` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWSMarketplace Metering all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::MarketplaceMetering::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::MarketplaceMetering
44
+
45
+ GEM_VERSION = '1.0.0.rc1'
46
+
47
+ end
@@ -0,0 +1,307 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:marketplacemetering)
25
+
26
+ module Aws
27
+ module MarketplaceMetering
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :marketplacemetering
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::SignatureV4)
50
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
51
+
52
+ # @option options [required, Aws::CredentialProvider] :credentials
53
+ # Your AWS credentials. This can be an instance of any one of the
54
+ # following classes:
55
+ #
56
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
57
+ # credentials.
58
+ #
59
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
60
+ # from an EC2 IMDS on an EC2 instance.
61
+ #
62
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
63
+ # shared file, such as `~/.aws/config`.
64
+ #
65
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
66
+ #
67
+ # When `:credentials` are not configured directly, the following
68
+ # locations will be searched for credentials:
69
+ #
70
+ # * `Aws.config[:credentials]`
71
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
72
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
73
+ # * `~/.aws/credentials`
74
+ # * `~/.aws/config`
75
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
76
+ # very aggressive. Construct and pass an instance of
77
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
78
+ # timeouts.
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # @option options [String] :access_key_id
91
+ # @option options [Boolean] :convert_params (true)
92
+ # When `true`, an attempt is made to coerce request parameters into
93
+ # the required types.
94
+ # @option options [String] :endpoint
95
+ # The client endpoint is normally constructed from the `:region`
96
+ # option. You should only configure an `:endpoint` when connecting
97
+ # to test endpoints. This should be avalid HTTP(S) URI.
98
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
99
+ # The log formatter.
100
+ # @option options [Symbol] :log_level (:info)
101
+ # The log level to send messages to the `:logger` at.
102
+ # @option options [Logger] :logger
103
+ # The Logger instance to send log messages to. If this option
104
+ # is not set, logging will be disabled.
105
+ # @option options [String] :profile ("default")
106
+ # Used when loading credentials from the shared credentials file
107
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
108
+ # @option options [Integer] :retry_limit (3)
109
+ # The maximum number of times to retry failed requests. Only
110
+ # ~ 500 level server errors and certain ~ 400 level client errors
111
+ # are retried. Generally, these are throttling errors, data
112
+ # checksum errors, networking errors, timeout errors and auth
113
+ # errors from expired credentials.
114
+ # @option options [String] :secret_access_key
115
+ # @option options [String] :session_token
116
+ # @option options [Boolean] :simple_json (false)
117
+ # Disables request parameter conversion, validation, and formatting.
118
+ # Also disable response data type conversions. This option is useful
119
+ # when you want to ensure the highest level of performance by
120
+ # avoiding overhead of walking request parameters and response data
121
+ # structures.
122
+ #
123
+ # When `:simple_json` is enabled, the request parameters hash must
124
+ # be formatted exactly as the DynamoDB API expects.
125
+ # @option options [Boolean] :stub_responses (false)
126
+ # Causes the client to return stubbed responses. By default
127
+ # fake responses are generated and returned. You can specify
128
+ # the response data to return or errors to raise by calling
129
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
130
+ #
131
+ # ** Please note ** When response stubbing is enabled, no HTTP
132
+ # requests are made, and retries are disabled.
133
+ # @option options [Boolean] :validate_params (true)
134
+ # When `true`, request parameters are validated before
135
+ # sending the request.
136
+ def initialize(*args)
137
+ super
138
+ end
139
+
140
+ # @!group API Operations
141
+
142
+ # BatchMeterUsage is called from a SaaS application listed on the AWS
143
+ # Marketplace to post metering records for a set of customers.
144
+ #
145
+ # For identical requests, the API is idempotent; requests can be retried
146
+ # with the same records or a subset of the input records.
147
+ #
148
+ # Every request to BatchMeterUsage is for one product. If you need to
149
+ # meter usage for multiple products, you must make multiple calls to
150
+ # BatchMeterUsage.
151
+ #
152
+ # BatchMeterUsage can process up to 25 UsageRecords at a time.
153
+ # @option params [required, Array<Types::UsageRecord>] :usage_records
154
+ # The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
155
+ # UsageRecords at a time.
156
+ # @option params [required, String] :product_code
157
+ # Product code is used to uniquely identify a product in AWS
158
+ # Marketplace. The product code should be the same as the one used
159
+ # during the publishing of a new product.
160
+ # @return [Types::BatchMeterUsageResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
161
+ #
162
+ # * {Types::BatchMeterUsageResult#results #Results} => Array&lt;Types::UsageRecordResult&gt;
163
+ # * {Types::BatchMeterUsageResult#unprocessed_records #UnprocessedRecords} => Array&lt;Types::UsageRecord&gt;
164
+ #
165
+ # @example Request syntax with placeholder values
166
+ # resp = client.batch_meter_usage({
167
+ # usage_records: [ # required
168
+ # {
169
+ # timestamp: Time.now, # required
170
+ # customer_identifier: "CustomerIdentifier", # required
171
+ # dimension: "UsageDimension", # required
172
+ # quantity: 1, # required
173
+ # },
174
+ # ],
175
+ # product_code: "ProductCode", # required
176
+ # })
177
+ #
178
+ # @example Response structure
179
+ # resp.results #=> Array
180
+ # resp.results[0].usage_record.timestamp #=> Time
181
+ # resp.results[0].usage_record.customer_identifier #=> String
182
+ # resp.results[0].usage_record.dimension #=> String
183
+ # resp.results[0].usage_record.quantity #=> Integer
184
+ # resp.results[0].metering_record_id #=> String
185
+ # resp.results[0].status #=> String, one of "Success", "CustomerNotSubscribed", "DuplicateRecord"
186
+ # resp.unprocessed_records #=> Array
187
+ # resp.unprocessed_records[0].timestamp #=> Time
188
+ # resp.unprocessed_records[0].customer_identifier #=> String
189
+ # resp.unprocessed_records[0].dimension #=> String
190
+ # resp.unprocessed_records[0].quantity #=> Integer
191
+ # @overload batch_meter_usage(params = {})
192
+ # @param [Hash] params ({})
193
+ def batch_meter_usage(params = {}, options = {})
194
+ req = build_request(:batch_meter_usage, params)
195
+ req.send_request(options)
196
+ end
197
+
198
+ # API to emit metering records. For identical requests, the API is
199
+ # idempotent. It simply returns the metering record ID.
200
+ #
201
+ # MeterUsage is authenticated on the buyer's AWS account, generally
202
+ # when running from an EC2 instance on the AWS Marketplace.
203
+ # @option params [required, String] :product_code
204
+ # Product code is used to uniquely identify a product in AWS
205
+ # Marketplace. The product code should be the same as the one used
206
+ # during the publishing of a new product.
207
+ # @option params [required, Time,DateTime,Date,Integer,String] :timestamp
208
+ # Timestamp of the hour, recorded in UTC. The seconds and milliseconds
209
+ # portions of the timestamp will be ignored.
210
+ # @option params [required, String] :usage_dimension
211
+ # It will be one of the fcp dimension name provided during the
212
+ # publishing of the product.
213
+ # @option params [required, Integer] :usage_quantity
214
+ # Consumption value for the hour.
215
+ # @option params [required, Boolean] :dry_run
216
+ # Checks whether you have the permissions required for the action, but
217
+ # does not make the request. If you have the permissions, the request
218
+ # returns DryRunOperation; otherwise, it returns UnauthorizedException.
219
+ # @return [Types::MeterUsageResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
220
+ #
221
+ # * {Types::MeterUsageResult#metering_record_id #MeteringRecordId} => String
222
+ #
223
+ # @example Request syntax with placeholder values
224
+ # resp = client.meter_usage({
225
+ # product_code: "ProductCode", # required
226
+ # timestamp: Time.now, # required
227
+ # usage_dimension: "UsageDimension", # required
228
+ # usage_quantity: 1, # required
229
+ # dry_run: false, # required
230
+ # })
231
+ #
232
+ # @example Response structure
233
+ # resp.metering_record_id #=> String
234
+ # @overload meter_usage(params = {})
235
+ # @param [Hash] params ({})
236
+ def meter_usage(params = {}, options = {})
237
+ req = build_request(:meter_usage, params)
238
+ req.send_request(options)
239
+ end
240
+
241
+ # ResolveCustomer is called by a SaaS application during the
242
+ # registration process. When a buyer visits your website during the
243
+ # registration process, the buyer submits a registration token through
244
+ # their browser. The registration token is resolved through this API to
245
+ # obtain a CustomerIdentifier and product code.
246
+ # @option params [required, String] :registration_token
247
+ # When a buyer visits your website during the registration process, the
248
+ # buyer submits a registration token through the browser. The
249
+ # registration token is resolved to obtain a CustomerIdentifier and
250
+ # product code.
251
+ # @return [Types::ResolveCustomerResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
252
+ #
253
+ # * {Types::ResolveCustomerResult#customer_identifier #CustomerIdentifier} => String
254
+ # * {Types::ResolveCustomerResult#product_code #ProductCode} => String
255
+ #
256
+ # @example Request syntax with placeholder values
257
+ # resp = client.resolve_customer({
258
+ # registration_token: "NonEmptyString", # required
259
+ # })
260
+ #
261
+ # @example Response structure
262
+ # resp.customer_identifier #=> String
263
+ # resp.product_code #=> String
264
+ # @overload resolve_customer(params = {})
265
+ # @param [Hash] params ({})
266
+ def resolve_customer(params = {}, options = {})
267
+ req = build_request(:resolve_customer, params)
268
+ req.send_request(options)
269
+ end
270
+
271
+ # @!endgroup
272
+
273
+ # @param params ({})
274
+ # @api private
275
+ def build_request(operation_name, params = {})
276
+ handlers = @handlers.for(operation_name)
277
+ context = Seahorse::Client::RequestContext.new(
278
+ operation_name: operation_name,
279
+ operation: config.api.operation(operation_name),
280
+ client: self,
281
+ params: params,
282
+ config: config)
283
+ context[:gem_name] = 'aws-sdk-marketplacemetering'
284
+ context[:gem_version] = '1.0.0.rc1'
285
+ Seahorse::Client::Request.new(handlers, context)
286
+ end
287
+
288
+ # @api private
289
+ # @deprecated
290
+ def waiter_names
291
+ []
292
+ end
293
+
294
+ class << self
295
+
296
+ # @api private
297
+ attr_reader :identifier
298
+
299
+ # @api private
300
+ def errors_module
301
+ Errors
302
+ end
303
+
304
+ end
305
+ end
306
+ end
307
+ end
@@ -0,0 +1,146 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module MarketplaceMetering
10
+ # @api private
11
+ module ClientApi
12
+
13
+ include Seahorse::Model
14
+
15
+ BatchMeterUsageRequest = Shapes::StructureShape.new(name: 'BatchMeterUsageRequest')
16
+ BatchMeterUsageResult = Shapes::StructureShape.new(name: 'BatchMeterUsageResult')
17
+ Boolean = Shapes::BooleanShape.new(name: 'Boolean')
18
+ CustomerIdentifier = Shapes::StringShape.new(name: 'CustomerIdentifier')
19
+ DuplicateRequestException = Shapes::StructureShape.new(name: 'DuplicateRequestException')
20
+ ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException')
21
+ InternalServiceErrorException = Shapes::StructureShape.new(name: 'InternalServiceErrorException')
22
+ InvalidCustomerIdentifierException = Shapes::StructureShape.new(name: 'InvalidCustomerIdentifierException')
23
+ InvalidEndpointRegionException = Shapes::StructureShape.new(name: 'InvalidEndpointRegionException')
24
+ InvalidProductCodeException = Shapes::StructureShape.new(name: 'InvalidProductCodeException')
25
+ InvalidTokenException = Shapes::StructureShape.new(name: 'InvalidTokenException')
26
+ InvalidUsageDimensionException = Shapes::StructureShape.new(name: 'InvalidUsageDimensionException')
27
+ MeterUsageRequest = Shapes::StructureShape.new(name: 'MeterUsageRequest')
28
+ MeterUsageResult = Shapes::StructureShape.new(name: 'MeterUsageResult')
29
+ NonEmptyString = Shapes::StringShape.new(name: 'NonEmptyString')
30
+ ProductCode = Shapes::StringShape.new(name: 'ProductCode')
31
+ ResolveCustomerRequest = Shapes::StructureShape.new(name: 'ResolveCustomerRequest')
32
+ ResolveCustomerResult = Shapes::StructureShape.new(name: 'ResolveCustomerResult')
33
+ String = Shapes::StringShape.new(name: 'String')
34
+ ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
35
+ Timestamp = Shapes::TimestampShape.new(name: 'Timestamp')
36
+ TimestampOutOfBoundsException = Shapes::StructureShape.new(name: 'TimestampOutOfBoundsException')
37
+ UsageDimension = Shapes::StringShape.new(name: 'UsageDimension')
38
+ UsageQuantity = Shapes::IntegerShape.new(name: 'UsageQuantity')
39
+ UsageRecord = Shapes::StructureShape.new(name: 'UsageRecord')
40
+ UsageRecordList = Shapes::ListShape.new(name: 'UsageRecordList')
41
+ UsageRecordResult = Shapes::StructureShape.new(name: 'UsageRecordResult')
42
+ UsageRecordResultList = Shapes::ListShape.new(name: 'UsageRecordResultList')
43
+ UsageRecordResultStatus = Shapes::StringShape.new(name: 'UsageRecordResultStatus')
44
+ errorMessage = Shapes::StringShape.new(name: 'errorMessage')
45
+
46
+ BatchMeterUsageRequest.add_member(:usage_records, Shapes::ShapeRef.new(shape: UsageRecordList, required: true, location_name: "UsageRecords"))
47
+ BatchMeterUsageRequest.add_member(:product_code, Shapes::ShapeRef.new(shape: ProductCode, required: true, location_name: "ProductCode"))
48
+ BatchMeterUsageRequest.struct_class = Types::BatchMeterUsageRequest
49
+
50
+ BatchMeterUsageResult.add_member(:results, Shapes::ShapeRef.new(shape: UsageRecordResultList, location_name: "Results"))
51
+ BatchMeterUsageResult.add_member(:unprocessed_records, Shapes::ShapeRef.new(shape: UsageRecordList, location_name: "UnprocessedRecords"))
52
+ BatchMeterUsageResult.struct_class = Types::BatchMeterUsageResult
53
+
54
+ MeterUsageRequest.add_member(:product_code, Shapes::ShapeRef.new(shape: ProductCode, required: true, location_name: "ProductCode"))
55
+ MeterUsageRequest.add_member(:timestamp, Shapes::ShapeRef.new(shape: Timestamp, required: true, location_name: "Timestamp"))
56
+ MeterUsageRequest.add_member(:usage_dimension, Shapes::ShapeRef.new(shape: UsageDimension, required: true, location_name: "UsageDimension"))
57
+ MeterUsageRequest.add_member(:usage_quantity, Shapes::ShapeRef.new(shape: UsageQuantity, required: true, location_name: "UsageQuantity"))
58
+ MeterUsageRequest.add_member(:dry_run, Shapes::ShapeRef.new(shape: Boolean, required: true, location_name: "DryRun"))
59
+ MeterUsageRequest.struct_class = Types::MeterUsageRequest
60
+
61
+ MeterUsageResult.add_member(:metering_record_id, Shapes::ShapeRef.new(shape: String, location_name: "MeteringRecordId"))
62
+ MeterUsageResult.struct_class = Types::MeterUsageResult
63
+
64
+ ResolveCustomerRequest.add_member(:registration_token, Shapes::ShapeRef.new(shape: NonEmptyString, required: true, location_name: "RegistrationToken"))
65
+ ResolveCustomerRequest.struct_class = Types::ResolveCustomerRequest
66
+
67
+ ResolveCustomerResult.add_member(:customer_identifier, Shapes::ShapeRef.new(shape: CustomerIdentifier, location_name: "CustomerIdentifier"))
68
+ ResolveCustomerResult.add_member(:product_code, Shapes::ShapeRef.new(shape: ProductCode, location_name: "ProductCode"))
69
+ ResolveCustomerResult.struct_class = Types::ResolveCustomerResult
70
+
71
+ UsageRecord.add_member(:timestamp, Shapes::ShapeRef.new(shape: Timestamp, required: true, location_name: "Timestamp"))
72
+ UsageRecord.add_member(:customer_identifier, Shapes::ShapeRef.new(shape: CustomerIdentifier, required: true, location_name: "CustomerIdentifier"))
73
+ UsageRecord.add_member(:dimension, Shapes::ShapeRef.new(shape: UsageDimension, required: true, location_name: "Dimension"))
74
+ UsageRecord.add_member(:quantity, Shapes::ShapeRef.new(shape: UsageQuantity, required: true, location_name: "Quantity"))
75
+ UsageRecord.struct_class = Types::UsageRecord
76
+
77
+ UsageRecordList.member = Shapes::ShapeRef.new(shape: UsageRecord)
78
+
79
+ UsageRecordResult.add_member(:usage_record, Shapes::ShapeRef.new(shape: UsageRecord, location_name: "UsageRecord"))
80
+ UsageRecordResult.add_member(:metering_record_id, Shapes::ShapeRef.new(shape: String, location_name: "MeteringRecordId"))
81
+ UsageRecordResult.add_member(:status, Shapes::ShapeRef.new(shape: UsageRecordResultStatus, location_name: "Status"))
82
+ UsageRecordResult.struct_class = Types::UsageRecordResult
83
+
84
+ UsageRecordResultList.member = Shapes::ShapeRef.new(shape: UsageRecordResult)
85
+
86
+
87
+ # @api private
88
+ API = Seahorse::Model::Api.new.tap do |api|
89
+
90
+ api.version = "2016-01-14"
91
+
92
+ api.metadata = {
93
+ "endpointPrefix" => "metering.marketplace",
94
+ "jsonVersion" => "1.1",
95
+ "protocol" => "json",
96
+ "serviceFullName" => "AWSMarketplace Metering",
97
+ "signatureVersion" => "v4",
98
+ "signingName" => "aws-marketplace",
99
+ "targetPrefix" => "AWSMPMeteringService",
100
+ }
101
+
102
+ api.add_operation(:batch_meter_usage, Seahorse::Model::Operation.new.tap do |o|
103
+ o.name = "BatchMeterUsage"
104
+ o.http_method = "POST"
105
+ o.http_request_uri = "/"
106
+ o.input = Shapes::ShapeRef.new(shape: BatchMeterUsageRequest)
107
+ o.output = Shapes::ShapeRef.new(shape: BatchMeterUsageResult)
108
+ o.errors << Shapes::ShapeRef.new(shape: InternalServiceErrorException)
109
+ o.errors << Shapes::ShapeRef.new(shape: InvalidProductCodeException)
110
+ o.errors << Shapes::ShapeRef.new(shape: InvalidUsageDimensionException)
111
+ o.errors << Shapes::ShapeRef.new(shape: InvalidCustomerIdentifierException)
112
+ o.errors << Shapes::ShapeRef.new(shape: TimestampOutOfBoundsException)
113
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
114
+ end)
115
+
116
+ api.add_operation(:meter_usage, Seahorse::Model::Operation.new.tap do |o|
117
+ o.name = "MeterUsage"
118
+ o.http_method = "POST"
119
+ o.http_request_uri = "/"
120
+ o.input = Shapes::ShapeRef.new(shape: MeterUsageRequest)
121
+ o.output = Shapes::ShapeRef.new(shape: MeterUsageResult)
122
+ o.errors << Shapes::ShapeRef.new(shape: InternalServiceErrorException)
123
+ o.errors << Shapes::ShapeRef.new(shape: InvalidProductCodeException)
124
+ o.errors << Shapes::ShapeRef.new(shape: InvalidUsageDimensionException)
125
+ o.errors << Shapes::ShapeRef.new(shape: InvalidEndpointRegionException)
126
+ o.errors << Shapes::ShapeRef.new(shape: TimestampOutOfBoundsException)
127
+ o.errors << Shapes::ShapeRef.new(shape: DuplicateRequestException)
128
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
129
+ end)
130
+
131
+ api.add_operation(:resolve_customer, Seahorse::Model::Operation.new.tap do |o|
132
+ o.name = "ResolveCustomer"
133
+ o.http_method = "POST"
134
+ o.http_request_uri = "/"
135
+ o.input = Shapes::ShapeRef.new(shape: ResolveCustomerRequest)
136
+ o.output = Shapes::ShapeRef.new(shape: ResolveCustomerResult)
137
+ o.errors << Shapes::ShapeRef.new(shape: InvalidTokenException)
138
+ o.errors << Shapes::ShapeRef.new(shape: ExpiredTokenException)
139
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
140
+ o.errors << Shapes::ShapeRef.new(shape: InternalServiceErrorException)
141
+ end)
142
+ end
143
+
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,7 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
@@ -0,0 +1,23 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module MarketplaceMetering
10
+ module Errors
11
+
12
+ extend Aws::Errors::DynamicErrors
13
+
14
+ # Raised when calling #load or #data on a resource class that can not be
15
+ # loaded. This can happen when:
16
+ #
17
+ # * A resource class has identifiers, but no data attributes.
18
+ # * Resource data is only available when making an API call that
19
+ # enumerates all resources of that type.
20
+ class ResourceNotLoadable < RuntimeError; end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module MarketplaceMetering
10
+ class Resource
11
+
12
+ # @param options ({})
13
+ # @option options [Client] :client
14
+ def initialize(options = {})
15
+ @client = options[:client] || Client.new(options)
16
+ end
17
+
18
+ # @return [Client]
19
+ def client
20
+ @client
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,232 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module MarketplaceMetering
10
+ module Types
11
+
12
+ # A BatchMeterUsageRequest contains UsageRecords, which indicate
13
+ # quantities of usage within your application.
14
+ # @note When making an API call, pass BatchMeterUsageRequest
15
+ # data as a hash:
16
+ #
17
+ # {
18
+ # usage_records: [ # required
19
+ # {
20
+ # timestamp: Time.now, # required
21
+ # customer_identifier: "CustomerIdentifier", # required
22
+ # dimension: "UsageDimension", # required
23
+ # quantity: 1, # required
24
+ # },
25
+ # ],
26
+ # product_code: "ProductCode", # required
27
+ # }
28
+ # @!attribute [rw] usage_records
29
+ # The set of UsageRecords to submit. BatchMeterUsage accepts up to 25
30
+ # UsageRecords at a time.
31
+ # @return [Array<Types::UsageRecord>]
32
+ #
33
+ # @!attribute [rw] product_code
34
+ # Product code is used to uniquely identify a product in AWS
35
+ # Marketplace. The product code should be the same as the one used
36
+ # during the publishing of a new product.
37
+ # @return [String]
38
+ class BatchMeterUsageRequest < Struct.new(
39
+ :usage_records,
40
+ :product_code)
41
+ include Aws::Structure
42
+ end
43
+
44
+ # Contains the UsageRecords processed by BatchMeterUsage and any records
45
+ # that have failed due to transient error.
46
+ # @!attribute [rw] results
47
+ # Contains all UsageRecords processed by BatchMeterUsage. These
48
+ # records were either honored by AWS Marketplace Metering Service or
49
+ # were invalid.
50
+ # @return [Array<Types::UsageRecordResult>]
51
+ #
52
+ # @!attribute [rw] unprocessed_records
53
+ # Contains all UsageRecords that were not processed by
54
+ # BatchMeterUsage. This is a list of UsageRecords. You can retry the
55
+ # failed request by making another BatchMeterUsage call with this list
56
+ # as input in the BatchMeterUsageRequest.
57
+ # @return [Array<Types::UsageRecord>]
58
+ class BatchMeterUsageResult < Struct.new(
59
+ :results,
60
+ :unprocessed_records)
61
+ include Aws::Structure
62
+ end
63
+
64
+ # @note When making an API call, pass MeterUsageRequest
65
+ # data as a hash:
66
+ #
67
+ # {
68
+ # product_code: "ProductCode", # required
69
+ # timestamp: Time.now, # required
70
+ # usage_dimension: "UsageDimension", # required
71
+ # usage_quantity: 1, # required
72
+ # dry_run: false, # required
73
+ # }
74
+ # @!attribute [rw] product_code
75
+ # Product code is used to uniquely identify a product in AWS
76
+ # Marketplace. The product code should be the same as the one used
77
+ # during the publishing of a new product.
78
+ # @return [String]
79
+ #
80
+ # @!attribute [rw] timestamp
81
+ # Timestamp of the hour, recorded in UTC. The seconds and milliseconds
82
+ # portions of the timestamp will be ignored.
83
+ # @return [Time]
84
+ #
85
+ # @!attribute [rw] usage_dimension
86
+ # It will be one of the fcp dimension name provided during the
87
+ # publishing of the product.
88
+ # @return [String]
89
+ #
90
+ # @!attribute [rw] usage_quantity
91
+ # Consumption value for the hour.
92
+ # @return [Integer]
93
+ #
94
+ # @!attribute [rw] dry_run
95
+ # Checks whether you have the permissions required for the action, but
96
+ # does not make the request. If you have the permissions, the request
97
+ # returns DryRunOperation; otherwise, it returns
98
+ # UnauthorizedException.
99
+ # @return [Boolean]
100
+ class MeterUsageRequest < Struct.new(
101
+ :product_code,
102
+ :timestamp,
103
+ :usage_dimension,
104
+ :usage_quantity,
105
+ :dry_run)
106
+ include Aws::Structure
107
+ end
108
+
109
+ # @!attribute [rw] metering_record_id
110
+ # @return [String]
111
+ class MeterUsageResult < Struct.new(
112
+ :metering_record_id)
113
+ include Aws::Structure
114
+ end
115
+
116
+ # Contains input to the ResolveCustomer operation.
117
+ # @note When making an API call, pass ResolveCustomerRequest
118
+ # data as a hash:
119
+ #
120
+ # {
121
+ # registration_token: "NonEmptyString", # required
122
+ # }
123
+ # @!attribute [rw] registration_token
124
+ # When a buyer visits your website during the registration process,
125
+ # the buyer submits a registration token through the browser. The
126
+ # registration token is resolved to obtain a CustomerIdentifier and
127
+ # product code.
128
+ # @return [String]
129
+ class ResolveCustomerRequest < Struct.new(
130
+ :registration_token)
131
+ include Aws::Structure
132
+ end
133
+
134
+ # The result of the ResolveCustomer operation. Contains the
135
+ # CustomerIdentifier and product code.
136
+ # @!attribute [rw] customer_identifier
137
+ # The CustomerIdentifier is used to identify an individual customer in
138
+ # your application. Calls to BatchMeterUsage require
139
+ # CustomerIdentifiers for each UsageRecord.
140
+ # @return [String]
141
+ #
142
+ # @!attribute [rw] product_code
143
+ # The product code is returned to confirm that the buyer is
144
+ # registering for your product. Subsequent BatchMeterUsage calls
145
+ # should be made using this product code.
146
+ # @return [String]
147
+ class ResolveCustomerResult < Struct.new(
148
+ :customer_identifier,
149
+ :product_code)
150
+ include Aws::Structure
151
+ end
152
+
153
+ # A UsageRecord indicates a quantity of usage for a given product,
154
+ # customer, dimension and time.
155
+ #
156
+ # Multiple requests with the same UsageRecords as input will be
157
+ # deduplicated to prevent double charges.
158
+ # @note When making an API call, pass UsageRecord
159
+ # data as a hash:
160
+ #
161
+ # {
162
+ # timestamp: Time.now, # required
163
+ # customer_identifier: "CustomerIdentifier", # required
164
+ # dimension: "UsageDimension", # required
165
+ # quantity: 1, # required
166
+ # }
167
+ # @!attribute [rw] timestamp
168
+ # Timestamp of the hour, recorded in UTC. The seconds and milliseconds
169
+ # portions of the timestamp will be ignored.
170
+ #
171
+ # Your application can meter usage for up to one hour in the past.
172
+ # @return [Time]
173
+ #
174
+ # @!attribute [rw] customer_identifier
175
+ # The CustomerIdentifier is obtained through the ResolveCustomer
176
+ # operation and represents an individual buyer in your application.
177
+ # @return [String]
178
+ #
179
+ # @!attribute [rw] dimension
180
+ # During the process of registering a product on AWS Marketplace, up
181
+ # to eight dimensions are specified. These represent different units
182
+ # of value in your application.
183
+ # @return [String]
184
+ #
185
+ # @!attribute [rw] quantity
186
+ # The quantity of usage consumed by the customer for the given
187
+ # dimension and time.
188
+ # @return [Integer]
189
+ class UsageRecord < Struct.new(
190
+ :timestamp,
191
+ :customer_identifier,
192
+ :dimension,
193
+ :quantity)
194
+ include Aws::Structure
195
+ end
196
+
197
+ # A UsageRecordResult indicates the status of a given UsageRecord
198
+ # processed by BatchMeterUsage.
199
+ # @!attribute [rw] usage_record
200
+ # The UsageRecord that was part of the BatchMeterUsage request.
201
+ # @return [Types::UsageRecord]
202
+ #
203
+ # @!attribute [rw] metering_record_id
204
+ # The MeteringRecordId is a unique identifier for this metering event.
205
+ # @return [String]
206
+ #
207
+ # @!attribute [rw] status
208
+ # The UsageRecordResult Status indicates the status of an individual
209
+ # UsageRecord processed by BatchMeterUsage.
210
+ #
211
+ # * *Success*- The UsageRecord was accepted and honored by
212
+ # BatchMeterUsage.
213
+ #
214
+ # * *CustomerNotSubscribed*- The CustomerIdentifier specified is not
215
+ # subscribed to your product. The UsageRecord was not honored.
216
+ # Future UsageRecords for this customer will fail until the customer
217
+ # subscribes to your product.
218
+ #
219
+ # * *DuplicateRecord*- Indicates that the UsageRecord was invalid and
220
+ # not honored. A previously metered UsageRecord had the same
221
+ # customer, dimension, and time, but a different quantity.
222
+ # @return [String]
223
+ class UsageRecordResult < Struct.new(
224
+ :usage_record,
225
+ :metering_record_id,
226
+ :status)
227
+ include Aws::Structure
228
+ end
229
+
230
+ end
231
+ end
232
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-marketplacemetering
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.rc1
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0.rc1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0.rc1
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sigv4
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ description: Official AWS Ruby gem for AWSMarketplace Metering. This gem is part of
42
+ the AWS SDK for Ruby.
43
+ email:
44
+ - trevrowe@amazon.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/aws-sdk-marketplacemetering.rb
50
+ - lib/aws-sdk-marketplacemetering/client.rb
51
+ - lib/aws-sdk-marketplacemetering/client_api.rb
52
+ - lib/aws-sdk-marketplacemetering/customizations.rb
53
+ - lib/aws-sdk-marketplacemetering/errors.rb
54
+ - lib/aws-sdk-marketplacemetering/resource.rb
55
+ - lib/aws-sdk-marketplacemetering/types.rb
56
+ homepage: http://github.com/aws/aws-sdk-ruby
57
+ licenses:
58
+ - Apache-2.0
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">"
72
+ - !ruby/object:Gem::Version
73
+ version: 1.3.1
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.5.1
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: AWS SDK for Ruby - AWSMarketplace Metering
80
+ test_files: []