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