-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
errors.go
152 lines (131 loc) · 6.56 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package marketplacemetering
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeCustomerNotEntitledException for service response error code
// "CustomerNotEntitledException".
//
// Exception thrown when the customer does not have a valid subscription for
// the product.
ErrCodeCustomerNotEntitledException = "CustomerNotEntitledException"
// ErrCodeDisabledApiException for service response error code
// "DisabledApiException".
//
// The API is disabled in the Region.
ErrCodeDisabledApiException = "DisabledApiException"
// ErrCodeDuplicateRequestException for service response error code
// "DuplicateRequestException".
//
// A metering record has already been emitted by the same EC2 instance, ECS
// task, or EKS pod for the given {usageDimension, timestamp} with a different
// usageQuantity.
ErrCodeDuplicateRequestException = "DuplicateRequestException"
// ErrCodeExpiredTokenException for service response error code
// "ExpiredTokenException".
//
// The submitted registration token has expired. This can happen if the buyer's
// browser takes too long to redirect to your page, the buyer has resubmitted
// the registration token, or your application has held on to the registration
// token for too long. Your SaaS registration website should redeem this token
// as soon as it is submitted by the buyer's browser.
ErrCodeExpiredTokenException = "ExpiredTokenException"
// ErrCodeInternalServiceErrorException for service response error code
// "InternalServiceErrorException".
//
// An internal error has occurred. Retry your request. If the problem persists,
// post a message with details on the AWS forums.
ErrCodeInternalServiceErrorException = "InternalServiceErrorException"
// ErrCodeInvalidCustomerIdentifierException for service response error code
// "InvalidCustomerIdentifierException".
//
// You have metered usage for a CustomerIdentifier that does not exist.
ErrCodeInvalidCustomerIdentifierException = "InvalidCustomerIdentifierException"
// ErrCodeInvalidEndpointRegionException for service response error code
// "InvalidEndpointRegionException".
//
// The endpoint being called is in a AWS Region different from your EC2 instance,
// ECS task, or EKS pod. The Region of the Metering Service endpoint and the
// AWS Region of the resource must match.
ErrCodeInvalidEndpointRegionException = "InvalidEndpointRegionException"
// ErrCodeInvalidProductCodeException for service response error code
// "InvalidProductCodeException".
//
// The product code passed does not match the product code used for publishing
// the product.
ErrCodeInvalidProductCodeException = "InvalidProductCodeException"
// ErrCodeInvalidPublicKeyVersionException for service response error code
// "InvalidPublicKeyVersionException".
//
// Public Key version is invalid.
ErrCodeInvalidPublicKeyVersionException = "InvalidPublicKeyVersionException"
// ErrCodeInvalidRegionException for service response error code
// "InvalidRegionException".
//
// RegisterUsage must be called in the same AWS Region the ECS task was launched
// in. This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”)
// when calling RegisterUsage.
ErrCodeInvalidRegionException = "InvalidRegionException"
// ErrCodeInvalidTagException for service response error code
// "InvalidTagException".
//
// The tag is invalid, or the number of tags is greater than 5.
ErrCodeInvalidTagException = "InvalidTagException"
// ErrCodeInvalidTokenException for service response error code
// "InvalidTokenException".
//
// Registration token is invalid.
ErrCodeInvalidTokenException = "InvalidTokenException"
// ErrCodeInvalidUsageAllocationsException for service response error code
// "InvalidUsageAllocationsException".
//
// The usage allocation objects are invalid, or the number of allocations is
// greater than 500 for a single usage record.
ErrCodeInvalidUsageAllocationsException = "InvalidUsageAllocationsException"
// ErrCodeInvalidUsageDimensionException for service response error code
// "InvalidUsageDimensionException".
//
// The usage dimension does not match one of the UsageDimensions associated
// with products.
ErrCodeInvalidUsageDimensionException = "InvalidUsageDimensionException"
// ErrCodePlatformNotSupportedException for service response error code
// "PlatformNotSupportedException".
//
// AWS Marketplace does not support metering usage from the underlying platform.
// Currently, Amazon ECS, Amazon EKS, and AWS Fargate are supported.
ErrCodePlatformNotSupportedException = "PlatformNotSupportedException"
// ErrCodeThrottlingException for service response error code
// "ThrottlingException".
//
// The calls to the API are throttled.
ErrCodeThrottlingException = "ThrottlingException"
// ErrCodeTimestampOutOfBoundsException for service response error code
// "TimestampOutOfBoundsException".
//
// The timestamp value passed in the UsageRecord is out of allowed range.
//
// For BatchMeterUsage, if any of the records are outside of the allowed range,
// the entire batch is not processed. You must remove invalid records and try
// again.
ErrCodeTimestampOutOfBoundsException = "TimestampOutOfBoundsException"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"CustomerNotEntitledException": newErrorCustomerNotEntitledException,
"DisabledApiException": newErrorDisabledApiException,
"DuplicateRequestException": newErrorDuplicateRequestException,
"ExpiredTokenException": newErrorExpiredTokenException,
"InternalServiceErrorException": newErrorInternalServiceErrorException,
"InvalidCustomerIdentifierException": newErrorInvalidCustomerIdentifierException,
"InvalidEndpointRegionException": newErrorInvalidEndpointRegionException,
"InvalidProductCodeException": newErrorInvalidProductCodeException,
"InvalidPublicKeyVersionException": newErrorInvalidPublicKeyVersionException,
"InvalidRegionException": newErrorInvalidRegionException,
"InvalidTagException": newErrorInvalidTagException,
"InvalidTokenException": newErrorInvalidTokenException,
"InvalidUsageAllocationsException": newErrorInvalidUsageAllocationsException,
"InvalidUsageDimensionException": newErrorInvalidUsageDimensionException,
"PlatformNotSupportedException": newErrorPlatformNotSupportedException,
"ThrottlingException": newErrorThrottlingException,
"TimestampOutOfBoundsException": newErrorTimestampOutOfBoundsException,
}