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