Skip to content

Commit 0c2d5d6

Browse files
feat: [AnalyticsAdmin] add the GetSubpropertySyncConfigRequest method (#8376)
* feat: add the `GetSubpropertySyncConfigRequest` method feat: add the `ListSubpropertySyncConfigsRequest` method feat: add the `UpdateSubpropertySyncConfigRequest` method PiperOrigin-RevId: 771095956 Source-Link: googleapis/googleapis@fbd3e7f Source-Link: googleapis/googleapis-gen@9b5d38d Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6IjliNWQzOGRmYTdhYTE4OWU5NTgzM2Y5NDBjZjZkOTc5MDA3ZDEzZjEifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6f5a6b5 commit 0c2d5d6

20 files changed

Lines changed: 1584 additions & 5 deletions

AnalyticsAdmin/metadata/V1Alpha/AnalyticsAdmin.php

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
588 Bytes
Binary file not shown.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_GetSubpropertySyncConfig_sync]
26+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\GetSubpropertySyncConfigRequest;
28+
use Google\Analytics\Admin\V1alpha\SubpropertySyncConfig;
29+
use Google\ApiCore\ApiException;
30+
31+
/**
32+
* Lookup for a single Subproperty Sync Config.
33+
*
34+
* @param string $formattedName Resource name of the SubpropertySyncConfig to lookup.
35+
* Format:
36+
* properties/{ordinary_property_id}/subpropertySyncConfigs/{subproperty_id}
37+
* Example: properties/1234/subpropertySyncConfigs/5678
38+
* Please see {@see AnalyticsAdminServiceClient::subpropertySyncConfigName()} for help formatting this field.
39+
*/
40+
function get_subproperty_sync_config_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
44+
45+
// Prepare the request message.
46+
$request = (new GetSubpropertySyncConfigRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var SubpropertySyncConfig $response */
52+
$response = $analyticsAdminServiceClient->getSubpropertySyncConfig($request);
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+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedName = AnalyticsAdminServiceClient::subpropertySyncConfigName(
71+
'[PROPERTY]',
72+
'[SUBPROPERTY_SYNC_CONFIG]'
73+
);
74+
75+
get_subproperty_sync_config_sample($formattedName);
76+
}
77+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetSubpropertySyncConfig_sync]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_ListSubpropertySyncConfigs_sync]
26+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\ListSubpropertySyncConfigsRequest;
28+
use Google\Analytics\Admin\V1alpha\SubpropertySyncConfig;
29+
use Google\ApiCore\ApiException;
30+
use Google\ApiCore\PagedListResponse;
31+
32+
/**
33+
* List all Subproperty Sync Configs on a property.
34+
*
35+
* @param string $formattedParent Resource name of the property.
36+
* Format: properties/property_id
37+
* Example: properties/123
38+
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
39+
*/
40+
function list_subproperty_sync_configs_sample(string $formattedParent): void
41+
{
42+
// Create a client.
43+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
44+
45+
// Prepare the request message.
46+
$request = (new ListSubpropertySyncConfigsRequest())
47+
->setParent($formattedParent);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var PagedListResponse $response */
52+
$response = $analyticsAdminServiceClient->listSubpropertySyncConfigs($request);
53+
54+
/** @var SubpropertySyncConfig $element */
55+
foreach ($response as $element) {
56+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
57+
}
58+
} catch (ApiException $ex) {
59+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
60+
}
61+
}
62+
63+
/**
64+
* Helper to execute the sample.
65+
*
66+
* This sample has been automatically generated and should be regarded as a code
67+
* template only. It will require modifications to work:
68+
* - It may require correct/in-range values for request initialization.
69+
* - It may require specifying regional endpoints when creating the service client,
70+
* please see the apiEndpoint client configuration option for more details.
71+
*/
72+
function callSample(): void
73+
{
74+
$formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
75+
76+
list_subproperty_sync_configs_sample($formattedParent);
77+
}
78+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListSubpropertySyncConfigs_sync]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_UpdateSubpropertySyncConfig_sync]
26+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\SubpropertySyncConfig;
28+
use Google\Analytics\Admin\V1alpha\SubpropertySyncConfig\SynchronizationMode;
29+
use Google\Analytics\Admin\V1alpha\UpdateSubpropertySyncConfigRequest;
30+
use Google\ApiCore\ApiException;
31+
32+
/**
33+
* Updates a Subproperty Sync Config.
34+
*
35+
* @param int $subpropertySyncConfigCustomDimensionAndMetricSyncMode Specifies the Custom Dimension / Metric synchronization mode for
36+
* the Subproperty.
37+
*
38+
* If set to ALL, Custom Dimension / Metric synchronization will be
39+
* immediately enabled. Local configuration of Custom Dimensions / Metrics
40+
* will not be allowed on the Subproperty so long as the synchronization mode
41+
* is set to ALL.
42+
*
43+
* If set to NONE, Custom Dimensions / Metric synchronization is disabled.
44+
* Custom Dimensions / Metrics must be configured explicitly on the
45+
* Subproperty.
46+
*/
47+
function update_subproperty_sync_config_sample(
48+
int $subpropertySyncConfigCustomDimensionAndMetricSyncMode
49+
): void {
50+
// Create a client.
51+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
52+
53+
// Prepare the request message.
54+
$subpropertySyncConfig = (new SubpropertySyncConfig())
55+
->setCustomDimensionAndMetricSyncMode($subpropertySyncConfigCustomDimensionAndMetricSyncMode);
56+
$request = (new UpdateSubpropertySyncConfigRequest())
57+
->setSubpropertySyncConfig($subpropertySyncConfig);
58+
59+
// Call the API and handle any network failures.
60+
try {
61+
/** @var SubpropertySyncConfig $response */
62+
$response = $analyticsAdminServiceClient->updateSubpropertySyncConfig($request);
63+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
64+
} catch (ApiException $ex) {
65+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
66+
}
67+
}
68+
69+
/**
70+
* Helper to execute the sample.
71+
*
72+
* This sample has been automatically generated and should be regarded as a code
73+
* template only. It will require modifications to work:
74+
* - It may require correct/in-range values for request initialization.
75+
* - It may require specifying regional endpoints when creating the service client,
76+
* please see the apiEndpoint client configuration option for more details.
77+
*/
78+
function callSample(): void
79+
{
80+
$subpropertySyncConfigCustomDimensionAndMetricSyncMode = SynchronizationMode::SYNCHRONIZATION_MODE_UNSPECIFIED;
81+
82+
update_subproperty_sync_config_sample($subpropertySyncConfigCustomDimensionAndMetricSyncMode);
83+
}
84+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateSubpropertySyncConfig_sync]

AnalyticsAdmin/src/V1alpha/ChangeHistoryChange/ChangeHistoryResource.php

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

AnalyticsAdmin/src/V1alpha/ChangeHistoryResourceType.php

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

0 commit comments

Comments
 (0)