Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .changeset/famous-planes-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ generate-protocol-tests:
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model-schema/typescript-client-codegen/ ./private/my-local-model-schema
node ./scripts/post-protocol-test-codegen
npx prettier --write ./private/smithy-rpcv2-cbor
npx prettier --write ./private/smithy-rpcv2-cbor-schema
npx prettier --write ./private/my-local-model
npx prettier --write ./private/my-local-model-schema
yarn
yarn turbo run build -F="./private/*" --only

Expand Down
10 changes: 8 additions & 2 deletions private/my-local-model-schema/src/XYZService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ export interface XYZService {
* @see {@link GetNumbersCommand}
*/
getNumbers(): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, options?: __HttpHandlerOptions): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, cb: (err: any, data?: GetNumbersCommandOutput) => void): void;
getNumbers(
args: GetNumbersCommandInput,
options?: __HttpHandlerOptions
): Promise<GetNumbersCommandOutput>;
getNumbers(
args: GetNumbersCommandInput,
cb: (err: any, data?: GetNumbersCommandOutput) => void
): void;
getNumbers(
args: GetNumbersCommandInput,
options: __HttpHandlerOptions,
Expand Down
19 changes: 11 additions & 8 deletions private/my-local-model-schema/src/XYZServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ export { __Client };
/**
* @public
*/
export type ServiceInputTypes = GetNumbersCommandInput | TradeEventStreamCommandInput;
export type ServiceInputTypes =
| GetNumbersCommandInput
| TradeEventStreamCommandInput;

/**
* @public
*/
export type ServiceOutputTypes = GetNumbersCommandOutput | TradeEventStreamCommandOutput;
export type ServiceOutputTypes =
| GetNumbersCommandOutput
| TradeEventStreamCommandOutput;

/**
* @public
Expand Down Expand Up @@ -259,13 +263,12 @@ export class XYZServiceClient extends __Client<
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config,
{
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>
new DefaultIdentityProviderConfig({}),
})
);
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) => new DefaultIdentityProviderConfig({}),
}
));
this.middlewareStack.use(getHttpSigningPlugin(this.config));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function createSmithyApiNoAuthHttpAuthOption(authParameters: XYZServiceHttpAuthS
/**
* @internal
*/
export interface XYZServiceHttpAuthSchemeProvider extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}
export interface XYZServiceHttpAuthSchemeProvider
extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion private/my-local-model-schema/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export interface GetNumbersResponse {
/**
* @public
*/
export interface Unit {}
export interface Unit {
}

/**
* @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const getRuntimeConfig = (config: XYZServiceClientConfig) => {
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
retryMode:
config?.retryMode ??
(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
sha256: config?.sha256 ?? Sha256,
streamCollector: config?.streamCollector ?? streamCollector,
};
Expand Down
131 changes: 52 additions & 79 deletions private/my-local-model-schema/src/schemas/schemas_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,104 +39,77 @@ import {
RetryableError as __RetryableError,
XYZServiceServiceException as __XYZServiceServiceException,
} from "../models/errors";
import { XYZServiceSyntheticServiceException as __XYZServiceSyntheticServiceException } from "../models/XYZServiceSyntheticServiceException";
import {
XYZServiceSyntheticServiceException as __XYZServiceSyntheticServiceException,
} from "../models/XYZServiceSyntheticServiceException";

/* eslint no-var: 0 */

export var Alpha: StaticStructureSchema = [3, n0, _A, 0, [_i, _t], [0, 4]];
export var CodedThrottlingError: StaticErrorSchema = [
-3,
n0,
_CTE,
{
[_e]: _c,
[_hE]: 429,
},
[],
export var Alpha: StaticStructureSchema = [3, n0, _A,
0,
[_i, _t],
[0, 4]
];
export var CodedThrottlingError: StaticErrorSchema = [-3, n0, _CTE,
{ [_e]: _c, [_hE]: 429 },
[],
[]
];
TypeRegistry.for(n0).registerError(CodedThrottlingError, __CodedThrottlingError);

export var GetNumbersRequest: StaticStructureSchema = [3, n0, _GNR, 0, [_bD, _bI, _fWM, _fWMi], [17, 19, 0, 0]];
export var GetNumbersResponse: StaticStructureSchema = [3, n0, _GNRe, 0, [_bD, _bI], [17, 19]];
export var HaltError: StaticErrorSchema = [
-3,
n0,
_HE,
{
[_e]: _c,
},
[],
export var GetNumbersRequest: StaticStructureSchema = [3, n0, _GNR,
0,
[_bD, _bI, _fWM, _fWMi],
[17, 19, 0, 0]
];
export var GetNumbersResponse: StaticStructureSchema = [3, n0, _GNRe,
0,
[_bD, _bI],
[17, 19]
];
export var HaltError: StaticErrorSchema = [-3, n0, _HE,
{ [_e]: _c },
[],
[]
];
TypeRegistry.for(n0).registerError(HaltError, __HaltError);

export var MysteryThrottlingError: StaticErrorSchema = [
-3,
n0,
_MTE,
{
[_e]: _c,
},
[],
export var MysteryThrottlingError: StaticErrorSchema = [-3, n0, _MTE,
{ [_e]: _c },
[],
[]
];
TypeRegistry.for(n0).registerError(MysteryThrottlingError, __MysteryThrottlingError);

export var RetryableError: StaticErrorSchema = [
-3,
n0,
_RE,
{
[_e]: _c,
},
[],
export var RetryableError: StaticErrorSchema = [-3, n0, _RE,
{ [_e]: _c },
[],
[]
];
TypeRegistry.for(n0).registerError(RetryableError, __RetryableError);

export var TradeEventStreamRequest: StaticStructureSchema = [3, n0, _TESR, 0, [_eS], [[() => TradeEvents, 0]]];
export var TradeEventStreamResponse: StaticStructureSchema = [3, n0, _TESRr, 0, [_eS], [[() => TradeEvents, 0]]];
export var XYZServiceServiceException: StaticErrorSchema = [
-3,
n0,
_XYZSSE,
{
[_e]: _c,
},
[],
[],
export var TradeEventStreamRequest: StaticStructureSchema = [3, n0, _TESR,
0,
[_eS],
[[() => TradeEvents, 0]]
];
TypeRegistry.for(n0).registerError(XYZServiceServiceException, __XYZServiceServiceException);

export var __Unit = "unit" as const;

export var XYZServiceSyntheticServiceException: StaticErrorSchema = [
-3,
_s,
"XYZServiceSyntheticServiceException",
export var TradeEventStreamResponse: StaticStructureSchema = [3, n0, _TESRr,
0,
[_eS],
[[() => TradeEvents, 0]]
];
export var XYZServiceServiceException: StaticErrorSchema = [-3, n0, _XYZSSE,
{ [_e]: _c },
[],
[],
[]
];
TypeRegistry.for(n0).registerError(XYZServiceServiceException, __XYZServiceServiceException);
export var __Unit = "unit" as const;
export var XYZServiceSyntheticServiceException: StaticErrorSchema = [-3, _s, "XYZServiceSyntheticServiceException", 0, [], []];
TypeRegistry.for(_s).registerError(XYZServiceSyntheticServiceException, __XYZServiceSyntheticServiceException);

export var TradeEvents: StaticStructureSchema = [
3,
n0,
_TE,
{
[_st]: 1,
},
export var TradeEvents: StaticStructureSchema = [3, n0, _TE,
{ [_st]: 1 },
[_a, _b, _g],
[() => Alpha, () => __Unit, () => __Unit],
[() => Alpha, () => __Unit, () => __Unit]
];
export var GetNumbers: StaticOperationSchema = [9, n0, _GN, 0, () => GetNumbersRequest, () => GetNumbersResponse];
export var TradeEventStream: StaticOperationSchema = [
9,
n0,
_TES,
0,
() => TradeEventStreamRequest,
() => TradeEventStreamResponse,
export var GetNumbers: StaticOperationSchema = [9, n0, _GN,
0, () => GetNumbersRequest, () => GetNumbersResponse
];
export var TradeEventStream: StaticOperationSchema = [9, n0, _TES,
0, () => TradeEventStreamRequest, () => TradeEventStreamResponse
];
10 changes: 8 additions & 2 deletions private/my-local-model/src/XYZService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ export interface XYZService {
* @see {@link GetNumbersCommand}
*/
getNumbers(): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, options?: __HttpHandlerOptions): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, cb: (err: any, data?: GetNumbersCommandOutput) => void): void;
getNumbers(
args: GetNumbersCommandInput,
options?: __HttpHandlerOptions
): Promise<GetNumbersCommandOutput>;
getNumbers(
args: GetNumbersCommandInput,
cb: (err: any, data?: GetNumbersCommandOutput) => void
): void;
getNumbers(
args: GetNumbersCommandInput,
options: __HttpHandlerOptions,
Expand Down
19 changes: 11 additions & 8 deletions private/my-local-model/src/XYZServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ export { __Client };
/**
* @public
*/
export type ServiceInputTypes = GetNumbersCommandInput | TradeEventStreamCommandInput;
export type ServiceInputTypes =
| GetNumbersCommandInput
| TradeEventStreamCommandInput;

/**
* @public
*/
export type ServiceOutputTypes = GetNumbersCommandOutput | TradeEventStreamCommandOutput;
export type ServiceOutputTypes =
| GetNumbersCommandOutput
| TradeEventStreamCommandOutput;

/**
* @public
Expand Down Expand Up @@ -244,13 +248,12 @@ export class XYZServiceClient extends __Client<
this.config = _config_7;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config,
{
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>
new DefaultIdentityProviderConfig({}),
})
);
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) => new DefaultIdentityProviderConfig({}),
}
));
this.middlewareStack.use(getHttpSigningPlugin(this.config));
}

Expand Down
3 changes: 2 additions & 1 deletion private/my-local-model/src/auth/httpAuthSchemeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function createSmithyApiNoAuthHttpAuthOption(authParameters: XYZServiceHttpAuthS
/**
* @internal
*/
export interface XYZServiceHttpAuthSchemeProvider extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}
export interface XYZServiceHttpAuthSchemeProvider
extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}

/**
* @internal
Expand Down
35 changes: 26 additions & 9 deletions private/my-local-model/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export interface GetNumbersResponse {
/**
* @public
*/
export interface Unit {}
export interface Unit {
}

/**
* @public
Expand Down Expand Up @@ -107,11 +108,23 @@ export namespace TradeEvents {
* @internal
*/
export const TradeEventsFilterSensitiveLog = (obj: TradeEvents): any => {
if (obj.alpha !== undefined) return { alpha: obj.alpha };
if (obj.beta !== undefined) return { beta: obj.beta };
if (obj.gamma !== undefined) return { gamma: obj.gamma };
if (obj.alpha !== undefined) {
return {
alpha: obj.alpha
};
}
if (obj.beta !== undefined) {
return {
beta: obj.beta
};
}
if (obj.gamma !== undefined) {
return {
gamma: obj.gamma
};
}
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
};
}

/**
* @public
Expand All @@ -125,8 +138,10 @@ export interface TradeEventStreamRequest {
*/
export const TradeEventStreamRequestFilterSensitiveLog = (obj: TradeEventStreamRequest): any => ({
...obj,
...(obj.eventStream && { eventStream: "STREAMING_CONTENT" }),
});
...(obj.eventStream && { eventStream:
'STREAMING_CONTENT'
}),
})

/**
* @public
Expand All @@ -140,5 +155,7 @@ export interface TradeEventStreamResponse {
*/
export const TradeEventStreamResponseFilterSensitiveLog = (obj: TradeEventStreamResponse): any => ({
...obj,
...(obj.eventStream && { eventStream: "STREAMING_CONTENT" }),
});
...(obj.eventStream && { eventStream:
'STREAMING_CONTENT'
}),
})
Loading