@maxim_mazurok/gapi.client.spanner-v1 0.0.20230823 → 0.0.20230909
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +112 -1
- package/package.json +1 -1
- package/tests.ts +96 -1
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
10
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
11
|
// Generated from: https://spanner.googleapis.com/$discovery/rest?version=v1
|
|
12
|
-
// Revision:
|
|
12
|
+
// Revision: 20230909
|
|
13
13
|
|
|
14
14
|
/// <reference types="gapi.client" />
|
|
15
15
|
|
|
@@ -117,6 +117,25 @@ declare namespace gapi.client {
|
|
|
117
117
|
session?:
|
|
118
118
|
Session[];
|
|
119
119
|
}
|
|
120
|
+
interface BatchWriteRequest {
|
|
121
|
+
/** Required. The groups of mutations to be applied. */
|
|
122
|
+
mutationGroups?:
|
|
123
|
+
MutationGroup[];
|
|
124
|
+
/** Common options for this request. */
|
|
125
|
+
requestOptions?:
|
|
126
|
+
RequestOptions;
|
|
127
|
+
}
|
|
128
|
+
interface BatchWriteResponse {
|
|
129
|
+
/** The commit timestamp of the transaction that applied this batch. Present if `status` is `OK`, absent otherwise. */
|
|
130
|
+
commitTimestamp?:
|
|
131
|
+
string;
|
|
132
|
+
/** The mutation groups applied in this batch. The values index into the `mutation_groups` field in the corresponding `BatchWriteRequest`. */
|
|
133
|
+
indexes?:
|
|
134
|
+
number[];
|
|
135
|
+
/** An `OK` status indicates success. Any other status indicates a failure. */
|
|
136
|
+
status?:
|
|
137
|
+
Status;
|
|
138
|
+
}
|
|
120
139
|
interface BeginTransactionRequest {
|
|
121
140
|
/** Required. Options for the new transaction. */
|
|
122
141
|
options?:
|
|
@@ -1092,6 +1111,11 @@ declare namespace gapi.client {
|
|
|
1092
1111
|
update?:
|
|
1093
1112
|
Write;
|
|
1094
1113
|
}
|
|
1114
|
+
interface MutationGroup {
|
|
1115
|
+
/** Required. The mutations in this group. */
|
|
1116
|
+
mutations?:
|
|
1117
|
+
Mutation[];
|
|
1118
|
+
}
|
|
1095
1119
|
interface Operation {
|
|
1096
1120
|
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
|
|
1097
1121
|
done?:
|
|
@@ -3775,6 +3799,93 @@ declare namespace gapi.client {
|
|
|
3775
3799
|
string;
|
|
3776
3800
|
},
|
|
3777
3801
|
body: BatchCreateSessionsRequest): Request<BatchCreateSessionsResponse>;
|
|
3802
|
+
/**
|
|
3803
|
+
* Batches the supplied mutation groups in a collection of efficient transactions. All mutations in a group are committed atomically. However, mutations across groups can be committed
|
|
3804
|
+
* non-atomically in an unspecified order and thus, they must be independent of each other. Partial failure is possible, i.e., some groups may have been committed successfully, while
|
|
3805
|
+
* some may have failed. The results of individual batches are streamed into the response as the batches are applied. BatchWrite requests are not replay protected, meaning that each
|
|
3806
|
+
* mutation group may be applied more than once. Replays of non-idempotent mutations may have undesirable effects. For example, replays of an insert mutation may produce an already
|
|
3807
|
+
* exists error or result in additional rows if using generated or commit timestamp-based keys. We recommend structuring your mutation groups to be idempotent to avoid this issue.
|
|
3808
|
+
*/
|
|
3809
|
+
batchWrite(request: {
|
|
3810
|
+
/** V1 error format. */
|
|
3811
|
+
"$.xgafv"?:
|
|
3812
|
+
string;
|
|
3813
|
+
/** OAuth access token. */
|
|
3814
|
+
access_token?:
|
|
3815
|
+
string;
|
|
3816
|
+
/** Data format for response. */
|
|
3817
|
+
alt?:
|
|
3818
|
+
string;
|
|
3819
|
+
/** JSONP */
|
|
3820
|
+
callback?:
|
|
3821
|
+
string;
|
|
3822
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
3823
|
+
fields?:
|
|
3824
|
+
string;
|
|
3825
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
3826
|
+
key?:
|
|
3827
|
+
string;
|
|
3828
|
+
/** OAuth 2.0 token for the current user. */
|
|
3829
|
+
oauth_token?:
|
|
3830
|
+
string;
|
|
3831
|
+
/** Returns response with indentations and line breaks. */
|
|
3832
|
+
prettyPrint?:
|
|
3833
|
+
boolean;
|
|
3834
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
3835
|
+
quotaUser?:
|
|
3836
|
+
string;
|
|
3837
|
+
/** Required. The session in which the batch request is to be run. */
|
|
3838
|
+
session:
|
|
3839
|
+
string;
|
|
3840
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
3841
|
+
upload_protocol?:
|
|
3842
|
+
string;
|
|
3843
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
3844
|
+
uploadType?:
|
|
3845
|
+
string;
|
|
3846
|
+
/** Request body */
|
|
3847
|
+
resource:
|
|
3848
|
+
BatchWriteRequest;
|
|
3849
|
+
}): Request<BatchWriteResponse>;
|
|
3850
|
+
batchWrite(request: {
|
|
3851
|
+
/** V1 error format. */
|
|
3852
|
+
"$.xgafv"?:
|
|
3853
|
+
string;
|
|
3854
|
+
/** OAuth access token. */
|
|
3855
|
+
access_token?:
|
|
3856
|
+
string;
|
|
3857
|
+
/** Data format for response. */
|
|
3858
|
+
alt?:
|
|
3859
|
+
string;
|
|
3860
|
+
/** JSONP */
|
|
3861
|
+
callback?:
|
|
3862
|
+
string;
|
|
3863
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
3864
|
+
fields?:
|
|
3865
|
+
string;
|
|
3866
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
3867
|
+
key?:
|
|
3868
|
+
string;
|
|
3869
|
+
/** OAuth 2.0 token for the current user. */
|
|
3870
|
+
oauth_token?:
|
|
3871
|
+
string;
|
|
3872
|
+
/** Returns response with indentations and line breaks. */
|
|
3873
|
+
prettyPrint?:
|
|
3874
|
+
boolean;
|
|
3875
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
3876
|
+
quotaUser?:
|
|
3877
|
+
string;
|
|
3878
|
+
/** Required. The session in which the batch request is to be run. */
|
|
3879
|
+
session:
|
|
3880
|
+
string;
|
|
3881
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
3882
|
+
upload_protocol?:
|
|
3883
|
+
string;
|
|
3884
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
3885
|
+
uploadType?:
|
|
3886
|
+
string;
|
|
3887
|
+
},
|
|
3888
|
+
body: BatchWriteRequest): Request<BatchWriteResponse>;
|
|
3778
3889
|
/** Begins a new transaction. This step can often be skipped: Read, ExecuteSql and Commit can begin a new transaction as a side-effect. */
|
|
3779
3890
|
beginTransaction(request: {
|
|
3780
3891
|
/** V1 error format. */
|
package/package.json
CHANGED
package/tests.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
4
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
5
|
|
|
6
|
-
// Revision:
|
|
6
|
+
// Revision: 20230909
|
|
7
7
|
|
|
8
8
|
gapi.load('client', async () => {
|
|
9
9
|
/** now we can use gapi.client */
|
|
@@ -756,6 +756,101 @@ gapi.load('client', async () => {
|
|
|
756
756
|
name: "Test string",
|
|
757
757
|
},
|
|
758
758
|
});
|
|
759
|
+
/**
|
|
760
|
+
* Batches the supplied mutation groups in a collection of efficient transactions. All mutations in a group are committed atomically. However, mutations across groups can be committed
|
|
761
|
+
* non-atomically in an unspecified order and thus, they must be independent of each other. Partial failure is possible, i.e., some groups may have been committed successfully, while some
|
|
762
|
+
* may have failed. The results of individual batches are streamed into the response as the batches are applied. BatchWrite requests are not replay protected, meaning that each mutation
|
|
763
|
+
* group may be applied more than once. Replays of non-idempotent mutations may have undesirable effects. For example, replays of an insert mutation may produce an already exists error or
|
|
764
|
+
* result in additional rows if using generated or commit timestamp-based keys. We recommend structuring your mutation groups to be idempotent to avoid this issue.
|
|
765
|
+
*/
|
|
766
|
+
await gapi.client.spanner.projects.instances.databases.sessions.batchWrite({
|
|
767
|
+
session: "Test string",
|
|
768
|
+
}, {
|
|
769
|
+
mutationGroups: [
|
|
770
|
+
{
|
|
771
|
+
mutations: [
|
|
772
|
+
{
|
|
773
|
+
delete: {
|
|
774
|
+
keySet: {
|
|
775
|
+
all: true,
|
|
776
|
+
keys: [
|
|
777
|
+
[
|
|
778
|
+
42
|
|
779
|
+
]
|
|
780
|
+
],
|
|
781
|
+
ranges: [
|
|
782
|
+
{
|
|
783
|
+
endClosed: [
|
|
784
|
+
42
|
|
785
|
+
],
|
|
786
|
+
endOpen: [
|
|
787
|
+
42
|
|
788
|
+
],
|
|
789
|
+
startClosed: [
|
|
790
|
+
42
|
|
791
|
+
],
|
|
792
|
+
startOpen: [
|
|
793
|
+
42
|
|
794
|
+
],
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
},
|
|
798
|
+
table: "Test string",
|
|
799
|
+
},
|
|
800
|
+
insert: {
|
|
801
|
+
columns: [
|
|
802
|
+
"Test string"
|
|
803
|
+
],
|
|
804
|
+
table: "Test string",
|
|
805
|
+
values: [
|
|
806
|
+
[
|
|
807
|
+
42
|
|
808
|
+
]
|
|
809
|
+
],
|
|
810
|
+
},
|
|
811
|
+
insertOrUpdate: {
|
|
812
|
+
columns: [
|
|
813
|
+
"Test string"
|
|
814
|
+
],
|
|
815
|
+
table: "Test string",
|
|
816
|
+
values: [
|
|
817
|
+
[
|
|
818
|
+
42
|
|
819
|
+
]
|
|
820
|
+
],
|
|
821
|
+
},
|
|
822
|
+
replace: {
|
|
823
|
+
columns: [
|
|
824
|
+
"Test string"
|
|
825
|
+
],
|
|
826
|
+
table: "Test string",
|
|
827
|
+
values: [
|
|
828
|
+
[
|
|
829
|
+
42
|
|
830
|
+
]
|
|
831
|
+
],
|
|
832
|
+
},
|
|
833
|
+
update: {
|
|
834
|
+
columns: [
|
|
835
|
+
"Test string"
|
|
836
|
+
],
|
|
837
|
+
table: "Test string",
|
|
838
|
+
values: [
|
|
839
|
+
[
|
|
840
|
+
42
|
|
841
|
+
]
|
|
842
|
+
],
|
|
843
|
+
},
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
}
|
|
847
|
+
],
|
|
848
|
+
requestOptions: {
|
|
849
|
+
priority: "Test string",
|
|
850
|
+
requestTag: "Test string",
|
|
851
|
+
transactionTag: "Test string",
|
|
852
|
+
},
|
|
853
|
+
});
|
|
759
854
|
/** Begins a new transaction. This step can often be skipped: Read, ExecuteSql and Commit can begin a new transaction as a side-effect. */
|
|
760
855
|
await gapi.client.spanner.projects.instances.databases.sessions.beginTransaction({
|
|
761
856
|
session: "Test string",
|