Skip to content

Commit

Permalink
feat(client-eventbridge): codegen EventBridge with endpointRuleSet
Browse files Browse the repository at this point in the history
…`HttpAuthSchemeProvider`
  • Loading branch information
Steven Yuan committed Sep 25, 2023
1 parent 69775fe commit 68066bd
Show file tree
Hide file tree
Showing 60 changed files with 239 additions and 3 deletions.
50 changes: 49 additions & 1 deletion clients/client-eventbridge/src/auth/httpAuthSchemeProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// smithy-typescript generated code
import {
createEndpointRuleSetHttpAuthSchemeParametersProvider,
createEndpointRuleSetHttpAuthSchemeProvider,
DefaultIdentityProviderConfig,
doesIdentityRequireRefresh,
HttpAuthOption,
Expand All @@ -13,6 +15,8 @@ import {
import { AwsCredentialIdentity, AwsCredentialIdentityProvider, Provider as __Provider } from "@smithy/types";
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";

import { EndpointParameters } from "../endpoint/EndpointParameters";
import { defaultEndpointResolver } from "../endpoint/endpointResolver";
import { EventBridgeClientResolvedConfig } from "../EventBridgeClient";

/**
Expand Down Expand Up @@ -56,6 +60,16 @@ function createAwsAuthSigv4HttpAuthOption(authParameters: EventBridgeHttpAuthSch
};
}

function createAwsAuthSigv4aHttpAuthOption(authParameters: EventBridgeHttpAuthSchemeParameters): HttpAuthOption {
return {
schemeId: "aws.auth#sigv4a",
signingProperties: {
name: "events",
region: authParameters.region,
},
};
}

/**
* @internal
*/
Expand Down Expand Up @@ -123,9 +137,43 @@ export const resolveHttpAuthSchemeConfig = (config: HttpAuthSchemeInputConfig):
...config,
credentials,
region,
httpAuthSchemeParametersProvider: defaultEventBridgeHttpAuthSchemeParametersProvider,
httpAuthSchemeParametersProvider: defaultEndpointRuleSetHttpAuthSchemeParametersProvider,
identityProviderConfig: new DefaultIdentityProviderConfig({
"aws.auth#sigv4": credentials,
}),
};
};

/**
* @internal
*/
export interface EventBridgeEndpointRuleSetHttpAuthSchemeParameters
extends EndpointParameters,
EventBridgeHttpAuthSchemeParameters {}

/**
* @internal
*/
export interface EventBridgeEndpointRuleSetHttpAuthSchemeParametersProvider
extends HttpAuthSchemeParametersProvider<
EventBridgeClientResolvedConfig,
EventBridgeEndpointRuleSetHttpAuthSchemeParameters
> {}

/**
* @internal
*/
export const defaultEndpointRuleSetHttpAuthSchemeParametersProvider: EventBridgeEndpointRuleSetHttpAuthSchemeParametersProvider =
createEndpointRuleSetHttpAuthSchemeParametersProvider(defaultEventBridgeHttpAuthSchemeParametersProvider);

/**
* @internal
*/
export interface EventBridgeEndpointRuleSetHttpAuthSchemeProvider
extends HttpAuthSchemeProvider<EventBridgeEndpointRuleSetHttpAuthSchemeParameters> {}

/**
* @internal
*/
export const defaultEndpointRuleSetHttpAuthSchemeProvider: EventBridgeEndpointRuleSetHttpAuthSchemeProvider =
createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, defaultEventBridgeHttpAuthSchemeProvider);
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export class ActivateEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "ActivateEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: ActivateEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export class CancelReplayCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CancelReplay",
endpointRuleSet: {
getEndpointParameterInstructions: CancelReplayCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ export class CreateApiDestinationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreateApiDestination",
endpointRuleSet: {
getEndpointParameterInstructions: CreateApiDestinationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export class CreateArchiveCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreateArchive",
endpointRuleSet: {
getEndpointParameterInstructions: CreateArchiveCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ export class CreateConnectionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreateConnection",
endpointRuleSet: {
getEndpointParameterInstructions: CreateConnectionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ export class CreateEndpointCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreateEndpoint",
endpointRuleSet: {
getEndpointParameterInstructions: CreateEndpointCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export class CreateEventBusCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreateEventBus",
endpointRuleSet: {
getEndpointParameterInstructions: CreateEventBusCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ export class CreatePartnerEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "CreatePartnerEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: CreatePartnerEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export class DeactivateEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeactivateEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: DeactivateEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export class DeauthorizeConnectionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeauthorizeConnection",
endpointRuleSet: {
getEndpointParameterInstructions: DeauthorizeConnectionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export class DeleteApiDestinationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteApiDestination",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteApiDestinationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class DeleteArchiveCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteArchive",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteArchiveCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export class DeleteConnectionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteConnection",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteConnectionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export class DeleteEndpointCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteEndpoint",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteEndpointCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class DeleteEventBusCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteEventBus",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteEventBusCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export class DeletePartnerEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeletePartnerEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: DeletePartnerEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-eventbridge/src/commands/DeleteRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ export class DeleteRuleCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DeleteRule",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteRuleCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export class DescribeApiDestinationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeApiDestination",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeApiDestinationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export class DescribeArchiveCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeArchive",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeArchiveCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ export class DescribeConnectionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeConnection",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeConnectionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ export class DescribeEndpointCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeEndpoint",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeEndpointCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export class DescribeEventBusCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeEventBus",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeEventBusCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export class DescribeEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export class DescribePartnerEventSourceCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribePartnerEventSource",
endpointRuleSet: {
getEndpointParameterInstructions: DescribePartnerEventSourceCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ export class DescribeReplayCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeReplay",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeReplayCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export class DescribeRuleCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DescribeRule",
endpointRuleSet: {
getEndpointParameterInstructions: DescribeRuleCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-eventbridge/src/commands/DisableRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export class DisableRuleCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "DisableRule",
endpointRuleSet: {
getEndpointParameterInstructions: DisableRuleCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-eventbridge/src/commands/EnableRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export class EnableRuleCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "EnableRule",
endpointRuleSet: {
getEndpointParameterInstructions: EnableRuleCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export class ListApiDestinationsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "ListApiDestinations",
endpointRuleSet: {
getEndpointParameterInstructions: ListApiDestinationsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export class ListArchivesCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "ListArchives",
endpointRuleSet: {
getEndpointParameterInstructions: ListArchivesCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export class ListConnectionsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "ListConnections",
endpointRuleSet: {
getEndpointParameterInstructions: ListConnectionsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ export class ListEndpointsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSEvents",
operation: "ListEndpoints",
endpointRuleSet: {
getEndpointParameterInstructions: ListEndpointsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Loading

0 comments on commit 68066bd

Please sign in to comment.