google-apis-bigqueryreservation_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module BigqueryreservationV1
18
+ # Version of the google-apis-bigqueryreservation_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200808"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,298 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module BigqueryreservationV1
24
+
25
+ class Assignment
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class BiReservation
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class CapacityCommitment
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class CreateSlotPoolMetadata
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Empty
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ListAssignmentsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ListCapacityCommitmentsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class ListOperationsResponse
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ListReservationsResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class MergeCapacityCommitmentsRequest
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class MoveAssignmentRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class Operation
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Reservation
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class SearchAllAssignmentsResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class SearchAssignmentsResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class SplitCapacityCommitmentRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class SplitCapacityCommitmentResponse
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Status
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class Assignment
134
+ # @private
135
+ class Representation < Google::Apis::Core::JsonRepresentation
136
+ property :assignee, as: 'assignee'
137
+ property :job_type, as: 'jobType'
138
+ property :name, as: 'name'
139
+ property :state, as: 'state'
140
+ end
141
+ end
142
+
143
+ class BiReservation
144
+ # @private
145
+ class Representation < Google::Apis::Core::JsonRepresentation
146
+ property :name, as: 'name'
147
+ property :size, :numeric_string => true, as: 'size'
148
+ property :update_time, as: 'updateTime'
149
+ end
150
+ end
151
+
152
+ class CapacityCommitment
153
+ # @private
154
+ class Representation < Google::Apis::Core::JsonRepresentation
155
+ property :commitment_end_time, as: 'commitmentEndTime'
156
+ property :commitment_start_time, as: 'commitmentStartTime'
157
+ property :failure_status, as: 'failureStatus', class: Google::Apis::BigqueryreservationV1::Status, decorator: Google::Apis::BigqueryreservationV1::Status::Representation
158
+
159
+ property :name, as: 'name'
160
+ property :plan, as: 'plan'
161
+ property :renewal_plan, as: 'renewalPlan'
162
+ property :slot_count, :numeric_string => true, as: 'slotCount'
163
+ property :state, as: 'state'
164
+ end
165
+ end
166
+
167
+ class CreateSlotPoolMetadata
168
+ # @private
169
+ class Representation < Google::Apis::Core::JsonRepresentation
170
+ property :slot_pool, as: 'slotPool'
171
+ end
172
+ end
173
+
174
+ class Empty
175
+ # @private
176
+ class Representation < Google::Apis::Core::JsonRepresentation
177
+ end
178
+ end
179
+
180
+ class ListAssignmentsResponse
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ collection :assignments, as: 'assignments', class: Google::Apis::BigqueryreservationV1::Assignment, decorator: Google::Apis::BigqueryreservationV1::Assignment::Representation
184
+
185
+ property :next_page_token, as: 'nextPageToken'
186
+ end
187
+ end
188
+
189
+ class ListCapacityCommitmentsResponse
190
+ # @private
191
+ class Representation < Google::Apis::Core::JsonRepresentation
192
+ collection :capacity_commitments, as: 'capacityCommitments', class: Google::Apis::BigqueryreservationV1::CapacityCommitment, decorator: Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
193
+
194
+ property :next_page_token, as: 'nextPageToken'
195
+ end
196
+ end
197
+
198
+ class ListOperationsResponse
199
+ # @private
200
+ class Representation < Google::Apis::Core::JsonRepresentation
201
+ property :next_page_token, as: 'nextPageToken'
202
+ collection :operations, as: 'operations', class: Google::Apis::BigqueryreservationV1::Operation, decorator: Google::Apis::BigqueryreservationV1::Operation::Representation
203
+
204
+ end
205
+ end
206
+
207
+ class ListReservationsResponse
208
+ # @private
209
+ class Representation < Google::Apis::Core::JsonRepresentation
210
+ property :next_page_token, as: 'nextPageToken'
211
+ collection :reservations, as: 'reservations', class: Google::Apis::BigqueryreservationV1::Reservation, decorator: Google::Apis::BigqueryreservationV1::Reservation::Representation
212
+
213
+ end
214
+ end
215
+
216
+ class MergeCapacityCommitmentsRequest
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ collection :capacity_commitment_ids, as: 'capacityCommitmentIds'
220
+ end
221
+ end
222
+
223
+ class MoveAssignmentRequest
224
+ # @private
225
+ class Representation < Google::Apis::Core::JsonRepresentation
226
+ property :destination_id, as: 'destinationId'
227
+ end
228
+ end
229
+
230
+ class Operation
231
+ # @private
232
+ class Representation < Google::Apis::Core::JsonRepresentation
233
+ property :done, as: 'done'
234
+ property :error, as: 'error', class: Google::Apis::BigqueryreservationV1::Status, decorator: Google::Apis::BigqueryreservationV1::Status::Representation
235
+
236
+ hash :metadata, as: 'metadata'
237
+ property :name, as: 'name'
238
+ hash :response, as: 'response'
239
+ end
240
+ end
241
+
242
+ class Reservation
243
+ # @private
244
+ class Representation < Google::Apis::Core::JsonRepresentation
245
+ property :creation_time, as: 'creationTime'
246
+ property :ignore_idle_slots, as: 'ignoreIdleSlots'
247
+ property :name, as: 'name'
248
+ property :slot_capacity, :numeric_string => true, as: 'slotCapacity'
249
+ property :update_time, as: 'updateTime'
250
+ end
251
+ end
252
+
253
+ class SearchAllAssignmentsResponse
254
+ # @private
255
+ class Representation < Google::Apis::Core::JsonRepresentation
256
+ collection :assignments, as: 'assignments', class: Google::Apis::BigqueryreservationV1::Assignment, decorator: Google::Apis::BigqueryreservationV1::Assignment::Representation
257
+
258
+ property :next_page_token, as: 'nextPageToken'
259
+ end
260
+ end
261
+
262
+ class SearchAssignmentsResponse
263
+ # @private
264
+ class Representation < Google::Apis::Core::JsonRepresentation
265
+ collection :assignments, as: 'assignments', class: Google::Apis::BigqueryreservationV1::Assignment, decorator: Google::Apis::BigqueryreservationV1::Assignment::Representation
266
+
267
+ property :next_page_token, as: 'nextPageToken'
268
+ end
269
+ end
270
+
271
+ class SplitCapacityCommitmentRequest
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :slot_count, :numeric_string => true, as: 'slotCount'
275
+ end
276
+ end
277
+
278
+ class SplitCapacityCommitmentResponse
279
+ # @private
280
+ class Representation < Google::Apis::Core::JsonRepresentation
281
+ property :first, as: 'first', class: Google::Apis::BigqueryreservationV1::CapacityCommitment, decorator: Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
282
+
283
+ property :second, as: 'second', class: Google::Apis::BigqueryreservationV1::CapacityCommitment, decorator: Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
284
+
285
+ end
286
+ end
287
+
288
+ class Status
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ property :code, as: 'code'
292
+ collection :details, as: 'details'
293
+ property :message, as: 'message'
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,913 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module BigqueryreservationV1
23
+ # BigQuery Reservation API
24
+ #
25
+ # A service to modify your BigQuery flat-rate reservations.
26
+ #
27
+ # @example
28
+ # require 'google/apis/bigqueryreservation_v1'
29
+ #
30
+ # Bigqueryreservation = Google::Apis::BigqueryreservationV1 # Alias the module
31
+ # service = Bigqueryreservation::BigQueryReservationService.new
32
+ #
33
+ # @see https://cloud.google.com/bigquery/
34
+ class BigQueryReservationService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://bigqueryreservation.googleapis.com/', '',
47
+ client_name: 'google-apis-bigqueryreservation_v1',
48
+ client_version: Google::Apis::BigqueryreservationV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Deletes a long-running operation. This method indicates that the client is no
53
+ # longer interested in the operation result. It does not cancel the operation.
54
+ # If the server doesn't support this method, it returns `google.rpc.Code.
55
+ # UNIMPLEMENTED`.
56
+ # @param [String] name
57
+ # The name of the operation resource to be deleted.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Empty] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::BigqueryreservationV1::Empty]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:delete, 'v1/{+name}', options)
77
+ command.response_representation = Google::Apis::BigqueryreservationV1::Empty::Representation
78
+ command.response_class = Google::Apis::BigqueryreservationV1::Empty
79
+ command.params['name'] = name unless name.nil?
80
+ command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
+ execute_or_queue_command(command, &block)
83
+ end
84
+
85
+ # Lists operations that match the specified filter in the request. If the server
86
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
87
+ # binding allows API services to override the binding to use different resource
88
+ # name schemes, such as `users/*/operations`. To override the binding, API
89
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
90
+ # service configuration. For backwards compatibility, the default name includes
91
+ # the operations collection id, however overriding users must ensure the name
92
+ # binding is the parent resource, without the operations collection id.
93
+ # @param [String] name
94
+ # The name of the operation's parent resource.
95
+ # @param [String] filter
96
+ # The standard list filter.
97
+ # @param [Fixnum] page_size
98
+ # The standard list page size.
99
+ # @param [String] page_token
100
+ # The standard list page token.
101
+ # @param [String] fields
102
+ # Selector specifying which fields to include in a partial response.
103
+ # @param [String] quota_user
104
+ # Available to use for quota purposes for server-side applications. Can be any
105
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
106
+ # @param [Google::Apis::RequestOptions] options
107
+ # Request-specific options
108
+ #
109
+ # @yield [result, err] Result & error if block supplied
110
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::ListOperationsResponse] parsed result object
111
+ # @yieldparam err [StandardError] error object if request failed
112
+ #
113
+ # @return [Google::Apis::BigqueryreservationV1::ListOperationsResponse]
114
+ #
115
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
116
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
117
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
118
+ def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
119
+ command = make_simple_command(:get, 'v1/{+name}', options)
120
+ command.response_representation = Google::Apis::BigqueryreservationV1::ListOperationsResponse::Representation
121
+ command.response_class = Google::Apis::BigqueryreservationV1::ListOperationsResponse
122
+ command.params['name'] = name unless name.nil?
123
+ command.query['filter'] = filter unless filter.nil?
124
+ command.query['pageSize'] = page_size unless page_size.nil?
125
+ command.query['pageToken'] = page_token unless page_token.nil?
126
+ command.query['fields'] = fields unless fields.nil?
127
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
128
+ execute_or_queue_command(command, &block)
129
+ end
130
+
131
+ # Retrieves a BI reservation.
132
+ # @param [String] name
133
+ # Required. Name of the requested reservation, for example: `projects/`
134
+ # project_id`/locations/`location_id`/bireservation`
135
+ # @param [String] fields
136
+ # Selector specifying which fields to include in a partial response.
137
+ # @param [String] quota_user
138
+ # Available to use for quota purposes for server-side applications. Can be any
139
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
140
+ # @param [Google::Apis::RequestOptions] options
141
+ # Request-specific options
142
+ #
143
+ # @yield [result, err] Result & error if block supplied
144
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::BiReservation] parsed result object
145
+ # @yieldparam err [StandardError] error object if request failed
146
+ #
147
+ # @return [Google::Apis::BigqueryreservationV1::BiReservation]
148
+ #
149
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
150
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
151
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
152
+ def get_project_location_bi_reservation(name, fields: nil, quota_user: nil, options: nil, &block)
153
+ command = make_simple_command(:get, 'v1/{+name}', options)
154
+ command.response_representation = Google::Apis::BigqueryreservationV1::BiReservation::Representation
155
+ command.response_class = Google::Apis::BigqueryreservationV1::BiReservation
156
+ command.params['name'] = name unless name.nil?
157
+ command.query['fields'] = fields unless fields.nil?
158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
159
+ execute_or_queue_command(command, &block)
160
+ end
161
+
162
+ # Looks up assignments for a specified resource for a particular region. If the
163
+ # request is about a project: 1. Assignments created on the project will be
164
+ # returned if they exist. 2. Otherwise assignments created on the closest
165
+ # ancestor will be returned. 3. Assignments for different JobTypes will all be
166
+ # returned. The same logic applies if the request is about a folder. If the
167
+ # request is about an organization, then assignments created on the organization
168
+ # will be returned (organization doesn't have ancestors). Comparing to
169
+ # ListAssignments, there are some behavior differences: 1. permission on the
170
+ # assignee will be verified in this API. 2. Hierarchy lookup (project->folder->
171
+ # organization) happens in this API. 3. Parent here is `projects/*/locations/*`,
172
+ # instead of `projects/*/locations/*reservations/*`.
173
+ # @param [String] parent
174
+ # Required. The resource name with location (project name could be the wildcard '
175
+ # -'), e.g.: `projects/-/locations/US`.
176
+ # @param [Fixnum] page_size
177
+ # The maximum number of items to return per page.
178
+ # @param [String] page_token
179
+ # The next_page_token value returned from a previous List request, if any.
180
+ # @param [String] query
181
+ # Please specify resource name as assignee in the query. Examples: * `assignee=
182
+ # projects/myproject` * `assignee=folders/123` * `assignee=organizations/456`
183
+ # @param [String] fields
184
+ # Selector specifying which fields to include in a partial response.
185
+ # @param [String] quota_user
186
+ # Available to use for quota purposes for server-side applications. Can be any
187
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
188
+ # @param [Google::Apis::RequestOptions] options
189
+ # Request-specific options
190
+ #
191
+ # @yield [result, err] Result & error if block supplied
192
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::SearchAllAssignmentsResponse] parsed result object
193
+ # @yieldparam err [StandardError] error object if request failed
194
+ #
195
+ # @return [Google::Apis::BigqueryreservationV1::SearchAllAssignmentsResponse]
196
+ #
197
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
198
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
199
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
200
+ def search_project_location_all_assignments(parent, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
201
+ command = make_simple_command(:get, 'v1/{+parent}:searchAllAssignments', options)
202
+ command.response_representation = Google::Apis::BigqueryreservationV1::SearchAllAssignmentsResponse::Representation
203
+ command.response_class = Google::Apis::BigqueryreservationV1::SearchAllAssignmentsResponse
204
+ command.params['parent'] = parent unless parent.nil?
205
+ command.query['pageSize'] = page_size unless page_size.nil?
206
+ command.query['pageToken'] = page_token unless page_token.nil?
207
+ command.query['query'] = query unless query.nil?
208
+ command.query['fields'] = fields unless fields.nil?
209
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
210
+ execute_or_queue_command(command, &block)
211
+ end
212
+
213
+ # Looks up assignments for a specified resource for a particular region. If the
214
+ # request is about a project: 1. Assignments created on the project will be
215
+ # returned if they exist. 2. Otherwise assignments created on the closest
216
+ # ancestor will be returned. 3. Assignments for different JobTypes will all be
217
+ # returned. The same logic applies if the request is about a folder. If the
218
+ # request is about an organization, then assignments created on the organization
219
+ # will be returned (organization doesn't have ancestors). Comparing to
220
+ # ListAssignments, there are some behavior differences: 1. permission on the
221
+ # assignee will be verified in this API. 2. Hierarchy lookup (project->folder->
222
+ # organization) happens in this API. 3. Parent here is `projects/*/locations/*`,
223
+ # instead of `projects/*/locations/*reservations/*`. **Note** "-" cannot be used
224
+ # for projects nor locations.
225
+ # @param [String] parent
226
+ # Required. The resource name of the admin project(containing project and
227
+ # location), e.g.: `projects/myproject/locations/US`.
228
+ # @param [Fixnum] page_size
229
+ # The maximum number of items to return per page.
230
+ # @param [String] page_token
231
+ # The next_page_token value returned from a previous List request, if any.
232
+ # @param [String] query
233
+ # Please specify resource name as assignee in the query. Examples: * `assignee=
234
+ # projects/myproject` * `assignee=folders/123` * `assignee=organizations/456`
235
+ # @param [String] fields
236
+ # Selector specifying which fields to include in a partial response.
237
+ # @param [String] quota_user
238
+ # Available to use for quota purposes for server-side applications. Can be any
239
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
240
+ # @param [Google::Apis::RequestOptions] options
241
+ # Request-specific options
242
+ #
243
+ # @yield [result, err] Result & error if block supplied
244
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::SearchAssignmentsResponse] parsed result object
245
+ # @yieldparam err [StandardError] error object if request failed
246
+ #
247
+ # @return [Google::Apis::BigqueryreservationV1::SearchAssignmentsResponse]
248
+ #
249
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
250
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
251
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
252
+ def search_project_location_assignments(parent, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
253
+ command = make_simple_command(:get, 'v1/{+parent}:searchAssignments', options)
254
+ command.response_representation = Google::Apis::BigqueryreservationV1::SearchAssignmentsResponse::Representation
255
+ command.response_class = Google::Apis::BigqueryreservationV1::SearchAssignmentsResponse
256
+ command.params['parent'] = parent unless parent.nil?
257
+ command.query['pageSize'] = page_size unless page_size.nil?
258
+ command.query['pageToken'] = page_token unless page_token.nil?
259
+ command.query['query'] = query unless query.nil?
260
+ command.query['fields'] = fields unless fields.nil?
261
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
262
+ execute_or_queue_command(command, &block)
263
+ end
264
+
265
+ # Updates a BI reservation. Only fields specified in the `field_mask` are
266
+ # updated. A singleton BI reservation always exists with default size 0. In
267
+ # order to reserve BI capacity it needs to be updated to an amount greater than
268
+ # 0. In order to release BI capacity reservation size must be set to 0.
269
+ # @param [String] name
270
+ # The resource name of the singleton BI reservation. Reservation names have the
271
+ # form `projects/`project_id`/locations/`location_id`/bireservation`.
272
+ # @param [Google::Apis::BigqueryreservationV1::BiReservation] bi_reservation_object
273
+ # @param [String] update_mask
274
+ # A list of fields to be updated in this request.
275
+ # @param [String] fields
276
+ # Selector specifying which fields to include in a partial response.
277
+ # @param [String] quota_user
278
+ # Available to use for quota purposes for server-side applications. Can be any
279
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
280
+ # @param [Google::Apis::RequestOptions] options
281
+ # Request-specific options
282
+ #
283
+ # @yield [result, err] Result & error if block supplied
284
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::BiReservation] parsed result object
285
+ # @yieldparam err [StandardError] error object if request failed
286
+ #
287
+ # @return [Google::Apis::BigqueryreservationV1::BiReservation]
288
+ #
289
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
290
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
291
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
292
+ def update_project_location_bi_reservation(name, bi_reservation_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
293
+ command = make_simple_command(:patch, 'v1/{+name}', options)
294
+ command.request_representation = Google::Apis::BigqueryreservationV1::BiReservation::Representation
295
+ command.request_object = bi_reservation_object
296
+ command.response_representation = Google::Apis::BigqueryreservationV1::BiReservation::Representation
297
+ command.response_class = Google::Apis::BigqueryreservationV1::BiReservation
298
+ command.params['name'] = name unless name.nil?
299
+ command.query['updateMask'] = update_mask unless update_mask.nil?
300
+ command.query['fields'] = fields unless fields.nil?
301
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
302
+ execute_or_queue_command(command, &block)
303
+ end
304
+
305
+ # Creates a new capacity commitment resource.
306
+ # @param [String] parent
307
+ # Required. Resource name of the parent reservation. E.g., `projects/myproject/
308
+ # locations/US`
309
+ # @param [Google::Apis::BigqueryreservationV1::CapacityCommitment] capacity_commitment_object
310
+ # @param [Boolean] enforce_single_admin_project_per_org
311
+ # If true, fail the request if another project in the organization has a
312
+ # capacity commitment.
313
+ # @param [String] fields
314
+ # Selector specifying which fields to include in a partial response.
315
+ # @param [String] quota_user
316
+ # Available to use for quota purposes for server-side applications. Can be any
317
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::CapacityCommitment] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::BigqueryreservationV1::CapacityCommitment]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ def create_project_location_capacity_commitment(parent, capacity_commitment_object = nil, enforce_single_admin_project_per_org: nil, fields: nil, quota_user: nil, options: nil, &block)
331
+ command = make_simple_command(:post, 'v1/{+parent}/capacityCommitments', options)
332
+ command.request_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
333
+ command.request_object = capacity_commitment_object
334
+ command.response_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
335
+ command.response_class = Google::Apis::BigqueryreservationV1::CapacityCommitment
336
+ command.params['parent'] = parent unless parent.nil?
337
+ command.query['enforceSingleAdminProjectPerOrg'] = enforce_single_admin_project_per_org unless enforce_single_admin_project_per_org.nil?
338
+ command.query['fields'] = fields unless fields.nil?
339
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
340
+ execute_or_queue_command(command, &block)
341
+ end
342
+
343
+ # Deletes a capacity commitment. Attempting to delete capacity commitment before
344
+ # its commitment_end_time will fail with the error code `google.rpc.Code.
345
+ # FAILED_PRECONDITION`.
346
+ # @param [String] name
347
+ # Required. Resource name of the capacity commitment to delete. E.g., `projects/
348
+ # myproject/locations/US/capacityCommitments/123`
349
+ # @param [String] fields
350
+ # Selector specifying which fields to include in a partial response.
351
+ # @param [String] quota_user
352
+ # Available to use for quota purposes for server-side applications. Can be any
353
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
354
+ # @param [Google::Apis::RequestOptions] options
355
+ # Request-specific options
356
+ #
357
+ # @yield [result, err] Result & error if block supplied
358
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Empty] parsed result object
359
+ # @yieldparam err [StandardError] error object if request failed
360
+ #
361
+ # @return [Google::Apis::BigqueryreservationV1::Empty]
362
+ #
363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
366
+ def delete_project_location_capacity_commitment(name, fields: nil, quota_user: nil, options: nil, &block)
367
+ command = make_simple_command(:delete, 'v1/{+name}', options)
368
+ command.response_representation = Google::Apis::BigqueryreservationV1::Empty::Representation
369
+ command.response_class = Google::Apis::BigqueryreservationV1::Empty
370
+ command.params['name'] = name unless name.nil?
371
+ command.query['fields'] = fields unless fields.nil?
372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
373
+ execute_or_queue_command(command, &block)
374
+ end
375
+
376
+ # Returns information about the capacity commitment.
377
+ # @param [String] name
378
+ # Required. Resource name of the capacity commitment to retrieve. E.g., `
379
+ # projects/myproject/locations/US/capacityCommitments/123`
380
+ # @param [String] fields
381
+ # Selector specifying which fields to include in a partial response.
382
+ # @param [String] quota_user
383
+ # Available to use for quota purposes for server-side applications. Can be any
384
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
385
+ # @param [Google::Apis::RequestOptions] options
386
+ # Request-specific options
387
+ #
388
+ # @yield [result, err] Result & error if block supplied
389
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::CapacityCommitment] parsed result object
390
+ # @yieldparam err [StandardError] error object if request failed
391
+ #
392
+ # @return [Google::Apis::BigqueryreservationV1::CapacityCommitment]
393
+ #
394
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
395
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
396
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
397
+ def get_project_location_capacity_commitment(name, fields: nil, quota_user: nil, options: nil, &block)
398
+ command = make_simple_command(:get, 'v1/{+name}', options)
399
+ command.response_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
400
+ command.response_class = Google::Apis::BigqueryreservationV1::CapacityCommitment
401
+ command.params['name'] = name unless name.nil?
402
+ command.query['fields'] = fields unless fields.nil?
403
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
404
+ execute_or_queue_command(command, &block)
405
+ end
406
+
407
+ # Lists all the capacity commitments for the admin project.
408
+ # @param [String] parent
409
+ # Required. Resource name of the parent reservation. E.g., `projects/myproject/
410
+ # locations/US`
411
+ # @param [Fixnum] page_size
412
+ # The maximum number of items to return.
413
+ # @param [String] page_token
414
+ # The next_page_token value returned from a previous List request, if any.
415
+ # @param [String] fields
416
+ # Selector specifying which fields to include in a partial response.
417
+ # @param [String] quota_user
418
+ # Available to use for quota purposes for server-side applications. Can be any
419
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
420
+ # @param [Google::Apis::RequestOptions] options
421
+ # Request-specific options
422
+ #
423
+ # @yield [result, err] Result & error if block supplied
424
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::ListCapacityCommitmentsResponse] parsed result object
425
+ # @yieldparam err [StandardError] error object if request failed
426
+ #
427
+ # @return [Google::Apis::BigqueryreservationV1::ListCapacityCommitmentsResponse]
428
+ #
429
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
430
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
431
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
432
+ def list_project_location_capacity_commitments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
433
+ command = make_simple_command(:get, 'v1/{+parent}/capacityCommitments', options)
434
+ command.response_representation = Google::Apis::BigqueryreservationV1::ListCapacityCommitmentsResponse::Representation
435
+ command.response_class = Google::Apis::BigqueryreservationV1::ListCapacityCommitmentsResponse
436
+ command.params['parent'] = parent unless parent.nil?
437
+ command.query['pageSize'] = page_size unless page_size.nil?
438
+ command.query['pageToken'] = page_token unless page_token.nil?
439
+ command.query['fields'] = fields unless fields.nil?
440
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
441
+ execute_or_queue_command(command, &block)
442
+ end
443
+
444
+ # Merges capacity commitments of the same plan into a single commitment. The
445
+ # resulting capacity commitment has the greater commitment_end_time out of the
446
+ # to-be-merged capacity commitments. Attempting to merge capacity commitments of
447
+ # different plan will fail with the error code `google.rpc.Code.
448
+ # FAILED_PRECONDITION`.
449
+ # @param [String] parent
450
+ # Parent resource that identifies admin project and location e.g., `projects/
451
+ # myproject/locations/us`
452
+ # @param [Google::Apis::BigqueryreservationV1::MergeCapacityCommitmentsRequest] merge_capacity_commitments_request_object
453
+ # @param [String] fields
454
+ # Selector specifying which fields to include in a partial response.
455
+ # @param [String] quota_user
456
+ # Available to use for quota purposes for server-side applications. Can be any
457
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
458
+ # @param [Google::Apis::RequestOptions] options
459
+ # Request-specific options
460
+ #
461
+ # @yield [result, err] Result & error if block supplied
462
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::CapacityCommitment] parsed result object
463
+ # @yieldparam err [StandardError] error object if request failed
464
+ #
465
+ # @return [Google::Apis::BigqueryreservationV1::CapacityCommitment]
466
+ #
467
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
468
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
469
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
470
+ def merge_capacity_commitments(parent, merge_capacity_commitments_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
471
+ command = make_simple_command(:post, 'v1/{+parent}/capacityCommitments:merge', options)
472
+ command.request_representation = Google::Apis::BigqueryreservationV1::MergeCapacityCommitmentsRequest::Representation
473
+ command.request_object = merge_capacity_commitments_request_object
474
+ command.response_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
475
+ command.response_class = Google::Apis::BigqueryreservationV1::CapacityCommitment
476
+ command.params['parent'] = parent unless parent.nil?
477
+ command.query['fields'] = fields unless fields.nil?
478
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
479
+ execute_or_queue_command(command, &block)
480
+ end
481
+
482
+ # Updates an existing capacity commitment. Only `plan` and `renewal_plan` fields
483
+ # can be updated. Plan can only be changed to a plan of a longer commitment
484
+ # period. Attempting to change to a plan with shorter commitment period will
485
+ # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.
486
+ # @param [String] name
487
+ # Output only. The resource name of the capacity commitment, e.g., `projects/
488
+ # myproject/locations/US/capacityCommitments/123`
489
+ # @param [Google::Apis::BigqueryreservationV1::CapacityCommitment] capacity_commitment_object
490
+ # @param [String] update_mask
491
+ # Standard field mask for the set of fields to be updated.
492
+ # @param [String] fields
493
+ # Selector specifying which fields to include in a partial response.
494
+ # @param [String] quota_user
495
+ # Available to use for quota purposes for server-side applications. Can be any
496
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
497
+ # @param [Google::Apis::RequestOptions] options
498
+ # Request-specific options
499
+ #
500
+ # @yield [result, err] Result & error if block supplied
501
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::CapacityCommitment] parsed result object
502
+ # @yieldparam err [StandardError] error object if request failed
503
+ #
504
+ # @return [Google::Apis::BigqueryreservationV1::CapacityCommitment]
505
+ #
506
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
507
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
508
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
509
+ def patch_project_location_capacity_commitment(name, capacity_commitment_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
510
+ command = make_simple_command(:patch, 'v1/{+name}', options)
511
+ command.request_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
512
+ command.request_object = capacity_commitment_object
513
+ command.response_representation = Google::Apis::BigqueryreservationV1::CapacityCommitment::Representation
514
+ command.response_class = Google::Apis::BigqueryreservationV1::CapacityCommitment
515
+ command.params['name'] = name unless name.nil?
516
+ command.query['updateMask'] = update_mask unless update_mask.nil?
517
+ command.query['fields'] = fields unless fields.nil?
518
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
519
+ execute_or_queue_command(command, &block)
520
+ end
521
+
522
+ # Splits capacity commitment to two commitments of the same plan and `
523
+ # commitment_end_time`. A common use case is to enable downgrading commitments.
524
+ # For example, in order to downgrade from 10000 slots to 8000, you might split a
525
+ # 10000 capacity commitment into commitments of 2000 and 8000. Then, you would
526
+ # change the plan of the first one to `FLEX` and then delete it.
527
+ # @param [String] name
528
+ # Required. The resource name e.g.,: `projects/myproject/locations/US/
529
+ # capacityCommitments/123`
530
+ # @param [Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentRequest] split_capacity_commitment_request_object
531
+ # @param [String] fields
532
+ # Selector specifying which fields to include in a partial response.
533
+ # @param [String] quota_user
534
+ # Available to use for quota purposes for server-side applications. Can be any
535
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
536
+ # @param [Google::Apis::RequestOptions] options
537
+ # Request-specific options
538
+ #
539
+ # @yield [result, err] Result & error if block supplied
540
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentResponse] parsed result object
541
+ # @yieldparam err [StandardError] error object if request failed
542
+ #
543
+ # @return [Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentResponse]
544
+ #
545
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
546
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
547
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
548
+ def split_capacity_commitment(name, split_capacity_commitment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
549
+ command = make_simple_command(:post, 'v1/{+name}:split', options)
550
+ command.request_representation = Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentRequest::Representation
551
+ command.request_object = split_capacity_commitment_request_object
552
+ command.response_representation = Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentResponse::Representation
553
+ command.response_class = Google::Apis::BigqueryreservationV1::SplitCapacityCommitmentResponse
554
+ command.params['name'] = name unless name.nil?
555
+ command.query['fields'] = fields unless fields.nil?
556
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
557
+ execute_or_queue_command(command, &block)
558
+ end
559
+
560
+ # Creates a new reservation resource.
561
+ # @param [String] parent
562
+ # Required. Project, location. E.g., `projects/myproject/locations/US`
563
+ # @param [Google::Apis::BigqueryreservationV1::Reservation] reservation_object
564
+ # @param [String] reservation_id
565
+ # The reservation ID. This field must only contain lower case alphanumeric
566
+ # characters or dash. Max length is 64 characters.
567
+ # @param [String] fields
568
+ # Selector specifying which fields to include in a partial response.
569
+ # @param [String] quota_user
570
+ # Available to use for quota purposes for server-side applications. Can be any
571
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
572
+ # @param [Google::Apis::RequestOptions] options
573
+ # Request-specific options
574
+ #
575
+ # @yield [result, err] Result & error if block supplied
576
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Reservation] parsed result object
577
+ # @yieldparam err [StandardError] error object if request failed
578
+ #
579
+ # @return [Google::Apis::BigqueryreservationV1::Reservation]
580
+ #
581
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
582
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
583
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
584
+ def create_project_location_reservation(parent, reservation_object = nil, reservation_id: nil, fields: nil, quota_user: nil, options: nil, &block)
585
+ command = make_simple_command(:post, 'v1/{+parent}/reservations', options)
586
+ command.request_representation = Google::Apis::BigqueryreservationV1::Reservation::Representation
587
+ command.request_object = reservation_object
588
+ command.response_representation = Google::Apis::BigqueryreservationV1::Reservation::Representation
589
+ command.response_class = Google::Apis::BigqueryreservationV1::Reservation
590
+ command.params['parent'] = parent unless parent.nil?
591
+ command.query['reservationId'] = reservation_id unless reservation_id.nil?
592
+ command.query['fields'] = fields unless fields.nil?
593
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
594
+ execute_or_queue_command(command, &block)
595
+ end
596
+
597
+ # Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when
598
+ # reservation has assignments.
599
+ # @param [String] name
600
+ # Required. Resource name of the reservation to retrieve. E.g., `projects/
601
+ # myproject/locations/US/reservations/team1-prod`
602
+ # @param [String] fields
603
+ # Selector specifying which fields to include in a partial response.
604
+ # @param [String] quota_user
605
+ # Available to use for quota purposes for server-side applications. Can be any
606
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
607
+ # @param [Google::Apis::RequestOptions] options
608
+ # Request-specific options
609
+ #
610
+ # @yield [result, err] Result & error if block supplied
611
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Empty] parsed result object
612
+ # @yieldparam err [StandardError] error object if request failed
613
+ #
614
+ # @return [Google::Apis::BigqueryreservationV1::Empty]
615
+ #
616
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
617
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
618
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
619
+ def delete_project_location_reservation(name, fields: nil, quota_user: nil, options: nil, &block)
620
+ command = make_simple_command(:delete, 'v1/{+name}', options)
621
+ command.response_representation = Google::Apis::BigqueryreservationV1::Empty::Representation
622
+ command.response_class = Google::Apis::BigqueryreservationV1::Empty
623
+ command.params['name'] = name unless name.nil?
624
+ command.query['fields'] = fields unless fields.nil?
625
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
626
+ execute_or_queue_command(command, &block)
627
+ end
628
+
629
+ # Returns information about the reservation.
630
+ # @param [String] name
631
+ # Required. Resource name of the reservation to retrieve. E.g., `projects/
632
+ # myproject/locations/US/reservations/team1-prod`
633
+ # @param [String] fields
634
+ # Selector specifying which fields to include in a partial response.
635
+ # @param [String] quota_user
636
+ # Available to use for quota purposes for server-side applications. Can be any
637
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
638
+ # @param [Google::Apis::RequestOptions] options
639
+ # Request-specific options
640
+ #
641
+ # @yield [result, err] Result & error if block supplied
642
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Reservation] parsed result object
643
+ # @yieldparam err [StandardError] error object if request failed
644
+ #
645
+ # @return [Google::Apis::BigqueryreservationV1::Reservation]
646
+ #
647
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
648
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
649
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
650
+ def get_project_location_reservation(name, fields: nil, quota_user: nil, options: nil, &block)
651
+ command = make_simple_command(:get, 'v1/{+name}', options)
652
+ command.response_representation = Google::Apis::BigqueryreservationV1::Reservation::Representation
653
+ command.response_class = Google::Apis::BigqueryreservationV1::Reservation
654
+ command.params['name'] = name unless name.nil?
655
+ command.query['fields'] = fields unless fields.nil?
656
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
657
+ execute_or_queue_command(command, &block)
658
+ end
659
+
660
+ # Lists all the reservations for the project in the specified location.
661
+ # @param [String] parent
662
+ # Required. The parent resource name containing project and location, e.g.: `
663
+ # projects/myproject/locations/US`
664
+ # @param [Fixnum] page_size
665
+ # The maximum number of items to return per page.
666
+ # @param [String] page_token
667
+ # The next_page_token value returned from a previous List request, if any.
668
+ # @param [String] fields
669
+ # Selector specifying which fields to include in a partial response.
670
+ # @param [String] quota_user
671
+ # Available to use for quota purposes for server-side applications. Can be any
672
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
673
+ # @param [Google::Apis::RequestOptions] options
674
+ # Request-specific options
675
+ #
676
+ # @yield [result, err] Result & error if block supplied
677
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::ListReservationsResponse] parsed result object
678
+ # @yieldparam err [StandardError] error object if request failed
679
+ #
680
+ # @return [Google::Apis::BigqueryreservationV1::ListReservationsResponse]
681
+ #
682
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
683
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
684
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
685
+ def list_project_location_reservations(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
686
+ command = make_simple_command(:get, 'v1/{+parent}/reservations', options)
687
+ command.response_representation = Google::Apis::BigqueryreservationV1::ListReservationsResponse::Representation
688
+ command.response_class = Google::Apis::BigqueryreservationV1::ListReservationsResponse
689
+ command.params['parent'] = parent unless parent.nil?
690
+ command.query['pageSize'] = page_size unless page_size.nil?
691
+ command.query['pageToken'] = page_token unless page_token.nil?
692
+ command.query['fields'] = fields unless fields.nil?
693
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
694
+ execute_or_queue_command(command, &block)
695
+ end
696
+
697
+ # Updates an existing reservation resource.
698
+ # @param [String] name
699
+ # The resource name of the reservation, e.g., `projects/*/locations/*/
700
+ # reservations/team1-prod`.
701
+ # @param [Google::Apis::BigqueryreservationV1::Reservation] reservation_object
702
+ # @param [String] update_mask
703
+ # Standard field mask for the set of fields to be updated.
704
+ # @param [String] fields
705
+ # Selector specifying which fields to include in a partial response.
706
+ # @param [String] quota_user
707
+ # Available to use for quota purposes for server-side applications. Can be any
708
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
709
+ # @param [Google::Apis::RequestOptions] options
710
+ # Request-specific options
711
+ #
712
+ # @yield [result, err] Result & error if block supplied
713
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Reservation] parsed result object
714
+ # @yieldparam err [StandardError] error object if request failed
715
+ #
716
+ # @return [Google::Apis::BigqueryreservationV1::Reservation]
717
+ #
718
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
719
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
720
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
721
+ def patch_project_location_reservation(name, reservation_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
722
+ command = make_simple_command(:patch, 'v1/{+name}', options)
723
+ command.request_representation = Google::Apis::BigqueryreservationV1::Reservation::Representation
724
+ command.request_object = reservation_object
725
+ command.response_representation = Google::Apis::BigqueryreservationV1::Reservation::Representation
726
+ command.response_class = Google::Apis::BigqueryreservationV1::Reservation
727
+ command.params['name'] = name unless name.nil?
728
+ command.query['updateMask'] = update_mask unless update_mask.nil?
729
+ command.query['fields'] = fields unless fields.nil?
730
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
731
+ execute_or_queue_command(command, &block)
732
+ end
733
+
734
+ # Creates an assignment object which allows the given project to submit jobs of
735
+ # a certain type using slots from the specified reservation. Currently a
736
+ # resource (project, folder, organization) can only have one assignment per each
737
+ # (job_type, location) combination, and that reservation will be used for all
738
+ # jobs of the matching type. Different assignments can be created on different
739
+ # levels of the projects, folders or organization hierarchy. During query
740
+ # execution, the assignment is looked up at the project, folder and organization
741
+ # levels in that order. The first assignment found is applied to the query. When
742
+ # creating assignments, it does not matter if other assignments exist at higher
743
+ # levels. Example: * The organization `organizationA` contains two projects, `
744
+ # project1` and `project2`. * Assignments for all three entities (`organizationA`
745
+ # , `project1`, and `project2`) could all be created and mapped to the same or
746
+ # different reservations. Returns `google.rpc.Code.PERMISSION_DENIED` if user
747
+ # does not have 'bigquery.admin' permissions on the project using the
748
+ # reservation and the project that owns this reservation. Returns `google.rpc.
749
+ # Code.INVALID_ARGUMENT` when location of the assignment does not match location
750
+ # of the reservation.
751
+ # @param [String] parent
752
+ # Required. The parent resource name of the assignment E.g. `projects/myproject/
753
+ # locations/US/reservations/team1-prod`
754
+ # @param [Google::Apis::BigqueryreservationV1::Assignment] assignment_object
755
+ # @param [String] fields
756
+ # Selector specifying which fields to include in a partial response.
757
+ # @param [String] quota_user
758
+ # Available to use for quota purposes for server-side applications. Can be any
759
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
760
+ # @param [Google::Apis::RequestOptions] options
761
+ # Request-specific options
762
+ #
763
+ # @yield [result, err] Result & error if block supplied
764
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Assignment] parsed result object
765
+ # @yieldparam err [StandardError] error object if request failed
766
+ #
767
+ # @return [Google::Apis::BigqueryreservationV1::Assignment]
768
+ #
769
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
770
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
771
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
772
+ def create_project_location_reservation_assignment(parent, assignment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
773
+ command = make_simple_command(:post, 'v1/{+parent}/assignments', options)
774
+ command.request_representation = Google::Apis::BigqueryreservationV1::Assignment::Representation
775
+ command.request_object = assignment_object
776
+ command.response_representation = Google::Apis::BigqueryreservationV1::Assignment::Representation
777
+ command.response_class = Google::Apis::BigqueryreservationV1::Assignment
778
+ command.params['parent'] = parent unless parent.nil?
779
+ command.query['fields'] = fields unless fields.nil?
780
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
781
+ execute_or_queue_command(command, &block)
782
+ end
783
+
784
+ # Deletes a assignment. No expansion will happen. Example: * Organization `
785
+ # organizationA` contains two projects, `project1` and `project2`. * Reservation
786
+ # `res1` exists and was created previously. * CreateAssignment was used
787
+ # previously to define the following associations between entities and
788
+ # reservations: `` and `` In this example, deletion of the `` assignment won't
789
+ # affect the other assignment ``. After said deletion, queries from `project1`
790
+ # will still use `res1` while queries from `project2` will switch to use on-
791
+ # demand mode.
792
+ # @param [String] name
793
+ # Required. Name of the resource, e.g. `projects/myproject/locations/US/
794
+ # reservations/team1-prod/assignments/123`
795
+ # @param [String] fields
796
+ # Selector specifying which fields to include in a partial response.
797
+ # @param [String] quota_user
798
+ # Available to use for quota purposes for server-side applications. Can be any
799
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
800
+ # @param [Google::Apis::RequestOptions] options
801
+ # Request-specific options
802
+ #
803
+ # @yield [result, err] Result & error if block supplied
804
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Empty] parsed result object
805
+ # @yieldparam err [StandardError] error object if request failed
806
+ #
807
+ # @return [Google::Apis::BigqueryreservationV1::Empty]
808
+ #
809
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
810
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
811
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
812
+ def delete_project_location_reservation_assignment(name, fields: nil, quota_user: nil, options: nil, &block)
813
+ command = make_simple_command(:delete, 'v1/{+name}', options)
814
+ command.response_representation = Google::Apis::BigqueryreservationV1::Empty::Representation
815
+ command.response_class = Google::Apis::BigqueryreservationV1::Empty
816
+ command.params['name'] = name unless name.nil?
817
+ command.query['fields'] = fields unless fields.nil?
818
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
819
+ execute_or_queue_command(command, &block)
820
+ end
821
+
822
+ # Lists assignments. Only explicitly created assignments will be returned.
823
+ # Example: * Organization `organizationA` contains two projects, `project1` and `
824
+ # project2`. * Reservation `res1` exists and was created previously. *
825
+ # CreateAssignment was used previously to define the following associations
826
+ # between entities and reservations: `` and `` In this example, ListAssignments
827
+ # will just return the above two assignments for reservation `res1`, and no
828
+ # expansion/merge will happen. The wildcard "-" can be used for reservations in
829
+ # the request. In that case all assignments belongs to the specified project and
830
+ # location will be listed. **Note** "-" cannot be used for projects nor
831
+ # locations.
832
+ # @param [String] parent
833
+ # Required. The parent resource name e.g.: `projects/myproject/locations/US/
834
+ # reservations/team1-prod` Or: `projects/myproject/locations/US/reservations/-`
835
+ # @param [Fixnum] page_size
836
+ # The maximum number of items to return per page.
837
+ # @param [String] page_token
838
+ # The next_page_token value returned from a previous List request, if any.
839
+ # @param [String] fields
840
+ # Selector specifying which fields to include in a partial response.
841
+ # @param [String] quota_user
842
+ # Available to use for quota purposes for server-side applications. Can be any
843
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
844
+ # @param [Google::Apis::RequestOptions] options
845
+ # Request-specific options
846
+ #
847
+ # @yield [result, err] Result & error if block supplied
848
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::ListAssignmentsResponse] parsed result object
849
+ # @yieldparam err [StandardError] error object if request failed
850
+ #
851
+ # @return [Google::Apis::BigqueryreservationV1::ListAssignmentsResponse]
852
+ #
853
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
854
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
855
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
856
+ def list_project_location_reservation_assignments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
857
+ command = make_simple_command(:get, 'v1/{+parent}/assignments', options)
858
+ command.response_representation = Google::Apis::BigqueryreservationV1::ListAssignmentsResponse::Representation
859
+ command.response_class = Google::Apis::BigqueryreservationV1::ListAssignmentsResponse
860
+ command.params['parent'] = parent unless parent.nil?
861
+ command.query['pageSize'] = page_size unless page_size.nil?
862
+ command.query['pageToken'] = page_token unless page_token.nil?
863
+ command.query['fields'] = fields unless fields.nil?
864
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
865
+ execute_or_queue_command(command, &block)
866
+ end
867
+
868
+ # Moves an assignment under a new reservation. This differs from removing an
869
+ # existing assignment and recreating a new one by providing a transactional
870
+ # change that ensures an assignee always has an associated reservation.
871
+ # @param [String] name
872
+ # Required. The resource name of the assignment, e.g. `projects/myproject/
873
+ # locations/US/reservations/team1-prod/assignments/123`
874
+ # @param [Google::Apis::BigqueryreservationV1::MoveAssignmentRequest] move_assignment_request_object
875
+ # @param [String] fields
876
+ # Selector specifying which fields to include in a partial response.
877
+ # @param [String] quota_user
878
+ # Available to use for quota purposes for server-side applications. Can be any
879
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
880
+ # @param [Google::Apis::RequestOptions] options
881
+ # Request-specific options
882
+ #
883
+ # @yield [result, err] Result & error if block supplied
884
+ # @yieldparam result [Google::Apis::BigqueryreservationV1::Assignment] parsed result object
885
+ # @yieldparam err [StandardError] error object if request failed
886
+ #
887
+ # @return [Google::Apis::BigqueryreservationV1::Assignment]
888
+ #
889
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
890
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
891
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
892
+ def move_assignment(name, move_assignment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
893
+ command = make_simple_command(:post, 'v1/{+name}:move', options)
894
+ command.request_representation = Google::Apis::BigqueryreservationV1::MoveAssignmentRequest::Representation
895
+ command.request_object = move_assignment_request_object
896
+ command.response_representation = Google::Apis::BigqueryreservationV1::Assignment::Representation
897
+ command.response_class = Google::Apis::BigqueryreservationV1::Assignment
898
+ command.params['name'] = name unless name.nil?
899
+ command.query['fields'] = fields unless fields.nil?
900
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
901
+ execute_or_queue_command(command, &block)
902
+ end
903
+
904
+ protected
905
+
906
+ def apply_command_defaults(command)
907
+ command.query['key'] = key unless key.nil?
908
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
909
+ end
910
+ end
911
+ end
912
+ end
913
+ end