Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update all enum members to be UPPER_CASE #2918

Merged
merged 43 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f327c67
update enum members in @aws-cdk/aws-apigateway
shivlaks Jun 17, 2019
6d9cd78
update enum members in @aws-cdk/aws-applicationautoscaling
shivlaks Jun 17, 2019
d8ee474
update enum members in @aws-cdk/aws-autoscaling
shivlaks Jun 17, 2019
662bcb0
update enum members in @aws-cdk/aws-cloudformation
shivlaks Jun 17, 2019
af7bd3d
update enum members in @aws-cdk/aws-cloudfront
shivlaks Jun 18, 2019
e1afbab
update enum members in @aws-cdk/aws-cloudtrail
shivlaks Jun 18, 2019
4856f20
update enum members in @aws-cdk/aws-cloudwatch
shivlaks Jun 18, 2019
a907af9
update enum members in @aws-cdk/aws-codebuild
shivlaks Jun 18, 2019
160536e
update enum members in @aws-cdk/aws-codecommit
shivlaks Jun 18, 2019
8e49cad
update enum members in @aws-cdk/aws-codedeploy and @aws-cdk/aws-codep…
shivlaks Jun 18, 2019
462336e
update enum members in @aws-cdk/aws-cognito
shivlaks Jun 18, 2019
a339455
update enum members in @aws-cdk/aws-dynamodb
shivlaks Jun 18, 2019
a9599d8
update enum members in @aws-cdk/aws-ec2
shivlaks Jun 18, 2019
113a6a1
update enum members in @aws-cdk/aws-ecr
shivlaks Jun 18, 2019
724079c
update enum members in @aws-cdk/aws-ecs
shivlaks Jun 18, 2019
d2e7a75
update enum members in @aws-cdk/aws-eks
shivlaks Jun 18, 2019
2558086
update enum members in @aws-cdk/aws-elasticloadbalancing
shivlaks Jun 18, 2019
08db033
update enum members in @aws-cdk/aws-glue
shivlaks Jun 18, 2019
34f7f79
update enum members in @aws-cdk/aws-iam
shivlaks Jun 18, 2019
f63056e
update enum members in @aws-cdk/aws-kinesis
shivlaks Jun 18, 2019
3621b7d
update enum members in @aws-cdk/aws-lambda
shivlaks Jun 18, 2019
c985e74
update enum members in @aws-cdk/aws-logs
shivlaks Jun 18, 2019
dd86f7d
update enum members in @aws-cdk/aws-rds
shivlaks Jun 18, 2019
c8e9566
update enum members in @aws-cdk/aws-s3
shivlaks Jun 18, 2019
60e1410
update enum members in @aws-cdk/aws-secretsmanager
shivlaks Jun 18, 2019
9730c61
update enum members in @aws-cdk/aws-servicediscovery
shivlaks Jun 18, 2019
690ae5a
update enum members in @aws-cdk/aws-ses
shivlaks Jun 18, 2019
73cf741
update enum members in @aws-cdk/aws-sns
shivlaks Jun 18, 2019
b88662f
update enum members in @aws-cdk/aws-sqs
shivlaks Jun 18, 2019
305b148
update enum members in @aws-cdk/aws-stepfunctions
shivlaks Jun 18, 2019
7d809b4
update enum members in cdk, assets, and cx-api modules
shivlaks Jun 18, 2019
888e9e4
Fix various failing tests to use updated enum member names.
shivlaks Jun 18, 2019
e462fdc
update tests for @aws-cdk/aws-lambda-event-sources
shivlaks Jun 18, 2019
b438996
update tests for @aws-cdk/aws-autoscaling-hooktargets
shivlaks Jun 18, 2019
09564e4
update tests for @aws-cdk/aws-codedeploy
shivlaks Jun 18, 2019
67281a4
update tests for aws-codepipeline, aws-ecs, aws-events-targets, aws-r…
shivlaks Jun 18, 2019
704172e
Merge branch 'master' into shivlaks/upper-case-enum-members
shivlaks Jun 19, 2019
038a2e1
fix remnant merge conflicts and breaks
shivlaks Jun 19, 2019
d5cb002
Merge branch 'master' into shivlaks/upper-case-enum-members
shivlaks Jun 19, 2019
ba7780d
fixing decdk lambda-events test to use enum member names that have ch…
shivlaks Jun 19, 2019
97bef4d
fixing decdk: queue-kms to address snapshot error
shivlaks Jun 19, 2019
dbe03cc
Merge branch 'master' into shivlaks/upper-case-enum-members
shivlaks Jun 19, 2019
b945048
fix test in @aws-cdk/aws-rds referencing old enum member name
shivlaks Jun 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class FakeAction extends codepipeline.Action {
super({
actionName,
artifactBounds: { minInputs: 0, maxInputs: 5, minOutputs: 0, maxOutputs: 5 },
category: codepipeline.ActionCategory.Test,
category: codepipeline.ActionCategory.TEST,
provider: 'Test',
});

Expand Down
24 changes: 12 additions & 12 deletions packages/@aws-cdk/aws-apigateway/lib/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ export enum ContentHandling {
/**
* Converts a request payload from a base64-encoded string to a binary blob.
*/
ConvertToBinary = 'CONVERT_TO_BINARY',
CONVERT_TO_BINARY = 'CONVERT_TO_BINARY',

/**
* Converts a request payload from a binary blob to a base64-encoded string.
*/
ConvertToText = 'CONVERT_TO_TEXT'
CONVERT_TO_TEXT = 'CONVERT_TO_TEXT'
}

export enum IntegrationType {
Expand All @@ -170,67 +170,67 @@ export enum IntegrationType {
* integration. With any other AWS service action, this is known as AWS
* integration.
*/
Aws = 'AWS',
AWS = 'AWS',

/**
* For integrating the API method request with the Lambda function-invoking
* action with the client request passed through as-is. This integration is
* also referred to as the Lambda proxy integration
*/
AwsProxy = 'AWS_PROXY',
AWS_PROXY = 'AWS_PROXY',

/**
* For integrating the API method request with an HTTP endpoint, including a
* private HTTP endpoint within a VPC. This integration is also referred to
* as the HTTP custom integration.
*/
Http = 'HTTP',
HTTP = 'HTTP',

/**
* For integrating the API method request with an HTTP endpoint, including a
* private HTTP endpoint within a VPC, with the client request passed
* through as-is. This is also referred to as the HTTP proxy integration
*/
HttpProxy = 'HTTP_PROXY',
HTTP_PROXY = 'HTTP_PROXY',

/**
* For integrating the API method request with API Gateway as a "loop-back"
* endpoint without invoking any backend.
*/
Mock = 'MOCK'
MOCK = 'MOCK'
}

export enum PassthroughBehavior {
/**
* Passes the request body for unmapped content types through to the
* integration back end without transformation.
*/
WhenNoMatch = 'WHEN_NO_MATCH',
WHEN_NO_MATCH = 'WHEN_NO_MATCH',

/**
* Rejects unmapped content types with an HTTP 415 'Unsupported Media Type'
* response
*/
Never = 'NEVER',
NEVER = 'NEVER',

/**
* Allows pass-through when the integration has NO content types mapped to
* templates. However if there is at least one content type defined,
* unmapped content types will be rejected with the same 415 response.
*/
WhenNoTemplates = 'WHEN_NO_TEMPLATES'
WHEN_NO_TEMPLATES = 'WHEN_NO_TEMPLATES'
}

export enum ConnectionType {
/**
* For connections through the public routable internet
*/
Internet = 'INTERNET',
INTERNET = 'INTERNET',

/**
* For private connections between API Gateway and a network load balancer in a VPC
*/
VpcLink = 'VPC_LINK'
VPC_LINK = 'VPC_LINK'
}

export interface IntegrationResponse {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class AwsIntegration extends Integration {

constructor(props: AwsIntegrationProps) {
const backend = props.subdomain ? `${props.subdomain}.${props.service}` : props.service;
const type = props.proxy ? IntegrationType.AwsProxy : IntegrationType.Aws;
const type = props.proxy ? IntegrationType.AWS_PROXY : IntegrationType.AWS;
const { apiType, apiValue } = parseAwsApiCall(props.path, props.action, props.actionParameters);
super({
type,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/integrations/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class HttpIntegration extends Integration {
const proxy = props.proxy !== undefined ? props.proxy : true;
const method = props.httpMethod || 'GET';
super({
type: proxy ? IntegrationType.HttpProxy : IntegrationType.Http,
type: proxy ? IntegrationType.HTTP_PROXY : IntegrationType.HTTP,
integrationHttpMethod: method,
uri: url,
options: props.options,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/integrations/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Integration, IntegrationOptions, IntegrationType } from '../integration
export class MockIntegration extends Integration {
constructor(options?: IntegrationOptions) {
super({
type: IntegrationType.Mock,
type: IntegrationType.MOCK,
options
});
}
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-apigateway/lib/method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class Method extends Resource {
httpMethod: this.httpMethod,
operationName: options.operationName || defaultMethodOptions.operationName,
apiKeyRequired: options.apiKeyRequired || defaultMethodOptions.apiKeyRequired,
authorizationType: options.authorizationType || defaultMethodOptions.authorizationType || AuthorizationType.None,
authorizationType: options.authorizationType || defaultMethodOptions.authorizationType || AuthorizationType.NONE,
authorizerId: authorizer && authorizer.authorizerId,
requestParameters: options.requestParameters,
integration: this.renderIntegration(props.integration),
Expand Down Expand Up @@ -183,11 +183,11 @@ export class Method extends Resource {
throw new Error(`'credentialsPassthrough' and 'credentialsRole' are mutually exclusive`);
}

if (options.connectionType === ConnectionType.VpcLink && options.vpcLink === undefined) {
if (options.connectionType === ConnectionType.VPC_LINK && options.vpcLink === undefined) {
throw new Error(`'connectionType' of VPC_LINK requires 'vpcLink' prop to be set`);
}

if (options.connectionType === ConnectionType.Internet && options.vpcLink !== undefined) {
if (options.connectionType === ConnectionType.INTERNET && options.vpcLink !== undefined) {
throw new Error(`cannot set 'vpcLink' where 'connectionType' is INTERNET`);
}

Expand Down Expand Up @@ -249,7 +249,7 @@ export enum AuthorizationType {
/**
* Open access.
*/
None = 'NONE',
NONE = 'NONE',

/**
* Use AWS IAM permissions.
Expand All @@ -259,10 +259,10 @@ export enum AuthorizationType {
/**
* Use a custom authorizer.
*/
Custom = 'CUSTOM',
CUSTOM = 'CUSTOM',

/**
* Use an AWS Cognito user pool.
*/
Cognito = 'COGNITO_USER_POOLS',
COGNITO = 'COGNITO_USER_POOLS',
}
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,29 +363,29 @@ export enum ApiKeySourceType {
/**
* To read the API key from the `X-API-Key` header of a request.
*/
Header = 'HEADER',
HEADER = 'HEADER',

/**
* To read the API key from the `UsageIdentifierKey` from a custom authorizer.
*/
Authorizer = 'AUTHORIZER',
AUTHORIZER = 'AUTHORIZER',
}

export enum EndpointType {
/**
* For an edge-optimized API and its custom domain name.
*/
Edge = 'EDGE',
EDGE = 'EDGE',

/**
* For a regional API and its custom domain name.
*/
Regional = 'REGIONAL',
REGIONAL = 'REGIONAL',

/**
* For a private API and its custom domain name.
*/
Private = 'PRIVATE'
PRIVATE = 'PRIVATE'
}

class RootResource extends ResourceBase {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export interface StageProps extends StageOptions {
}

export enum MethodLoggingLevel {
Off = 'OFF',
Error = 'ERROR',
Info = 'INFO'
OFF = 'OFF',
ERROR = 'ERROR',
INFO = 'INFO'
}

export interface MethodDeploymentOptions {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export interface ThrottleSettings {
* Time period for which quota settings apply.
*/
export enum Period {
Day = 'DAY',
Week = 'WEEK',
Month = 'MONTH'
DAY = 'DAY',
WEEK = 'WEEK',
MONTH = 'MONTH'
}

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ export interface ThrottlingPerMethod {
}

/**
* Type of Usage Plan Key. Currently the only supported type is 'API_KEY'
* Type of Usage Plan Key. Currently the only supported type is 'ApiKey'
*/
export enum UsagePlanKeyType {
ApiKey = 'API_KEY'
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Test extends cdk.Stack {
cacheClusterEnabled: true,
stageName: 'beta',
description: 'beta stage',
loggingLevel: apigateway.MethodLoggingLevel.Info,
loggingLevel: apigateway.MethodLoggingLevel.INFO,
dataTraceEnabled: true,
methodOptions: {
'/api/appliances/GET': {
Expand Down Expand Up @@ -61,7 +61,7 @@ class Test extends cdk.Stack {
throttle: { rateLimit: 5 },
quota: {
limit: 10000,
period: apigateway.Period.Month
period: apigateway.Period.MONTH
}
});
plan.addApiStage({
Expand Down
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-apigateway/test/test.method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export = {
'use default integration from api'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
const defaultIntegration = new apigateway.Integration({ type: apigateway.IntegrationType.HttpProxy, uri: 'https://amazon.com' });
const defaultIntegration = new apigateway.Integration({ type: apigateway.IntegrationType.HTTP_PROXY, uri: 'https://amazon.com' });
const api = new apigateway.RestApi(stack, 'test-api', {
cloudWatchRole: false,
deploy: false,
Expand Down Expand Up @@ -223,7 +223,7 @@ export = {

// WHEN
api.root.addMethod('GET', new apigateway.Integration({
type: apigateway.IntegrationType.AwsProxy,
type: apigateway.IntegrationType.AWS_PROXY,
options: {
credentialsRole: role
}
Expand All @@ -245,7 +245,7 @@ export = {

// WHEN
api.root.addMethod('GET', new apigateway.Integration({
type: apigateway.IntegrationType.AwsProxy,
type: apigateway.IntegrationType.AWS_PROXY,
options: {
credentialsPassthrough: true
}
Expand All @@ -268,7 +268,7 @@ export = {

// WHEN
const integration = new apigateway.Integration({
type: apigateway.IntegrationType.AwsProxy,
type: apigateway.IntegrationType.AWS_PROXY,
options: {
credentialsPassthrough: true,
credentialsRole: role
Expand All @@ -287,10 +287,10 @@ export = {

// WHEN
const integration = new apigateway.Integration({
type: apigateway.IntegrationType.HttpProxy,
type: apigateway.IntegrationType.HTTP_PROXY,
integrationHttpMethod: 'ANY',
options: {
connectionType: ConnectionType.VpcLink,
connectionType: ConnectionType.VPC_LINK,
}
});

Expand All @@ -313,10 +313,10 @@ export = {

// WHEN
const integration = new apigateway.Integration({
type: apigateway.IntegrationType.HttpProxy,
type: apigateway.IntegrationType.HTTP_PROXY,
integrationHttpMethod: 'ANY',
options: {
connectionType: ConnectionType.Internet,
connectionType: ConnectionType.INTERNET,
vpcLink: link
}
});
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/test/test.restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export = {

// WHEN
const api = new apigateway.RestApi(stack, 'api', {
endpointTypes: [ apigateway.EndpointType.Edge, apigateway.EndpointType.Private ]
endpointTypes: [ apigateway.EndpointType.EDGE, apigateway.EndpointType.PRIVATE ]
});

api.root.addMethod('GET');
Expand Down Expand Up @@ -547,7 +547,7 @@ export = {
// CASE #2: should inherit integration from root and method options, but
// "authorizationType" will be overridden to "None" instead of "IAM"
child.addMethod('POST', undefined, {
authorizationType: apigateway.AuthorizationType.Cognito
authorizationType: apigateway.AuthorizationType.COGNITO
});

const child2 = api.root.addResource('child2', {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/test/test.stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export = {
// WHEN
new apigateway.Stage(stack, 'my-stage', {
deployment,
loggingLevel: apigateway.MethodLoggingLevel.Info,
loggingLevel: apigateway.MethodLoggingLevel.INFO,
throttlingRateLimit: 12
});

Expand Down Expand Up @@ -107,11 +107,11 @@ export = {
// WHEN
new apigateway.Stage(stack, 'my-stage', {
deployment,
loggingLevel: apigateway.MethodLoggingLevel.Info,
loggingLevel: apigateway.MethodLoggingLevel.INFO,
throttlingRateLimit: 12,
methodOptions: {
'/goo/bar/GET': {
loggingLevel: apigateway.MethodLoggingLevel.Error,
loggingLevel: apigateway.MethodLoggingLevel.ERROR,
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/test.usage-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export = {
new apigateway.UsagePlan(stack, 'my-usage-plan', {
quota: {
limit: 10000,
period: apigateway.Period.Month
period: apigateway.Period.MONTH
}
});

Expand Down
Loading