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\Analytics\Resource;
19
20use Google\Service\Analytics\EntityAdWordsLink;
21use Google\Service\Analytics\EntityAdWordsLinks;
22
23/**
24 * The "webPropertyAdWordsLinks" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $analyticsService = new Google\Service\Analytics(...);
28 *   $webPropertyAdWordsLinks = $analyticsService->webPropertyAdWordsLinks;
29 *  </code>
30 */
31class ManagementWebPropertyAdWordsLinks extends \Google\Service\Resource
32{
33  /**
34   * Deletes a web property-Google Ads link. (webPropertyAdWordsLinks.delete)
35   *
36   * @param string $accountId ID of the account which the given web property
37   * belongs to.
38   * @param string $webPropertyId Web property ID to delete the Google Ads link
39   * for.
40   * @param string $webPropertyAdWordsLinkId Web property Google Ads link ID.
41   * @param array $optParams Optional parameters.
42   */
43  public function delete($accountId, $webPropertyId, $webPropertyAdWordsLinkId, $optParams = [])
44  {
45    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId];
46    $params = array_merge($params, $optParams);
47    return $this->call('delete', [$params]);
48  }
49  /**
50   * Returns a web property-Google Ads link to which the user has access.
51   * (webPropertyAdWordsLinks.get)
52   *
53   * @param string $accountId ID of the account which the given web property
54   * belongs to.
55   * @param string $webPropertyId Web property ID to retrieve the Google Ads link
56   * for.
57   * @param string $webPropertyAdWordsLinkId Web property-Google Ads link ID.
58   * @param array $optParams Optional parameters.
59   * @return EntityAdWordsLink
60   */
61  public function get($accountId, $webPropertyId, $webPropertyAdWordsLinkId, $optParams = [])
62  {
63    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], EntityAdWordsLink::class);
66  }
67  /**
68   * Creates a webProperty-Google Ads link. (webPropertyAdWordsLinks.insert)
69   *
70   * @param string $accountId ID of the Google Analytics account to create the
71   * link for.
72   * @param string $webPropertyId Web property ID to create the link for.
73   * @param EntityAdWordsLink $postBody
74   * @param array $optParams Optional parameters.
75   * @return EntityAdWordsLink
76   */
77  public function insert($accountId, $webPropertyId, EntityAdWordsLink $postBody, $optParams = [])
78  {
79    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody];
80    $params = array_merge($params, $optParams);
81    return $this->call('insert', [$params], EntityAdWordsLink::class);
82  }
83  /**
84   * Lists webProperty-Google Ads links for a given web property.
85   * (webPropertyAdWordsLinks.listManagementWebPropertyAdWordsLinks)
86   *
87   * @param string $accountId ID of the account which the given web property
88   * belongs to.
89   * @param string $webPropertyId Web property ID to retrieve the Google Ads links
90   * for.
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param int max-results The maximum number of webProperty-Google Ads links
94   * to include in this response.
95   * @opt_param int start-index An index of the first webProperty-Google Ads link
96   * to retrieve. Use this parameter as a pagination mechanism along with the max-
97   * results parameter.
98   * @return EntityAdWordsLinks
99   */
100  public function listManagementWebPropertyAdWordsLinks($accountId, $webPropertyId, $optParams = [])
101  {
102    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId];
103    $params = array_merge($params, $optParams);
104    return $this->call('list', [$params], EntityAdWordsLinks::class);
105  }
106  /**
107   * Updates an existing webProperty-Google Ads link. This method supports patch
108   * semantics. (webPropertyAdWordsLinks.patch)
109   *
110   * @param string $accountId ID of the account which the given web property
111   * belongs to.
112   * @param string $webPropertyId Web property ID to retrieve the Google Ads link
113   * for.
114   * @param string $webPropertyAdWordsLinkId Web property-Google Ads link ID.
115   * @param EntityAdWordsLink $postBody
116   * @param array $optParams Optional parameters.
117   * @return EntityAdWordsLink
118   */
119  public function patch($accountId, $webPropertyId, $webPropertyAdWordsLinkId, EntityAdWordsLink $postBody, $optParams = [])
120  {
121    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody];
122    $params = array_merge($params, $optParams);
123    return $this->call('patch', [$params], EntityAdWordsLink::class);
124  }
125  /**
126   * Updates an existing webProperty-Google Ads link.
127   * (webPropertyAdWordsLinks.update)
128   *
129   * @param string $accountId ID of the account which the given web property
130   * belongs to.
131   * @param string $webPropertyId Web property ID to retrieve the Google Ads link
132   * for.
133   * @param string $webPropertyAdWordsLinkId Web property-Google Ads link ID.
134   * @param EntityAdWordsLink $postBody
135   * @param array $optParams Optional parameters.
136   * @return EntityAdWordsLink
137   */
138  public function update($accountId, $webPropertyId, $webPropertyAdWordsLinkId, EntityAdWordsLink $postBody, $optParams = [])
139  {
140    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'webPropertyAdWordsLinkId' => $webPropertyAdWordsLinkId, 'postBody' => $postBody];
141    $params = array_merge($params, $optParams);
142    return $this->call('update', [$params], EntityAdWordsLink::class);
143  }
144}
145
146// Adding a class alias for backwards compatibility with the previous class name.
147class_alias(ManagementWebPropertyAdWordsLinks::class, 'Google_Service_Analytics_Resource_ManagementWebPropertyAdWordsLinks');
148