1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Reservation {
4 #[prost(string, tag="1")]
7 pub name: std::string::String,
8 #[prost(int64, tag="2")]
19 pub slot_capacity: i64,
20 #[prost(bool, tag="4")]
24 pub ignore_idle_slots: bool,
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct CapacityCommitment {
38 #[prost(string, tag="1")]
41 pub name: std::string::String,
42 #[prost(int64, tag="2")]
44 pub slot_count: i64,
45 #[prost(enumeration="capacity_commitment::CommitmentPlan", tag="3")]
47 pub plan: i32,
48 #[prost(enumeration="capacity_commitment::State", tag="4")]
50 pub state: i32,
51 #[prost(message, optional, tag="5")]
54 pub commitment_end_time: ::std::option::Option<::prost_types::Timestamp>,
55 #[prost(message, optional, tag="7")]
57 pub failure_status: ::std::option::Option<super::super::super::super::rpc::Status>,
58 #[prost(enumeration="capacity_commitment::CommitmentPlan", tag="8")]
62 pub renewal_plan: i32,
63}
64pub mod capacity_commitment {
65 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
68 #[repr(i32)]
69 pub enum CommitmentPlan {
70 Unspecified = 0,
73 Flex = 3,
77 Trial = 5,
82 Monthly = 2,
86 Annual = 4,
90 }
91 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
94 #[repr(i32)]
95 pub enum State {
96 Unspecified = 0,
98 Pending = 1,
101 Active = 2,
104 Failed = 3,
106 }
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct CreateReservationRequest {
112 #[prost(string, tag="1")]
115 pub parent: std::string::String,
116 #[prost(string, tag="2")]
119 pub reservation_id: std::string::String,
120 #[prost(message, optional, tag="3")]
122 pub reservation: ::std::option::Option<Reservation>,
123}
124#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ListReservationsRequest {
128 #[prost(string, tag="1")]
131 pub parent: std::string::String,
132 #[prost(int32, tag="2")]
134 pub page_size: i32,
135 #[prost(string, tag="3")]
137 pub page_token: std::string::String,
138}
139#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct ListReservationsResponse {
143 #[prost(message, repeated, tag="1")]
145 pub reservations: ::std::vec::Vec<Reservation>,
146 #[prost(string, tag="2")]
149 pub next_page_token: std::string::String,
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct GetReservationRequest {
155 #[prost(string, tag="1")]
158 pub name: std::string::String,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct DeleteReservationRequest {
164 #[prost(string, tag="1")]
167 pub name: std::string::String,
168}
169#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct UpdateReservationRequest {
173 #[prost(message, optional, tag="1")]
175 pub reservation: ::std::option::Option<Reservation>,
176 #[prost(message, optional, tag="2")]
178 pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct CreateCapacityCommitmentRequest {
184 #[prost(string, tag="1")]
187 pub parent: std::string::String,
188 #[prost(message, optional, tag="2")]
190 pub capacity_commitment: ::std::option::Option<CapacityCommitment>,
191 #[prost(bool, tag="4")]
194 pub enforce_single_admin_project_per_org: bool,
195}
196#[derive(Clone, PartialEq, ::prost::Message)]
199pub struct ListCapacityCommitmentsRequest {
200 #[prost(string, tag="1")]
203 pub parent: std::string::String,
204 #[prost(int32, tag="2")]
206 pub page_size: i32,
207 #[prost(string, tag="3")]
209 pub page_token: std::string::String,
210}
211#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct ListCapacityCommitmentsResponse {
215 #[prost(message, repeated, tag="1")]
217 pub capacity_commitments: ::std::vec::Vec<CapacityCommitment>,
218 #[prost(string, tag="2")]
221 pub next_page_token: std::string::String,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct GetCapacityCommitmentRequest {
227 #[prost(string, tag="1")]
230 pub name: std::string::String,
231}
232#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct DeleteCapacityCommitmentRequest {
236 #[prost(string, tag="1")]
239 pub name: std::string::String,
240}
241#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct UpdateCapacityCommitmentRequest {
245 #[prost(message, optional, tag="1")]
247 pub capacity_commitment: ::std::option::Option<CapacityCommitment>,
248 #[prost(message, optional, tag="2")]
250 pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
251}
252#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct SplitCapacityCommitmentRequest {
256 #[prost(string, tag="1")]
259 pub name: std::string::String,
260 #[prost(int64, tag="2")]
262 pub slot_count: i64,
263}
264#[derive(Clone, PartialEq, ::prost::Message)]
267pub struct SplitCapacityCommitmentResponse {
268 #[prost(message, optional, tag="1")]
270 pub first: ::std::option::Option<CapacityCommitment>,
271 #[prost(message, optional, tag="2")]
273 pub second: ::std::option::Option<CapacityCommitment>,
274}
275#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct MergeCapacityCommitmentsRequest {
279 #[prost(string, tag="1")]
282 pub parent: std::string::String,
283 #[prost(string, repeated, tag="2")]
287 pub capacity_commitment_ids: ::std::vec::Vec<std::string::String>,
288}
289#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct Assignment {
293 #[prost(string, tag="1")]
296 pub name: std::string::String,
297 #[prost(string, tag="4")]
300 pub assignee: std::string::String,
301 #[prost(enumeration="assignment::JobType", tag="3")]
303 pub job_type: i32,
304 #[prost(enumeration="assignment::State", tag="6")]
306 pub state: i32,
307}
308pub mod assignment {
309 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
311 #[repr(i32)]
312 pub enum JobType {
313 Unspecified = 0,
316 Pipeline = 1,
318 Query = 2,
320 }
321 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
325 #[repr(i32)]
326 pub enum State {
327 Unspecified = 0,
329 Pending = 1,
332 Active = 2,
334 }
335}
336#[derive(Clone, PartialEq, ::prost::Message)]
341pub struct CreateAssignmentRequest {
342 #[prost(string, tag="1")]
345 pub parent: std::string::String,
346 #[prost(message, optional, tag="2")]
348 pub assignment: ::std::option::Option<Assignment>,
349}
350#[derive(Clone, PartialEq, ::prost::Message)]
353pub struct ListAssignmentsRequest {
354 #[prost(string, tag="1")]
362 pub parent: std::string::String,
363 #[prost(int32, tag="2")]
365 pub page_size: i32,
366 #[prost(string, tag="3")]
368 pub page_token: std::string::String,
369}
370#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct ListAssignmentsResponse {
374 #[prost(message, repeated, tag="1")]
376 pub assignments: ::std::vec::Vec<Assignment>,
377 #[prost(string, tag="2")]
380 pub next_page_token: std::string::String,
381}
382#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct DeleteAssignmentRequest {
388 #[prost(string, tag="1")]
391 pub name: std::string::String,
392}
393#[derive(Clone, PartialEq, ::prost::Message)]
398pub struct SearchAssignmentsRequest {
399 #[prost(string, tag="1")]
403 pub parent: std::string::String,
404 #[prost(string, tag="2")]
412 pub query: std::string::String,
413 #[prost(int32, tag="3")]
415 pub page_size: i32,
416 #[prost(string, tag="4")]
418 pub page_token: std::string::String,
419}
420#[derive(Clone, PartialEq, ::prost::Message)]
423pub struct SearchAssignmentsResponse {
424 #[prost(message, repeated, tag="1")]
426 pub assignments: ::std::vec::Vec<Assignment>,
427 #[prost(string, tag="2")]
430 pub next_page_token: std::string::String,
431}
432#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct MoveAssignmentRequest {
443 #[prost(string, tag="1")]
447 pub name: std::string::String,
448 #[prost(string, tag="3")]
451 pub destination_id: std::string::String,
452}
453#[derive(Clone, PartialEq, ::prost::Message)]
455pub struct BiReservation {
456 #[prost(string, tag="1")]
460 pub name: std::string::String,
461 #[prost(message, optional, tag="3")]
463 pub update_time: ::std::option::Option<::prost_types::Timestamp>,
464 #[prost(int64, tag="4")]
466 pub size: i64,
467}
468#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct GetBiReservationRequest {
471 #[prost(string, tag="1")]
474 pub name: std::string::String,
475}
476#[derive(Clone, PartialEq, ::prost::Message)]
478pub struct UpdateBiReservationRequest {
479 #[prost(message, optional, tag="1")]
481 pub bi_reservation: ::std::option::Option<BiReservation>,
482 #[prost(message, optional, tag="2")]
484 pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
485}
486# [ doc = r" Generated client implementations." ] pub mod reservation_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " This API allows users to manage their flat-rate BigQuery reservations." ] # [ doc = "" ] # [ doc = " A reservation provides computational resource guarantees, in the form of" ] # [ doc = " [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a" ] # [ doc = " unit of computational power in BigQuery, and serves as the basic unit of" ] # [ doc = " parallelism. In a scan of a multi-partitioned table, a single slot operates" ] # [ doc = " on a single partition of the table. A reservation resource exists as a child" ] # [ doc = " resource of the admin project and location, e.g.:" ] # [ doc = " `projects/myproject/locations/US/reservations/reservationName`." ] # [ doc = "" ] # [ doc = " A capacity commitment is a way to purchase compute capacity for BigQuery jobs" ] # [ doc = " (in the form of slots) with some committed period of usage. A capacity" ] # [ doc = " commitment resource exists as a child resource of the admin project and" ] # [ doc = " location, e.g.:" ] # [ doc = " `projects/myproject/locations/US/capacityCommitments/id`." ] pub struct ReservationServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > ReservationServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Creates a new reservation resource." ] pub async fn create_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: CreateReservationRequest > , ) -> Result < tonic :: Response < super :: Reservation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/CreateReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists all the reservations for the project in the specified location." ] pub async fn list_reservations ( & mut self , request : impl tonic :: IntoRequest < super :: ListReservationsRequest > , ) -> Result < tonic :: Response < super :: ListReservationsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/ListReservations" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns information about the reservation." ] pub async fn get_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: GetReservationRequest > , ) -> Result < tonic :: Response < super :: Reservation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/GetReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a reservation." ] # [ doc = " Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has" ] # [ doc = " assignments." ] pub async fn delete_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteReservationRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/DeleteReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates an existing reservation resource." ] pub async fn update_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateReservationRequest > , ) -> Result < tonic :: Response < super :: Reservation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/UpdateReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates a new capacity commitment resource." ] pub async fn create_capacity_commitment ( & mut self , request : impl tonic :: IntoRequest < super :: CreateCapacityCommitmentRequest > , ) -> Result < tonic :: Response < super :: CapacityCommitment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/CreateCapacityCommitment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists all the capacity commitments for the admin project." ] pub async fn list_capacity_commitments ( & mut self , request : impl tonic :: IntoRequest < super :: ListCapacityCommitmentsRequest > , ) -> Result < tonic :: Response < super :: ListCapacityCommitmentsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/ListCapacityCommitments" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns information about the capacity commitment." ] pub async fn get_capacity_commitment ( & mut self , request : impl tonic :: IntoRequest < super :: GetCapacityCommitmentRequest > , ) -> Result < tonic :: Response < super :: CapacityCommitment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/GetCapacityCommitment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a capacity commitment. Attempting to delete capacity commitment" ] # [ doc = " before its commitment_end_time will fail with the error code" ] # [ doc = " `google.rpc.Code.FAILED_PRECONDITION`." ] pub async fn delete_capacity_commitment ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteCapacityCommitmentRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/DeleteCapacityCommitment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates an existing capacity commitment." ] # [ doc = "" ] # [ doc = " Only `plan` and `renewal_plan` fields can be updated." ] # [ doc = "" ] # [ doc = " Plan can only be changed to a plan of a longer commitment period." ] # [ doc = " Attempting to change to a plan with shorter commitment period will fail" ] # [ doc = " with the error code `google.rpc.Code.FAILED_PRECONDITION`." ] pub async fn update_capacity_commitment ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateCapacityCommitmentRequest > , ) -> Result < tonic :: Response < super :: CapacityCommitment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/UpdateCapacityCommitment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Splits capacity commitment to two commitments of the same plan and" ] # [ doc = " `commitment_end_time`." ] # [ doc = "" ] # [ doc = " A common use case is to enable downgrading commitments." ] # [ doc = "" ] # [ doc = " For example, in order to downgrade from 10000 slots to 8000, you might" ] # [ doc = " split a 10000 capacity commitment into commitments of 2000 and 8000. Then," ] # [ doc = " you would change the plan of the first one to `FLEX` and then delete it." ] pub async fn split_capacity_commitment ( & mut self , request : impl tonic :: IntoRequest < super :: SplitCapacityCommitmentRequest > , ) -> Result < tonic :: Response < super :: SplitCapacityCommitmentResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/SplitCapacityCommitment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Merges capacity commitments of the same plan into a single commitment." ] # [ doc = "" ] # [ doc = " The resulting capacity commitment has the greater commitment_end_time" ] # [ doc = " out of the to-be-merged capacity commitments." ] # [ doc = "" ] # [ doc = " Attempting to merge capacity commitments of different plan will fail" ] # [ doc = " with the error code `google.rpc.Code.FAILED_PRECONDITION`." ] pub async fn merge_capacity_commitments ( & mut self , request : impl tonic :: IntoRequest < super :: MergeCapacityCommitmentsRequest > , ) -> Result < tonic :: Response < super :: CapacityCommitment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/MergeCapacityCommitments" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates an assignment object which allows the given project to submit jobs" ] # [ doc = " of a certain type using slots from the specified reservation." ] # [ doc = "" ] # [ doc = " Currently a" ] # [ doc = " resource (project, folder, organization) can only have one assignment per" ] # [ doc = " each (job_type, location) combination, and that reservation will be used" ] # [ doc = " for all jobs of the matching type." ] # [ doc = "" ] # [ doc = " Different assignments can be created on different levels of the" ] # [ doc = " projects, folders or organization hierarchy. During query execution," ] # [ doc = " the assignment is looked up at the project, folder and organization levels" ] # [ doc = " in that order. The first assignment found is applied to the query." ] # [ doc = "" ] # [ doc = " When creating assignments, it does not matter if other assignments exist at" ] # [ doc = " higher levels." ] # [ doc = "" ] # [ doc = " Example:" ] # [ doc = "" ] # [ doc = " * The organization `organizationA` contains two projects, `project1`" ] # [ doc = " and `project2`." ] # [ doc = " * Assignments for all three entities (`organizationA`, `project1`, and" ] # [ doc = " `project2`) could all be created and mapped to the same or different" ] # [ doc = " reservations." ] # [ doc = "" ] # [ doc = " Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have" ] # [ doc = " 'bigquery.admin' permissions on the project using the reservation" ] # [ doc = " and the project that owns this reservation." ] # [ doc = "" ] # [ doc = " Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment" ] # [ doc = " does not match location of the reservation." ] pub async fn create_assignment ( & mut self , request : impl tonic :: IntoRequest < super :: CreateAssignmentRequest > , ) -> Result < tonic :: Response < super :: Assignment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/CreateAssignment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists assignments." ] # [ doc = "" ] # [ doc = " Only explicitly created assignments will be returned." ] # [ doc = "" ] # [ doc = " Example:" ] # [ doc = "" ] # [ doc = " * Organization `organizationA` contains two projects, `project1` and" ] # [ doc = " `project2`." ] # [ doc = " * Reservation `res1` exists and was created previously." ] # [ doc = " * CreateAssignment was used previously to define the following" ] # [ doc = " associations between entities and reservations: `<organizationA, res1>`" ] # [ doc = " and `<project1, res1>`" ] # [ doc = "" ] # [ doc = " In this example, ListAssignments will just return the above two assignments" ] # [ doc = " for reservation `res1`, and no expansion/merge will happen." ] # [ doc = "" ] # [ doc = " The wildcard \"-\" can be used for" ] # [ doc = " reservations in the request. In that case all assignments belongs to the" ] # [ doc = " specified project and location will be listed." ] # [ doc = "" ] # [ doc = " **Note** \"-\" cannot be used for projects nor locations." ] pub async fn list_assignments ( & mut self , request : impl tonic :: IntoRequest < super :: ListAssignmentsRequest > , ) -> Result < tonic :: Response < super :: ListAssignmentsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/ListAssignments" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a assignment. No expansion will happen." ] # [ doc = "" ] # [ doc = " Example:" ] # [ doc = "" ] # [ doc = " * Organization `organizationA` contains two projects, `project1` and" ] # [ doc = " `project2`." ] # [ doc = " * Reservation `res1` exists and was created previously." ] # [ doc = " * CreateAssignment was used previously to define the following" ] # [ doc = " associations between entities and reservations: `<organizationA, res1>`" ] # [ doc = " and `<project1, res1>`" ] # [ doc = "" ] # [ doc = " In this example, deletion of the `<organizationA, res1>` assignment won't" ] # [ doc = " affect the other assignment `<project1, res1>`. After said deletion," ] # [ doc = " queries from `project1` will still use `res1` while queries from" ] # [ doc = " `project2` will switch to use on-demand mode." ] pub async fn delete_assignment ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteAssignmentRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/DeleteAssignment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Looks up assignments for a specified resource for a particular region." ] # [ doc = " If the request is about a project:" ] # [ doc = "" ] # [ doc = " 1. Assignments created on the project will be returned if they exist." ] # [ doc = " 2. Otherwise assignments created on the closest ancestor will be" ] # [ doc = " returned." ] # [ doc = " 3. Assignments for different JobTypes will all be returned." ] # [ doc = "" ] # [ doc = " The same logic applies if the request is about a folder." ] # [ doc = "" ] # [ doc = " If the request is about an organization, then assignments created on the" ] # [ doc = " organization will be returned (organization doesn't have ancestors)." ] # [ doc = "" ] # [ doc = " Comparing to ListAssignments, there are some behavior" ] # [ doc = " differences:" ] # [ doc = "" ] # [ doc = " 1. permission on the assignee will be verified in this API." ] # [ doc = " 2. Hierarchy lookup (project->folder->organization) happens in this API." ] # [ doc = " 3. Parent here is `projects/*/locations/*`, instead of" ] # [ doc = " `projects/*/locations/*reservations/*`." ] # [ doc = "" ] # [ doc = " **Note** \"-\" cannot be used for projects" ] # [ doc = " nor locations." ] pub async fn search_assignments ( & mut self , request : impl tonic :: IntoRequest < super :: SearchAssignmentsRequest > , ) -> Result < tonic :: Response < super :: SearchAssignmentsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/SearchAssignments" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Moves an assignment under a new reservation." ] # [ doc = "" ] # [ doc = " This differs from removing an existing assignment and recreating a new one" ] # [ doc = " by providing a transactional change that ensures an assignee always has an" ] # [ doc = " associated reservation." ] pub async fn move_assignment ( & mut self , request : impl tonic :: IntoRequest < super :: MoveAssignmentRequest > , ) -> Result < tonic :: Response < super :: Assignment > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/MoveAssignment" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Retrieves a BI reservation." ] pub async fn get_bi_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: GetBiReservationRequest > , ) -> Result < tonic :: Response < super :: BiReservation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/GetBiReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates a BI reservation." ] # [ doc = "" ] # [ doc = " Only fields specified in the `field_mask` are updated." ] # [ doc = "" ] # [ doc = " A singleton BI reservation always exists with default size 0." ] # [ doc = " In order to reserve BI capacity it needs to be updated to an amount" ] # [ doc = " greater than 0. In order to release BI capacity reservation size" ] # [ doc = " must be set to 0." ] pub async fn update_bi_reservation ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateBiReservationRequest > , ) -> Result < tonic :: Response < super :: BiReservation > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.bigquery.reservation.v1.ReservationService/UpdateBiReservation" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for ReservationServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for ReservationServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "ReservationServiceClient {{ ... }}" ) } } }use serde :: { Serialize , Deserialize } ;