|
| 1 | +import { |
| 2 | + CreateCloudFrontOriginAccessIdentityRequest, |
| 3 | + CreateCloudFrontOriginAccessIdentityResult, |
| 4 | + CreateDistributionRequest, |
| 5 | + CreateDistributionResult, |
| 6 | + CreateDistributionWithTagsRequest, |
| 7 | + CreateDistributionWithTagsResult, |
| 8 | + CreateFieldLevelEncryptionConfigRequest, |
| 9 | + CreateFieldLevelEncryptionConfigResult, |
| 10 | + CreateFieldLevelEncryptionProfileRequest, |
| 11 | + CreateFieldLevelEncryptionProfileResult, |
| 12 | + CreateInvalidationRequest, |
| 13 | + CreateInvalidationResult, |
| 14 | + CreatePublicKeyRequest, |
| 15 | + CreatePublicKeyResult, |
| 16 | + CreateStreamingDistributionRequest, |
| 17 | + CreateStreamingDistributionResult, |
| 18 | + CreateStreamingDistributionWithTagsRequest, |
| 19 | + CreateStreamingDistributionWithTagsResult, |
| 20 | + DeleteCloudFrontOriginAccessIdentityRequest, |
| 21 | + DeleteDistributionRequest, |
| 22 | + DeleteFieldLevelEncryptionConfigRequest, |
| 23 | + DeleteFieldLevelEncryptionProfileRequest, |
| 24 | + DeletePublicKeyRequest, |
| 25 | + DeleteStreamingDistributionRequest, |
| 26 | + GetCloudFrontOriginAccessIdentityConfigRequest, |
| 27 | + GetCloudFrontOriginAccessIdentityConfigResult, |
| 28 | + GetCloudFrontOriginAccessIdentityRequest, |
| 29 | + GetCloudFrontOriginAccessIdentityResult, |
| 30 | + GetDistributionConfigRequest, |
| 31 | + GetDistributionConfigResult, |
| 32 | + GetDistributionRequest, |
| 33 | + GetDistributionResult, |
| 34 | + GetFieldLevelEncryptionConfigRequest, |
| 35 | + GetFieldLevelEncryptionConfigResult, |
| 36 | + GetFieldLevelEncryptionProfileConfigRequest, |
| 37 | + GetFieldLevelEncryptionProfileConfigResult, |
| 38 | + GetFieldLevelEncryptionProfileRequest, |
| 39 | + GetFieldLevelEncryptionProfileResult, |
| 40 | + GetFieldLevelEncryptionRequest, |
| 41 | + GetFieldLevelEncryptionResult, |
| 42 | + GetInvalidationRequest, |
| 43 | + GetInvalidationResult, |
| 44 | + GetPublicKeyConfigRequest, |
| 45 | + GetPublicKeyConfigResult, |
| 46 | + GetPublicKeyRequest, |
| 47 | + GetPublicKeyResult, |
| 48 | + GetStreamingDistributionConfigRequest, |
| 49 | + GetStreamingDistributionConfigResult, |
| 50 | + GetStreamingDistributionRequest, |
| 51 | + GetStreamingDistributionResult, |
| 52 | + ListCloudFrontOriginAccessIdentitiesRequest, |
| 53 | + ListCloudFrontOriginAccessIdentitiesResult, |
| 54 | + ListDistributionsByWebACLIdRequest, |
| 55 | + ListDistributionsByWebACLIdResult, |
| 56 | + ListDistributionsRequest, |
| 57 | + ListDistributionsResult, |
| 58 | + ListFieldLevelEncryptionConfigsRequest, |
| 59 | + ListFieldLevelEncryptionConfigsResult, |
| 60 | + ListFieldLevelEncryptionProfilesRequest, |
| 61 | + ListFieldLevelEncryptionProfilesResult, |
| 62 | + ListInvalidationsRequest, |
| 63 | + ListInvalidationsResult, |
| 64 | + ListPublicKeysRequest, |
| 65 | + ListPublicKeysResult, |
| 66 | + ListStreamingDistributionsRequest, |
| 67 | + ListStreamingDistributionsResult, |
| 68 | + ListTagsForResourceRequest, |
| 69 | + ListTagsForResourceResult, |
| 70 | + TagResourceRequest, |
| 71 | + UntagResourceRequest, |
| 72 | + UpdateCloudFrontOriginAccessIdentityRequest, |
| 73 | + UpdateCloudFrontOriginAccessIdentityResult, |
| 74 | + UpdateDistributionRequest, |
| 75 | + UpdateDistributionResult, |
| 76 | + UpdateFieldLevelEncryptionConfigRequest, |
| 77 | + UpdateFieldLevelEncryptionConfigResult, |
| 78 | + UpdateFieldLevelEncryptionProfileRequest, |
| 79 | + UpdateFieldLevelEncryptionProfileResult, |
| 80 | + UpdatePublicKeyRequest, |
| 81 | + UpdatePublicKeyResult, |
| 82 | + UpdateStreamingDistributionRequest, |
| 83 | + UpdateStreamingDistributionResult |
| 84 | +} from "./models/index"; |
| 85 | +import { ClientDefaultValues as __ClientDefaultValues } from "./runtimeConfig"; |
| 86 | +import { |
| 87 | + EndpointsInputConfig, |
| 88 | + EndpointsResolvedConfig, |
| 89 | + RegionInputConfig, |
| 90 | + RegionResolvedConfig, |
| 91 | + resolveEndpointsConfig, |
| 92 | + resolveRegionConfig |
| 93 | +} from "@aws-sdk/config-resolver"; |
| 94 | +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; |
| 95 | +import { |
| 96 | + HostHeaderInputConfig, |
| 97 | + HostHeaderResolvedConfig, |
| 98 | + getHostHeaderPlugin, |
| 99 | + resolveHostHeaderConfig |
| 100 | +} from "@aws-sdk/middleware-host-header"; |
| 101 | +import { |
| 102 | + RetryInputConfig, |
| 103 | + RetryResolvedConfig, |
| 104 | + getRetryPlugin, |
| 105 | + resolveRetryConfig |
| 106 | +} from "@aws-sdk/middleware-retry"; |
| 107 | +import { |
| 108 | + AwsAuthInputConfig, |
| 109 | + AwsAuthResolvedConfig, |
| 110 | + getAwsAuthPlugin, |
| 111 | + resolveAwsAuthConfig |
| 112 | +} from "@aws-sdk/middleware-signing"; |
| 113 | +import { |
| 114 | + UserAgentInputConfig, |
| 115 | + UserAgentResolvedConfig, |
| 116 | + getUserAgentPlugin, |
| 117 | + resolveUserAgentConfig |
| 118 | +} from "@aws-sdk/middleware-user-agent"; |
| 119 | +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; |
| 120 | +import { |
| 121 | + Client as __Client, |
| 122 | + SmithyConfiguration as __SmithyConfiguration, |
| 123 | + SmithyResolvedConfiguration as __SmithyResolvedConfiguration |
| 124 | +} from "@aws-sdk/smithy-client"; |
| 125 | +import { |
| 126 | + RegionInfoProvider, |
| 127 | + Credentials as __Credentials, |
| 128 | + Decoder as __Decoder, |
| 129 | + Encoder as __Encoder, |
| 130 | + HashConstructor as __HashConstructor, |
| 131 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 132 | + MetadataBearer as __MetadataBearer, |
| 133 | + Provider as __Provider, |
| 134 | + StreamCollector as __StreamCollector, |
| 135 | + UrlParser as __UrlParser |
| 136 | +} from "@aws-sdk/types"; |
| 137 | + |
| 138 | +export type ServiceInputTypes = |
| 139 | + | CreateCloudFrontOriginAccessIdentityRequest |
| 140 | + | CreateDistributionRequest |
| 141 | + | CreateDistributionWithTagsRequest |
| 142 | + | CreateFieldLevelEncryptionConfigRequest |
| 143 | + | CreateFieldLevelEncryptionProfileRequest |
| 144 | + | CreateInvalidationRequest |
| 145 | + | CreatePublicKeyRequest |
| 146 | + | CreateStreamingDistributionRequest |
| 147 | + | CreateStreamingDistributionWithTagsRequest |
| 148 | + | DeleteCloudFrontOriginAccessIdentityRequest |
| 149 | + | DeleteDistributionRequest |
| 150 | + | DeleteFieldLevelEncryptionConfigRequest |
| 151 | + | DeleteFieldLevelEncryptionProfileRequest |
| 152 | + | DeletePublicKeyRequest |
| 153 | + | DeleteStreamingDistributionRequest |
| 154 | + | GetCloudFrontOriginAccessIdentityConfigRequest |
| 155 | + | GetCloudFrontOriginAccessIdentityRequest |
| 156 | + | GetDistributionConfigRequest |
| 157 | + | GetDistributionRequest |
| 158 | + | GetFieldLevelEncryptionConfigRequest |
| 159 | + | GetFieldLevelEncryptionProfileConfigRequest |
| 160 | + | GetFieldLevelEncryptionProfileRequest |
| 161 | + | GetFieldLevelEncryptionRequest |
| 162 | + | GetInvalidationRequest |
| 163 | + | GetPublicKeyConfigRequest |
| 164 | + | GetPublicKeyRequest |
| 165 | + | GetStreamingDistributionConfigRequest |
| 166 | + | GetStreamingDistributionRequest |
| 167 | + | ListCloudFrontOriginAccessIdentitiesRequest |
| 168 | + | ListDistributionsByWebACLIdRequest |
| 169 | + | ListDistributionsRequest |
| 170 | + | ListFieldLevelEncryptionConfigsRequest |
| 171 | + | ListFieldLevelEncryptionProfilesRequest |
| 172 | + | ListInvalidationsRequest |
| 173 | + | ListPublicKeysRequest |
| 174 | + | ListStreamingDistributionsRequest |
| 175 | + | ListTagsForResourceRequest |
| 176 | + | TagResourceRequest |
| 177 | + | UntagResourceRequest |
| 178 | + | UpdateCloudFrontOriginAccessIdentityRequest |
| 179 | + | UpdateDistributionRequest |
| 180 | + | UpdateFieldLevelEncryptionConfigRequest |
| 181 | + | UpdateFieldLevelEncryptionProfileRequest |
| 182 | + | UpdatePublicKeyRequest |
| 183 | + | UpdateStreamingDistributionRequest; |
| 184 | + |
| 185 | +export type ServiceOutputTypes = |
| 186 | + | __MetadataBearer |
| 187 | + | CreateCloudFrontOriginAccessIdentityResult |
| 188 | + | CreateDistributionResult |
| 189 | + | CreateDistributionWithTagsResult |
| 190 | + | CreateFieldLevelEncryptionConfigResult |
| 191 | + | CreateFieldLevelEncryptionProfileResult |
| 192 | + | CreateInvalidationResult |
| 193 | + | CreatePublicKeyResult |
| 194 | + | CreateStreamingDistributionResult |
| 195 | + | CreateStreamingDistributionWithTagsResult |
| 196 | + | GetCloudFrontOriginAccessIdentityConfigResult |
| 197 | + | GetCloudFrontOriginAccessIdentityResult |
| 198 | + | GetDistributionConfigResult |
| 199 | + | GetDistributionResult |
| 200 | + | GetFieldLevelEncryptionConfigResult |
| 201 | + | GetFieldLevelEncryptionProfileConfigResult |
| 202 | + | GetFieldLevelEncryptionProfileResult |
| 203 | + | GetFieldLevelEncryptionResult |
| 204 | + | GetInvalidationResult |
| 205 | + | GetPublicKeyConfigResult |
| 206 | + | GetPublicKeyResult |
| 207 | + | GetStreamingDistributionConfigResult |
| 208 | + | GetStreamingDistributionResult |
| 209 | + | ListCloudFrontOriginAccessIdentitiesResult |
| 210 | + | ListDistributionsByWebACLIdResult |
| 211 | + | ListDistributionsResult |
| 212 | + | ListFieldLevelEncryptionConfigsResult |
| 213 | + | ListFieldLevelEncryptionProfilesResult |
| 214 | + | ListInvalidationsResult |
| 215 | + | ListPublicKeysResult |
| 216 | + | ListStreamingDistributionsResult |
| 217 | + | ListTagsForResourceResult |
| 218 | + | UpdateCloudFrontOriginAccessIdentityResult |
| 219 | + | UpdateDistributionResult |
| 220 | + | UpdateFieldLevelEncryptionConfigResult |
| 221 | + | UpdateFieldLevelEncryptionProfileResult |
| 222 | + | UpdatePublicKeyResult |
| 223 | + | UpdateStreamingDistributionResult; |
| 224 | + |
| 225 | +export interface ClientDefaults |
| 226 | + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { |
| 227 | + /** |
| 228 | + * The HTTP handler to use. Fetch in browser and Https in Nodejs. |
| 229 | + */ |
| 230 | + requestHandler?: __HttpHandler; |
| 231 | + |
| 232 | + /** |
| 233 | + * A constructor for a class implementing the @aws-sdk/types.Hash interface |
| 234 | + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. |
| 235 | + */ |
| 236 | + sha256?: __HashConstructor; |
| 237 | + |
| 238 | + /** |
| 239 | + * The function that will be used to convert strings into HTTP endpoints. |
| 240 | + */ |
| 241 | + urlParser?: __UrlParser; |
| 242 | + |
| 243 | + /** |
| 244 | + * A function that can calculate the length of a request body. |
| 245 | + */ |
| 246 | + bodyLengthChecker?: (body: any) => number | undefined; |
| 247 | + |
| 248 | + /** |
| 249 | + * A function that converts a stream into an array of bytes. |
| 250 | + */ |
| 251 | + streamCollector?: __StreamCollector; |
| 252 | + |
| 253 | + /** |
| 254 | + * The function that will be used to convert a base64-encoded string to a byte array |
| 255 | + */ |
| 256 | + base64Decoder?: __Decoder; |
| 257 | + |
| 258 | + /** |
| 259 | + * The function that will be used to convert binary data to a base64-encoded string |
| 260 | + */ |
| 261 | + base64Encoder?: __Encoder; |
| 262 | + |
| 263 | + /** |
| 264 | + * The function that will be used to convert a UTF8-encoded string to a byte array |
| 265 | + */ |
| 266 | + utf8Decoder?: __Decoder; |
| 267 | + |
| 268 | + /** |
| 269 | + * The function that will be used to convert binary data to a UTF-8 encoded string |
| 270 | + */ |
| 271 | + utf8Encoder?: __Encoder; |
| 272 | + |
| 273 | + /** |
| 274 | + * The string that will be used to populate default value in 'User-Agent' header |
| 275 | + */ |
| 276 | + defaultUserAgent?: string; |
| 277 | + |
| 278 | + /** |
| 279 | + * The runtime environment |
| 280 | + */ |
| 281 | + runtime?: string; |
| 282 | + |
| 283 | + /** |
| 284 | + * The service name with which to sign requests. |
| 285 | + */ |
| 286 | + signingName?: string; |
| 287 | + |
| 288 | + /** |
| 289 | + * Default credentials provider; Not available in browser runtime |
| 290 | + */ |
| 291 | + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; |
| 292 | + |
| 293 | + /** |
| 294 | + * Provider function that return promise of a region string |
| 295 | + */ |
| 296 | + regionDefaultProvider?: (input: any) => __Provider<string>; |
| 297 | + |
| 298 | + /** |
| 299 | + * Fetch related hostname, signing name or signing region with given region. |
| 300 | + */ |
| 301 | + regionInfoProvider?: RegionInfoProvider; |
| 302 | +} |
| 303 | + |
| 304 | +export type CloudFrontClientConfig = Partial< |
| 305 | + __SmithyConfiguration<__HttpHandlerOptions> |
| 306 | +> & |
| 307 | + ClientDefaults & |
| 308 | + RegionInputConfig & |
| 309 | + EndpointsInputConfig & |
| 310 | + AwsAuthInputConfig & |
| 311 | + RetryInputConfig & |
| 312 | + UserAgentInputConfig & |
| 313 | + HostHeaderInputConfig; |
| 314 | + |
| 315 | +export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration< |
| 316 | + __HttpHandlerOptions |
| 317 | +> & |
| 318 | + Required<ClientDefaults> & |
| 319 | + RegionResolvedConfig & |
| 320 | + EndpointsResolvedConfig & |
| 321 | + AwsAuthResolvedConfig & |
| 322 | + RetryResolvedConfig & |
| 323 | + UserAgentResolvedConfig & |
| 324 | + HostHeaderResolvedConfig; |
| 325 | + |
| 326 | +/** |
| 327 | + * |
| 328 | + * <fullname>Amazon CloudFront</fullname> |
| 329 | + * <p>This is the <i>Amazon CloudFront API Reference</i>. This guide is for developers who need detailed information about |
| 330 | + * CloudFront API actions, data types, and errors. For detailed information about CloudFront features, see the <i>Amazon CloudFront Developer Guide</i>.</p> |
| 331 | + * |
| 332 | + */ |
| 333 | +export class CloudFrontClient extends __Client< |
| 334 | + __HttpHandlerOptions, |
| 335 | + ServiceInputTypes, |
| 336 | + ServiceOutputTypes, |
| 337 | + CloudFrontClientResolvedConfig |
| 338 | +> { |
| 339 | + readonly config: CloudFrontClientResolvedConfig; |
| 340 | + |
| 341 | + constructor(configuration: CloudFrontClientConfig) { |
| 342 | + let _config_0 = { |
| 343 | + ...__ClientDefaultValues, |
| 344 | + ...configuration |
| 345 | + }; |
| 346 | + let _config_1 = resolveRegionConfig(_config_0); |
| 347 | + let _config_2 = resolveEndpointsConfig(_config_1); |
| 348 | + let _config_3 = resolveAwsAuthConfig(_config_2); |
| 349 | + let _config_4 = resolveRetryConfig(_config_3); |
| 350 | + let _config_5 = resolveUserAgentConfig(_config_4); |
| 351 | + let _config_6 = resolveHostHeaderConfig(_config_5); |
| 352 | + super(_config_6); |
| 353 | + this.config = _config_6; |
| 354 | + this.middlewareStack.use(getAwsAuthPlugin(this.config)); |
| 355 | + this.middlewareStack.use(getRetryPlugin(this.config)); |
| 356 | + this.middlewareStack.use(getUserAgentPlugin(this.config)); |
| 357 | + this.middlewareStack.use(getContentLengthPlugin(this.config)); |
| 358 | + this.middlewareStack.use(getHostHeaderPlugin(this.config)); |
| 359 | + } |
| 360 | + |
| 361 | + destroy(): void {} |
| 362 | +} |
0 commit comments