[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\APIManagement\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\APIManagement\ListObservationSourcesResponse;
|
---|
| 21 | use Google\Service\APIManagement\ObservationSource;
|
---|
| 22 | use Google\Service\APIManagement\Operation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "observationSources" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $apimService = new Google\Service\APIManagement(...);
|
---|
| 29 | * $observationSources = $apimService->projects_locations_observationSources;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsObservationSources extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * CreateObservationSource creates a new ObservationSource but does not affect
|
---|
| 36 | * any deployed infrastructure. It is a configuration that can be used in an
|
---|
| 37 | * Observation Job to collect data about APIs running in user's dataplane.
|
---|
| 38 | * (observationSources.create)
|
---|
| 39 | *
|
---|
| 40 | * @param string $parent Required. Value for parent.
|
---|
| 41 | * @param ObservationSource $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | *
|
---|
| 44 | * @opt_param string observationSourceId Required. The ID to use for the
|
---|
| 45 | * Observation Source. This value should be 4-63 characters, and valid
|
---|
| 46 | * characters are /a-z-/.
|
---|
| 47 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 48 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 49 | * the server will know to ignore the request if it has already been completed.
|
---|
| 50 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 51 | * request. For example, consider a situation where you make an initial request
|
---|
| 52 | * and the request times out. If you make the request again with the same
|
---|
| 53 | * request ID, the server can check if original operation with the same request
|
---|
| 54 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 55 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 56 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 57 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 58 | * @return Operation
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function create($parent, ObservationSource $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('create', [$params], Operation::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * DeleteObservationSource deletes an observation source. This method will fail
|
---|
| 69 | * if the observation source is currently being used by any ObservationJob, even
|
---|
| 70 | * if not enabled. (observationSources.delete)
|
---|
| 71 | *
|
---|
| 72 | * @param string $name Required. Name of the resource Format:
|
---|
| 73 | * projects/{project}/locations/{location}/observationSources/{source}
|
---|
| 74 | * @param array $optParams Optional parameters.
|
---|
| 75 | * @return Operation
|
---|
| 76 | * @throws \Google\Service\Exception
|
---|
| 77 | */
|
---|
| 78 | public function delete($name, $optParams = [])
|
---|
| 79 | {
|
---|
| 80 | $params = ['name' => $name];
|
---|
| 81 | $params = array_merge($params, $optParams);
|
---|
| 82 | return $this->call('delete', [$params], Operation::class);
|
---|
| 83 | }
|
---|
| 84 | /**
|
---|
| 85 | * GetObservationSource retrieves a single ObservationSource by name.
|
---|
| 86 | * (observationSources.get)
|
---|
| 87 | *
|
---|
| 88 | * @param string $name Required. The name of the ObservationSource to retrieve.
|
---|
| 89 | * Format: projects/{project}/locations/{location}/observationSources/{source}
|
---|
| 90 | * @param array $optParams Optional parameters.
|
---|
| 91 | * @return ObservationSource
|
---|
| 92 | * @throws \Google\Service\Exception
|
---|
| 93 | */
|
---|
| 94 | public function get($name, $optParams = [])
|
---|
| 95 | {
|
---|
| 96 | $params = ['name' => $name];
|
---|
| 97 | $params = array_merge($params, $optParams);
|
---|
| 98 | return $this->call('get', [$params], ObservationSource::class);
|
---|
| 99 | }
|
---|
| 100 | /**
|
---|
| 101 | * ListObservationSources gets all ObservationSources for a given project and
|
---|
| 102 | * location. (observationSources.listProjectsLocationsObservationSources)
|
---|
| 103 | *
|
---|
| 104 | * @param string $parent Required. The parent, which owns this collection of
|
---|
| 105 | * ObservationSources. Format: projects/{project}/locations/{location}
|
---|
| 106 | * @param array $optParams Optional parameters.
|
---|
| 107 | *
|
---|
| 108 | * @opt_param int pageSize Optional. The maximum number of ObservationSources to
|
---|
| 109 | * return. The service may return fewer than this value. If unspecified, at most
|
---|
| 110 | * 10 ObservationSources will be returned. The maximum value is 1000; values
|
---|
| 111 | * above 1000 will be coerced to 1000.
|
---|
| 112 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 113 | * `ListObservationSources` call. Provide this to retrieve the subsequent page.
|
---|
| 114 | * When paginating, all other parameters provided to `ListObservationSources`
|
---|
| 115 | * must match the call that provided the page token.
|
---|
| 116 | * @return ListObservationSourcesResponse
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function listProjectsLocationsObservationSources($parent, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['parent' => $parent];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('list', [$params], ListObservationSourcesResponse::class);
|
---|
| 124 | }
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 128 | class_alias(ProjectsLocationsObservationSources::class, 'Google_Service_APIManagement_Resource_ProjectsLocationsObservationSources');
|
---|