Skip to content

Commit

Permalink
fix!: update the ReportingAttributionModel enum to rename `CROSS_CH…
Browse files Browse the repository at this point in the history
…ANNEL_DATA_DRIVEN` to `PAID_AND_ORGANIC_CHANNELS_DATA_DRIVEN`, `CROSS_CHANNEL_LAST_CLICK` to `PAID_AND_ORGANIC_CHANNELS_LAST_CLICK`, `CROSS_CHANNEL_FIRST_CLICK` to `P... (#6497)

* fix!: update the `ReportingAttributionModel` enum to rename `CROSS_CHANNEL_DATA_DRIVEN` to `PAID_AND_ORGANIC_CHANNELS_DATA_DRIVEN`, `CROSS_CHANNEL_LAST_CLICK` to `PAID_AND_ORGANIC_CHANNELS_LAST_CLICK`, `CROSS_CHANNEL_FIRST_CLICK` to `PAID_AND_ORGANIC_CHANNELS_FIRST_CLICK`, `CROSS_CHANNEL_LINEAR` to `PAID_AND_ORGANIC_CHANNELS_LINEAR`, `CROSS_CHANNEL_POSITION_BASED` to `PAID_AND_ORGANIC_CHANNELS_POSITION_BASED` `CROSS_CHANNEL_TIME_DECAY` to `PAID_AND_ORGANIC_CHANNELS_TIME_DECAY`, `ADS_PREFERRED_LAST_CLICK` to `GOOGLE_PAID_CHANNELS_LAST_CLICK`

fix!: update the `AdsWebConversionDataExportScope` enum to rename `CROSS_CHANNEL` to `PAID_AND_ORGANIC_CHANNELS`, `ADS_PREFERRED` to `GOOGLE_PAID_CHANNELS`
PiperOrigin-RevId: 551280325
Source-Link: googleapis/googleapis@0d84384
Source-Link: googleapis/googleapis-gen@da9de65
Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6ImRhOWRlNjU4MzRhNGI2YjdlYzQ1ODYyMjA1MDBlOGNlZmViNWVmZDMifQ==
Co-authored-by: Yash Sahu <[email protected]>
  • Loading branch information
gcf-owl-bot[bot] and yash30201 authored Jul 28, 2023
1 parent aeb00a0 commit 5bf5f4f
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 56 deletions.
8 changes: 4 additions & 4 deletions AnalyticsAdmin/metadata/V1Alpha/AnalyticsAdmin.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified AnalyticsAdmin/metadata/V1Alpha/Resources.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
* Updates a measurement protocol secret.
Expand All @@ -41,12 +42,14 @@ function update_measurement_protocol_secret_sample(
// Prepare any non-scalar elements to be passed along with the request.
$measurementProtocolSecret = (new MeasurementProtocolSecret())
->setDisplayName($measurementProtocolSecretDisplayName);
$updateMask = new FieldMask();

// Call the API and handle any network failures.
try {
/** @var MeasurementProtocolSecret $response */
$response = $analyticsAdminServiceClient->updateMeasurementProtocolSecret(
$measurementProtocolSecret
$measurementProtocolSecret,
$updateMask
);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7453,18 +7453,19 @@ public function updateGoogleSignalsSettings($googleSignalsSettings, $updateMask,
* $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
* try {
* $measurementProtocolSecret = new MeasurementProtocolSecret();
* $response = $analyticsAdminServiceClient->updateMeasurementProtocolSecret($measurementProtocolSecret);
* $updateMask = new FieldMask();
* $response = $analyticsAdminServiceClient->updateMeasurementProtocolSecret($measurementProtocolSecret, $updateMask);
* } finally {
* $analyticsAdminServiceClient->close();
* }
* ```
*
* @param MeasurementProtocolSecret $measurementProtocolSecret Required. The measurement protocol secret to update.
* @param FieldMask $updateMask Required. The list of fields to be updated. Omitted fields will not be
* updated.
* @param array $optionalArgs {
* Optional.
*
* @type FieldMask $updateMask
* The list of fields to be updated. Omitted fields will not be updated.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
Expand All @@ -7477,16 +7478,13 @@ public function updateGoogleSignalsSettings($googleSignalsSettings, $updateMask,
*
* @experimental
*/
public function updateMeasurementProtocolSecret($measurementProtocolSecret, array $optionalArgs = [])
public function updateMeasurementProtocolSecret($measurementProtocolSecret, $updateMask, array $optionalArgs = [])
{
$request = new UpdateMeasurementProtocolSecretRequest();
$requestParamHeaders = [];
$request->setMeasurementProtocolSecret($measurementProtocolSecret);
$request->setUpdateMask($updateMask);
$requestParamHeaders['measurement_protocol_secret.name'] = $measurementProtocolSecret->getName();
if (isset($optionalArgs['updateMask'])) {
$request->setUpdateMask($optionalArgs['updateMask']);
}

$requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
$optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
return $this->startCall('UpdateMeasurementProtocolSecret', MeasurementProtocolSecret::class, $optionalArgs, $request)->wait();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,9 @@
],
],
],
'queryParams' => [
'update_mask',
],
],
'UpdateProperty' => [
'method' => 'patch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7904,7 +7904,8 @@ public function updateMeasurementProtocolSecretTest()
$measurementProtocolSecret = new MeasurementProtocolSecret();
$measurementProtocolSecretDisplayName = 'measurementProtocolSecretDisplayName1279116681';
$measurementProtocolSecret->setDisplayName($measurementProtocolSecretDisplayName);
$response = $gapicClient->updateMeasurementProtocolSecret($measurementProtocolSecret);
$updateMask = new FieldMask();
$response = $gapicClient->updateMeasurementProtocolSecret($measurementProtocolSecret, $updateMask);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
Expand All @@ -7913,6 +7914,8 @@ public function updateMeasurementProtocolSecretTest()
$this->assertSame('/google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateMeasurementProtocolSecret', $actualFuncCall);
$actualValue = $actualRequestObject->getMeasurementProtocolSecret();
$this->assertProtobufEquals($measurementProtocolSecret, $actualValue);
$actualValue = $actualRequestObject->getUpdateMask();
$this->assertProtobufEquals($updateMask, $actualValue);
$this->assertTrue($transport->isExhausted());
}

Expand All @@ -7938,8 +7941,9 @@ public function updateMeasurementProtocolSecretExceptionTest()
$measurementProtocolSecret = new MeasurementProtocolSecret();
$measurementProtocolSecretDisplayName = 'measurementProtocolSecretDisplayName1279116681';
$measurementProtocolSecret->setDisplayName($measurementProtocolSecretDisplayName);
$updateMask = new FieldMask();
try {
$gapicClient->updateMeasurementProtocolSecret($measurementProtocolSecret);
$gapicClient->updateMeasurementProtocolSecret($measurementProtocolSecret, $updateMask);
// If the $gapicClient method call did not throw, fail the test
$this->fail('Expected an ApiException, but no exception was thrown.');
} catch (ApiException $ex) {
Expand Down

0 comments on commit 5bf5f4f

Please sign in to comment.