Closed ayeshLK closed 1 month ago
public type ConnectionConfig record {|
Region region;
AuthConfig auth;
|};
public enum Region {
US_EAST_1 = "us-east-1"
// other regions
}
public type AuthConfig record {|
string accessKeyId;
string secretAccessKey;
string sessionToken?;
|};
public type Client distinct client object {
remote function resolveCustomer(string registrationToken) returns ResolveCustomerResponse|Error;
remote function batchMeterUsage(*BatchMeterUsageRequest request) returns BatchMeterUsageResponse|Error;
};
public type ResolveCustomerResponse record {|
string customerAWSAccountId;
string customerIdentifier;
string productCode;
|};
public type BatchMeterUsageRequest record {|
@constraint:String {
pattern: re `^[-a-zA-Z0-9/=:_.@]{1,255}$`
}
string productCode;
@constraint:Array {
maxLength: 25
}
UsageRecord[] usageRecords = [];
|};
public type UsageRecord record {|
@constraint:String {
pattern: re `[\s\S]{1,255}$`
}
string customerIdentifier;
@constraint:String {
pattern: re `[\s\S]{1,255}$`
}
string dimension;
time:Utc timestamp;
@constraint:Int {
minValue: 0,
maxValue: 2147483647
}
int quantity?;
@constraint:Array {
minLength: 1,
maxLength: 2500
}
UsageAllocation[] usageAllocations?;
|};
public type UsageAllocation record {|
@constraint:Int {
minValue: 0,
maxValue: 2147483647
}
int allocatedUsageQuantity;
@constraint:Array {
minLength: 1,
maxLength: 5
}
Tag[] tags;
|};
public type Tag record {|
string 'key;
string value;
|};
public type BatchMeterUsageResponse record {|
UsageRecordResult[] results;
UsageRecord[] unprocessedRecords;
|};
public type UsageRecordResult record {|
string meteringRecordId?;
UsageRecordStatus status?;
UsageRecord usageRecord?;
|};
public enum UsageRecordStatus {
SUCCESS = "Success",
CUSTOMER_NOT_SUBSCRIBED = "CustomerNotSubscribed",
DUPLICATE_RECORD = "DuplicateRecord"
}
public type Error distinct error;
Completed this with the following PRs. Hence, closing.
Description:
Following APIs should be supported:
Related to: #740
[1] - https://docs.aws.amazon.com/marketplacemetering/latest/APIReference/API_ResolveCustomer.html [2] - https://docs.aws.amazon.com/marketplacemetering/latest/APIReference/API_BatchMeterUsage.html