Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: [AnalyticsAdmin] 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 `P... #6497

Merged
merged 4 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
* $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 @@
*
* @experimental
*/
public function updateMeasurementProtocolSecret($measurementProtocolSecret, array $optionalArgs = [])
public function updateMeasurementProtocolSecret($measurementProtocolSecret, $updateMask, array $optionalArgs = [])

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

The number of required arguments for Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() increased from 1 to 2

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

The parameter $optionalArgs of Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() changed from array to no type

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

Parameter 1 of Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() changed name from optionalArgs to updateMask

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

The number of required arguments for Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() increased from 1 to 2

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

The parameter $optionalArgs of Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() changed from array to no type

Check failure on line 7481 in AnalyticsAdmin/src/V1alpha/Gapic/AnalyticsAdminServiceGapicClient.php

View workflow job for this annotation

GitHub Actions / backwards-compatibility-check

Parameter 1 of Google\Analytics\Admin\V1alpha\Gapic\AnalyticsAdminServiceGapicClient#updateMeasurementProtocolSecret() changed name from optionalArgs to updateMask
{
$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
Loading