[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\Goal;
|
---|
| 21 | use Google\Service\Analytics\Goals;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "goals" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $analyticsService = new Google\Service\Analytics(...);
|
---|
| 28 | * $goals = $analyticsService->management_goals;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class ManagementGoals extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Gets a goal to which the user has access. (goals.get)
|
---|
| 35 | *
|
---|
| 36 | * @param string $accountId Account ID to retrieve the goal for.
|
---|
| 37 | * @param string $webPropertyId Web property ID to retrieve the goal for.
|
---|
| 38 | * @param string $profileId View (Profile) ID to retrieve the goal for.
|
---|
| 39 | * @param string $goalId Goal ID to retrieve the goal for.
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return Goal
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function get($accountId, $webPropertyId, $profileId, $goalId, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('get', [$params], Goal::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Create a new goal. (goals.insert)
|
---|
| 52 | *
|
---|
| 53 | * @param string $accountId Account ID to create the goal for.
|
---|
| 54 | * @param string $webPropertyId Web property ID to create the goal for.
|
---|
| 55 | * @param string $profileId View (Profile) ID to create the goal for.
|
---|
| 56 | * @param Goal $postBody
|
---|
| 57 | * @param array $optParams Optional parameters.
|
---|
| 58 | * @return Goal
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function insert($accountId, $webPropertyId, $profileId, Goal $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('insert', [$params], Goal::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Lists goals to which the user has access. (goals.listManagementGoals)
|
---|
| 69 | *
|
---|
| 70 | * @param string $accountId Account ID to retrieve goals for. Can either be a
|
---|
| 71 | * specific account ID or '~all', which refers to all the accounts that user has
|
---|
| 72 | * access to.
|
---|
| 73 | * @param string $webPropertyId Web property ID to retrieve goals for. Can
|
---|
| 74 | * either be a specific web property ID or '~all', which refers to all the web
|
---|
| 75 | * properties that user has access to.
|
---|
| 76 | * @param string $profileId View (Profile) ID to retrieve goals for. Can either
|
---|
| 77 | * be a specific view (profile) ID or '~all', which refers to all the views
|
---|
| 78 | * (profiles) that user has access to.
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | *
|
---|
| 81 | * @opt_param int max-results The maximum number of goals to include in this
|
---|
| 82 | * response.
|
---|
| 83 | * @opt_param int start-index An index of the first goal to retrieve. Use this
|
---|
| 84 | * parameter as a pagination mechanism along with the max-results parameter.
|
---|
| 85 | * @return Goals
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('list', [$params], Goals::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Updates an existing goal. This method supports patch semantics. (goals.patch)
|
---|
| 96 | *
|
---|
| 97 | * @param string $accountId Account ID to update the goal.
|
---|
| 98 | * @param string $webPropertyId Web property ID to update the goal.
|
---|
| 99 | * @param string $profileId View (Profile) ID to update the goal.
|
---|
| 100 | * @param string $goalId Index of the goal to be updated.
|
---|
| 101 | * @param Goal $postBody
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | * @return Goal
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function patch($accountId, $webPropertyId, $profileId, $goalId, Goal $postBody, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('patch', [$params], Goal::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Updates an existing goal. (goals.update)
|
---|
| 114 | *
|
---|
| 115 | * @param string $accountId Account ID to update the goal.
|
---|
| 116 | * @param string $webPropertyId Web property ID to update the goal.
|
---|
| 117 | * @param string $profileId View (Profile) ID to update the goal.
|
---|
| 118 | * @param string $goalId Index of the goal to be updated.
|
---|
| 119 | * @param Goal $postBody
|
---|
| 120 | * @param array $optParams Optional parameters.
|
---|
| 121 | * @return Goal
|
---|
| 122 | * @throws \Google\Service\Exception
|
---|
| 123 | */
|
---|
| 124 | public function update($accountId, $webPropertyId, $profileId, $goalId, Goal $postBody, $optParams = [])
|
---|
| 125 | {
|
---|
| 126 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'goalId' => $goalId, 'postBody' => $postBody];
|
---|
| 127 | $params = array_merge($params, $optParams);
|
---|
| 128 | return $this->call('update', [$params], Goal::class);
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 133 | class_alias(ManagementGoals::class, 'Google_Service_Analytics_Resource_ManagementGoals');
|
---|