File tree 4 files changed +40
-0
lines changed
packages/smithy-client/src
4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Smithy document type values.
3
+ */
4
+ export namespace DocumentType {
5
+ export type Value = Scalar | Structure | List ;
6
+ export type Scalar = string | number | boolean | null ;
7
+ export type Structure = { [ member : string ] : Value } ;
8
+ export interface List extends Array < Value > { }
9
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Type that is implemented by all Smithy shapes marked with the
3
+ * error trait.
4
+ */
5
+ export interface SmithyException {
6
+ /**
7
+ * The shape ID name of the exception.
8
+ */
9
+ readonly __type : string ;
10
+
11
+ /**
12
+ * Whether the client or server are at fault.
13
+ */
14
+ readonly $fault : "client" | "server" ;
15
+
16
+ /**
17
+ * The service that encountered the exception.
18
+ */
19
+ readonly $service ?: string ;
20
+ }
Original file line number Diff line number Diff line change 1
1
export * from "./client" ;
2
2
export * from "./command" ;
3
+ export * from "./document-type" ;
4
+ export * from "./exception" ;
5
+ export * from "./isa" ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Checks if the given value is a Smithy structure of the given type.
3
+ */
4
+ export function isa < T > ( o : any , ...ids : string [ ] ) : o is T {
5
+ return (
6
+ typeof o === "object" && "__type" in o && ids . indexOf ( o [ "__type" ] ) > - 1
7
+ ) ;
8
+ }
You can’t perform that action at this time.
0 commit comments