|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 4 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 5 | + |
| 6 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 7 | +import { InvoicingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InvoicingClient"; |
| 8 | +import { GetInvoicePDFRequest, GetInvoicePDFResponse } from "../models/models_0"; |
| 9 | +import { GetInvoicePDF } from "../schemas/schemas_0"; |
| 10 | + |
| 11 | +/** |
| 12 | + * @public |
| 13 | + */ |
| 14 | +export type { __MetadataBearer }; |
| 15 | +export { $Command }; |
| 16 | +/** |
| 17 | + * @public |
| 18 | + * |
| 19 | + * The input for {@link GetInvoicePDFCommand}. |
| 20 | + */ |
| 21 | +export interface GetInvoicePDFCommandInput extends GetInvoicePDFRequest {} |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The output of {@link GetInvoicePDFCommand}. |
| 26 | + */ |
| 27 | +export interface GetInvoicePDFCommandOutput extends GetInvoicePDFResponse, __MetadataBearer {} |
| 28 | + |
| 29 | +/** |
| 30 | + * <p>Returns a URL to download the invoice document and supplemental documents associated with an invoice. The URLs are pre-signed and have expiration time. For special cases like Brazil, where Amazon Web Services generated invoice identifiers and government provided identifiers do not match, use the Amazon Web Services generated invoice identifier when making API requests. To grant IAM permission to use this operation, the caller needs the <code>invoicing:GetInvoicePDF</code> policy action.</p> |
| 31 | + * @example |
| 32 | + * Use a bare-bones client and the command you need to make an API call. |
| 33 | + * ```javascript |
| 34 | + * import { InvoicingClient, GetInvoicePDFCommand } from "@aws-sdk/client-invoicing"; // ES Modules import |
| 35 | + * // const { InvoicingClient, GetInvoicePDFCommand } = require("@aws-sdk/client-invoicing"); // CommonJS import |
| 36 | + * // import type { InvoicingClientConfig } from "@aws-sdk/client-invoicing"; |
| 37 | + * const config = {}; // type is InvoicingClientConfig |
| 38 | + * const client = new InvoicingClient(config); |
| 39 | + * const input = { // GetInvoicePDFRequest |
| 40 | + * InvoiceId: "STRING_VALUE", // required |
| 41 | + * }; |
| 42 | + * const command = new GetInvoicePDFCommand(input); |
| 43 | + * const response = await client.send(command); |
| 44 | + * // { // GetInvoicePDFResponse |
| 45 | + * // InvoicePDF: { // InvoicePDF |
| 46 | + * // InvoiceId: "STRING_VALUE", |
| 47 | + * // DocumentUrl: "STRING_VALUE", |
| 48 | + * // DocumentUrlExpirationDate: new Date("TIMESTAMP"), |
| 49 | + * // SupplementalDocuments: [ // SupplementalDocuments |
| 50 | + * // { // SupplementalDocument |
| 51 | + * // DocumentUrl: "STRING_VALUE", |
| 52 | + * // DocumentUrlExpirationDate: new Date("TIMESTAMP"), |
| 53 | + * // }, |
| 54 | + * // ], |
| 55 | + * // }, |
| 56 | + * // }; |
| 57 | + * |
| 58 | + * ``` |
| 59 | + * |
| 60 | + * @param GetInvoicePDFCommandInput - {@link GetInvoicePDFCommandInput} |
| 61 | + * @returns {@link GetInvoicePDFCommandOutput} |
| 62 | + * @see {@link GetInvoicePDFCommandInput} for command's `input` shape. |
| 63 | + * @see {@link GetInvoicePDFCommandOutput} for command's `response` shape. |
| 64 | + * @see {@link InvoicingClientResolvedConfig | config} for InvoicingClient's `config` shape. |
| 65 | + * |
| 66 | + * @throws {@link AccessDeniedException} (client fault) |
| 67 | + * <p>You don't have sufficient access to perform this action.</p> |
| 68 | + * |
| 69 | + * @throws {@link InternalServerException} (server fault) |
| 70 | + * <p>The processing request failed because of an unknown error, exception, or failure. </p> |
| 71 | + * |
| 72 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 73 | + * <p>The resource could not be found. </p> |
| 74 | + * |
| 75 | + * @throws {@link ThrottlingException} (client fault) |
| 76 | + * <p>The request was denied due to request throttling.</p> |
| 77 | + * |
| 78 | + * @throws {@link ValidationException} (client fault) |
| 79 | + * <p> The input fails to satisfy the constraints specified by an Amazon Web Services service. </p> |
| 80 | + * |
| 81 | + * @throws {@link InvoicingServiceException} |
| 82 | + * <p>Base exception class for all service exceptions from Invoicing service.</p> |
| 83 | + * |
| 84 | + * |
| 85 | + * @example GetInvoicePDF without supplemental documents |
| 86 | + * ```javascript |
| 87 | + * // |
| 88 | + * const input = { |
| 89 | + * InvoiceId: "abc123" |
| 90 | + * }; |
| 91 | + * const command = new GetInvoicePDFCommand(input); |
| 92 | + * const response = await client.send(command); |
| 93 | + * /* response is |
| 94 | + * { |
| 95 | + * InvoicePDF: { |
| 96 | + * DocumentUrl: "https://abcd123.com?securityTokenForDoc", |
| 97 | + * DocumentUrlExpirationDate: "2025-04-01T01:00:00.000Z", |
| 98 | + * InvoiceId: "abc123", |
| 99 | + * SupplementalDocuments: [] |
| 100 | + * } |
| 101 | + * } |
| 102 | + * *\/ |
| 103 | + * ``` |
| 104 | + * |
| 105 | + * @example GetInvoicePDF with supplemental documents |
| 106 | + * ```javascript |
| 107 | + * // |
| 108 | + * const input = { |
| 109 | + * InvoiceId: "abc123" |
| 110 | + * }; |
| 111 | + * const command = new GetInvoicePDFCommand(input); |
| 112 | + * const response = await client.send(command); |
| 113 | + * /* response is |
| 114 | + * { |
| 115 | + * InvoicePDF: { |
| 116 | + * DocumentUrl: "https://abcd123.com?securityTokenForDoc", |
| 117 | + * DocumentUrlExpirationDate: "2025-04-01T01:00:00.000Z", |
| 118 | + * InvoiceId: "abc123", |
| 119 | + * SupplementalDocuments: [ |
| 120 | + * { |
| 121 | + * DocumentUrl: "https://abcd123.com?securityTokenForSupplementalDoc", |
| 122 | + * DocumentUrlExpirationDate: "2025-04-01T01:00:00.000Z" |
| 123 | + * } |
| 124 | + * ] |
| 125 | + * } |
| 126 | + * } |
| 127 | + * *\/ |
| 128 | + * ``` |
| 129 | + * |
| 130 | + * @public |
| 131 | + */ |
| 132 | +export class GetInvoicePDFCommand extends $Command |
| 133 | + .classBuilder< |
| 134 | + GetInvoicePDFCommandInput, |
| 135 | + GetInvoicePDFCommandOutput, |
| 136 | + InvoicingClientResolvedConfig, |
| 137 | + ServiceInputTypes, |
| 138 | + ServiceOutputTypes |
| 139 | + >() |
| 140 | + .ep(commonParams) |
| 141 | + .m(function (this: any, Command: any, cs: any, config: InvoicingClientResolvedConfig, o: any) { |
| 142 | + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; |
| 143 | + }) |
| 144 | + .s("Invoicing", "GetInvoicePDF", {}) |
| 145 | + .n("InvoicingClient", "GetInvoicePDFCommand") |
| 146 | + .sc(GetInvoicePDF) |
| 147 | + .build() { |
| 148 | + /** @internal type navigation helper, not in runtime. */ |
| 149 | + protected declare static __types: { |
| 150 | + api: { |
| 151 | + input: GetInvoicePDFRequest; |
| 152 | + output: GetInvoicePDFResponse; |
| 153 | + }; |
| 154 | + sdk: { |
| 155 | + input: GetInvoicePDFCommandInput; |
| 156 | + output: GetInvoicePDFCommandOutput; |
| 157 | + }; |
| 158 | + }; |
| 159 | +} |
0 commit comments