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\GoogleAnalyticsAdminV1alphaListMeasurementProtocolSecretsResponse;
21use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret;
22use Google\Service\GoogleAnalyticsAdmin\GoogleProtobufEmpty;
23
24/**
25 * The "measurementProtocolSecrets" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
29 *   $measurementProtocolSecrets = $analyticsadminService->measurementProtocolSecrets;
30 *  </code>
31 */
32class PropertiesDataStreamsMeasurementProtocolSecrets extends \Google\Service\Resource
33{
34  /**
35   * Creates a measurement protocol secret. (measurementProtocolSecrets.create)
36   *
37   * @param string $parent Required. The parent resource where this secret will be
38   * created. Format: properties/{property}/dataStreams/{dataStream}
39   * @param GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret $postBody
40   * @param array $optParams Optional parameters.
41   * @return GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret
42   */
43  public function create($parent, GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret::class);
48  }
49  /**
50   * Deletes target MeasurementProtocolSecret. (measurementProtocolSecrets.delete)
51   *
52   * @param string $name Required. The name of the MeasurementProtocolSecret to
53   * delete. Format: properties/{property}/dataStreams/{dataStream}/measurementPro
54   * tocolSecrets/{measurementProtocolSecret}
55   * @param array $optParams Optional parameters.
56   * @return GoogleProtobufEmpty
57   */
58  public function delete($name, $optParams = [])
59  {
60    $params = ['name' => $name];
61    $params = array_merge($params, $optParams);
62    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
63  }
64  /**
65   * Lookup for a single "GA4" MeasurementProtocolSecret.
66   * (measurementProtocolSecrets.get)
67   *
68   * @param string $name Required. The name of the measurement protocol secret to
69   * lookup. Format: properties/{property}/dataStreams/{dataStream}/measurementPro
70   * tocolSecrets/{measurementProtocolSecret}
71   * @param array $optParams Optional parameters.
72   * @return GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret::class);
79  }
80  /**
81   * Returns child MeasurementProtocolSecrets under the specified parent Property.
82   * (measurementProtocolSecrets.listPropertiesDataStreamsMeasurementProtocolSecre
83   * ts)
84   *
85   * @param string $parent Required. The resource name of the parent stream.
86   * Format:
87   * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param int pageSize The maximum number of resources to return. If
91   * unspecified, at most 10 resources will be returned. The maximum value is 10.
92   * Higher values will be coerced to the maximum.
93   * @opt_param string pageToken A page token, received from a previous
94   * `ListMeasurementProtocolSecrets` call. Provide this to retrieve the
95   * subsequent page. When paginating, all other parameters provided to
96   * `ListMeasurementProtocolSecrets` must match the call that provided the page
97   * token.
98   * @return GoogleAnalyticsAdminV1alphaListMeasurementProtocolSecretsResponse
99   */
100  public function listPropertiesDataStreamsMeasurementProtocolSecrets($parent, $optParams = [])
101  {
102    $params = ['parent' => $parent];
103    $params = array_merge($params, $optParams);
104    return $this->call('list', [$params], GoogleAnalyticsAdminV1alphaListMeasurementProtocolSecretsResponse::class);
105  }
106  /**
107   * Updates a measurement protocol secret. (measurementProtocolSecrets.patch)
108   *
109   * @param string $name Output only. Resource name of this secret. This secret
110   * may be a child of any type of stream. Format: properties/{property}/dataStrea
111   * ms/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
112   * @param GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret $postBody
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string updateMask The list of fields to be updated. Omitted fields
116   * will not be updated.
117   * @return GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret
118   */
119  public function patch($name, GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret $postBody, $optParams = [])
120  {
121    $params = ['name' => $name, 'postBody' => $postBody];
122    $params = array_merge($params, $optParams);
123    return $this->call('patch', [$params], GoogleAnalyticsAdminV1alphaMeasurementProtocolSecret::class);
124  }
125}
126
127// Adding a class alias for backwards compatibility with the previous class name.
128class_alias(PropertiesDataStreamsMeasurementProtocolSecrets::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_PropertiesDataStreamsMeasurementProtocolSecrets');
129