@@ -138,6 +138,56 @@ service AdminService {
138138 };
139139 option (google.api.method_signature ) = "name" ;
140140 }
141+
142+ // Creates a new reservation.
143+ rpc CreateReservation (CreateReservationRequest ) returns (Reservation ) {
144+ option (google.api.http ) = {
145+ post : "/v1/admin/{parent=projects/*/locations/*}/reservations"
146+ body : "reservation"
147+ };
148+ option (google.api.method_signature ) = "parent,reservation,reservation_id" ;
149+ }
150+
151+ // Returns the reservation configuration.
152+ rpc GetReservation (GetReservationRequest ) returns (Reservation ) {
153+ option (google.api.http ) = {
154+ get : "/v1/admin/{name=projects/*/locations/*/reservations/*}"
155+ };
156+ option (google.api.method_signature ) = "name" ;
157+ }
158+
159+ // Returns the list of reservations for the given project.
160+ rpc ListReservations (ListReservationsRequest ) returns (ListReservationsResponse ) {
161+ option (google.api.http ) = {
162+ get : "/v1/admin/{parent=projects/*/locations/*}/reservations"
163+ };
164+ option (google.api.method_signature ) = "parent" ;
165+ }
166+
167+ // Updates properties of the specified reservation.
168+ rpc UpdateReservation (UpdateReservationRequest ) returns (Reservation ) {
169+ option (google.api.http ) = {
170+ patch : "/v1/admin/{reservation.name=projects/*/locations/*/reservations/*}"
171+ body : "reservation"
172+ };
173+ option (google.api.method_signature ) = "reservation,update_mask" ;
174+ }
175+
176+ // Deletes the specified reservation.
177+ rpc DeleteReservation (DeleteReservationRequest ) returns (google.protobuf.Empty ) {
178+ option (google.api.http ) = {
179+ delete : "/v1/admin/{name=projects/*/locations/*/reservations/*}"
180+ };
181+ option (google.api.method_signature ) = "name" ;
182+ }
183+
184+ // Lists the topics attached to the specified reservation.
185+ rpc ListReservationTopics (ListReservationTopicsRequest ) returns (ListReservationTopicsResponse ) {
186+ option (google.api.http ) = {
187+ get : "/v1/admin/{name=projects/*/locations/*/reservations/*}/topics"
188+ };
189+ option (google.api.method_signature ) = "name" ;
190+ }
141191}
142192
143193// Request for CreateTopic.
@@ -370,3 +420,130 @@ message DeleteSubscriptionRequest {
370420 }
371421 ];
372422}
423+
424+ // Request for CreateReservation.
425+ message CreateReservationRequest {
426+ // Required. The parent location in which to create the reservation.
427+ // Structured like `projects/{project_number}/locations/{location}`.
428+ string parent = 1 [
429+ (google.api.field_behavior ) = REQUIRED ,
430+ (google.api.resource_reference ) = {
431+ type : "locations.googleapis.com/Location"
432+ }
433+ ];
434+
435+ // Required. Configuration of the reservation to create. Its `name` field is ignored.
436+ Reservation reservation = 2 [(google.api.field_behavior ) = REQUIRED ];
437+
438+ // Required. The ID to use for the reservation, which will become the final component of
439+ // the reservation's name.
440+ //
441+ // This value is structured like: `my-reservation-name`.
442+ string reservation_id = 3 [(google.api.field_behavior ) = REQUIRED ];
443+ }
444+
445+ // Request for GetReservation.
446+ message GetReservationRequest {
447+ // Required. The name of the reservation whose configuration to return.
448+ // Structured like:
449+ // projects/{project_number}/locations/{location}/reservations/{reservation_id}
450+ string name = 1 [
451+ (google.api.field_behavior ) = REQUIRED ,
452+ (google.api.resource_reference ) = {
453+ type : "pubsublite.googleapis.com/Reservation"
454+ }
455+ ];
456+ }
457+
458+ // Request for ListReservations.
459+ message ListReservationsRequest {
460+ // Required. The parent whose reservations are to be listed.
461+ // Structured like `projects/{project_number}/locations/{location}`.
462+ string parent = 1 [
463+ (google.api.field_behavior ) = REQUIRED ,
464+ (google.api.resource_reference ) = {
465+ type : "locations.googleapis.com/Location"
466+ }
467+ ];
468+
469+ // The maximum number of reservations to return. The service may return fewer
470+ // than this value. If unset or zero, all reservations for the parent will be
471+ // returned.
472+ int32 page_size = 2 ;
473+
474+ // A page token, received from a previous `ListReservations` call.
475+ // Provide this to retrieve the subsequent page.
476+ //
477+ // When paginating, all other parameters provided to `ListReservations` must
478+ // match the call that provided the page token.
479+ string page_token = 3 ;
480+ }
481+
482+ // Response for ListReservations.
483+ message ListReservationsResponse {
484+ // The list of reservation in the requested parent. The order of the
485+ // reservations is unspecified.
486+ repeated Reservation reservations = 1 ;
487+
488+ // A token that can be sent as `page_token` to retrieve the next page of
489+ // results. If this field is omitted, there are no more results.
490+ string next_page_token = 2 ;
491+ }
492+
493+ // Request for UpdateReservation.
494+ message UpdateReservationRequest {
495+ // Required. The reservation to update. Its `name` field must be populated.
496+ Reservation reservation = 1 [(google.api.field_behavior ) = REQUIRED ];
497+
498+ // Required. A mask specifying the reservation fields to change.
499+ google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior ) = REQUIRED ];
500+ }
501+
502+ // Request for DeleteReservation.
503+ message DeleteReservationRequest {
504+ // Required. The name of the reservation to delete.
505+ // Structured like:
506+ // projects/{project_number}/locations/{location}/reservations/{reservation_id}
507+ string name = 1 [
508+ (google.api.field_behavior ) = REQUIRED ,
509+ (google.api.resource_reference ) = {
510+ type : "pubsublite.googleapis.com/Reservation"
511+ }
512+ ];
513+ }
514+
515+ // Request for ListReservationTopics.
516+ message ListReservationTopicsRequest {
517+ // Required. The name of the reservation whose topics to list.
518+ // Structured like:
519+ // projects/{project_number}/locations/{location}/reservations/{reservation_id}
520+ string name = 1 [
521+ (google.api.field_behavior ) = REQUIRED ,
522+ (google.api.resource_reference ) = {
523+ type : "pubsublite.googleapis.com/Reservation"
524+ }
525+ ];
526+
527+ // The maximum number of topics to return. The service may return fewer
528+ // than this value.
529+ // If unset or zero, all topics for the given reservation will be returned.
530+ int32 page_size = 2 ;
531+
532+ // A page token, received from a previous `ListReservationTopics` call.
533+ // Provide this to retrieve the subsequent page.
534+ //
535+ // When paginating, all other parameters provided to `ListReservationTopics`
536+ // must match the call that provided the page token.
537+ string page_token = 3 ;
538+ }
539+
540+ // Response for ListReservationTopics.
541+ message ListReservationTopicsResponse {
542+ // The names of topics attached to the reservation. The order of the
543+ // topics is unspecified.
544+ repeated string topics = 1 ;
545+
546+ // A token that can be sent as `page_token` to retrieve the next page of
547+ // results. If this field is omitted, there are no more results.
548+ string next_page_token = 2 ;
549+ }
0 commit comments