Skip to content

Commit 437f3e3

Browse files
author
awstools
committed
feat(client-eventbridge): Updates internal logic for constructing API endpoints. We have added rule-based endpoints and internal model parameters.
1 parent b84f8b8 commit 437f3e3

File tree

64 files changed

+4225
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4225
-533
lines changed

clients/client-eventbridge/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@aws-sdk/hash-node": "*",
2929
"@aws-sdk/invalid-dependency": "*",
3030
"@aws-sdk/middleware-content-length": "*",
31+
"@aws-sdk/middleware-endpoint": "*",
3132
"@aws-sdk/middleware-host-header": "*",
3233
"@aws-sdk/middleware-logger": "*",
3334
"@aws-sdk/middleware-recursion-detection": "*",

clients/client-eventbridge/src/EventBridgeClient.ts

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// smithy-typescript generated code
2-
import {
3-
EndpointsInputConfig,
4-
EndpointsResolvedConfig,
5-
RegionInputConfig,
6-
RegionResolvedConfig,
7-
resolveEndpointsConfig,
8-
resolveRegionConfig,
9-
} from "@aws-sdk/config-resolver";
2+
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver";
103
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4+
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint";
115
import {
126
getHostHeaderPlugin,
137
HostHeaderInputConfig,
@@ -41,13 +35,13 @@ import {
4135
Credentials as __Credentials,
4236
Decoder as __Decoder,
4337
Encoder as __Encoder,
38+
EndpointV2 as __EndpointV2,
4439
Hash as __Hash,
4540
HashConstructor as __HashConstructor,
4641
HttpHandlerOptions as __HttpHandlerOptions,
4742
Logger as __Logger,
4843
Provider as __Provider,
4944
Provider,
50-
RegionInfoProvider,
5145
StreamCollector as __StreamCollector,
5246
UrlParser as __UrlParser,
5347
UserAgent as __UserAgent,
@@ -157,6 +151,12 @@ import {
157151
import { UpdateArchiveCommandInput, UpdateArchiveCommandOutput } from "./commands/UpdateArchiveCommand";
158152
import { UpdateConnectionCommandInput, UpdateConnectionCommandOutput } from "./commands/UpdateConnectionCommand";
159153
import { UpdateEndpointCommandInput, UpdateEndpointCommandOutput } from "./commands/UpdateEndpointCommand";
154+
import {
155+
ClientInputEndpointParameters,
156+
ClientResolvedEndpointParameters,
157+
EndpointParameters,
158+
resolveClientEndpointParameters,
159+
} from "./endpoint/EndpointParameters";
160160
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
161161

162162
export type ServiceInputTypes =
@@ -384,12 +384,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
384384
*/
385385
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
386386

387-
/**
388-
* Fetch related hostname, signing name or signing region with given region.
389-
* @internal
390-
*/
391-
regionInfoProvider?: RegionInfoProvider;
392-
393387
/**
394388
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
395389
* @internal
@@ -405,11 +399,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
405399
type EventBridgeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
406400
ClientDefaults &
407401
RegionInputConfig &
408-
EndpointsInputConfig &
402+
EndpointInputConfig<EndpointParameters> &
409403
RetryInputConfig &
410404
HostHeaderInputConfig &
411405
AwsAuthInputConfig &
412-
UserAgentInputConfig;
406+
UserAgentInputConfig &
407+
ClientInputEndpointParameters;
413408
/**
414409
* The configuration interface of EventBridgeClient class constructor that set the region, credentials and other options.
415410
*/
@@ -418,11 +413,12 @@ export interface EventBridgeClientConfig extends EventBridgeClientConfigType {}
418413
type EventBridgeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
419414
Required<ClientDefaults> &
420415
RegionResolvedConfig &
421-
EndpointsResolvedConfig &
416+
EndpointResolvedConfig<EndpointParameters> &
422417
RetryResolvedConfig &
423418
HostHeaderResolvedConfig &
424419
AwsAuthResolvedConfig &
425-
UserAgentResolvedConfig;
420+
UserAgentResolvedConfig &
421+
ClientResolvedEndpointParameters;
426422
/**
427423
* The resolved configuration interface of EventBridgeClient class. This is resolved and normalized from the {@link EventBridgeClientConfig | constructor configuration interface}.
428424
*/
@@ -464,14 +460,15 @@ export class EventBridgeClient extends __Client<
464460

465461
constructor(configuration: EventBridgeClientConfig) {
466462
const _config_0 = __getRuntimeConfig(configuration);
467-
const _config_1 = resolveRegionConfig(_config_0);
468-
const _config_2 = resolveEndpointsConfig(_config_1);
469-
const _config_3 = resolveRetryConfig(_config_2);
470-
const _config_4 = resolveHostHeaderConfig(_config_3);
471-
const _config_5 = resolveAwsAuthConfig(_config_4);
472-
const _config_6 = resolveUserAgentConfig(_config_5);
473-
super(_config_6);
474-
this.config = _config_6;
463+
const _config_1 = resolveClientEndpointParameters(_config_0);
464+
const _config_2 = resolveRegionConfig(_config_1);
465+
const _config_3 = resolveEndpointConfig(_config_2);
466+
const _config_4 = resolveRetryConfig(_config_3);
467+
const _config_5 = resolveHostHeaderConfig(_config_4);
468+
const _config_6 = resolveAwsAuthConfig(_config_5);
469+
const _config_7 = resolveUserAgentConfig(_config_6);
470+
super(_config_7);
471+
this.config = _config_7;
475472
this.middlewareStack.use(getRetryPlugin(this.config));
476473
this.middlewareStack.use(getContentLengthPlugin(this.config));
477474
this.middlewareStack.use(getHostHeaderPlugin(this.config));

clients/client-eventbridge/src/commands/ActivateEventSourceCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -48,6 +49,15 @@ export class ActivateEventSourceCommand extends $Command<
4849
// Start section: command_properties
4950
// End section: command_properties
5051

52+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
53+
return {
54+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
55+
Endpoint: { type: "builtInParams", name: "endpoint" },
56+
Region: { type: "builtInParams", name: "region" },
57+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
58+
};
59+
}
60+
5161
constructor(readonly input: ActivateEventSourceCommandInput) {
5262
// Start section: command_constructor
5363
super();
@@ -63,6 +73,9 @@ export class ActivateEventSourceCommand extends $Command<
6373
options?: __HttpHandlerOptions
6474
): Handler<ActivateEventSourceCommandInput, ActivateEventSourceCommandOutput> {
6575
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
76+
this.middlewareStack.use(
77+
getEndpointPlugin(configuration, ActivateEventSourceCommand.getEndpointParameterInstructions())
78+
);
6679

6780
const stack = clientStack.concat(this.middlewareStack);
6881

clients/client-eventbridge/src/commands/CancelReplayCommand.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -52,6 +53,15 @@ export class CancelReplayCommand extends $Command<
5253
// Start section: command_properties
5354
// End section: command_properties
5455

56+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
57+
return {
58+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
59+
Endpoint: { type: "builtInParams", name: "endpoint" },
60+
Region: { type: "builtInParams", name: "region" },
61+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
62+
};
63+
}
64+
5565
constructor(readonly input: CancelReplayCommandInput) {
5666
// Start section: command_constructor
5767
super();
@@ -67,6 +77,7 @@ export class CancelReplayCommand extends $Command<
6777
options?: __HttpHandlerOptions
6878
): Handler<CancelReplayCommandInput, CancelReplayCommandOutput> {
6979
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
80+
this.middlewareStack.use(getEndpointPlugin(configuration, CancelReplayCommand.getEndpointParameterInstructions()));
7081

7182
const stack = clientStack.concat(this.middlewareStack);
7283

clients/client-eventbridge/src/commands/CreateApiDestinationCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -53,6 +54,15 @@ export class CreateApiDestinationCommand extends $Command<
5354
// Start section: command_properties
5455
// End section: command_properties
5556

57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
5666
constructor(readonly input: CreateApiDestinationCommandInput) {
5767
// Start section: command_constructor
5868
super();
@@ -68,6 +78,9 @@ export class CreateApiDestinationCommand extends $Command<
6878
options?: __HttpHandlerOptions
6979
): Handler<CreateApiDestinationCommandInput, CreateApiDestinationCommandOutput> {
7080
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, CreateApiDestinationCommand.getEndpointParameterInstructions())
83+
);
7184

7285
const stack = clientStack.concat(this.middlewareStack);
7386

clients/client-eventbridge/src/commands/CreateArchiveCommand.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -56,6 +57,15 @@ export class CreateArchiveCommand extends $Command<
5657
// Start section: command_properties
5758
// End section: command_properties
5859

60+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
61+
return {
62+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
63+
Endpoint: { type: "builtInParams", name: "endpoint" },
64+
Region: { type: "builtInParams", name: "region" },
65+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
66+
};
67+
}
68+
5969
constructor(readonly input: CreateArchiveCommandInput) {
6070
// Start section: command_constructor
6171
super();
@@ -71,6 +81,7 @@ export class CreateArchiveCommand extends $Command<
7181
options?: __HttpHandlerOptions
7282
): Handler<CreateArchiveCommandInput, CreateArchiveCommandOutput> {
7383
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
84+
this.middlewareStack.use(getEndpointPlugin(configuration, CreateArchiveCommand.getEndpointParameterInstructions()));
7485

7586
const stack = clientStack.concat(this.middlewareStack);
7687

clients/client-eventbridge/src/commands/CreateConnectionCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -53,6 +54,15 @@ export class CreateConnectionCommand extends $Command<
5354
// Start section: command_properties
5455
// End section: command_properties
5556

57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
5666
constructor(readonly input: CreateConnectionCommandInput) {
5767
// Start section: command_constructor
5868
super();
@@ -68,6 +78,9 @@ export class CreateConnectionCommand extends $Command<
6878
options?: __HttpHandlerOptions
6979
): Handler<CreateConnectionCommandInput, CreateConnectionCommandOutput> {
7080
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, CreateConnectionCommand.getEndpointParameterInstructions())
83+
);
7184

7285
const stack = clientStack.concat(this.middlewareStack);
7386

clients/client-eventbridge/src/commands/CreateEndpointCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -54,6 +55,15 @@ export class CreateEndpointCommand extends $Command<
5455
// Start section: command_properties
5556
// End section: command_properties
5657

58+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
59+
return {
60+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61+
Endpoint: { type: "builtInParams", name: "endpoint" },
62+
Region: { type: "builtInParams", name: "region" },
63+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
64+
};
65+
}
66+
5767
constructor(readonly input: CreateEndpointCommandInput) {
5868
// Start section: command_constructor
5969
super();
@@ -69,6 +79,9 @@ export class CreateEndpointCommand extends $Command<
6979
options?: __HttpHandlerOptions
7080
): Handler<CreateEndpointCommandInput, CreateEndpointCommandOutput> {
7181
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
82+
this.middlewareStack.use(
83+
getEndpointPlugin(configuration, CreateEndpointCommand.getEndpointParameterInstructions())
84+
);
7285

7386
const stack = clientStack.concat(this.middlewareStack);
7487

clients/client-eventbridge/src/commands/CreateEventBusCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -54,6 +55,15 @@ export class CreateEventBusCommand extends $Command<
5455
// Start section: command_properties
5556
// End section: command_properties
5657

58+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
59+
return {
60+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61+
Endpoint: { type: "builtInParams", name: "endpoint" },
62+
Region: { type: "builtInParams", name: "region" },
63+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
64+
};
65+
}
66+
5767
constructor(readonly input: CreateEventBusCommandInput) {
5868
// Start section: command_constructor
5969
super();
@@ -69,6 +79,9 @@ export class CreateEventBusCommand extends $Command<
6979
options?: __HttpHandlerOptions
7080
): Handler<CreateEventBusCommandInput, CreateEventBusCommandOutput> {
7181
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
82+
this.middlewareStack.use(
83+
getEndpointPlugin(configuration, CreateEventBusCommand.getEndpointParameterInstructions())
84+
);
7285

7386
const stack = clientStack.concat(this.middlewareStack);
7487

clients/client-eventbridge/src/commands/CreatePartnerEventSourceCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -75,6 +76,15 @@ export class CreatePartnerEventSourceCommand extends $Command<
7576
// Start section: command_properties
7677
// End section: command_properties
7778

79+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
80+
return {
81+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
82+
Endpoint: { type: "builtInParams", name: "endpoint" },
83+
Region: { type: "builtInParams", name: "region" },
84+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
85+
};
86+
}
87+
7888
constructor(readonly input: CreatePartnerEventSourceCommandInput) {
7989
// Start section: command_constructor
8090
super();
@@ -90,6 +100,9 @@ export class CreatePartnerEventSourceCommand extends $Command<
90100
options?: __HttpHandlerOptions
91101
): Handler<CreatePartnerEventSourceCommandInput, CreatePartnerEventSourceCommandOutput> {
92102
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
103+
this.middlewareStack.use(
104+
getEndpointPlugin(configuration, CreatePartnerEventSourceCommand.getEndpointParameterInstructions())
105+
);
93106

94107
const stack = clientStack.concat(this.middlewareStack);
95108

0 commit comments

Comments
 (0)