[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\AnalyticsData\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\AnalyticsData\AudienceExport;
|
---|
| 21 | use Google\Service\AnalyticsData\ListAudienceExportsResponse;
|
---|
| 22 | use Google\Service\AnalyticsData\Operation;
|
---|
| 23 | use Google\Service\AnalyticsData\QueryAudienceExportRequest;
|
---|
| 24 | use Google\Service\AnalyticsData\QueryAudienceExportResponse;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "audienceExports" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $analyticsdataService = new Google\Service\AnalyticsData(...);
|
---|
| 31 | * $audienceExports = $analyticsdataService->properties_audienceExports;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class PropertiesAudienceExports extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates an audience export for later retrieval. This method quickly returns
|
---|
| 38 | * the audience export's resource name and initiates a long running asynchronous
|
---|
| 39 | * request to form an audience export. To export the users in an audience
|
---|
| 40 | * export, first create the audience export through this method and then send
|
---|
| 41 | * the audience resource name to the `QueryAudienceExport` method. See [Creating
|
---|
| 42 | * an Audience Export](https://developers.google.com/analytics/devguides/reporti
|
---|
| 43 | * ng/data/v1/audience-list-basics) for an introduction to Audience Exports with
|
---|
| 44 | * examples. An audience export is a snapshot of the users currently in the
|
---|
| 45 | * audience at the time of audience export creation. Creating audience exports
|
---|
| 46 | * for one audience on different days will return different results as users
|
---|
| 47 | * enter and exit the audience. Audiences in Google Analytics 4 allow you to
|
---|
| 48 | * segment your users in the ways that are important to your business. To learn
|
---|
| 49 | * more, see https://support.google.com/analytics/answer/9267572. Audience
|
---|
| 50 | * exports contain the users in each audience. Audience Export APIs have some
|
---|
| 51 | * methods at alpha and other methods at beta stability. The intention is to
|
---|
| 52 | * advance methods to beta stability after some feedback and adoption. To give
|
---|
| 53 | * your feedback on this API, complete the [Google Analytics Audience Export API
|
---|
| 54 | * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. (audienceExports.create)
|
---|
| 55 | *
|
---|
| 56 | * @param string $parent Required. The parent resource where this audience
|
---|
| 57 | * export will be created. Format: `properties/{property}`
|
---|
| 58 | * @param AudienceExport $postBody
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, AudienceExport $postBody, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('create', [$params], Operation::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Gets configuration metadata about a specific audience export. This method can
|
---|
| 71 | * be used to understand an audience export after it has been created. See
|
---|
| 72 | * [Creating an Audience Export](https://developers.google.com/analytics/devguid
|
---|
| 73 | * es/reporting/data/v1/audience-list-basics) for an introduction to Audience
|
---|
| 74 | * Exports with examples. Audience Export APIs have some methods at alpha and
|
---|
| 75 | * other methods at beta stability. The intention is to advance methods to beta
|
---|
| 76 | * stability after some feedback and adoption. To give your feedback on this
|
---|
| 77 | * API, complete the [Google Analytics Audience Export API
|
---|
| 78 | * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. (audienceExports.get)
|
---|
| 79 | *
|
---|
| 80 | * @param string $name Required. The audience export resource name. Format:
|
---|
| 81 | * `properties/{property}/audienceExports/{audience_export}`
|
---|
| 82 | * @param array $optParams Optional parameters.
|
---|
| 83 | * @return AudienceExport
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function get($name, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['name' => $name];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('get', [$params], AudienceExport::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Lists all audience exports for a property. This method can be used for you to
|
---|
| 94 | * find and reuse existing audience exports rather than creating unnecessary new
|
---|
| 95 | * audience exports. The same audience can have multiple audience exports that
|
---|
| 96 | * represent the export of users that were in an audience on different days. See
|
---|
| 97 | * [Creating an Audience Export](https://developers.google.com/analytics/devguid
|
---|
| 98 | * es/reporting/data/v1/audience-list-basics) for an introduction to Audience
|
---|
| 99 | * Exports with examples. Audience Export APIs have some methods at alpha and
|
---|
| 100 | * other methods at beta stability. The intention is to advance methods to beta
|
---|
| 101 | * stability after some feedback and adoption. To give your feedback on this
|
---|
| 102 | * API, complete the [Google Analytics Audience Export API
|
---|
| 103 | * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
---|
| 104 | * (audienceExports.listPropertiesAudienceExports)
|
---|
| 105 | *
|
---|
| 106 | * @param string $parent Required. All audience exports for this property will
|
---|
| 107 | * be listed in the response. Format: `properties/{property}`
|
---|
| 108 | * @param array $optParams Optional parameters.
|
---|
| 109 | *
|
---|
| 110 | * @opt_param int pageSize Optional. The maximum number of audience exports to
|
---|
| 111 | * return. The service may return fewer than this value. If unspecified, at most
|
---|
| 112 | * 200 audience exports will be returned. The maximum value is 1000 (higher
|
---|
| 113 | * values will be coerced to the maximum).
|
---|
| 114 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 115 | * `ListAudienceExports` call. Provide this to retrieve the subsequent page.
|
---|
| 116 | * When paginating, all other parameters provided to `ListAudienceExports` must
|
---|
| 117 | * match the call that provided the page token.
|
---|
| 118 | * @return ListAudienceExportsResponse
|
---|
| 119 | * @throws \Google\Service\Exception
|
---|
| 120 | */
|
---|
| 121 | public function listPropertiesAudienceExports($parent, $optParams = [])
|
---|
| 122 | {
|
---|
| 123 | $params = ['parent' => $parent];
|
---|
| 124 | $params = array_merge($params, $optParams);
|
---|
| 125 | return $this->call('list', [$params], ListAudienceExportsResponse::class);
|
---|
| 126 | }
|
---|
| 127 | /**
|
---|
| 128 | * Retrieves an audience export of users. After creating an audience, the users
|
---|
| 129 | * are not immediately available for exporting. First, a request to
|
---|
| 130 | * `CreateAudienceExport` is necessary to create an audience export of users,
|
---|
| 131 | * and then second, this method is used to retrieve the users in the audience
|
---|
| 132 | * export. See [Creating an Audience Export](https://developers.google.com/analy
|
---|
| 133 | * tics/devguides/reporting/data/v1/audience-list-basics) for an introduction to
|
---|
| 134 | * Audience Exports with examples. Audiences in Google Analytics 4 allow you to
|
---|
| 135 | * segment your users in the ways that are important to your business. To learn
|
---|
| 136 | * more, see https://support.google.com/analytics/answer/9267572. Audience
|
---|
| 137 | * Export APIs have some methods at alpha and other methods at beta stability.
|
---|
| 138 | * The intention is to advance methods to beta stability after some feedback and
|
---|
| 139 | * adoption. To give your feedback on this API, complete the [Google Analytics
|
---|
| 140 | * Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
---|
| 141 | * (audienceExports.query)
|
---|
| 142 | *
|
---|
| 143 | * @param string $name Required. The name of the audience export to retrieve
|
---|
| 144 | * users from. Format: `properties/{property}/audienceExports/{audience_export}`
|
---|
| 145 | * @param QueryAudienceExportRequest $postBody
|
---|
| 146 | * @param array $optParams Optional parameters.
|
---|
| 147 | * @return QueryAudienceExportResponse
|
---|
| 148 | * @throws \Google\Service\Exception
|
---|
| 149 | */
|
---|
| 150 | public function query($name, QueryAudienceExportRequest $postBody, $optParams = [])
|
---|
| 151 | {
|
---|
| 152 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 153 | $params = array_merge($params, $optParams);
|
---|
| 154 | return $this->call('query', [$params], QueryAudienceExportResponse::class);
|
---|
| 155 | }
|
---|
| 156 | }
|
---|
| 157 |
|
---|
| 158 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 159 | class_alias(PropertiesAudienceExports::class, 'Google_Service_AnalyticsData_Resource_PropertiesAudienceExports');
|
---|