UNPKG

@aws-cdk/aws-apigateway

Version:

The CDK Construct Library for AWS::ApiGateway

1,024 lines 939 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; Object.defineProperty(exports, "__esModule", { value: true }); exports.CfnVpcLink = exports.CfnUsagePlanKey = exports.CfnUsagePlan = exports.CfnStage = exports.CfnRestApi = exports.CfnResource = exports.CfnRequestValidator = exports.CfnModel = exports.CfnMethod = exports.CfnGatewayResponse = exports.CfnDomainName = exports.CfnDocumentationVersion = exports.CfnDocumentationPart = exports.CfnDeployment = exports.CfnClientCertificate = exports.CfnBasePathMapping = exports.CfnAuthorizer = exports.CfnApiKey = exports.CfnAccount = void 0; const jsiiDeprecationWarnings = require("../.warnings.jsii.js"); const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); // Copyright 2012-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. // Generated from the AWS CloudFormation Resource Specification // See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html // @cfn2ts:meta@ {"generated":"2023-06-19T15:20:27.731Z","fingerprint":"5Y7wo8IW84hSjAAR5MfCOWZyOMSRhV/uEt5JjPcetuc="} /* eslint-disable max-len */ // This is generated code - line lengths are difficult to control const cdk = require("@aws-cdk/core"); const cfn_parse = require("@aws-cdk/core/lib/helpers-internal"); /** * Determine whether the given properties match those of a `CfnAccountProps` * * @param properties - the TypeScript properties of a `CfnAccountProps` * * @returns the result of the validation. */ function CfnAccountPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('cloudWatchRoleArn', cdk.validateString)(properties.cloudWatchRoleArn)); return errors.wrap('supplied properties not correct for "CfnAccountProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::Account` resource * * @param properties - the TypeScript properties of a `CfnAccountProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::Account` resource. */ // @ts-ignore TS6133 function cfnAccountPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAccountPropsValidator(properties).assertSuccess(); return { CloudWatchRoleArn: cdk.stringToCloudFormation(properties.cloudWatchRoleArn), }; } // @ts-ignore TS6133 function CfnAccountPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('cloudWatchRoleArn', 'CloudWatchRoleArn', properties.CloudWatchRoleArn != null ? cfn_parse.FromCloudFormation.getString(properties.CloudWatchRoleArn) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::Account` * * The `AWS::ApiGateway::Account` resource specifies the IAM role that Amazon API Gateway uses to write API logs to Amazon CloudWatch Logs. To avoid overwriting other roles, you should only have one `AWS::ApiGateway::Account` resource per region per account. * * @cloudformationResource AWS::ApiGateway::Account * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-account.html */ class CfnAccount extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::Account`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props = {}) { super(scope, id, { type: CfnAccount.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnAccountProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnAccount); } throw error; } this.attrId = cdk.Token.asString(this.getAtt('Id')); this.cloudWatchRoleArn = props.cloudWatchRoleArn; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnAccountPropsFromCloudFormation(resourceProperties); const ret = new CfnAccount(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnAccount.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { cloudWatchRoleArn: this.cloudWatchRoleArn, }; } renderProperties(props) { return cfnAccountPropsToCloudFormation(props); } } exports.CfnAccount = CfnAccount; _a = JSII_RTTI_SYMBOL_1; CfnAccount[_a] = { fqn: "@aws-cdk/aws-apigateway.CfnAccount", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnAccount.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::Account"; /** * Determine whether the given properties match those of a `CfnApiKeyProps` * * @param properties - the TypeScript properties of a `CfnApiKeyProps` * * @returns the result of the validation. */ function CfnApiKeyPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('customerId', cdk.validateString)(properties.customerId)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled)); errors.collect(cdk.propertyValidator('generateDistinctId', cdk.validateBoolean)(properties.generateDistinctId)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('stageKeys', cdk.listValidator(CfnApiKey_StageKeyPropertyValidator))(properties.stageKeys)); errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags)); errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value)); return errors.wrap('supplied properties not correct for "CfnApiKeyProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::ApiKey` resource * * @param properties - the TypeScript properties of a `CfnApiKeyProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::ApiKey` resource. */ // @ts-ignore TS6133 function cfnApiKeyPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnApiKeyPropsValidator(properties).assertSuccess(); return { CustomerId: cdk.stringToCloudFormation(properties.customerId), Description: cdk.stringToCloudFormation(properties.description), Enabled: cdk.booleanToCloudFormation(properties.enabled), GenerateDistinctId: cdk.booleanToCloudFormation(properties.generateDistinctId), Name: cdk.stringToCloudFormation(properties.name), StageKeys: cdk.listMapper(cfnApiKeyStageKeyPropertyToCloudFormation)(properties.stageKeys), Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags), Value: cdk.stringToCloudFormation(properties.value), }; } // @ts-ignore TS6133 function CfnApiKeyPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('customerId', 'CustomerId', properties.CustomerId != null ? cfn_parse.FromCloudFormation.getString(properties.CustomerId) : undefined); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('enabled', 'Enabled', properties.Enabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.Enabled) : undefined); ret.addPropertyResult('generateDistinctId', 'GenerateDistinctId', properties.GenerateDistinctId != null ? cfn_parse.FromCloudFormation.getBoolean(properties.GenerateDistinctId) : undefined); ret.addPropertyResult('name', 'Name', properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined); ret.addPropertyResult('stageKeys', 'StageKeys', properties.StageKeys != null ? cfn_parse.FromCloudFormation.getArray(CfnApiKeyStageKeyPropertyFromCloudFormation)(properties.StageKeys) : undefined); ret.addPropertyResult('tags', 'Tags', properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined); ret.addPropertyResult('value', 'Value', properties.Value != null ? cfn_parse.FromCloudFormation.getString(properties.Value) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::ApiKey` * * The `AWS::ApiGateway::ApiKey` resource creates a unique key that you can distribute to clients who are executing API Gateway `Method` resources that require an API key. To specify which API key clients must use, map the API key with the `RestApi` and `Stage` resources that include the methods that require a key. * * @cloudformationResource AWS::ApiGateway::ApiKey * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html */ class CfnApiKey extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::ApiKey`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props = {}) { super(scope, id, { type: CfnApiKey.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnApiKeyProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnApiKey); } throw error; } this.attrApiKeyId = cdk.Token.asString(this.getAtt('APIKeyId')); this.customerId = props.customerId; this.description = props.description; this.enabled = props.enabled; this.generateDistinctId = props.generateDistinctId; this.name = props.name; this.stageKeys = props.stageKeys; this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::ApiGateway::ApiKey", props.tags, { tagPropertyName: 'tags' }); this.value = props.value; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnApiKeyPropsFromCloudFormation(resourceProperties); const ret = new CfnApiKey(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnApiKey.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { customerId: this.customerId, description: this.description, enabled: this.enabled, generateDistinctId: this.generateDistinctId, name: this.name, stageKeys: this.stageKeys, tags: this.tags.renderTags(), value: this.value, }; } renderProperties(props) { return cfnApiKeyPropsToCloudFormation(props); } } exports.CfnApiKey = CfnApiKey; _b = JSII_RTTI_SYMBOL_1; CfnApiKey[_b] = { fqn: "@aws-cdk/aws-apigateway.CfnApiKey", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnApiKey.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::ApiKey"; /** * Determine whether the given properties match those of a `StageKeyProperty` * * @param properties - the TypeScript properties of a `StageKeyProperty` * * @returns the result of the validation. */ function CfnApiKey_StageKeyPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('restApiId', cdk.validateString)(properties.restApiId)); errors.collect(cdk.propertyValidator('stageName', cdk.validateString)(properties.stageName)); return errors.wrap('supplied properties not correct for "StageKeyProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::ApiKey.StageKey` resource * * @param properties - the TypeScript properties of a `StageKeyProperty` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::ApiKey.StageKey` resource. */ // @ts-ignore TS6133 function cfnApiKeyStageKeyPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnApiKey_StageKeyPropertyValidator(properties).assertSuccess(); return { RestApiId: cdk.stringToCloudFormation(properties.restApiId), StageName: cdk.stringToCloudFormation(properties.stageName), }; } // @ts-ignore TS6133 function CfnApiKeyStageKeyPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('restApiId', 'RestApiId', properties.RestApiId != null ? cfn_parse.FromCloudFormation.getString(properties.RestApiId) : undefined); ret.addPropertyResult('stageName', 'StageName', properties.StageName != null ? cfn_parse.FromCloudFormation.getString(properties.StageName) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `CfnAuthorizerProps` * * @param properties - the TypeScript properties of a `CfnAuthorizerProps` * * @returns the result of the validation. */ function CfnAuthorizerPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('authType', cdk.validateString)(properties.authType)); errors.collect(cdk.propertyValidator('authorizerCredentials', cdk.validateString)(properties.authorizerCredentials)); errors.collect(cdk.propertyValidator('authorizerResultTtlInSeconds', cdk.validateNumber)(properties.authorizerResultTtlInSeconds)); errors.collect(cdk.propertyValidator('authorizerUri', cdk.validateString)(properties.authorizerUri)); errors.collect(cdk.propertyValidator('identitySource', cdk.validateString)(properties.identitySource)); errors.collect(cdk.propertyValidator('identityValidationExpression', cdk.validateString)(properties.identityValidationExpression)); errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('providerArns', cdk.listValidator(cdk.validateString))(properties.providerArns)); errors.collect(cdk.propertyValidator('restApiId', cdk.requiredValidator)(properties.restApiId)); errors.collect(cdk.propertyValidator('restApiId', cdk.validateString)(properties.restApiId)); errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type)); errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type)); return errors.wrap('supplied properties not correct for "CfnAuthorizerProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::Authorizer` resource * * @param properties - the TypeScript properties of a `CfnAuthorizerProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::Authorizer` resource. */ // @ts-ignore TS6133 function cfnAuthorizerPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnAuthorizerPropsValidator(properties).assertSuccess(); return { Name: cdk.stringToCloudFormation(properties.name), RestApiId: cdk.stringToCloudFormation(properties.restApiId), Type: cdk.stringToCloudFormation(properties.type), AuthorizerCredentials: cdk.stringToCloudFormation(properties.authorizerCredentials), AuthorizerResultTtlInSeconds: cdk.numberToCloudFormation(properties.authorizerResultTtlInSeconds), AuthorizerUri: cdk.stringToCloudFormation(properties.authorizerUri), AuthType: cdk.stringToCloudFormation(properties.authType), IdentitySource: cdk.stringToCloudFormation(properties.identitySource), IdentityValidationExpression: cdk.stringToCloudFormation(properties.identityValidationExpression), ProviderARNs: cdk.listMapper(cdk.stringToCloudFormation)(properties.providerArns), }; } // @ts-ignore TS6133 function CfnAuthorizerPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('name', 'Name', cfn_parse.FromCloudFormation.getString(properties.Name)); ret.addPropertyResult('restApiId', 'RestApiId', cfn_parse.FromCloudFormation.getString(properties.RestApiId)); ret.addPropertyResult('type', 'Type', cfn_parse.FromCloudFormation.getString(properties.Type)); ret.addPropertyResult('authorizerCredentials', 'AuthorizerCredentials', properties.AuthorizerCredentials != null ? cfn_parse.FromCloudFormation.getString(properties.AuthorizerCredentials) : undefined); ret.addPropertyResult('authorizerResultTtlInSeconds', 'AuthorizerResultTtlInSeconds', properties.AuthorizerResultTtlInSeconds != null ? cfn_parse.FromCloudFormation.getNumber(properties.AuthorizerResultTtlInSeconds) : undefined); ret.addPropertyResult('authorizerUri', 'AuthorizerUri', properties.AuthorizerUri != null ? cfn_parse.FromCloudFormation.getString(properties.AuthorizerUri) : undefined); ret.addPropertyResult('authType', 'AuthType', properties.AuthType != null ? cfn_parse.FromCloudFormation.getString(properties.AuthType) : undefined); ret.addPropertyResult('identitySource', 'IdentitySource', properties.IdentitySource != null ? cfn_parse.FromCloudFormation.getString(properties.IdentitySource) : undefined); ret.addPropertyResult('identityValidationExpression', 'IdentityValidationExpression', properties.IdentityValidationExpression != null ? cfn_parse.FromCloudFormation.getString(properties.IdentityValidationExpression) : undefined); ret.addPropertyResult('providerArns', 'ProviderARNs', properties.ProviderARNs != null ? cfn_parse.FromCloudFormation.getStringArray(properties.ProviderARNs) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::Authorizer` * * The `AWS::ApiGateway::Authorizer` resource creates an authorization layer that API Gateway activates for methods that have authorization enabled. API Gateway activates the authorizer when a client calls those methods. * * @cloudformationResource AWS::ApiGateway::Authorizer * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html */ class CfnAuthorizer extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::Authorizer`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnAuthorizer.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnAuthorizerProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnAuthorizer); } throw error; } cdk.requireProperty(props, 'name', this); cdk.requireProperty(props, 'restApiId', this); cdk.requireProperty(props, 'type', this); this.attrAuthorizerId = cdk.Token.asString(this.getAtt('AuthorizerId')); this.name = props.name; this.restApiId = props.restApiId; this.type = props.type; this.authorizerCredentials = props.authorizerCredentials; this.authorizerResultTtlInSeconds = props.authorizerResultTtlInSeconds; this.authorizerUri = props.authorizerUri; this.authType = props.authType; this.identitySource = props.identitySource; this.identityValidationExpression = props.identityValidationExpression; this.providerArns = props.providerArns; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnAuthorizerPropsFromCloudFormation(resourceProperties); const ret = new CfnAuthorizer(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnAuthorizer.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { name: this.name, restApiId: this.restApiId, type: this.type, authorizerCredentials: this.authorizerCredentials, authorizerResultTtlInSeconds: this.authorizerResultTtlInSeconds, authorizerUri: this.authorizerUri, authType: this.authType, identitySource: this.identitySource, identityValidationExpression: this.identityValidationExpression, providerArns: this.providerArns, }; } renderProperties(props) { return cfnAuthorizerPropsToCloudFormation(props); } } exports.CfnAuthorizer = CfnAuthorizer; _c = JSII_RTTI_SYMBOL_1; CfnAuthorizer[_c] = { fqn: "@aws-cdk/aws-apigateway.CfnAuthorizer", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnAuthorizer.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::Authorizer"; /** * Determine whether the given properties match those of a `CfnBasePathMappingProps` * * @param properties - the TypeScript properties of a `CfnBasePathMappingProps` * * @returns the result of the validation. */ function CfnBasePathMappingPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('basePath', cdk.validateString)(properties.basePath)); errors.collect(cdk.propertyValidator('domainName', cdk.requiredValidator)(properties.domainName)); errors.collect(cdk.propertyValidator('domainName', cdk.validateString)(properties.domainName)); errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id)); errors.collect(cdk.propertyValidator('restApiId', cdk.validateString)(properties.restApiId)); errors.collect(cdk.propertyValidator('stage', cdk.validateString)(properties.stage)); return errors.wrap('supplied properties not correct for "CfnBasePathMappingProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::BasePathMapping` resource * * @param properties - the TypeScript properties of a `CfnBasePathMappingProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::BasePathMapping` resource. */ // @ts-ignore TS6133 function cfnBasePathMappingPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnBasePathMappingPropsValidator(properties).assertSuccess(); return { DomainName: cdk.stringToCloudFormation(properties.domainName), BasePath: cdk.stringToCloudFormation(properties.basePath), Id: cdk.stringToCloudFormation(properties.id), RestApiId: cdk.stringToCloudFormation(properties.restApiId), Stage: cdk.stringToCloudFormation(properties.stage), }; } // @ts-ignore TS6133 function CfnBasePathMappingPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('domainName', 'DomainName', cfn_parse.FromCloudFormation.getString(properties.DomainName)); ret.addPropertyResult('basePath', 'BasePath', properties.BasePath != null ? cfn_parse.FromCloudFormation.getString(properties.BasePath) : undefined); ret.addPropertyResult('id', 'Id', properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined); ret.addPropertyResult('restApiId', 'RestApiId', properties.RestApiId != null ? cfn_parse.FromCloudFormation.getString(properties.RestApiId) : undefined); ret.addPropertyResult('stage', 'Stage', properties.Stage != null ? cfn_parse.FromCloudFormation.getString(properties.Stage) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::BasePathMapping` * * The `AWS::ApiGateway::BasePathMapping` resource creates a base path that clients who call your API must use in the invocation URL. * * @cloudformationResource AWS::ApiGateway::BasePathMapping * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-basepathmapping.html */ class CfnBasePathMapping extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::BasePathMapping`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnBasePathMapping.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnBasePathMappingProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnBasePathMapping); } throw error; } cdk.requireProperty(props, 'domainName', this); this.domainName = props.domainName; this.basePath = props.basePath; this.id = props.id; this.restApiId = props.restApiId; this.stage = props.stage; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnBasePathMappingPropsFromCloudFormation(resourceProperties); const ret = new CfnBasePathMapping(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnBasePathMapping.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { domainName: this.domainName, basePath: this.basePath, id: this.id, restApiId: this.restApiId, stage: this.stage, }; } renderProperties(props) { return cfnBasePathMappingPropsToCloudFormation(props); } } exports.CfnBasePathMapping = CfnBasePathMapping; _d = JSII_RTTI_SYMBOL_1; CfnBasePathMapping[_d] = { fqn: "@aws-cdk/aws-apigateway.CfnBasePathMapping", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnBasePathMapping.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::BasePathMapping"; /** * Determine whether the given properties match those of a `CfnClientCertificateProps` * * @param properties - the TypeScript properties of a `CfnClientCertificateProps` * * @returns the result of the validation. */ function CfnClientCertificatePropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags)); return errors.wrap('supplied properties not correct for "CfnClientCertificateProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::ClientCertificate` resource * * @param properties - the TypeScript properties of a `CfnClientCertificateProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::ClientCertificate` resource. */ // @ts-ignore TS6133 function cfnClientCertificatePropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnClientCertificatePropsValidator(properties).assertSuccess(); return { Description: cdk.stringToCloudFormation(properties.description), Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags), }; } // @ts-ignore TS6133 function CfnClientCertificatePropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('tags', 'Tags', properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::ClientCertificate` * * The `AWS::ApiGateway::ClientCertificate` resource creates a client certificate that API Gateway uses to configure client-side SSL authentication for sending requests to the integration endpoint. * * @cloudformationResource AWS::ApiGateway::ClientCertificate * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-clientcertificate.html */ class CfnClientCertificate extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::ClientCertificate`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props = {}) { super(scope, id, { type: CfnClientCertificate.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnClientCertificateProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnClientCertificate); } throw error; } this.attrClientCertificateId = cdk.Token.asString(this.getAtt('ClientCertificateId')); this.description = props.description; this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::ApiGateway::ClientCertificate", props.tags, { tagPropertyName: 'tags' }); } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnClientCertificatePropsFromCloudFormation(resourceProperties); const ret = new CfnClientCertificate(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnClientCertificate.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { description: this.description, tags: this.tags.renderTags(), }; } renderProperties(props) { return cfnClientCertificatePropsToCloudFormation(props); } } exports.CfnClientCertificate = CfnClientCertificate; _e = JSII_RTTI_SYMBOL_1; CfnClientCertificate[_e] = { fqn: "@aws-cdk/aws-apigateway.CfnClientCertificate", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnClientCertificate.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::ClientCertificate"; /** * Determine whether the given properties match those of a `CfnDeploymentProps` * * @param properties - the TypeScript properties of a `CfnDeploymentProps` * * @returns the result of the validation. */ function CfnDeploymentPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('deploymentCanarySettings', CfnDeployment_DeploymentCanarySettingsPropertyValidator)(properties.deploymentCanarySettings)); errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description)); errors.collect(cdk.propertyValidator('restApiId', cdk.requiredValidator)(properties.restApiId)); errors.collect(cdk.propertyValidator('restApiId', cdk.validateString)(properties.restApiId)); errors.collect(cdk.propertyValidator('stageDescription', CfnDeployment_StageDescriptionPropertyValidator)(properties.stageDescription)); errors.collect(cdk.propertyValidator('stageName', cdk.validateString)(properties.stageName)); return errors.wrap('supplied properties not correct for "CfnDeploymentProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment` resource * * @param properties - the TypeScript properties of a `CfnDeploymentProps` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment` resource. */ // @ts-ignore TS6133 function cfnDeploymentPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDeploymentPropsValidator(properties).assertSuccess(); return { RestApiId: cdk.stringToCloudFormation(properties.restApiId), DeploymentCanarySettings: cfnDeploymentDeploymentCanarySettingsPropertyToCloudFormation(properties.deploymentCanarySettings), Description: cdk.stringToCloudFormation(properties.description), StageDescription: cfnDeploymentStageDescriptionPropertyToCloudFormation(properties.stageDescription), StageName: cdk.stringToCloudFormation(properties.stageName), }; } // @ts-ignore TS6133 function CfnDeploymentPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('restApiId', 'RestApiId', cfn_parse.FromCloudFormation.getString(properties.RestApiId)); ret.addPropertyResult('deploymentCanarySettings', 'DeploymentCanarySettings', properties.DeploymentCanarySettings != null ? CfnDeploymentDeploymentCanarySettingsPropertyFromCloudFormation(properties.DeploymentCanarySettings) : undefined); ret.addPropertyResult('description', 'Description', properties.Description != null ? cfn_parse.FromCloudFormation.getString(properties.Description) : undefined); ret.addPropertyResult('stageDescription', 'StageDescription', properties.StageDescription != null ? CfnDeploymentStageDescriptionPropertyFromCloudFormation(properties.StageDescription) : undefined); ret.addPropertyResult('stageName', 'StageName', properties.StageName != null ? cfn_parse.FromCloudFormation.getString(properties.StageName) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::ApiGateway::Deployment` * * The `AWS::ApiGateway::Deployment` resource deploys an API Gateway `RestApi` resource to a stage so that clients can call the API over the internet. The stage acts as an environment. * * @cloudformationResource AWS::ApiGateway::Deployment * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html */ class CfnDeployment extends cdk.CfnResource { /** * Create a new `AWS::ApiGateway::Deployment`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnDeployment.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_apigateway_CfnDeploymentProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnDeployment); } throw error; } cdk.requireProperty(props, 'restApiId', this); this.attrDeploymentId = cdk.Token.asString(this.getAtt('DeploymentId')); this.restApiId = props.restApiId; this.deploymentCanarySettings = props.deploymentCanarySettings; this.description = props.description; this.stageDescription = props.stageDescription; this.stageName = props.stageName; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnDeploymentPropsFromCloudFormation(resourceProperties); const ret = new CfnDeployment(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnDeployment.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { restApiId: this.restApiId, deploymentCanarySettings: this.deploymentCanarySettings, description: this.description, stageDescription: this.stageDescription, stageName: this.stageName, }; } renderProperties(props) { return cfnDeploymentPropsToCloudFormation(props); } } exports.CfnDeployment = CfnDeployment; _f = JSII_RTTI_SYMBOL_1; CfnDeployment[_f] = { fqn: "@aws-cdk/aws-apigateway.CfnDeployment", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnDeployment.CFN_RESOURCE_TYPE_NAME = "AWS::ApiGateway::Deployment"; /** * Determine whether the given properties match those of a `AccessLogSettingProperty` * * @param properties - the TypeScript properties of a `AccessLogSettingProperty` * * @returns the result of the validation. */ function CfnDeployment_AccessLogSettingPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('destinationArn', cdk.validateString)(properties.destinationArn)); errors.collect(cdk.propertyValidator('format', cdk.validateString)(properties.format)); return errors.wrap('supplied properties not correct for "AccessLogSettingProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment.AccessLogSetting` resource * * @param properties - the TypeScript properties of a `AccessLogSettingProperty` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment.AccessLogSetting` resource. */ // @ts-ignore TS6133 function cfnDeploymentAccessLogSettingPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDeployment_AccessLogSettingPropertyValidator(properties).assertSuccess(); return { DestinationArn: cdk.stringToCloudFormation(properties.destinationArn), Format: cdk.stringToCloudFormation(properties.format), }; } // @ts-ignore TS6133 function CfnDeploymentAccessLogSettingPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('destinationArn', 'DestinationArn', properties.DestinationArn != null ? cfn_parse.FromCloudFormation.getString(properties.DestinationArn) : undefined); ret.addPropertyResult('format', 'Format', properties.Format != null ? cfn_parse.FromCloudFormation.getString(properties.Format) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `CanarySettingProperty` * * @param properties - the TypeScript properties of a `CanarySettingProperty` * * @returns the result of the validation. */ function CfnDeployment_CanarySettingPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('percentTraffic', cdk.validateNumber)(properties.percentTraffic)); errors.collect(cdk.propertyValidator('stageVariableOverrides', cdk.hashValidator(cdk.validateString))(properties.stageVariableOverrides)); errors.collect(cdk.propertyValidator('useStageCache', cdk.validateBoolean)(properties.useStageCache)); return errors.wrap('supplied properties not correct for "CanarySettingProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment.CanarySetting` resource * * @param properties - the TypeScript properties of a `CanarySettingProperty` * * @returns the AWS CloudFormation properties of an `AWS::ApiGateway::Deployment.CanarySetting` resource. */ // @ts-ignore TS6133 function cfnDeploymentCanarySettingPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDeployment_CanarySettingPropertyValidator(properties).assertSuccess(); return { PercentTraffic: cdk.numberToCloudFormation(properties.percentTraffic), StageVariableOverrides: cdk.hashMapper(cdk.stringToCloudFormation)(properties.stageVariableOverrides), UseStageCache: cdk.booleanToCloudFormation(properties.useStageCache), }; } // @ts-ignore TS6133 function CfnDe