-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a Ballerina connector for AWS Marketplace Metering service #6865
Comments
Initial design for the AWS Marketplace Metering connector1. ConfigurationsConnectionConfigpublic type ConnectionConfig record {|
Region region;
AuthConfig auth;
|}; Regionpublic enum Region {
US_EAST_1 = "us-east-1"
// other regions
} AuthConfigpublic type AuthConfig record {|
string accessKeyId;
string secretAccessKey;
string sessionToken?;
|}; 2. Client APIpublic type Client distinct client object {
remote function resolveCustomer(string registrationToken) returns ResolveCustomerResponse|Error;
remote function batchMeterUsage(*BatchMeterUsageRequest request) returns BatchMeterUsageResponse|Error;
}; 3. Types related resolve-customer APIpublic type ResolveCustomerResponse record {|
string customerAWSAccountId;
string customerIdentifier;
string productCode;
|}; 4. Types related to batch-meter-usage APIpublic 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"
} 5. Errorspublic type Error distinct error; |
Completed this with the following PRs. Hence, closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: