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\GoogleAnalyticsAdminV1alphaGoogleAdsLink;
21use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse;
22use Google\Service\GoogleAnalyticsAdmin\GoogleProtobufEmpty;
23
24/**
25 * The "googleAdsLinks" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
29 *   $googleAdsLinks = $analyticsadminService->googleAdsLinks;
30 *  </code>
31 */
32class PropertiesGoogleAdsLinks extends \Google\Service\Resource
33{
34  /**
35   * Creates a GoogleAdsLink. (googleAdsLinks.create)
36   *
37   * @param string $parent Required. Example format: properties/1234
38   * @param GoogleAnalyticsAdminV1alphaGoogleAdsLink $postBody
39   * @param array $optParams Optional parameters.
40   * @return GoogleAnalyticsAdminV1alphaGoogleAdsLink
41   */
42  public function create($parent, GoogleAnalyticsAdminV1alphaGoogleAdsLink $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], GoogleAnalyticsAdminV1alphaGoogleAdsLink::class);
47  }
48  /**
49   * Deletes a GoogleAdsLink on a property (googleAdsLinks.delete)
50   *
51   * @param string $name Required. Example format:
52   * properties/1234/googleAdsLinks/5678
53   * @param array $optParams Optional parameters.
54   * @return GoogleProtobufEmpty
55   */
56  public function delete($name, $optParams = [])
57  {
58    $params = ['name' => $name];
59    $params = array_merge($params, $optParams);
60    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
61  }
62  /**
63   * Lists GoogleAdsLinks on a property.
64   * (googleAdsLinks.listPropertiesGoogleAdsLinks)
65   *
66   * @param string $parent Required. Example format: properties/1234
67   * @param array $optParams Optional parameters.
68   *
69   * @opt_param int pageSize The maximum number of resources to return. If
70   * unspecified, at most 50 resources will be returned. The maximum value is 200
71   * (higher values will be coerced to the maximum).
72   * @opt_param string pageToken A page token, received from a previous
73   * `ListGoogleAdsLinks` call. Provide this to retrieve the subsequent page. When
74   * paginating, all other parameters provided to `ListGoogleAdsLinks` must match
75   * the call that provided the page token.
76   * @return GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse
77   */
78  public function listPropertiesGoogleAdsLinks($parent, $optParams = [])
79  {
80    $params = ['parent' => $parent];
81    $params = array_merge($params, $optParams);
82    return $this->call('list', [$params], GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse::class);
83  }
84  /**
85   * Updates a GoogleAdsLink on a property (googleAdsLinks.patch)
86   *
87   * @param string $name Output only. Format:
88   * properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} Note:
89   * googleAdsLinkId is not the Google Ads customer ID.
90   * @param GoogleAnalyticsAdminV1alphaGoogleAdsLink $postBody
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param string updateMask Required. The list of fields to be updated.
94   * Field names must be in snake case (e.g., "field_to_update"). Omitted fields
95   * will not be updated. To replace the entire entity, use one path with the
96   * string "*" to match all fields.
97   * @return GoogleAnalyticsAdminV1alphaGoogleAdsLink
98   */
99  public function patch($name, GoogleAnalyticsAdminV1alphaGoogleAdsLink $postBody, $optParams = [])
100  {
101    $params = ['name' => $name, 'postBody' => $postBody];
102    $params = array_merge($params, $optParams);
103    return $this->call('patch', [$params], GoogleAnalyticsAdminV1alphaGoogleAdsLink::class);
104  }
105}
106
107// Adding a class alias for backwards compatibility with the previous class name.
108class_alias(PropertiesGoogleAdsLinks::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_PropertiesGoogleAdsLinks');
109