1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18namespace Google\Service\PubsubLite\Resource; 19 20use Google\Service\PubsubLite\ListReservationsResponse; 21use Google\Service\PubsubLite\PubsubliteEmpty; 22use Google\Service\PubsubLite\Reservation; 23 24/** 25 * The "reservations" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $pubsubliteService = new Google\Service\PubsubLite(...); 29 * $reservations = $pubsubliteService->reservations; 30 * </code> 31 */ 32class AdminProjectsLocationsReservations extends \Google\Service\Resource 33{ 34 /** 35 * Creates a new reservation. (reservations.create) 36 * 37 * @param string $parent Required. The parent location in which to create the 38 * reservation. Structured like 39 * `projects/{project_number}/locations/{location}`. 40 * @param Reservation $postBody 41 * @param array $optParams Optional parameters. 42 * 43 * @opt_param string reservationId Required. The ID to use for the reservation, 44 * which will become the final component of the reservation's name. This value 45 * is structured like: `my-reservation-name`. 46 * @return Reservation 47 */ 48 public function create($parent, Reservation $postBody, $optParams = []) 49 { 50 $params = ['parent' => $parent, 'postBody' => $postBody]; 51 $params = array_merge($params, $optParams); 52 return $this->call('create', [$params], Reservation::class); 53 } 54 /** 55 * Deletes the specified reservation. (reservations.delete) 56 * 57 * @param string $name Required. The name of the reservation to delete. 58 * Structured like: 59 * projects/{project_number}/locations/{location}/reservations/{reservation_id} 60 * @param array $optParams Optional parameters. 61 * @return PubsubliteEmpty 62 */ 63 public function delete($name, $optParams = []) 64 { 65 $params = ['name' => $name]; 66 $params = array_merge($params, $optParams); 67 return $this->call('delete', [$params], PubsubliteEmpty::class); 68 } 69 /** 70 * Returns the reservation configuration. (reservations.get) 71 * 72 * @param string $name Required. The name of the reservation whose configuration 73 * to return. Structured like: 74 * projects/{project_number}/locations/{location}/reservations/{reservation_id} 75 * @param array $optParams Optional parameters. 76 * @return Reservation 77 */ 78 public function get($name, $optParams = []) 79 { 80 $params = ['name' => $name]; 81 $params = array_merge($params, $optParams); 82 return $this->call('get', [$params], Reservation::class); 83 } 84 /** 85 * Returns the list of reservations for the given project. 86 * (reservations.listAdminProjectsLocationsReservations) 87 * 88 * @param string $parent Required. The parent whose reservations are to be 89 * listed. Structured like `projects/{project_number}/locations/{location}`. 90 * @param array $optParams Optional parameters. 91 * 92 * @opt_param int pageSize The maximum number of reservations to return. The 93 * service may return fewer than this value. If unset or zero, all reservations 94 * for the parent will be returned. 95 * @opt_param string pageToken A page token, received from a previous 96 * `ListReservations` call. Provide this to retrieve the subsequent page. When 97 * paginating, all other parameters provided to `ListReservations` must match 98 * the call that provided the page token. 99 * @return ListReservationsResponse 100 */ 101 public function listAdminProjectsLocationsReservations($parent, $optParams = []) 102 { 103 $params = ['parent' => $parent]; 104 $params = array_merge($params, $optParams); 105 return $this->call('list', [$params], ListReservationsResponse::class); 106 } 107 /** 108 * Updates properties of the specified reservation. (reservations.patch) 109 * 110 * @param string $name The name of the reservation. Structured like: 111 * projects/{project_number}/locations/{location}/reservations/{reservation_id} 112 * @param Reservation $postBody 113 * @param array $optParams Optional parameters. 114 * 115 * @opt_param string updateMask Required. A mask specifying the reservation 116 * fields to change. 117 * @return Reservation 118 */ 119 public function patch($name, Reservation $postBody, $optParams = []) 120 { 121 $params = ['name' => $name, 'postBody' => $postBody]; 122 $params = array_merge($params, $optParams); 123 return $this->call('patch', [$params], Reservation::class); 124 } 125} 126 127// Adding a class alias for backwards compatibility with the previous class name. 128class_alias(AdminProjectsLocationsReservations::class, 'Google_Service_PubsubLite_Resource_AdminProjectsLocationsReservations'); 129