[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\CloudAsset\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudAsset\CloudassetEmpty;
|
---|
| 21 | use Google\Service\CloudAsset\CreateFeedRequest;
|
---|
| 22 | use Google\Service\CloudAsset\Feed;
|
---|
| 23 | use Google\Service\CloudAsset\ListFeedsResponse;
|
---|
| 24 | use Google\Service\CloudAsset\UpdateFeedRequest;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "feeds" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $cloudassetService = new Google\Service\CloudAsset(...);
|
---|
| 31 | * $feeds = $cloudassetService->feeds;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class Feeds extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates a feed in a parent project/folder/organization to listen to its asset
|
---|
| 38 | * updates. (feeds.create)
|
---|
| 39 | *
|
---|
| 40 | * @param string $parent Required. The name of the project/folder/organization
|
---|
| 41 | * where this feed should be created in. It can only be an organization number
|
---|
| 42 | * (such as "organizations/123"), a folder number (such as "folders/123"), a
|
---|
| 43 | * project ID (such as "projects/my-project-id"), or a project number (such as
|
---|
| 44 | * "projects/12345").
|
---|
| 45 | * @param CreateFeedRequest $postBody
|
---|
| 46 | * @param array $optParams Optional parameters.
|
---|
| 47 | * @return Feed
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function create($parent, CreateFeedRequest $postBody, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('create', [$params], Feed::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Deletes an asset feed. (feeds.delete)
|
---|
| 58 | *
|
---|
| 59 | * @param string $name Required. The name of the feed and it must be in the
|
---|
| 60 | * format of: projects/project_number/feeds/feed_id
|
---|
| 61 | * folders/folder_number/feeds/feed_id
|
---|
| 62 | * organizations/organization_number/feeds/feed_id
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return CloudassetEmpty
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function delete($name, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['name' => $name];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('delete', [$params], CloudassetEmpty::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Gets details about an asset feed. (feeds.get)
|
---|
| 75 | *
|
---|
| 76 | * @param string $name Required. The name of the Feed and it must be in the
|
---|
| 77 | * format of: projects/project_number/feeds/feed_id
|
---|
| 78 | * folders/folder_number/feeds/feed_id
|
---|
| 79 | * organizations/organization_number/feeds/feed_id
|
---|
| 80 | * @param array $optParams Optional parameters.
|
---|
| 81 | * @return Feed
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function get($name, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['name' => $name];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('get', [$params], Feed::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Lists all asset feeds in a parent project/folder/organization.
|
---|
| 92 | * (feeds.listFeeds)
|
---|
| 93 | *
|
---|
| 94 | * @param string $parent Required. The parent project/folder/organization whose
|
---|
| 95 | * feeds are to be listed. It can only be using project/folder/organization
|
---|
| 96 | * number (such as "folders/12345")", or a project ID (such as "projects/my-
|
---|
| 97 | * project-id").
|
---|
| 98 | * @param array $optParams Optional parameters.
|
---|
| 99 | * @return ListFeedsResponse
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function listFeeds($parent, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['parent' => $parent];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('list', [$params], ListFeedsResponse::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Updates an asset feed configuration. (feeds.patch)
|
---|
| 110 | *
|
---|
| 111 | * @param string $name Required. The format will be
|
---|
| 112 | * projects/{project_number}/feeds/{client-assigned_feed_identifier} or
|
---|
| 113 | * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or
|
---|
| 114 | * organizations/{organization_number}/feeds/{client-assigned_feed_identifier}
|
---|
| 115 | * The client-assigned feed identifier must be unique within the parent
|
---|
| 116 | * project/folder/organization.
|
---|
| 117 | * @param UpdateFeedRequest $postBody
|
---|
| 118 | * @param array $optParams Optional parameters.
|
---|
| 119 | * @return Feed
|
---|
| 120 | * @throws \Google\Service\Exception
|
---|
| 121 | */
|
---|
| 122 | public function patch($name, UpdateFeedRequest $postBody, $optParams = [])
|
---|
| 123 | {
|
---|
| 124 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 125 | $params = array_merge($params, $optParams);
|
---|
| 126 | return $this->call('patch', [$params], Feed::class);
|
---|
| 127 | }
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 131 | class_alias(Feeds::class, 'Google_Service_CloudAsset_Resource_Feeds');
|
---|