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\Datastream\Resource; 19 20use Google\Service\Datastream\ListStreamsResponse; 21use Google\Service\Datastream\Operation; 22use Google\Service\Datastream\Stream; 23 24/** 25 * The "streams" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $datastreamService = new Google\Service\Datastream(...); 29 * $streams = $datastreamService->streams; 30 * </code> 31 */ 32class ProjectsLocationsStreams extends \Google\Service\Resource 33{ 34 /** 35 * Use this method to create a stream. (streams.create) 36 * 37 * @param string $parent Required. The parent that owns the collection of 38 * streams. 39 * @param Stream $postBody 40 * @param array $optParams Optional parameters. 41 * 42 * @opt_param bool force Optional. Create the stream without validating it. 43 * @opt_param string requestId Optional. A request ID to identify requests. 44 * Specify a unique request ID so that if you must retry your request, the 45 * server will know to ignore the request if it has already been completed. The 46 * server will guarantee that for at least 60 minutes since the first request. 47 * For example, consider a situation where you make an initial request and the 48 * request times out. If you make the request again with the same request ID, 49 * the server can check if original operation with the same request ID was 50 * received, and if so, will ignore the second request. This prevents clients 51 * from accidentally creating duplicate commitments. The request ID must be a 52 * valid UUID with the exception that zero UUID is not supported 53 * (00000000-0000-0000-0000-000000000000). 54 * @opt_param string streamId Required. The stream identifier. 55 * @opt_param bool validateOnly Optional. Only validate the stream, but don't 56 * create any resources. The default is false. 57 * @return Operation 58 */ 59 public function create($parent, Stream $postBody, $optParams = []) 60 { 61 $params = ['parent' => $parent, 'postBody' => $postBody]; 62 $params = array_merge($params, $optParams); 63 return $this->call('create', [$params], Operation::class); 64 } 65 /** 66 * Use this method to delete a stream. (streams.delete) 67 * 68 * @param string $name Required. The name of the stream resource to delete. 69 * @param array $optParams Optional parameters. 70 * 71 * @opt_param string requestId Optional. A request ID to identify requests. 72 * Specify a unique request ID so that if you must retry your request, the 73 * server will know to ignore the request if it has already been completed. The 74 * server will guarantee that for at least 60 minutes after the first request. 75 * For example, consider a situation where you make an initial request and the 76 * request times out. If you make the request again with the same request ID, 77 * the server can check if original operation with the same request ID was 78 * received, and if so, will ignore the second request. This prevents clients 79 * from accidentally creating duplicate commitments. The request ID must be a 80 * valid UUID with the exception that zero UUID is not supported 81 * (00000000-0000-0000-0000-000000000000). 82 * @return Operation 83 */ 84 public function delete($name, $optParams = []) 85 { 86 $params = ['name' => $name]; 87 $params = array_merge($params, $optParams); 88 return $this->call('delete', [$params], Operation::class); 89 } 90 /** 91 * Use this method to get details about a stream. (streams.get) 92 * 93 * @param string $name Required. The name of the stream resource to get. 94 * @param array $optParams Optional parameters. 95 * @return Stream 96 */ 97 public function get($name, $optParams = []) 98 { 99 $params = ['name' => $name]; 100 $params = array_merge($params, $optParams); 101 return $this->call('get', [$params], Stream::class); 102 } 103 /** 104 * Use this method to list streams in a project and location. 105 * (streams.listProjectsLocationsStreams) 106 * 107 * @param string $parent Required. The parent that owns the collection of 108 * streams. 109 * @param array $optParams Optional parameters. 110 * 111 * @opt_param string filter Filter request. 112 * @opt_param string orderBy Order by fields for the result. 113 * @opt_param int pageSize Maximum number of streams to return. If unspecified, 114 * at most 50 streams will be returned. The maximum value is 1000; values above 115 * 1000 will be coerced to 1000. 116 * @opt_param string pageToken Page token received from a previous `ListStreams` 117 * call. Provide this to retrieve the subsequent page. When paginating, all 118 * other parameters provided to `ListStreams` must match the call that provided 119 * the page token. 120 * @return ListStreamsResponse 121 */ 122 public function listProjectsLocationsStreams($parent, $optParams = []) 123 { 124 $params = ['parent' => $parent]; 125 $params = array_merge($params, $optParams); 126 return $this->call('list', [$params], ListStreamsResponse::class); 127 } 128 /** 129 * Use this method to update the configuration of a stream. (streams.patch) 130 * 131 * @param string $name Output only. The stream's name. 132 * @param Stream $postBody 133 * @param array $optParams Optional parameters. 134 * 135 * @opt_param bool force Optional. Update the stream without validating it. 136 * @opt_param string requestId Optional. A request ID to identify requests. 137 * Specify a unique request ID so that if you must retry your request, the 138 * server will know to ignore the request if it has already been completed. The 139 * server will guarantee that for at least 60 minutes since the first request. 140 * For example, consider a situation where you make an initial request and the 141 * request times out. If you make the request again with the same request ID, 142 * the server can check if original operation with the same request ID was 143 * received, and if so, will ignore the second request. This prevents clients 144 * from accidentally creating duplicate commitments. The request ID must be a 145 * valid UUID with the exception that zero UUID is not supported 146 * (00000000-0000-0000-0000-000000000000). 147 * @opt_param string updateMask Optional. Field mask is used to specify the 148 * fields to be overwritten in the stream resource by the update. The fields 149 * specified in the update_mask are relative to the resource, not the full 150 * request. A field will be overwritten if it is in the mask. If the user does 151 * not provide a mask then all fields will be overwritten. 152 * @opt_param bool validateOnly Optional. Only validate the stream with the 153 * changes, without actually updating it. The default is false. 154 * @return Operation 155 */ 156 public function patch($name, Stream $postBody, $optParams = []) 157 { 158 $params = ['name' => $name, 'postBody' => $postBody]; 159 $params = array_merge($params, $optParams); 160 return $this->call('patch', [$params], Operation::class); 161 } 162} 163 164// Adding a class alias for backwards compatibility with the previous class name. 165class_alias(ProjectsLocationsStreams::class, 'Google_Service_Datastream_Resource_ProjectsLocationsStreams'); 166