UNPKG

7.24 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class QLDBSession extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: QLDBSession.Types.ClientConfiguration)
13 config: Config & QLDBSession.Types.ClientConfiguration;
14 /**
15 * Sends a command to an Amazon QLDB ledger.
16 */
17 sendCommand(params: QLDBSession.Types.SendCommandRequest, callback?: (err: AWSError, data: QLDBSession.Types.SendCommandResult) => void): Request<QLDBSession.Types.SendCommandResult, AWSError>;
18 /**
19 * Sends a command to an Amazon QLDB ledger.
20 */
21 sendCommand(callback?: (err: AWSError, data: QLDBSession.Types.SendCommandResult) => void): Request<QLDBSession.Types.SendCommandResult, AWSError>;
22}
23declare namespace QLDBSession {
24 export interface AbortTransactionRequest {
25 }
26 export interface AbortTransactionResult {
27 }
28 export type CommitDigest = Buffer|Uint8Array|Blob|string;
29 export interface CommitTransactionRequest {
30 /**
31 * Specifies the transaction id of the transaction to commit.
32 */
33 TransactionId: TransactionId;
34 /**
35 * Specifies the commit digest for the transaction to commit. For every active transaction, the commit digest must be passed. QLDB validates CommitDigest and rejects the commit with an error if the digest computed on the client does not match the digest computed by QLDB.
36 */
37 CommitDigest: CommitDigest;
38 }
39 export interface CommitTransactionResult {
40 /**
41 * The transaction id of the committed transaction.
42 */
43 TransactionId?: TransactionId;
44 /**
45 * The commit digest of the committed transaction.
46 */
47 CommitDigest?: CommitDigest;
48 }
49 export interface EndSessionRequest {
50 }
51 export interface EndSessionResult {
52 }
53 export interface ExecuteStatementRequest {
54 /**
55 * Specifies the transaction id of the request.
56 */
57 TransactionId: TransactionId;
58 /**
59 * Specifies the statement of the request.
60 */
61 Statement: Statement;
62 /**
63 * Specifies the parameters for the parameterized statement in the request.
64 */
65 Parameters?: StatementParameters;
66 }
67 export interface ExecuteStatementResult {
68 /**
69 * Contains the details of the first fetched page.
70 */
71 FirstPage?: Page;
72 }
73 export interface FetchPageRequest {
74 /**
75 * Specifies the transaction id of the page to be fetched.
76 */
77 TransactionId: TransactionId;
78 /**
79 * Specifies the next page token of the page to be fetched.
80 */
81 NextPageToken: PageToken;
82 }
83 export interface FetchPageResult {
84 /**
85 * Contains details of the fetched page.
86 */
87 Page?: Page;
88 }
89 export type IonBinary = Buffer|Uint8Array|Blob|string;
90 export type IonText = string;
91 export type LedgerName = string;
92 export interface Page {
93 /**
94 * A structure that contains values in multiple encoding formats.
95 */
96 Values?: ValueHolders;
97 /**
98 * The token of the next page.
99 */
100 NextPageToken?: PageToken;
101 }
102 export type PageToken = string;
103 export interface SendCommandRequest {
104 /**
105 * Specifies the session token for the current command. A session token is constant throughout the life of the session. To obtain a session token, run the StartSession command. This SessionToken is required for every subsequent command that is issued during the current session.
106 */
107 SessionToken?: SessionToken;
108 /**
109 * Command to start a new session. A session token is obtained as part of the response.
110 */
111 StartSession?: StartSessionRequest;
112 /**
113 * Command to start a new transaction.
114 */
115 StartTransaction?: StartTransactionRequest;
116 /**
117 * Command to end the current session.
118 */
119 EndSession?: EndSessionRequest;
120 /**
121 * Command to commit the specified transaction.
122 */
123 CommitTransaction?: CommitTransactionRequest;
124 /**
125 * Command to abort the current transaction.
126 */
127 AbortTransaction?: AbortTransactionRequest;
128 /**
129 * Command to execute a statement in the specified transaction.
130 */
131 ExecuteStatement?: ExecuteStatementRequest;
132 /**
133 * Command to fetch a page.
134 */
135 FetchPage?: FetchPageRequest;
136 }
137 export interface SendCommandResult {
138 /**
139 * Contains the details of the started session that includes a session token. This SessionToken is required for every subsequent command that is issued during the current session.
140 */
141 StartSession?: StartSessionResult;
142 /**
143 * Contains the details of the started transaction.
144 */
145 StartTransaction?: StartTransactionResult;
146 /**
147 * Contains the details of the ended session.
148 */
149 EndSession?: EndSessionResult;
150 /**
151 * Contains the details of the committed transaction.
152 */
153 CommitTransaction?: CommitTransactionResult;
154 /**
155 * Contains the details of the aborted transaction.
156 */
157 AbortTransaction?: AbortTransactionResult;
158 /**
159 * Contains the details of the executed statement.
160 */
161 ExecuteStatement?: ExecuteStatementResult;
162 /**
163 * Contains the details of the fetched page.
164 */
165 FetchPage?: FetchPageResult;
166 }
167 export type SessionToken = string;
168 export interface StartSessionRequest {
169 /**
170 * The name of the ledger to start a new session against.
171 */
172 LedgerName: LedgerName;
173 }
174 export interface StartSessionResult {
175 /**
176 * Session token of the started session. This SessionToken is required for every subsequent command that is issued during the current session.
177 */
178 SessionToken?: SessionToken;
179 }
180 export interface StartTransactionRequest {
181 }
182 export interface StartTransactionResult {
183 /**
184 * The transaction id of the started transaction.
185 */
186 TransactionId?: TransactionId;
187 }
188 export type Statement = string;
189 export type StatementParameters = ValueHolder[];
190 export type TransactionId = string;
191 export interface ValueHolder {
192 /**
193 * An Amazon Ion binary value contained in a ValueHolder structure.
194 */
195 IonBinary?: IonBinary;
196 /**
197 * An Amazon Ion plaintext value contained in a ValueHolder structure.
198 */
199 IonText?: IonText;
200 }
201 export type ValueHolders = ValueHolder[];
202 /**
203 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
204 */
205 export type apiVersion = "2019-07-11"|"latest"|string;
206 export interface ClientApiVersions {
207 /**
208 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
209 */
210 apiVersion?: apiVersion;
211 }
212 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
213 /**
214 * Contains interfaces for use with the QLDBSession client.
215 */
216 export import Types = QLDBSession;
217}
218export = QLDBSession;