[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\DiscoveryEngine\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\DiscoveryEngine\GoogleApiHttpBody;
|
---|
| 21 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1ImportUserEventsRequest;
|
---|
| 22 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1PurgeUserEventsRequest;
|
---|
| 23 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1UserEvent;
|
---|
| 24 | use Google\Service\DiscoveryEngine\GoogleLongrunningOperation;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "userEvents" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $discoveryengineService = new Google\Service\DiscoveryEngine(...);
|
---|
| 31 | * $userEvents = $discoveryengineService->projects_locations_collections_dataStores_userEvents;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class ProjectsLocationsCollectionsDataStoresUserEvents extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Writes a single user event from the browser. This uses a GET request to due
|
---|
| 38 | * to browser restriction of POST-ing to a third-party domain. This method is
|
---|
| 39 | * used only by the Discovery Engine API JavaScript pixel and Google Tag
|
---|
| 40 | * Manager. Users should not call this method directly. (userEvents.collect)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. The parent DataStore resource name, such as `
|
---|
| 43 | * projects/{project}/locations/{location}/collections/{collection}/dataStores/{
|
---|
| 44 | * data_store}`.
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | *
|
---|
| 47 | * @opt_param string ets The event timestamp in milliseconds. This prevents
|
---|
| 48 | * browser caching of otherwise identical get requests. The name is abbreviated
|
---|
| 49 | * to reduce the payload bytes.
|
---|
| 50 | * @opt_param string uri The URL including cgi-parameters but excluding the hash
|
---|
| 51 | * fragment with a length limit of 5,000 characters. This is often more useful
|
---|
| 52 | * than the referer URL, because many browsers only send the domain for third-
|
---|
| 53 | * party requests.
|
---|
| 54 | * @opt_param string userEvent Required. URL encoded UserEvent proto with a
|
---|
| 55 | * length limit of 2,000,000 characters.
|
---|
| 56 | * @return GoogleApiHttpBody
|
---|
| 57 | * @throws \Google\Service\Exception
|
---|
| 58 | */
|
---|
| 59 | public function collect($parent, $optParams = [])
|
---|
| 60 | {
|
---|
| 61 | $params = ['parent' => $parent];
|
---|
| 62 | $params = array_merge($params, $optParams);
|
---|
| 63 | return $this->call('collect', [$params], GoogleApiHttpBody::class);
|
---|
| 64 | }
|
---|
| 65 | /**
|
---|
| 66 | * Bulk import of user events. Request processing might be synchronous. Events
|
---|
| 67 | * that already exist are skipped. Use this method for backfilling historical
|
---|
| 68 | * user events. Operation.response is of type ImportResponse. Note that it is
|
---|
| 69 | * possible for a subset of the items to be successfully inserted.
|
---|
| 70 | * Operation.metadata is of type ImportMetadata. (userEvents.import)
|
---|
| 71 | *
|
---|
| 72 | * @param string $parent Required. Parent DataStore resource name, of the form `
|
---|
| 73 | * projects/{project}/locations/{location}/collections/{collection}/dataStores/{
|
---|
| 74 | * data_store}`
|
---|
| 75 | * @param GoogleCloudDiscoveryengineV1ImportUserEventsRequest $postBody
|
---|
| 76 | * @param array $optParams Optional parameters.
|
---|
| 77 | * @return GoogleLongrunningOperation
|
---|
| 78 | * @throws \Google\Service\Exception
|
---|
| 79 | */
|
---|
| 80 | public function import($parent, GoogleCloudDiscoveryengineV1ImportUserEventsRequest $postBody, $optParams = [])
|
---|
| 81 | {
|
---|
| 82 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 83 | $params = array_merge($params, $optParams);
|
---|
| 84 | return $this->call('import', [$params], GoogleLongrunningOperation::class);
|
---|
| 85 | }
|
---|
| 86 | /**
|
---|
| 87 | * Deletes permanently all user events specified by the filter provided.
|
---|
| 88 | * Depending on the number of events specified by the filter, this operation
|
---|
| 89 | * could take hours or days to complete. To test a filter, use the list command
|
---|
| 90 | * first. (userEvents.purge)
|
---|
| 91 | *
|
---|
| 92 | * @param string $parent Required. The resource name of the catalog under which
|
---|
| 93 | * the events are created. The format is `projects/{project}/locations/global/co
|
---|
| 94 | * llections/{collection}/dataStores/{dataStore}`.
|
---|
| 95 | * @param GoogleCloudDiscoveryengineV1PurgeUserEventsRequest $postBody
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | * @return GoogleLongrunningOperation
|
---|
| 98 | * @throws \Google\Service\Exception
|
---|
| 99 | */
|
---|
| 100 | public function purge($parent, GoogleCloudDiscoveryengineV1PurgeUserEventsRequest $postBody, $optParams = [])
|
---|
| 101 | {
|
---|
| 102 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 103 | $params = array_merge($params, $optParams);
|
---|
| 104 | return $this->call('purge', [$params], GoogleLongrunningOperation::class);
|
---|
| 105 | }
|
---|
| 106 | /**
|
---|
| 107 | * Writes a single user event. (userEvents.write)
|
---|
| 108 | *
|
---|
| 109 | * @param string $parent Required. The parent resource name. If the write user
|
---|
| 110 | * event action is applied in DataStore level, the format is: `projects/{project
|
---|
| 111 | * }/locations/{location}/collections/{collection}/dataStores/{data_store}`. If
|
---|
| 112 | * the write user event action is applied in Location level, for example, the
|
---|
| 113 | * event with Document across multiple DataStore, the format is:
|
---|
| 114 | * `projects/{project}/locations/{location}`.
|
---|
| 115 | * @param GoogleCloudDiscoveryengineV1UserEvent $postBody
|
---|
| 116 | * @param array $optParams Optional parameters.
|
---|
| 117 | *
|
---|
| 118 | * @opt_param bool writeAsync If set to true, the user event is written
|
---|
| 119 | * asynchronously after validation, and the API responds without waiting for the
|
---|
| 120 | * write.
|
---|
| 121 | * @return GoogleCloudDiscoveryengineV1UserEvent
|
---|
| 122 | * @throws \Google\Service\Exception
|
---|
| 123 | */
|
---|
| 124 | public function write($parent, GoogleCloudDiscoveryengineV1UserEvent $postBody, $optParams = [])
|
---|
| 125 | {
|
---|
| 126 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 127 | $params = array_merge($params, $optParams);
|
---|
| 128 | return $this->call('write', [$params], GoogleCloudDiscoveryengineV1UserEvent::class);
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 133 | class_alias(ProjectsLocationsCollectionsDataStoresUserEvents::class, 'Google_Service_DiscoveryEngine_Resource_ProjectsLocationsCollectionsDataStoresUserEvents');
|
---|