Skip to content

Commit 86eb848

Browse files
This release enhances the BatchMeterUsage API to support new field CustomerAWSAccountId in request and response and making CustomerIdentifier optional. CustomerAWSAccountId or CustomerIdentifier must be provided in request but not both.
1 parent 5376c4c commit 86eb848

25 files changed

+1716
-822
lines changed

generator/ServiceModels/meteringmarketplace/meteringmarketplace-2016-01-14.api.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"endpointPrefix":"metering.marketplace",
66
"jsonVersion":"1.1",
77
"protocol":"json",
8+
"protocols":["json"],
89
"serviceFullName":"AWSMarketplace Metering",
910
"serviceId":"Marketplace Metering",
1011
"signatureVersion":"v4",
1112
"signingName":"aws-marketplace",
1213
"targetPrefix":"AWSMPMeteringService",
13-
"uid":"meteringmarketplace-2016-01-14"
14+
"uid":"meteringmarketplace-2016-01-14",
15+
"auth":["aws.auth#sigv4"]
1416
},
1517
"operations":{
1618
"BatchMeterUsage":{
@@ -124,8 +126,8 @@
124126
"CustomerIdentifier":{
125127
"type":"string",
126128
"max":255,
127-
"min":1,
128-
"pattern":"[\\s\\S]+"
129+
"min":0,
130+
"pattern":"[\\s\\S]*"
129131
},
130132
"CustomerNotEntitledException":{
131133
"type":"structure",
@@ -378,15 +380,15 @@
378380
"type":"structure",
379381
"required":[
380382
"Timestamp",
381-
"CustomerIdentifier",
382383
"Dimension"
383384
],
384385
"members":{
385386
"Timestamp":{"shape":"Timestamp"},
386387
"CustomerIdentifier":{"shape":"CustomerIdentifier"},
387388
"Dimension":{"shape":"UsageDimension"},
388389
"Quantity":{"shape":"UsageQuantity"},
389-
"UsageAllocations":{"shape":"UsageAllocations"}
390+
"UsageAllocations":{"shape":"UsageAllocations"},
391+
"CustomerAWSAccountId":{"shape":"CustomerAWSAccountId"}
390392
}
391393
},
392394
"UsageRecordList":{

generator/ServiceModels/meteringmarketplace/meteringmarketplace-2016-01-14.docs.json

Lines changed: 20 additions & 19 deletions
Large diffs are not rendered by default.

generator/ServiceModels/meteringmarketplace/meteringmarketplace-2016-01-14.normal.json

Lines changed: 28 additions & 23 deletions
Large diffs are not rendered by default.

sdk/code-analysis/ServiceAnalysis/AWSMarketplaceMetering/Generated/PropertyValueRules.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
</property-value-rule>
5555
<property-value-rule>
5656
<property>Amazon.AWSMarketplaceMetering.Model.ResolveCustomerResponse.CustomerIdentifier</property>
57-
<min>1</min>
57+
<min>0</min>
5858
<max>255</max>
59-
<pattern>[\s\S]+</pattern>
59+
<pattern>[\s\S]*</pattern>
6060
</property-value-rule>
6161
<property-value-rule>
6262
<property>Amazon.AWSMarketplaceMetering.Model.ResolveCustomerResponse.ProductCode</property>
@@ -82,10 +82,16 @@
8282
<max>2147483647</max>
8383
</property-value-rule>
8484
<property-value-rule>
85-
<property>Amazon.AWSMarketplaceMetering.Model.UsageRecord.CustomerIdentifier</property>
85+
<property>Amazon.AWSMarketplaceMetering.Model.UsageRecord.CustomerAWSAccountId</property>
8686
<min>1</min>
8787
<max>255</max>
88-
<pattern>[\s\S]+</pattern>
88+
<pattern>^[0-9]+$</pattern>
89+
</property-value-rule>
90+
<property-value-rule>
91+
<property>Amazon.AWSMarketplaceMetering.Model.UsageRecord.CustomerIdentifier</property>
92+
<min>0</min>
93+
<max>255</max>
94+
<pattern>[\s\S]*</pattern>
8995
</property-value-rule>
9096
<property-value-rule>
9197
<property>Amazon.AWSMarketplaceMetering.Model.UsageRecord.Dimension</property>

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/BatchMeterUsageRequest.cs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,51 @@ namespace Amazon.AWSMarketplaceMetering.Model
3131
{
3232
/// <summary>
3333
/// Container for the parameters to the BatchMeterUsage operation.
34-
/// <c>BatchMeterUsage</c> is called from a SaaS application listed on AWS Marketplace
35-
/// to post metering records for a set of customers.
36-
///
37-
///
34+
/// <important>
3835
/// <para>
39-
/// For identical requests, the API is idempotent; requests can be retried with the same
40-
/// records or a subset of the input records.
36+
/// The <c>CustomerIdentifier</c> parameter is scheduled for deprecation. Use <c>CustomerAWSAccountID</c>
37+
/// instead.
4138
/// </para>
4239
///
4340
/// <para>
44-
/// Every request to <c>BatchMeterUsage</c> is for one product. If you need to meter usage
45-
/// for multiple products, you must make multiple calls to <c>BatchMeterUsage</c>.
41+
/// These parameters are mutually exclusive. You can't specify both <c>CustomerIdentifier</c>
42+
/// and <c>CustomerAWSAccountID</c> in the same request.
4643
/// </para>
47-
///
44+
/// </important>
4845
/// <para>
49-
/// Usage records are expected to be submitted as quickly as possible after the event
50-
/// that is being recorded, and are not accepted more than 6 hours after the event.
46+
/// To post metering records for customers, SaaS applications call <c>BatchMeterUsage</c>,
47+
/// which is used for metering SaaS flexible consumption pricing (FCP). Identical requests
48+
/// are idempotent and can be retried with the same records or a subset of records. Each
49+
/// <c>BatchMeterUsage</c> request is for only one product. If you want to meter usage
50+
/// for multiple products, you must make multiple <c>BatchMeterUsage</c> calls.
5151
/// </para>
5252
///
5353
/// <para>
54-
/// <c>BatchMeterUsage</c> can process up to 25 <c>UsageRecords</c> at a time.
54+
/// Usage records should be submitted in quick succession following a recorded event.
55+
/// Usage records aren't accepted 6 hours or more after an event.
5556
/// </para>
5657
///
5758
/// <para>
58-
/// A <c>UsageRecord</c> can optionally include multiple usage allocations, to provide
59-
/// customers with usage data split into buckets by tags that you define (or allow the
60-
/// customer to define).
59+
/// <c>BatchMeterUsage</c> can process up to 25 <c>UsageRecords</c> at a time, and each
60+
/// request must be less than 1 MB in size. Optionally, you can have multiple usage allocations
61+
/// for usage data that's split into buckets according to predefined tags.
6162
/// </para>
6263
///
6364
/// <para>
64-
/// <c>BatchMeterUsage</c> returns a list of <c>UsageRecordResult</c> objects, showing
65-
/// the result for each <c>UsageRecord</c>, as well as a list of <c>UnprocessedRecords</c>,
66-
/// indicating errors in the service side that you should retry.
65+
/// <c>BatchMeterUsage</c> returns a list of <c>UsageRecordResult</c> objects, which
66+
/// have each <c>UsageRecord</c>. It also returns a list of <c>UnprocessedRecords</c>,
67+
/// which indicate errors on the service side that should be retried.
6768
/// </para>
6869
///
6970
/// <para>
70-
/// <c>BatchMeterUsage</c> requests must be less than 1MB in size.
71+
/// For Amazon Web Services Regions that support <c>BatchMeterUsage</c>, see <a href="https://docs.aws.amazon.com/marketplace/latest/APIReference/metering-regions.html#batchmeterusage-region-support">BatchMeterUsage
72+
/// Region support</a>.
7173
/// </para>
7274
/// <note>
7375
/// <para>
74-
/// For an example of using <c>BatchMeterUsage</c>, see <a href="https://docs.aws.amazon.com/marketplace/latest/userguide/saas-code-examples.html#saas-batchmeterusage-example">
75-
/// BatchMeterUsage code example</a> in the <i>AWS Marketplace Seller Guide</i>.
76+
/// For an example of <c>BatchMeterUsage</c>, see <a href="https://docs.aws.amazon.com/marketplace/latest/userguide/saas-code-examples.html#saas-batchmeterusage-example">
77+
/// BatchMeterUsage code example</a> in the <i>Amazon Web Services Marketplace Seller
78+
/// Guide</i>.
7679
/// </para>
7780
/// </note>
7881
/// </summary>
@@ -84,8 +87,9 @@ public partial class BatchMeterUsageRequest : AmazonAWSMarketplaceMeteringReques
8487
/// <summary>
8588
/// Gets and sets the property ProductCode.
8689
/// <para>
87-
/// Product code is used to uniquely identify a product in AWS Marketplace. The product
88-
/// code should be the same as the one used during the publishing of a new product.
90+
/// Product code is used to uniquely identify a product in Amazon Web Services Marketplace.
91+
/// The product code should be the same as the one used during the publishing of a new
92+
/// product.
8993
/// </para>
9094
/// </summary>
9195
[AWSProperty(Required=true, Min=1, Max=255)]

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/BatchMeterUsageResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public partial class BatchMeterUsageResponse : AmazonWebServiceResponse
4242
/// Gets and sets the property Results.
4343
/// <para>
4444
/// Contains all <c>UsageRecords</c> processed by <c>BatchMeterUsage</c>. These records
45-
/// were either honored by AWS Marketplace Metering Service or were invalid. Invalid records
46-
/// should be fixed before being resubmitted.
45+
/// were either honored by Amazon Web Services Marketplace Metering Service or were invalid.
46+
/// Invalid records should be fixed before being resubmitted.
4747
/// </para>
4848
/// </summary>
4949
public List<UsageRecordResult> Results

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/Internal/MarshallTransformations/UsageRecordMarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public void Marshall(UsageRecord requestObject, JsonMarshallerContext context)
4848
{
4949
if(requestObject == null)
5050
return;
51+
if(requestObject.IsSetCustomerAWSAccountId())
52+
{
53+
context.Writer.WritePropertyName("CustomerAWSAccountId");
54+
context.Writer.Write(requestObject.CustomerAWSAccountId);
55+
}
56+
5157
if(requestObject.IsSetCustomerIdentifier())
5258
{
5359
context.Writer.WritePropertyName("CustomerIdentifier");

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/Internal/MarshallTransformations/UsageRecordUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public UsageRecord Unmarshall(JsonUnmarshallerContext context)
6666
int targetDepth = context.CurrentDepth;
6767
while (context.ReadAtDepth(targetDepth))
6868
{
69+
if (context.TestExpression("CustomerAWSAccountId", targetDepth))
70+
{
71+
var unmarshaller = StringUnmarshaller.Instance;
72+
unmarshalledObject.CustomerAWSAccountId = unmarshaller.Unmarshall(context);
73+
continue;
74+
}
6975
if (context.TestExpression("CustomerIdentifier", targetDepth))
7076
{
7177
var unmarshaller = StringUnmarshaller.Instance;

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/InternalServiceErrorException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Amazon.AWSMarketplaceMetering.Model
3131
{
3232
/// <summary>
3333
/// An internal error has occurred. Retry your request. If the problem persists, post
34-
/// a message with details on the AWS forums.
34+
/// a message with details on the Amazon Web Services forums.
3535
/// </summary>
3636
#if !NETSTANDARD
3737
[Serializable]

sdk/src/Services/AWSMarketplaceMetering/Generated/Model/InvalidEndpointRegionException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
namespace Amazon.AWSMarketplaceMetering.Model
3131
{
3232
/// <summary>
33-
/// The endpoint being called is in a AWS Region different from your EC2 instance, ECS
34-
/// task, or EKS pod. The Region of the Metering Service endpoint and the AWS Region of
35-
/// the resource must match.
33+
/// The endpoint being called is in a Amazon Web Services Region different from your EC2
34+
/// instance, ECS task, or EKS pod. The Region of the Metering Service endpoint and the
35+
/// Amazon Web Services Region of the resource must match.
3636
/// </summary>
3737
#if !NETSTANDARD
3838
[Serializable]

0 commit comments

Comments
 (0)