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