Skip to content
Draft
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ generate-protocol-tests:
npx prettier --write ./private/smithy-rpcv2-cbor-schema
npx prettier --write ./private/my-local-model
yarn
(cd ./private/smithy-rpcv2-cbor && npm run build)
(cd ./private/smithy-rpcv2-cbor-schema && npm run build)
(cd ./private/my-local-model && npm run build)

test-protocols:
(cd ./private/smithy-rpcv2-cbor && npx vitest run --globals)
Expand Down
11 changes: 10 additions & 1 deletion private/my-local-model/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
export type { RuntimeExtension } from "./runtimeExtensions";
export type { XYZServiceExtensionConfiguration } from "./extensionConfiguration";
export * from "./commands";
export * from "./models";

export * from "./models/errors";
export type {
Alpha,
GetNumbersRequest,
GetNumbersResponse,
TradeEventStreamRequest,
TradeEventStreamResponse,
Unit,
} from "./models/models_0";

export { XYZServiceSyntheticServiceException } from "./models/XYZServiceSyntheticServiceException";
105 changes: 105 additions & 0 deletions private/my-local-model/src/models/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// smithy-typescript generated code
import { XYZServiceSyntheticServiceException as __BaseException } from "./XYZServiceSyntheticServiceException";
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";

/**
* @public
*/
export class CodedThrottlingError extends __BaseException {
readonly name = "CodedThrottlingError" as const;
readonly $fault = "client" as const;
$retryable = {
throttling: true,
};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<CodedThrottlingError, __BaseException>) {
super({
name: "CodedThrottlingError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, CodedThrottlingError.prototype);
}
}

/**
* @public
*/
export class HaltError extends __BaseException {
readonly name = "HaltError" as const;
readonly $fault = "client" as const;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<HaltError, __BaseException>) {
super({
name: "HaltError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, HaltError.prototype);
}
}

/**
* @public
*/
export class MysteryThrottlingError extends __BaseException {
readonly name = "MysteryThrottlingError" as const;
readonly $fault = "client" as const;
$retryable = {
throttling: true,
};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<MysteryThrottlingError, __BaseException>) {
super({
name: "MysteryThrottlingError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, MysteryThrottlingError.prototype);
}
}

/**
* @public
*/
export class RetryableError extends __BaseException {
readonly name = "RetryableError" as const;
readonly $fault = "client" as const;
$retryable = {};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<RetryableError, __BaseException>) {
super({
name: "RetryableError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, RetryableError.prototype);
}
}

/**
* @public
*/
export class XYZServiceServiceException extends __BaseException {
readonly name = "XYZServiceServiceException" as const;
readonly $fault = "client" as const;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<XYZServiceServiceException, __BaseException>) {
super({
name: "XYZServiceServiceException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, XYZServiceServiceException.prototype);
}
}
2 changes: 0 additions & 2 deletions private/my-local-model/src/models/index.ts

This file was deleted.

104 changes: 0 additions & 104 deletions private/my-local-model/src/models/models_0.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// smithy-typescript generated code
import { XYZServiceSyntheticServiceException as __BaseException } from "./XYZServiceSyntheticServiceException";
import { NumericValue } from "@smithy/core/serde";
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";

/**
* @public
Expand All @@ -11,28 +9,6 @@ export interface Alpha {
timestamp?: Date | undefined;
}

/**
* @public
*/
export class CodedThrottlingError extends __BaseException {
readonly name: "CodedThrottlingError" = "CodedThrottlingError";
readonly $fault: "client" = "client";
$retryable = {
throttling: true,
};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<CodedThrottlingError, __BaseException>) {
super({
name: "CodedThrottlingError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, CodedThrottlingError.prototype);
}
}

/**
* @public
*/
Expand Down Expand Up @@ -64,86 +40,6 @@ export interface GetNumbersResponse {
bigInteger?: bigint | undefined;
}

/**
* @public
*/
export class HaltError extends __BaseException {
readonly name: "HaltError" = "HaltError";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<HaltError, __BaseException>) {
super({
name: "HaltError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, HaltError.prototype);
}
}

/**
* @public
*/
export class MysteryThrottlingError extends __BaseException {
readonly name: "MysteryThrottlingError" = "MysteryThrottlingError";
readonly $fault: "client" = "client";
$retryable = {
throttling: true,
};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<MysteryThrottlingError, __BaseException>) {
super({
name: "MysteryThrottlingError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, MysteryThrottlingError.prototype);
}
}

/**
* @public
*/
export class RetryableError extends __BaseException {
readonly name: "RetryableError" = "RetryableError";
readonly $fault: "client" = "client";
$retryable = {};
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<RetryableError, __BaseException>) {
super({
name: "RetryableError",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, RetryableError.prototype);
}
}

/**
* @public
*/
export class XYZServiceServiceException extends __BaseException {
readonly name: "XYZServiceServiceException" = "XYZServiceServiceException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<XYZServiceServiceException, __BaseException>) {
super({
name: "XYZServiceServiceException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, XYZServiceServiceException.prototype);
}
}

/**
* @public
*/
Expand Down
8 changes: 2 additions & 6 deletions private/my-local-model/src/protocols/Rpcv2cbor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import { GetNumbersCommandInput, GetNumbersCommandOutput } from "../commands/Get
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "../commands/TradeEventStreamCommand";
import { XYZServiceSyntheticServiceException as __BaseException } from "../models/XYZServiceSyntheticServiceException";
import {
Alpha,
CodedThrottlingError,
GetNumbersRequest,
GetNumbersResponse,
HaltError,
MysteryThrottlingError,
RetryableError,
TradeEvents,
Unit,
XYZServiceServiceException,
} from "../models/models_0";
} from "../models/errors";
import { Alpha, GetNumbersRequest, GetNumbersResponse, TradeEvents, Unit } from "../models/models_0";
import {
dateToTag as __dateToTag,
buildHttpRpcRequest,
Expand Down
27 changes: 26 additions & 1 deletion private/smithy-rpcv2-cbor-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
export type { RuntimeExtension } from "./runtimeExtensions";
export type { RpcV2ProtocolExtensionConfiguration } from "./extensionConfiguration";
export * from "./commands";
export * from "./models";

export * from "./models/enums";
export * from "./models/errors";
export type {
ClientOptionalDefaults,
ComplexNestedErrorData,
Defaults,
EmptyStructure,
Float16Output,
FractionalSecondsOutput,
GreetingStruct,
GreetingWithErrorsOutput,
OperationWithDefaultsInput,
OperationWithDefaultsOutput,
RecursiveShapesInputOutput,
RecursiveShapesInputOutputNested1,
RecursiveShapesInputOutputNested2,
RpcV2CborDenseMapsInputOutput,
RpcV2CborListInputOutput,
RpcV2CborSparseMapsInputOutput,
SimpleScalarStructure,
SimpleStructure,
SparseNullsOperationInputOutput,
StructureListMember,
ValidationExceptionField,
} from "./models/models_0";

export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException";
41 changes: 41 additions & 0 deletions private/smithy-rpcv2-cbor-schema/src/models/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// smithy-typescript generated code
/**
* @public
* @enum
*/
export const TestEnum = {
BAR: "BAR",
BAZ: "BAZ",
FOO: "FOO",
} as const;
/**
* @public
*/
export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum];

export enum TestIntEnum {
ONE = 1,
TWO = 2,
}

/**
* @public
* @enum
*/
export const FooEnum = {
BAR: "Bar",
BAZ: "Baz",
FOO: "Foo",
ONE: "1",
ZERO: "0",
} as const;
/**
* @public
*/
export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum];

export enum IntegerEnum {
A = 1,
B = 2,
C = 3,
}
Loading