Skip to content

Commit f573584

Browse files
fix!: rename the intraday_export_enabled field to enterprise_export_enabled in the BigQueryLink resource (#6549)
feat: add `UpdateConversionEvent` method to the Admin API v1 alpha feat: add the `counting_method` field to the `ConversionEvent` type feat: add the `ConversionCountingMethod` enum PiperOrigin-RevId: 555379699 Source-Link: googleapis/googleapis@a9a67de Source-Link: googleapis/googleapis-gen@31b8966 Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6IjMxYjg5NjZiNjVkOTIzMmI1YjM5NmQ3M2JlNjU3ODA4NmZmYzY3MTgifQ==
1 parent 8d849e1 commit f573584

12 files changed

Lines changed: 471 additions & 19 deletions

AnalyticsAdmin/metadata/V1Alpha/AnalyticsAdmin.php

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
220 Bytes
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/*
3+
* Copyright 2023 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://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,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateConversionEvent_sync]
26+
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\ConversionEvent;
28+
use Google\ApiCore\ApiException;
29+
use Google\Protobuf\FieldMask;
30+
31+
/**
32+
* Updates a conversion event with the specified attributes.
33+
*
34+
* This sample has been automatically generated and should be regarded as a code
35+
* template only. It will require modifications to work:
36+
* - It may require correct/in-range values for request initialization.
37+
* - It may require specifying regional endpoints when creating the service client,
38+
* please see the apiEndpoint client configuration option for more details.
39+
*/
40+
function update_conversion_event_sample(): void
41+
{
42+
// Create a client.
43+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
44+
45+
// Prepare any non-scalar elements to be passed along with the request.
46+
$conversionEvent = new ConversionEvent();
47+
$updateMask = new FieldMask();
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var ConversionEvent $response */
52+
$response = $analyticsAdminServiceClient->updateConversionEvent($conversionEvent, $updateMask);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateConversionEvent_sync]

AnalyticsAdmin/src/V1alpha/BigQueryLink.php

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnalyticsAdmin/src/V1alpha/ConversionEvent.php

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnalyticsAdmin/src/V1alpha/ConversionEvent/ConversionCountingMethod.php

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
use Google\Analytics\Admin\V1alpha\UpdateAttributionSettingsRequest;
204204
use Google\Analytics\Admin\V1alpha\UpdateAudienceRequest;
205205
use Google\Analytics\Admin\V1alpha\UpdateChannelGroupRequest;
206+
use Google\Analytics\Admin\V1alpha\UpdateConversionEventRequest;
206207
use Google\Analytics\Admin\V1alpha\UpdateCustomDimensionRequest;
207208
use Google\Analytics\Admin\V1alpha\UpdateCustomMetricRequest;
208209
use Google\Analytics\Admin\V1alpha\UpdateDataRetentionSettingsRequest;
@@ -6960,6 +6961,54 @@ public function updateChannelGroup($channelGroup, $updateMask, array $optionalAr
69606961
return $this->startCall('UpdateChannelGroup', ChannelGroup::class, $optionalArgs, $request)->wait();
69616962
}
69626963

6964+
/**
6965+
* Updates a conversion event with the specified attributes.
6966+
*
6967+
* Sample code:
6968+
* ```
6969+
* $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
6970+
* try {
6971+
* $conversionEvent = new ConversionEvent();
6972+
* $updateMask = new FieldMask();
6973+
* $response = $analyticsAdminServiceClient->updateConversionEvent($conversionEvent, $updateMask);
6974+
* } finally {
6975+
* $analyticsAdminServiceClient->close();
6976+
* }
6977+
* ```
6978+
*
6979+
* @param ConversionEvent $conversionEvent Required. The conversion event to update.
6980+
* The `name` field is used to identify the settings to be updated.
6981+
* @param FieldMask $updateMask Required. The list of fields to be updated. Field names must be in snake
6982+
* case (e.g., "field_to_update"). Omitted fields will not be updated. To
6983+
* replace the entire entity, use one path with the string "*" to match all
6984+
* fields.
6985+
* @param array $optionalArgs {
6986+
* Optional.
6987+
*
6988+
* @type RetrySettings|array $retrySettings
6989+
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
6990+
* associative array of retry settings parameters. See the documentation on
6991+
* {@see RetrySettings} for example usage.
6992+
* }
6993+
*
6994+
* @return \Google\Analytics\Admin\V1alpha\ConversionEvent
6995+
*
6996+
* @throws ApiException if the remote call fails
6997+
*
6998+
* @experimental
6999+
*/
7000+
public function updateConversionEvent($conversionEvent, $updateMask, array $optionalArgs = [])
7001+
{
7002+
$request = new UpdateConversionEventRequest();
7003+
$requestParamHeaders = [];
7004+
$request->setConversionEvent($conversionEvent);
7005+
$request->setUpdateMask($updateMask);
7006+
$requestParamHeaders['conversion_event.name'] = $conversionEvent->getName();
7007+
$requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
7008+
$optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
7009+
return $this->startCall('UpdateConversionEvent', ConversionEvent::class, $optionalArgs, $request)->wait();
7010+
}
7011+
69637012
/**
69647013
* Updates a CustomDimension on a property.
69657014
*

0 commit comments

Comments
 (0)