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\GoogleAnalyticsAdmin\Resource;
19
20use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaDataStream;
21use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaGlobalSiteTag;
22use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaListDataStreamsResponse;
23use Google\Service\GoogleAnalyticsAdmin\GoogleProtobufEmpty;
24
25/**
26 * The "dataStreams" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
30 *   $dataStreams = $analyticsadminService->dataStreams;
31 *  </code>
32 */
33class PropertiesDataStreams extends \Google\Service\Resource
34{
35  /**
36   * Creates a DataStream. (dataStreams.create)
37   *
38   * @param string $parent Required. Example format: properties/1234
39   * @param GoogleAnalyticsAdminV1alphaDataStream $postBody
40   * @param array $optParams Optional parameters.
41   * @return GoogleAnalyticsAdminV1alphaDataStream
42   */
43  public function create($parent, GoogleAnalyticsAdminV1alphaDataStream $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], GoogleAnalyticsAdminV1alphaDataStream::class);
48  }
49  /**
50   * Deletes a DataStream on a property. (dataStreams.delete)
51   *
52   * @param string $name Required. The name of the DataStream to delete. Example
53   * format: properties/1234/dataStreams/5678
54   * @param array $optParams Optional parameters.
55   * @return GoogleProtobufEmpty
56   */
57  public function delete($name, $optParams = [])
58  {
59    $params = ['name' => $name];
60    $params = array_merge($params, $optParams);
61    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
62  }
63  /**
64   * Lookup for a single DataStream. (dataStreams.get)
65   *
66   * @param string $name Required. The name of the DataStream to get. Example
67   * format: properties/1234/dataStreams/5678
68   * @param array $optParams Optional parameters.
69   * @return GoogleAnalyticsAdminV1alphaDataStream
70   */
71  public function get($name, $optParams = [])
72  {
73    $params = ['name' => $name];
74    $params = array_merge($params, $optParams);
75    return $this->call('get', [$params], GoogleAnalyticsAdminV1alphaDataStream::class);
76  }
77  /**
78   * Returns the Site Tag for the specified web stream. Site Tags are immutable
79   * singletons. (dataStreams.getGlobalSiteTag)
80   *
81   * @param string $name Required. The name of the site tag to lookup. Note that
82   * site tags are singletons and do not have unique IDs. Format:
83   * properties/{property_id}/dataStreams/{stream_id}/globalSiteTag Example:
84   * "properties/123/dataStreams/456/globalSiteTag"
85   * @param array $optParams Optional parameters.
86   * @return GoogleAnalyticsAdminV1alphaGlobalSiteTag
87   */
88  public function getGlobalSiteTag($name, $optParams = [])
89  {
90    $params = ['name' => $name];
91    $params = array_merge($params, $optParams);
92    return $this->call('getGlobalSiteTag', [$params], GoogleAnalyticsAdminV1alphaGlobalSiteTag::class);
93  }
94  /**
95   * Lists DataStreams on a property. (dataStreams.listPropertiesDataStreams)
96   *
97   * @param string $parent Required. Example format: properties/1234
98   * @param array $optParams Optional parameters.
99   *
100   * @opt_param int pageSize The maximum number of resources to return. If
101   * unspecified, at most 50 resources will be returned. The maximum value is 200
102   * (higher values will be coerced to the maximum).
103   * @opt_param string pageToken A page token, received from a previous
104   * `ListDataStreams` call. Provide this to retrieve the subsequent page. When
105   * paginating, all other parameters provided to `ListDataStreams` must match the
106   * call that provided the page token.
107   * @return GoogleAnalyticsAdminV1alphaListDataStreamsResponse
108   */
109  public function listPropertiesDataStreams($parent, $optParams = [])
110  {
111    $params = ['parent' => $parent];
112    $params = array_merge($params, $optParams);
113    return $this->call('list', [$params], GoogleAnalyticsAdminV1alphaListDataStreamsResponse::class);
114  }
115  /**
116   * Updates a DataStream on a property. (dataStreams.patch)
117   *
118   * @param string $name Output only. Resource name of this Data Stream. Format:
119   * properties/{property_id}/dataStreams/{stream_id} Example:
120   * "properties/1000/dataStreams/2000"
121   * @param GoogleAnalyticsAdminV1alphaDataStream $postBody
122   * @param array $optParams Optional parameters.
123   *
124   * @opt_param string updateMask Required. The list of fields to be updated.
125   * Omitted fields will not be updated. To replace the entire entity, use one
126   * path with the string "*" to match all fields.
127   * @return GoogleAnalyticsAdminV1alphaDataStream
128   */
129  public function patch($name, GoogleAnalyticsAdminV1alphaDataStream $postBody, $optParams = [])
130  {
131    $params = ['name' => $name, 'postBody' => $postBody];
132    $params = array_merge($params, $optParams);
133    return $this->call('patch', [$params], GoogleAnalyticsAdminV1alphaDataStream::class);
134  }
135}
136
137// Adding a class alias for backwards compatibility with the previous class name.
138class_alias(PropertiesDataStreams::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_PropertiesDataStreams');
139