@googleapis/storagebatchoperations 8.0.1 → 8.1.0

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/v1.ts CHANGED
@@ -150,6 +150,67 @@ export namespace storagebatchoperations_v1 {
150
150
  */
151
151
  buckets?: Schema$Bucket[];
152
152
  }
153
+ /**
154
+ * BucketOperation represents a bucket-level breakdown of a Job.
155
+ */
156
+ export interface Schema$BucketOperation {
157
+ /**
158
+ * The bucket name of the objects to be transformed in the BucketOperation.
159
+ */
160
+ bucketName?: string | null;
161
+ /**
162
+ * Output only. The time that the BucketOperation was completed.
163
+ */
164
+ completeTime?: string | null;
165
+ /**
166
+ * Output only. Information about the progress of the bucket operation.
167
+ */
168
+ counters?: Schema$Counters;
169
+ /**
170
+ * Output only. The time that the BucketOperation was created.
171
+ */
172
+ createTime?: string | null;
173
+ /**
174
+ * Delete objects.
175
+ */
176
+ deleteObject?: Schema$DeleteObject;
177
+ /**
178
+ * Output only. Summarizes errors encountered with sample error log entries.
179
+ */
180
+ errorSummaries?: Schema$ErrorSummary[];
181
+ /**
182
+ * Specifies objects in a manifest file.
183
+ */
184
+ manifest?: Schema$Manifest;
185
+ /**
186
+ * Identifier. The resource name of the BucketOperation. This is defined by the service. Format: projects/{project\}/locations/global/jobs/{job_id\}/bucketOperations/{bucket_operation\}.
187
+ */
188
+ name?: string | null;
189
+ /**
190
+ * Specifies objects matching a prefix set.
191
+ */
192
+ prefixList?: Schema$PrefixList;
193
+ /**
194
+ * Updates object metadata. Allows updating fixed-key and custom metadata and fixed-key metadata i.e. Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time.
195
+ */
196
+ putMetadata?: Schema$PutMetadata;
197
+ /**
198
+ * Changes object hold status.
199
+ */
200
+ putObjectHold?: Schema$PutObjectHold;
201
+ /**
202
+ * Rewrite the object and updates metadata like KMS key.
203
+ */
204
+ rewriteObject?: Schema$RewriteObject;
205
+ /**
206
+ * Output only. The time that the BucketOperation was started.
207
+ */
208
+ startTime?: string | null;
209
+ /**
210
+ * Output only. State of the BucketOperation.
211
+ */
212
+ state?: string | null;
213
+ }
153
214
  /**
154
215
  * Message for Job to Cancel
155
216
  */
@@ -296,6 +357,23 @@ export namespace storagebatchoperations_v1 {
296
357
  */
297
358
  state?: string | null;
298
359
  }
360
+ /**
361
+ * Message for response to listing BucketOperations
362
+ */
363
+ export interface Schema$ListBucketOperationsResponse {
364
+ /**
365
+ * A list of storage batch bucket operations.
366
+ */
367
+ bucketOperations?: Schema$BucketOperation[];
368
+ /**
369
+ * A token identifying a page of results.
370
+ */
371
+ nextPageToken?: string | null;
372
+ /**
373
+ * Locations that could not be reached.
374
+ */
375
+ unreachable?: string[] | null;
376
+ }
299
377
  /**
300
378
  * Message for response to listing Jobs
301
379
  */
@@ -339,7 +417,7 @@ export namespace storagebatchoperations_v1 {
339
417
  */
340
418
  operations?: Schema$Operation[];
341
419
  /**
342
- * Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections e.g. when attempting to list all resources across all supported locations.
420
+ * Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.
343
421
  */
344
422
  unreachable?: string[] | null;
345
423
  }
@@ -884,8 +962,11 @@ export namespace storagebatchoperations_v1 {
884
962
 
885
963
  export class Resource$Projects$Locations$Jobs {
886
964
  context: APIRequestContext;
965
+ bucketOperations: Resource$Projects$Locations$Jobs$Bucketoperations;
887
966
  constructor(context: APIRequestContext) {
888
967
  this.context = context;
968
+ this.bucketOperations =
969
+ new Resource$Projects$Locations$Jobs$Bucketoperations(this.context);
889
970
  }
890
971
 
891
972
  /**
@@ -1225,6 +1306,8 @@ export namespace storagebatchoperations_v1 {
1225
1306
  *
1226
1307
  * // Do the magic
1227
1308
  * const res = await storagebatchoperations.projects.locations.jobs.delete({
1309
+ * // Optional. If set to true, any child bucket operations of the job will also be deleted. Highly recommended to be set to true by all clients. Users cannot mutate bucket operations directly, so only the jobs.delete permission is required to delete a job (and its child bucket operations).
1310
+ * force: 'placeholder-value',
1228
1311
  * // Required. The `name` of the job to delete. Format: projects/{project_id\}/locations/global/jobs/{job_id\} .
1229
1312
  * name: 'projects/my-project/locations/my-location/jobs/my-job',
1230
1313
  * // Optional. An optional request ID to identify requests. Specify a unique request ID in case you need to retry your request. Requests with same `request_id` will be ignored for at least 60 minutes since the first request. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@@ -1655,6 +1738,10 @@ export namespace storagebatchoperations_v1 {
1655
1738
  requestBody?: Schema$Job;
1656
1739
  }
1657
1740
  export interface Params$Resource$Projects$Locations$Jobs$Delete extends StandardParameters {
1741
+ /**
1742
+ * Optional. If set to true, any child bucket operations of the job will also be deleted. Highly recommended to be set to true by all clients. Users cannot mutate bucket operations directly, so only the jobs.delete permission is required to delete a job (and its child bucket operations).
1743
+ */
1744
+ force?: boolean;
1658
1745
  /**
1659
1746
  * Required. The `name` of the job to delete. Format: projects/{project_id\}/locations/global/jobs/{job_id\} .
1660
1747
  */
@@ -1693,6 +1780,348 @@ export namespace storagebatchoperations_v1 {
1693
1780
  parent?: string;
1694
1781
  }
1695
1782
 
1783
+ export class Resource$Projects$Locations$Jobs$Bucketoperations {
1784
+ context: APIRequestContext;
1785
+ constructor(context: APIRequestContext) {
1786
+ this.context = context;
1787
+ }
1788
+
1789
+ /**
1790
+ * Gets a BucketOperation.
1791
+ * @example
1792
+ * ```js
1793
+ * // Before running the sample:
1794
+ * // - Enable the API at:
1795
+ * // https://console.developers.google.com/apis/api/storagebatchoperations.googleapis.com
1796
+ * // - Login into gcloud by running:
1797
+ * // ```sh
1798
+ * // $ gcloud auth application-default login
1799
+ * // ```
1800
+ * // - Install the npm module by running:
1801
+ * // ```sh
1802
+ * // $ npm install googleapis
1803
+ * // ```
1804
+ *
1805
+ * const {google} = require('googleapis');
1806
+ * const storagebatchoperations = google.storagebatchoperations('v1');
1807
+ *
1808
+ * async function main() {
1809
+ * const auth = new google.auth.GoogleAuth({
1810
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1811
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1812
+ * });
1813
+ *
1814
+ * // Acquire an auth client, and bind it to all future calls
1815
+ * const authClient = await auth.getClient();
1816
+ * google.options({auth: authClient});
1817
+ *
1818
+ * // Do the magic
1819
+ * const res =
1820
+ * await storagebatchoperations.projects.locations.jobs.bucketOperations.get({
1821
+ * // Required. `name` of the bucket operation to retrieve. Format: projects/{project_id\}/locations/global/jobs/{job_id\}/bucketOperations/{bucket_operation_id\}.
1822
+ * name: 'projects/my-project/locations/my-location/jobs/my-job/bucketOperations/my-bucketOperation',
1823
+ * });
1824
+ * console.log(res.data);
1825
+ *
1826
+ * // Example response
1827
+ * // {
1828
+ * // "bucketName": "my_bucketName",
1829
+ * // "completeTime": "my_completeTime",
1830
+ * // "counters": {},
1831
+ * // "createTime": "my_createTime",
1832
+ * // "deleteObject": {},
1833
+ * // "errorSummaries": [],
1834
+ * // "manifest": {},
1835
+ * // "name": "my_name",
1836
+ * // "prefixList": {},
1837
+ * // "putMetadata": {},
1838
+ * // "putObjectHold": {},
1839
+ * // "rewriteObject": {},
1840
+ * // "startTime": "my_startTime",
1841
+ * // "state": "my_state"
1842
+ * // }
1843
+ * }
1844
+ *
1845
+ * main().catch(e => {
1846
+ * console.error(e);
1847
+ * throw e;
1848
+ * });
1849
+ *
1850
+ * ```
1851
+ *
1852
+ * @param params - Parameters for request
1853
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1854
+ * @param callback - Optional callback that handles the response.
1855
+ * @returns A promise if used with async/await, or void if used with a callback.
1856
+ */
1857
+ get(
1858
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get,
1859
+ options: StreamMethodOptions
1860
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1861
+ get(
1862
+ params?: Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get,
1863
+ options?: MethodOptions
1864
+ ): Promise<GaxiosResponseWithHTTP2<Schema$BucketOperation>>;
1865
+ get(
1866
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get,
1867
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1868
+ callback: BodyResponseCallback<Readable>
1869
+ ): void;
1870
+ get(
1871
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get,
1872
+ options: MethodOptions | BodyResponseCallback<Schema$BucketOperation>,
1873
+ callback: BodyResponseCallback<Schema$BucketOperation>
1874
+ ): void;
1875
+ get(
1876
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get,
1877
+ callback: BodyResponseCallback<Schema$BucketOperation>
1878
+ ): void;
1879
+ get(callback: BodyResponseCallback<Schema$BucketOperation>): void;
1880
+ get(
1881
+ paramsOrCallback?:
1882
+ | Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get
1883
+ | BodyResponseCallback<Schema$BucketOperation>
1884
+ | BodyResponseCallback<Readable>,
1885
+ optionsOrCallback?:
1886
+ | MethodOptions
1887
+ | StreamMethodOptions
1888
+ | BodyResponseCallback<Schema$BucketOperation>
1889
+ | BodyResponseCallback<Readable>,
1890
+ callback?:
1891
+ | BodyResponseCallback<Schema$BucketOperation>
1892
+ | BodyResponseCallback<Readable>
1893
+ ):
1894
+ | void
1895
+ | Promise<GaxiosResponseWithHTTP2<Schema$BucketOperation>>
1896
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1897
+ let params = (paramsOrCallback ||
1898
+ {}) as Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get;
1899
+ let options = (optionsOrCallback || {}) as MethodOptions;
1900
+
1901
+ if (typeof paramsOrCallback === 'function') {
1902
+ callback = paramsOrCallback;
1903
+ params =
1904
+ {} as Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get;
1905
+ options = {};
1906
+ }
1907
+
1908
+ if (typeof optionsOrCallback === 'function') {
1909
+ callback = optionsOrCallback;
1910
+ options = {};
1911
+ }
1912
+
1913
+ const rootUrl =
1914
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
1915
+ const parameters = {
1916
+ options: Object.assign(
1917
+ {
1918
+ url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1919
+ method: 'GET',
1920
+ apiVersion: '',
1921
+ },
1922
+ options
1923
+ ),
1924
+ params,
1925
+ requiredParams: ['name'],
1926
+ pathParams: ['name'],
1927
+ context: this.context,
1928
+ };
1929
+ if (callback) {
1930
+ createAPIRequest<Schema$BucketOperation>(
1931
+ parameters,
1932
+ callback as BodyResponseCallback<unknown>
1933
+ );
1934
+ } else {
1935
+ return createAPIRequest<Schema$BucketOperation>(parameters);
1936
+ }
1937
+ }
1938
+
1939
+ /**
1940
+ * Lists BucketOperations in a given project and job.
1941
+ * @example
1942
+ * ```js
1943
+ * // Before running the sample:
1944
+ * // - Enable the API at:
1945
+ * // https://console.developers.google.com/apis/api/storagebatchoperations.googleapis.com
1946
+ * // - Login into gcloud by running:
1947
+ * // ```sh
1948
+ * // $ gcloud auth application-default login
1949
+ * // ```
1950
+ * // - Install the npm module by running:
1951
+ * // ```sh
1952
+ * // $ npm install googleapis
1953
+ * // ```
1954
+ *
1955
+ * const {google} = require('googleapis');
1956
+ * const storagebatchoperations = google.storagebatchoperations('v1');
1957
+ *
1958
+ * async function main() {
1959
+ * const auth = new google.auth.GoogleAuth({
1960
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1961
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1962
+ * });
1963
+ *
1964
+ * // Acquire an auth client, and bind it to all future calls
1965
+ * const authClient = await auth.getClient();
1966
+ * google.options({auth: authClient});
1967
+ *
1968
+ * // Do the magic
1969
+ * const res =
1970
+ * await storagebatchoperations.projects.locations.jobs.bucketOperations.list({
1971
+ * // Optional. Filters results as defined by https://google.aip.dev/160.
1972
+ * filter: 'placeholder-value',
1973
+ * // Optional. Field to sort by. Supported fields are name, create_time.
1974
+ * orderBy: 'placeholder-value',
1975
+ * // Optional. The list page size. Default page size is 100.
1976
+ * pageSize: 'placeholder-value',
1977
+ * // Optional. The list page token.
1978
+ * pageToken: 'placeholder-value',
1979
+ * // Required. Format: projects/{project_id\}/locations/global/jobs/{job_id\}.
1980
+ * parent: 'projects/my-project/locations/my-location/jobs/my-job',
1981
+ * });
1982
+ * console.log(res.data);
1983
+ *
1984
+ * // Example response
1985
+ * // {
1986
+ * // "bucketOperations": [],
1987
+ * // "nextPageToken": "my_nextPageToken",
1988
+ * // "unreachable": []
1989
+ * // }
1990
+ * }
1991
+ *
1992
+ * main().catch(e => {
1993
+ * console.error(e);
1994
+ * throw e;
1995
+ * });
1996
+ *
1997
+ * ```
1998
+ *
1999
+ * @param params - Parameters for request
2000
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2001
+ * @param callback - Optional callback that handles the response.
2002
+ * @returns A promise if used with async/await, or void if used with a callback.
2003
+ */
2004
+ list(
2005
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$List,
2006
+ options: StreamMethodOptions
2007
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2008
+ list(
2009
+ params?: Params$Resource$Projects$Locations$Jobs$Bucketoperations$List,
2010
+ options?: MethodOptions
2011
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListBucketOperationsResponse>>;
2012
+ list(
2013
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$List,
2014
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2015
+ callback: BodyResponseCallback<Readable>
2016
+ ): void;
2017
+ list(
2018
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$List,
2019
+ options:
2020
+ | MethodOptions
2021
+ | BodyResponseCallback<Schema$ListBucketOperationsResponse>,
2022
+ callback: BodyResponseCallback<Schema$ListBucketOperationsResponse>
2023
+ ): void;
2024
+ list(
2025
+ params: Params$Resource$Projects$Locations$Jobs$Bucketoperations$List,
2026
+ callback: BodyResponseCallback<Schema$ListBucketOperationsResponse>
2027
+ ): void;
2028
+ list(
2029
+ callback: BodyResponseCallback<Schema$ListBucketOperationsResponse>
2030
+ ): void;
2031
+ list(
2032
+ paramsOrCallback?:
2033
+ | Params$Resource$Projects$Locations$Jobs$Bucketoperations$List
2034
+ | BodyResponseCallback<Schema$ListBucketOperationsResponse>
2035
+ | BodyResponseCallback<Readable>,
2036
+ optionsOrCallback?:
2037
+ | MethodOptions
2038
+ | StreamMethodOptions
2039
+ | BodyResponseCallback<Schema$ListBucketOperationsResponse>
2040
+ | BodyResponseCallback<Readable>,
2041
+ callback?:
2042
+ | BodyResponseCallback<Schema$ListBucketOperationsResponse>
2043
+ | BodyResponseCallback<Readable>
2044
+ ):
2045
+ | void
2046
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListBucketOperationsResponse>>
2047
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2048
+ let params = (paramsOrCallback ||
2049
+ {}) as Params$Resource$Projects$Locations$Jobs$Bucketoperations$List;
2050
+ let options = (optionsOrCallback || {}) as MethodOptions;
2051
+
2052
+ if (typeof paramsOrCallback === 'function') {
2053
+ callback = paramsOrCallback;
2054
+ params =
2055
+ {} as Params$Resource$Projects$Locations$Jobs$Bucketoperations$List;
2056
+ options = {};
2057
+ }
2058
+
2059
+ if (typeof optionsOrCallback === 'function') {
2060
+ callback = optionsOrCallback;
2061
+ options = {};
2062
+ }
2063
+
2064
+ const rootUrl =
2065
+ options.rootUrl || 'https://storagebatchoperations.googleapis.com/';
2066
+ const parameters = {
2067
+ options: Object.assign(
2068
+ {
2069
+ url: (rootUrl + '/v1/{+parent}/bucketOperations').replace(
2070
+ /([^:]\/)\/+/g,
2071
+ '$1'
2072
+ ),
2073
+ method: 'GET',
2074
+ apiVersion: '',
2075
+ },
2076
+ options
2077
+ ),
2078
+ params,
2079
+ requiredParams: ['parent'],
2080
+ pathParams: ['parent'],
2081
+ context: this.context,
2082
+ };
2083
+ if (callback) {
2084
+ createAPIRequest<Schema$ListBucketOperationsResponse>(
2085
+ parameters,
2086
+ callback as BodyResponseCallback<unknown>
2087
+ );
2088
+ } else {
2089
+ return createAPIRequest<Schema$ListBucketOperationsResponse>(
2090
+ parameters
2091
+ );
2092
+ }
2093
+ }
2094
+ }
2095
+
2096
+ export interface Params$Resource$Projects$Locations$Jobs$Bucketoperations$Get extends StandardParameters {
2097
+ /**
2098
+ * Required. `name` of the bucket operation to retrieve. Format: projects/{project_id\}/locations/global/jobs/{job_id\}/bucketOperations/{bucket_operation_id\}.
2099
+ */
2100
+ name?: string;
2101
+ }
2102
+ export interface Params$Resource$Projects$Locations$Jobs$Bucketoperations$List extends StandardParameters {
2103
+ /**
2104
+ * Optional. Filters results as defined by https://google.aip.dev/160.
2105
+ */
2106
+ filter?: string;
2107
+ /**
2108
+ * Optional. Field to sort by. Supported fields are name, create_time.
2109
+ */
2110
+ orderBy?: string;
2111
+ /**
2112
+ * Optional. The list page size. Default page size is 100.
2113
+ */
2114
+ pageSize?: number;
2115
+ /**
2116
+ * Optional. The list page token.
2117
+ */
2118
+ pageToken?: string;
2119
+ /**
2120
+ * Required. Format: projects/{project_id\}/locations/global/jobs/{job_id\}.
2121
+ */
2122
+ parent?: string;
2123
+ }
2124
+
1696
2125
  export class Resource$Projects$Locations$Operations {
1697
2126
  context: APIRequestContext;
1698
2127
  constructor(context: APIRequestContext) {
@@ -2153,7 +2582,7 @@ export namespace storagebatchoperations_v1 {
2153
2582
  * pageSize: 'placeholder-value',
2154
2583
  * // The standard list page token.
2155
2584
  * pageToken: 'placeholder-value',
2156
- * // When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the [ListOperationsResponse.unreachable] field. This can only be `true` when reading across collections e.g. when `parent` is set to `"projects/example/locations/-"`. This field is not by default supported and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
2585
+ * // When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
2157
2586
  * returnPartialSuccess: 'placeholder-value',
2158
2587
  * });
2159
2588
  * console.log(res.data);
@@ -2306,7 +2735,7 @@ export namespace storagebatchoperations_v1 {
2306
2735
  */
2307
2736
  pageToken?: string;
2308
2737
  /**
2309
- * When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the [ListOperationsResponse.unreachable] field. This can only be `true` when reading across collections e.g. when `parent` is set to `"projects/example/locations/-"`. This field is not by default supported and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
2738
+ * When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
2310
2739
  */
2311
2740
  returnPartialSuccess?: boolean;
2312
2741
  }