@aws-sdk/client-marketplace-agreement 3.463.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +249 -0
- package/dist-cjs/MarketplaceAgreement.js +17 -0
- package/dist-cjs/MarketplaceAgreementClient.js +43 -0
- package/dist-cjs/commands/DescribeAgreementCommand.js +51 -0
- package/dist-cjs/commands/GetAgreementTermsCommand.js +51 -0
- package/dist-cjs/commands/SearchAgreementsCommand.js +51 -0
- package/dist-cjs/commands/index.js +6 -0
- package/dist-cjs/endpoint/EndpointParameters.js +12 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +12 -0
- package/dist-cjs/models/MarketplaceAgreementServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +137 -0
- package/dist-cjs/pagination/GetAgreementTermsPaginator.js +29 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/SearchAgreementsPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +6 -0
- package/dist-cjs/protocols/Aws_json1_0.js +420 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +50 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +24 -0
- package/dist-cjs/runtimeExtensions.js +22 -0
- package/dist-es/MarketplaceAgreement.js +13 -0
- package/dist-es/MarketplaceAgreementClient.js +39 -0
- package/dist-es/commands/DescribeAgreementCommand.js +47 -0
- package/dist-es/commands/GetAgreementTermsCommand.js +47 -0
- package/dist-es/commands/SearchAgreementsCommand.js +47 -0
- package/dist-es/commands/index.js +3 -0
- package/dist-es/endpoint/EndpointParameters.js +8 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +7 -0
- package/dist-es/models/MarketplaceAgreementServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +129 -0
- package/dist-es/pagination/GetAgreementTermsPaginator.js +25 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/SearchAgreementsPaginator.js +25 -0
- package/dist-es/pagination/index.js +3 -0
- package/dist-es/protocols/Aws_json1_0.js +411 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +45 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +20 -0
- package/dist-es/runtimeExtensions.js +18 -0
- package/dist-types/MarketplaceAgreement.d.ts +51 -0
- package/dist-types/MarketplaceAgreementClient.d.ts +192 -0
- package/dist-types/commands/DescribeAgreementCommand.d.ts +112 -0
- package/dist-types/commands/GetAgreementTermsCommand.d.ts +235 -0
- package/dist-types/commands/SearchAgreementsCommand.d.ts +213 -0
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +35 -0
- package/dist-types/models/MarketplaceAgreementServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1350 -0
- package/dist-types/pagination/GetAgreementTermsPaginator.d.ts +7 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/SearchAgreementsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +3 -0
- package/dist-types/protocols/Aws_json1_0.d.ts +29 -0
- package/dist-types/runtimeConfig.browser.d.ts +46 -0
- package/dist-types/runtimeConfig.d.ts +46 -0
- package/dist-types/runtimeConfig.native.d.ts +45 -0
- package/dist-types/runtimeConfig.shared.d.ts +19 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/MarketplaceAgreement.d.ts +58 -0
- package/dist-types/ts3.4/MarketplaceAgreementClient.d.ts +139 -0
- package/dist-types/ts3.4/commands/DescribeAgreementCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetAgreementTermsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/SearchAgreementsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +10 -0
- package/dist-types/ts3.4/models/MarketplaceAgreementServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +458 -0
- package/dist-types/ts3.4/pagination/GetAgreementTermsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/SearchAgreementsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +3 -0
- package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +41 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +99 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +90 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
- package/package.json +102 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
|
|
2
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { MarketplaceAgreementServiceException as __BaseException } from "../models/MarketplaceAgreementServiceException";
|
|
5
|
+
import { AccessDeniedException, InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_DescribeAgreementCommand = async (input, context) => {
|
|
7
|
+
const headers = sharedHeaders("DescribeAgreement");
|
|
8
|
+
let body;
|
|
9
|
+
body = JSON.stringify(_json(input));
|
|
10
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
11
|
+
};
|
|
12
|
+
export const se_GetAgreementTermsCommand = async (input, context) => {
|
|
13
|
+
const headers = sharedHeaders("GetAgreementTerms");
|
|
14
|
+
let body;
|
|
15
|
+
body = JSON.stringify(_json(input));
|
|
16
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
17
|
+
};
|
|
18
|
+
export const se_SearchAgreementsCommand = async (input, context) => {
|
|
19
|
+
const headers = sharedHeaders("SearchAgreements");
|
|
20
|
+
let body;
|
|
21
|
+
body = JSON.stringify(_json(input));
|
|
22
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
23
|
+
};
|
|
24
|
+
export const de_DescribeAgreementCommand = async (output, context) => {
|
|
25
|
+
if (output.statusCode >= 300) {
|
|
26
|
+
return de_DescribeAgreementCommandError(output, context);
|
|
27
|
+
}
|
|
28
|
+
const data = await parseBody(output.body, context);
|
|
29
|
+
let contents = {};
|
|
30
|
+
contents = de_DescribeAgreementOutput(data, context);
|
|
31
|
+
const response = {
|
|
32
|
+
$metadata: deserializeMetadata(output),
|
|
33
|
+
...contents,
|
|
34
|
+
};
|
|
35
|
+
return response;
|
|
36
|
+
};
|
|
37
|
+
const de_DescribeAgreementCommandError = async (output, context) => {
|
|
38
|
+
const parsedOutput = {
|
|
39
|
+
...output,
|
|
40
|
+
body: await parseErrorBody(output.body, context),
|
|
41
|
+
};
|
|
42
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
43
|
+
switch (errorCode) {
|
|
44
|
+
case "AccessDeniedException":
|
|
45
|
+
case "com.amazonaws.marketplaceagreement#AccessDeniedException":
|
|
46
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
47
|
+
case "InternalServerException":
|
|
48
|
+
case "com.amazonaws.marketplaceagreement#InternalServerException":
|
|
49
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
50
|
+
case "ResourceNotFoundException":
|
|
51
|
+
case "com.amazonaws.marketplaceagreement#ResourceNotFoundException":
|
|
52
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
53
|
+
case "ThrottlingException":
|
|
54
|
+
case "com.amazonaws.marketplaceagreement#ThrottlingException":
|
|
55
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
56
|
+
case "ValidationException":
|
|
57
|
+
case "com.amazonaws.marketplaceagreement#ValidationException":
|
|
58
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
59
|
+
default:
|
|
60
|
+
const parsedBody = parsedOutput.body;
|
|
61
|
+
return throwDefaultError({
|
|
62
|
+
output,
|
|
63
|
+
parsedBody,
|
|
64
|
+
errorCode,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
export const de_GetAgreementTermsCommand = async (output, context) => {
|
|
69
|
+
if (output.statusCode >= 300) {
|
|
70
|
+
return de_GetAgreementTermsCommandError(output, context);
|
|
71
|
+
}
|
|
72
|
+
const data = await parseBody(output.body, context);
|
|
73
|
+
let contents = {};
|
|
74
|
+
contents = de_GetAgreementTermsOutput(data, context);
|
|
75
|
+
const response = {
|
|
76
|
+
$metadata: deserializeMetadata(output),
|
|
77
|
+
...contents,
|
|
78
|
+
};
|
|
79
|
+
return response;
|
|
80
|
+
};
|
|
81
|
+
const de_GetAgreementTermsCommandError = async (output, context) => {
|
|
82
|
+
const parsedOutput = {
|
|
83
|
+
...output,
|
|
84
|
+
body: await parseErrorBody(output.body, context),
|
|
85
|
+
};
|
|
86
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
87
|
+
switch (errorCode) {
|
|
88
|
+
case "AccessDeniedException":
|
|
89
|
+
case "com.amazonaws.marketplaceagreement#AccessDeniedException":
|
|
90
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
91
|
+
case "InternalServerException":
|
|
92
|
+
case "com.amazonaws.marketplaceagreement#InternalServerException":
|
|
93
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
94
|
+
case "ResourceNotFoundException":
|
|
95
|
+
case "com.amazonaws.marketplaceagreement#ResourceNotFoundException":
|
|
96
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
97
|
+
case "ThrottlingException":
|
|
98
|
+
case "com.amazonaws.marketplaceagreement#ThrottlingException":
|
|
99
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
100
|
+
case "ValidationException":
|
|
101
|
+
case "com.amazonaws.marketplaceagreement#ValidationException":
|
|
102
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
103
|
+
default:
|
|
104
|
+
const parsedBody = parsedOutput.body;
|
|
105
|
+
return throwDefaultError({
|
|
106
|
+
output,
|
|
107
|
+
parsedBody,
|
|
108
|
+
errorCode,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export const de_SearchAgreementsCommand = async (output, context) => {
|
|
113
|
+
if (output.statusCode >= 300) {
|
|
114
|
+
return de_SearchAgreementsCommandError(output, context);
|
|
115
|
+
}
|
|
116
|
+
const data = await parseBody(output.body, context);
|
|
117
|
+
let contents = {};
|
|
118
|
+
contents = de_SearchAgreementsOutput(data, context);
|
|
119
|
+
const response = {
|
|
120
|
+
$metadata: deserializeMetadata(output),
|
|
121
|
+
...contents,
|
|
122
|
+
};
|
|
123
|
+
return response;
|
|
124
|
+
};
|
|
125
|
+
const de_SearchAgreementsCommandError = async (output, context) => {
|
|
126
|
+
const parsedOutput = {
|
|
127
|
+
...output,
|
|
128
|
+
body: await parseErrorBody(output.body, context),
|
|
129
|
+
};
|
|
130
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
131
|
+
switch (errorCode) {
|
|
132
|
+
case "AccessDeniedException":
|
|
133
|
+
case "com.amazonaws.marketplaceagreement#AccessDeniedException":
|
|
134
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
135
|
+
case "InternalServerException":
|
|
136
|
+
case "com.amazonaws.marketplaceagreement#InternalServerException":
|
|
137
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
138
|
+
case "ThrottlingException":
|
|
139
|
+
case "com.amazonaws.marketplaceagreement#ThrottlingException":
|
|
140
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
141
|
+
case "ValidationException":
|
|
142
|
+
case "com.amazonaws.marketplaceagreement#ValidationException":
|
|
143
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
144
|
+
default:
|
|
145
|
+
const parsedBody = parsedOutput.body;
|
|
146
|
+
return throwDefaultError({
|
|
147
|
+
output,
|
|
148
|
+
parsedBody,
|
|
149
|
+
errorCode,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
154
|
+
const body = parsedOutput.body;
|
|
155
|
+
const deserialized = _json(body);
|
|
156
|
+
const exception = new AccessDeniedException({
|
|
157
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
158
|
+
...deserialized,
|
|
159
|
+
});
|
|
160
|
+
return __decorateServiceException(exception, body);
|
|
161
|
+
};
|
|
162
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
163
|
+
const body = parsedOutput.body;
|
|
164
|
+
const deserialized = _json(body);
|
|
165
|
+
const exception = new InternalServerException({
|
|
166
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
167
|
+
...deserialized,
|
|
168
|
+
});
|
|
169
|
+
return __decorateServiceException(exception, body);
|
|
170
|
+
};
|
|
171
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
172
|
+
const body = parsedOutput.body;
|
|
173
|
+
const deserialized = _json(body);
|
|
174
|
+
const exception = new ResourceNotFoundException({
|
|
175
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
176
|
+
...deserialized,
|
|
177
|
+
});
|
|
178
|
+
return __decorateServiceException(exception, body);
|
|
179
|
+
};
|
|
180
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
181
|
+
const body = parsedOutput.body;
|
|
182
|
+
const deserialized = _json(body);
|
|
183
|
+
const exception = new ThrottlingException({
|
|
184
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
185
|
+
...deserialized,
|
|
186
|
+
});
|
|
187
|
+
return __decorateServiceException(exception, body);
|
|
188
|
+
};
|
|
189
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
190
|
+
const body = parsedOutput.body;
|
|
191
|
+
const deserialized = _json(body);
|
|
192
|
+
const exception = new ValidationException({
|
|
193
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
194
|
+
...deserialized,
|
|
195
|
+
});
|
|
196
|
+
return __decorateServiceException(exception, body);
|
|
197
|
+
};
|
|
198
|
+
const de_AcceptedTerm = (output, context) => {
|
|
199
|
+
if (output.byolPricingTerm != null) {
|
|
200
|
+
return {
|
|
201
|
+
byolPricingTerm: _json(output.byolPricingTerm),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (output.configurableUpfrontPricingTerm != null) {
|
|
205
|
+
return {
|
|
206
|
+
configurableUpfrontPricingTerm: _json(output.configurableUpfrontPricingTerm),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (output.fixedUpfrontPricingTerm != null) {
|
|
210
|
+
return {
|
|
211
|
+
fixedUpfrontPricingTerm: _json(output.fixedUpfrontPricingTerm),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
if (output.freeTrialPricingTerm != null) {
|
|
215
|
+
return {
|
|
216
|
+
freeTrialPricingTerm: _json(output.freeTrialPricingTerm),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
if (output.legalTerm != null) {
|
|
220
|
+
return {
|
|
221
|
+
legalTerm: _json(output.legalTerm),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (output.paymentScheduleTerm != null) {
|
|
225
|
+
return {
|
|
226
|
+
paymentScheduleTerm: de_PaymentScheduleTerm(output.paymentScheduleTerm, context),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (output.recurringPaymentTerm != null) {
|
|
230
|
+
return {
|
|
231
|
+
recurringPaymentTerm: _json(output.recurringPaymentTerm),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
if (output.renewalTerm != null) {
|
|
235
|
+
return {
|
|
236
|
+
renewalTerm: _json(output.renewalTerm),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (output.supportTerm != null) {
|
|
240
|
+
return {
|
|
241
|
+
supportTerm: _json(output.supportTerm),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (output.usageBasedPricingTerm != null) {
|
|
245
|
+
return {
|
|
246
|
+
usageBasedPricingTerm: _json(output.usageBasedPricingTerm),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (output.validityTerm != null) {
|
|
250
|
+
return {
|
|
251
|
+
validityTerm: de_ValidityTerm(output.validityTerm, context),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return { $unknown: Object.entries(output)[0] };
|
|
255
|
+
};
|
|
256
|
+
const de_AcceptedTermList = (output, context) => {
|
|
257
|
+
const retVal = (output || [])
|
|
258
|
+
.filter((e) => e != null)
|
|
259
|
+
.map((entry) => {
|
|
260
|
+
return de_AcceptedTerm(__expectUnion(entry), context);
|
|
261
|
+
});
|
|
262
|
+
return retVal;
|
|
263
|
+
};
|
|
264
|
+
const de_AgreementViewSummary = (output, context) => {
|
|
265
|
+
return take(output, {
|
|
266
|
+
acceptanceTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
267
|
+
acceptor: _json,
|
|
268
|
+
agreementId: __expectString,
|
|
269
|
+
agreementType: __expectString,
|
|
270
|
+
endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
271
|
+
proposalSummary: _json,
|
|
272
|
+
proposer: _json,
|
|
273
|
+
startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
274
|
+
status: __expectString,
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
const de_AgreementViewSummaryList = (output, context) => {
|
|
278
|
+
const retVal = (output || [])
|
|
279
|
+
.filter((e) => e != null)
|
|
280
|
+
.map((entry) => {
|
|
281
|
+
return de_AgreementViewSummary(entry, context);
|
|
282
|
+
});
|
|
283
|
+
return retVal;
|
|
284
|
+
};
|
|
285
|
+
const de_DescribeAgreementOutput = (output, context) => {
|
|
286
|
+
return take(output, {
|
|
287
|
+
acceptanceTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
288
|
+
acceptor: _json,
|
|
289
|
+
agreementId: __expectString,
|
|
290
|
+
agreementType: __expectString,
|
|
291
|
+
endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
292
|
+
estimatedCharges: _json,
|
|
293
|
+
proposalSummary: _json,
|
|
294
|
+
proposer: _json,
|
|
295
|
+
startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
296
|
+
status: __expectString,
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
const de_GetAgreementTermsOutput = (output, context) => {
|
|
300
|
+
return take(output, {
|
|
301
|
+
acceptedTerms: (_) => de_AcceptedTermList(_, context),
|
|
302
|
+
nextToken: __expectString,
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
const de_PaymentScheduleTerm = (output, context) => {
|
|
306
|
+
return take(output, {
|
|
307
|
+
currencyCode: __expectString,
|
|
308
|
+
schedule: (_) => de_ScheduleList(_, context),
|
|
309
|
+
type: __expectString,
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
const de_ScheduleItem = (output, context) => {
|
|
313
|
+
return take(output, {
|
|
314
|
+
chargeAmount: __expectString,
|
|
315
|
+
chargeDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
const de_ScheduleList = (output, context) => {
|
|
319
|
+
const retVal = (output || [])
|
|
320
|
+
.filter((e) => e != null)
|
|
321
|
+
.map((entry) => {
|
|
322
|
+
return de_ScheduleItem(entry, context);
|
|
323
|
+
});
|
|
324
|
+
return retVal;
|
|
325
|
+
};
|
|
326
|
+
const de_SearchAgreementsOutput = (output, context) => {
|
|
327
|
+
return take(output, {
|
|
328
|
+
agreementViewSummaries: (_) => de_AgreementViewSummaryList(_, context),
|
|
329
|
+
nextToken: __expectString,
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
const de_ValidityTerm = (output, context) => {
|
|
333
|
+
return take(output, {
|
|
334
|
+
agreementDuration: __expectString,
|
|
335
|
+
agreementEndDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
336
|
+
agreementStartDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
337
|
+
type: __expectString,
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
const deserializeMetadata = (output) => ({
|
|
341
|
+
httpStatusCode: output.statusCode,
|
|
342
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
343
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
344
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
345
|
+
});
|
|
346
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
347
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
348
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
349
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
350
|
+
const contents = {
|
|
351
|
+
protocol,
|
|
352
|
+
hostname,
|
|
353
|
+
port,
|
|
354
|
+
method: "POST",
|
|
355
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
356
|
+
headers,
|
|
357
|
+
};
|
|
358
|
+
if (resolvedHostname !== undefined) {
|
|
359
|
+
contents.hostname = resolvedHostname;
|
|
360
|
+
}
|
|
361
|
+
if (body !== undefined) {
|
|
362
|
+
contents.body = body;
|
|
363
|
+
}
|
|
364
|
+
return new __HttpRequest(contents);
|
|
365
|
+
};
|
|
366
|
+
function sharedHeaders(operation) {
|
|
367
|
+
return {
|
|
368
|
+
"content-type": "application/x-amz-json-1.0",
|
|
369
|
+
"x-amz-target": `AWSMPCommerceService_v20200301.${operation}`,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
373
|
+
if (encoded.length) {
|
|
374
|
+
return JSON.parse(encoded);
|
|
375
|
+
}
|
|
376
|
+
return {};
|
|
377
|
+
});
|
|
378
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
379
|
+
const value = await parseBody(errorBody, context);
|
|
380
|
+
value.message = value.message ?? value.Message;
|
|
381
|
+
return value;
|
|
382
|
+
};
|
|
383
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
384
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
385
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
386
|
+
let cleanValue = rawValue;
|
|
387
|
+
if (typeof cleanValue === "number") {
|
|
388
|
+
cleanValue = cleanValue.toString();
|
|
389
|
+
}
|
|
390
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
391
|
+
cleanValue = cleanValue.split(",")[0];
|
|
392
|
+
}
|
|
393
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
394
|
+
cleanValue = cleanValue.split(":")[0];
|
|
395
|
+
}
|
|
396
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
397
|
+
cleanValue = cleanValue.split("#")[1];
|
|
398
|
+
}
|
|
399
|
+
return cleanValue;
|
|
400
|
+
};
|
|
401
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
402
|
+
if (headerKey !== undefined) {
|
|
403
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
404
|
+
}
|
|
405
|
+
if (data.code !== undefined) {
|
|
406
|
+
return sanitizeErrorCode(data.code);
|
|
407
|
+
}
|
|
408
|
+
if (data["__type"] !== undefined) {
|
|
409
|
+
return sanitizeErrorCode(data["__type"]);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
3
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
4
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
5
|
+
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
6
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
7
|
+
import { Hash } from "@smithy/hash-node";
|
|
8
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
9
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
10
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
11
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
12
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
13
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
14
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
15
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
16
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
17
|
+
export const getRuntimeConfig = (config) => {
|
|
18
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
19
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
22
|
+
awsCheckVersion(process.version);
|
|
23
|
+
return {
|
|
24
|
+
...clientSharedValues,
|
|
25
|
+
...config,
|
|
26
|
+
runtime: "node",
|
|
27
|
+
defaultsMode,
|
|
28
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
30
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
31
|
+
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
33
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
34
|
+
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
|
|
35
|
+
retryMode: config?.retryMode ??
|
|
36
|
+
loadNodeConfig({
|
|
37
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
38
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
39
|
+
}),
|
|
40
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
|
43
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
2
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
3
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
5
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
6
|
+
export const getRuntimeConfig = (config) => {
|
|
7
|
+
return {
|
|
8
|
+
apiVersion: "2020-03-01",
|
|
9
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
10
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
11
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
13
|
+
extensions: config?.extensions ?? [],
|
|
14
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
15
|
+
serviceId: config?.serviceId ?? "Marketplace Agreement",
|
|
16
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
const asPartial = (t) => t;
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = {
|
|
7
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
};
|
|
11
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
|
+
return {
|
|
13
|
+
...runtimeConfig,
|
|
14
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { DescribeAgreementCommandInput, DescribeAgreementCommandOutput } from "./commands/DescribeAgreementCommand";
|
|
3
|
+
import { GetAgreementTermsCommandInput, GetAgreementTermsCommandOutput } from "./commands/GetAgreementTermsCommand";
|
|
4
|
+
import { SearchAgreementsCommandInput, SearchAgreementsCommandOutput } from "./commands/SearchAgreementsCommand";
|
|
5
|
+
import { MarketplaceAgreementClient } from "./MarketplaceAgreementClient";
|
|
6
|
+
export interface MarketplaceAgreement {
|
|
7
|
+
/**
|
|
8
|
+
* @see {@link DescribeAgreementCommand}
|
|
9
|
+
*/
|
|
10
|
+
describeAgreement(args: DescribeAgreementCommandInput, options?: __HttpHandlerOptions): Promise<DescribeAgreementCommandOutput>;
|
|
11
|
+
describeAgreement(args: DescribeAgreementCommandInput, cb: (err: any, data?: DescribeAgreementCommandOutput) => void): void;
|
|
12
|
+
describeAgreement(args: DescribeAgreementCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeAgreementCommandOutput) => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* @see {@link GetAgreementTermsCommand}
|
|
15
|
+
*/
|
|
16
|
+
getAgreementTerms(args: GetAgreementTermsCommandInput, options?: __HttpHandlerOptions): Promise<GetAgreementTermsCommandOutput>;
|
|
17
|
+
getAgreementTerms(args: GetAgreementTermsCommandInput, cb: (err: any, data?: GetAgreementTermsCommandOutput) => void): void;
|
|
18
|
+
getAgreementTerms(args: GetAgreementTermsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetAgreementTermsCommandOutput) => void): void;
|
|
19
|
+
/**
|
|
20
|
+
* @see {@link SearchAgreementsCommand}
|
|
21
|
+
*/
|
|
22
|
+
searchAgreements(args: SearchAgreementsCommandInput, options?: __HttpHandlerOptions): Promise<SearchAgreementsCommandOutput>;
|
|
23
|
+
searchAgreements(args: SearchAgreementsCommandInput, cb: (err: any, data?: SearchAgreementsCommandOutput) => void): void;
|
|
24
|
+
searchAgreements(args: SearchAgreementsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SearchAgreementsCommandOutput) => void): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
* <p>AWS Marketplace is a curated digital catalog that customers can use to find, buy, deploy, and manage third-party software, data, and services to build solutions and run their businesses. The AWS Marketplace Agreement Service provides an API interface that helps AWS Marketplace sellers manage their product-related agreements, including listing, searching, and filtering agreements.</p>
|
|
29
|
+
* <p>To manage agreements in AWS Marketplace, you must ensure that your AWS Identity and
|
|
30
|
+
* Access Management (IAM) policies and roles are set up. The user must have the required
|
|
31
|
+
* policies/permissions that allow them to carry out the actions in AWS:</p>
|
|
32
|
+
* <ul>
|
|
33
|
+
* <li>
|
|
34
|
+
* <p>
|
|
35
|
+
* <code>DescribeAgreement</code> – Grants permission to users to obtain detailed
|
|
36
|
+
* meta data about any of their agreements.</p>
|
|
37
|
+
* </li>
|
|
38
|
+
* <li>
|
|
39
|
+
* <p>
|
|
40
|
+
* <code>GetAgreementTerms</code> – Grants permission to users to obtain details
|
|
41
|
+
* about the terms of an agreement.</p>
|
|
42
|
+
* </li>
|
|
43
|
+
* <li>
|
|
44
|
+
* <p>
|
|
45
|
+
* <code>SearchAgreements</code> – Grants permission to users to search through all
|
|
46
|
+
* their agreements.</p>
|
|
47
|
+
* </li>
|
|
48
|
+
* </ul>
|
|
49
|
+
*/
|
|
50
|
+
export declare class MarketplaceAgreement extends MarketplaceAgreementClient implements MarketplaceAgreement {
|
|
51
|
+
}
|