Skip to content

Commit 53f9f98

Browse files
feat: add GetKeyEvent, CreateKeyEvent, ListKeyEvents, UpdateKeyEvent, and DeleteKeyEvent methods (#7571)
feat: mark `GetConversionEvent`, `CreateConversionEvent`, `ListConversionEvents`, `UpdateConversionEvent`, and `DeleteConversionEvent` methods as deprecated docs: add deprecation comment to `GetConversionEvent`, `CreateConversionEvent`, `ListConversionEvents`, `UpdateConversionEvent`, and `DeleteConversionEvent` methods docs: improve comment formatting of the `parent` field in `CreateFirebaseLinkRequest` and `ListFirebaseLinksRequest` docs: improve comment formatting of the `name` field in `DeleteFirebaseLinkRequest`, `GetGlobalSiteTagRequest`, and `GetDataSharingSettingsRequest` docs: improve comment formatting of `account` and `property` fields in `SearchChangeHistoryEventsRequest` feat: add the `create_time` field to the `Audience` resource feat: add the `primary` field to the `ChannelGroup` resource feat: add `CreateBigQueryLink`, `UpdateBigQueryLink`, and `DeleteBigQueryLink` methods feat: add the `dataset_location` field to the `BigQueryLink` resource feat: add the `BIGQUERY_LINK` option to the `ChangeHistoryResourceType` enum feat: add the `gmp_organization` field to the `Account` resource fix!: Rename custom method `CreateSubpropertyRequest` to `ProvisionSubpropertyRequest` feat: add `GetEventEditRule`, `CreateEventEditRule`, `ListEventEditRules`, `UpdateEventEditRule`, `DeleteEventEditRule`, and `ReorderEventEditRules` methods to the Admin API v1 alpha PiperOrigin-RevId: 658468819 Source-Link: googleapis/googleapis@b479bc2 Source-Link: googleapis/googleapis-gen@f7eacec Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6ImY3ZWFjZWM0MmQzYmYzNjMxNThkMzNkMjQyMjQxNDlhODdlODlmOGMifQ==
1 parent aca00f6 commit 53f9f98

72 files changed

Lines changed: 8734 additions & 399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AnalyticsAdmin/metadata/V1Alpha/AnalyticsAdmin.php

Lines changed: 87 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
147 Bytes
Binary file not shown.
22 Bytes
Binary file not shown.
427 Bytes
Binary file not shown.
827 Bytes
Binary file not shown.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* Copyright 2024 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_CreateBigQueryLink_sync]
26+
use Google\Analytics\Admin\V1alpha\BigQueryLink;
27+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
28+
use Google\Analytics\Admin\V1alpha\CreateBigQueryLinkRequest;
29+
use Google\ApiCore\ApiException;
30+
31+
/**
32+
* Creates a BigQueryLink.
33+
*
34+
* @param string $formattedParent Example format: properties/1234
35+
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
36+
* @param string $bigqueryLinkDatasetLocation Immutable. The geographic location where the created BigQuery
37+
* dataset should reside. See https://cloud.google.com/bigquery/docs/locations
38+
* for supported locations.
39+
*/
40+
function create_big_query_link_sample(
41+
string $formattedParent,
42+
string $bigqueryLinkDatasetLocation
43+
): void {
44+
// Create a client.
45+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
46+
47+
// Prepare the request message.
48+
$bigqueryLink = (new BigQueryLink())
49+
->setDatasetLocation($bigqueryLinkDatasetLocation);
50+
$request = (new CreateBigQueryLinkRequest())
51+
->setParent($formattedParent)
52+
->setBigqueryLink($bigqueryLink);
53+
54+
// Call the API and handle any network failures.
55+
try {
56+
/** @var BigQueryLink $response */
57+
$response = $analyticsAdminServiceClient->createBigQueryLink($request);
58+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
59+
} catch (ApiException $ex) {
60+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
61+
}
62+
}
63+
64+
/**
65+
* Helper to execute the sample.
66+
*
67+
* This sample has been automatically generated and should be regarded as a code
68+
* template only. It will require modifications to work:
69+
* - It may require correct/in-range values for request initialization.
70+
* - It may require specifying regional endpoints when creating the service client,
71+
* please see the apiEndpoint client configuration option for more details.
72+
*/
73+
function callSample(): void
74+
{
75+
$formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
76+
$bigqueryLinkDatasetLocation = '[DATASET_LOCATION]';
77+
78+
create_big_query_link_sample($formattedParent, $bigqueryLinkDatasetLocation);
79+
}
80+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateBigQueryLink_sync]

AnalyticsAdmin/samples/V1alpha/AnalyticsAdminServiceClient/create_conversion_event.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Google\ApiCore\ApiException;
3030

3131
/**
32+
* Deprecated: Use `CreateKeyEvent` instead.
3233
* Creates a conversion event with the specified attributes.
3334
*
3435
* @param string $formattedParent The resource name of the parent property where this conversion
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?php
2+
/*
3+
* Copyright 2024 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_CreateEventEditRule_sync]
26+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\CreateEventEditRuleRequest;
28+
use Google\Analytics\Admin\V1alpha\EventEditRule;
29+
use Google\Analytics\Admin\V1alpha\MatchingCondition;
30+
use Google\Analytics\Admin\V1alpha\MatchingCondition\ComparisonType;
31+
use Google\Analytics\Admin\V1alpha\ParameterMutation;
32+
use Google\ApiCore\ApiException;
33+
34+
/**
35+
* Creates an EventEditRule.
36+
*
37+
* @param string $formattedParent Example format: properties/123/dataStreams/456
38+
* Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
39+
* @param string $eventEditRuleDisplayName The display name of this event edit rule. Maximum of 255
40+
* characters.
41+
* @param string $eventEditRuleEventConditionsField The name of the field that is compared against for the condition.
42+
* If 'event_name' is specified this condition will apply to the name of the
43+
* event. Otherwise the condition will apply to a parameter with the
44+
* specified name.
45+
*
46+
* This value cannot contain spaces.
47+
* @param int $eventEditRuleEventConditionsComparisonType The type of comparison to be applied to the value.
48+
* @param string $eventEditRuleEventConditionsValue The value being compared against for this condition. The runtime
49+
* implementation may perform type coercion of this value to evaluate this
50+
* condition based on the type of the parameter value.
51+
* @param string $eventEditRuleParameterMutationsParameter The name of the parameter to mutate.
52+
* This value must:
53+
* * be less than 40 characters.
54+
* * be unique across across all mutations within the rule
55+
* * consist only of letters, digits or _ (underscores)
56+
* For event edit rules, the name may also be set to 'event_name' to modify
57+
* the event_name in place.
58+
* @param string $eventEditRuleParameterMutationsParameterValue The value mutation to perform.
59+
* * Must be less than 100 characters.
60+
* * To specify a constant value for the param, use the value's string.
61+
* * To copy value from another parameter, use syntax like
62+
* "[[other_parameter]]" For more details, see this [help center
63+
* article](https://support.google.com/analytics/answer/10085872#modify-an-event&zippy=%2Cin-this-article%2Cmodify-parameters).
64+
*/
65+
function create_event_edit_rule_sample(
66+
string $formattedParent,
67+
string $eventEditRuleDisplayName,
68+
string $eventEditRuleEventConditionsField,
69+
int $eventEditRuleEventConditionsComparisonType,
70+
string $eventEditRuleEventConditionsValue,
71+
string $eventEditRuleParameterMutationsParameter,
72+
string $eventEditRuleParameterMutationsParameterValue
73+
): void {
74+
// Create a client.
75+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
76+
77+
// Prepare the request message.
78+
$matchingCondition = (new MatchingCondition())
79+
->setField($eventEditRuleEventConditionsField)
80+
->setComparisonType($eventEditRuleEventConditionsComparisonType)
81+
->setValue($eventEditRuleEventConditionsValue);
82+
$eventEditRuleEventConditions = [$matchingCondition,];
83+
$parameterMutation = (new ParameterMutation())
84+
->setParameter($eventEditRuleParameterMutationsParameter)
85+
->setParameterValue($eventEditRuleParameterMutationsParameterValue);
86+
$eventEditRuleParameterMutations = [$parameterMutation,];
87+
$eventEditRule = (new EventEditRule())
88+
->setDisplayName($eventEditRuleDisplayName)
89+
->setEventConditions($eventEditRuleEventConditions)
90+
->setParameterMutations($eventEditRuleParameterMutations);
91+
$request = (new CreateEventEditRuleRequest())
92+
->setParent($formattedParent)
93+
->setEventEditRule($eventEditRule);
94+
95+
// Call the API and handle any network failures.
96+
try {
97+
/** @var EventEditRule $response */
98+
$response = $analyticsAdminServiceClient->createEventEditRule($request);
99+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
100+
} catch (ApiException $ex) {
101+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
102+
}
103+
}
104+
105+
/**
106+
* Helper to execute the sample.
107+
*
108+
* This sample has been automatically generated and should be regarded as a code
109+
* template only. It will require modifications to work:
110+
* - It may require correct/in-range values for request initialization.
111+
* - It may require specifying regional endpoints when creating the service client,
112+
* please see the apiEndpoint client configuration option for more details.
113+
*/
114+
function callSample(): void
115+
{
116+
$formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');
117+
$eventEditRuleDisplayName = '[DISPLAY_NAME]';
118+
$eventEditRuleEventConditionsField = '[FIELD]';
119+
$eventEditRuleEventConditionsComparisonType = ComparisonType::COMPARISON_TYPE_UNSPECIFIED;
120+
$eventEditRuleEventConditionsValue = '[VALUE]';
121+
$eventEditRuleParameterMutationsParameter = '[PARAMETER]';
122+
$eventEditRuleParameterMutationsParameterValue = '[PARAMETER_VALUE]';
123+
124+
create_event_edit_rule_sample(
125+
$formattedParent,
126+
$eventEditRuleDisplayName,
127+
$eventEditRuleEventConditionsField,
128+
$eventEditRuleEventConditionsComparisonType,
129+
$eventEditRuleEventConditionsValue,
130+
$eventEditRuleParameterMutationsParameter,
131+
$eventEditRuleParameterMutationsParameterValue
132+
);
133+
}
134+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateEventEditRule_sync]

AnalyticsAdmin/samples/V1alpha/AnalyticsAdminServiceClient/create_firebase_link.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
* Properties can have at most one FirebaseLink.
3535
*
3636
* @param string $formattedParent Format: properties/{property_id}
37-
* Example: properties/1234
37+
*
38+
* Example: `properties/1234`
3839
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
3940
*/
4041
function create_firebase_link_sample(string $formattedParent): void
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2024 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_CreateKeyEvent_sync]
26+
use Google\Analytics\Admin\V1alpha\Client\AnalyticsAdminServiceClient;
27+
use Google\Analytics\Admin\V1alpha\CreateKeyEventRequest;
28+
use Google\Analytics\Admin\V1alpha\KeyEvent;
29+
use Google\Analytics\Admin\V1alpha\KeyEvent\CountingMethod;
30+
use Google\ApiCore\ApiException;
31+
32+
/**
33+
* Creates a Key Event.
34+
*
35+
* @param int $keyEventCountingMethod The method by which Key Events will be counted across multiple
36+
* events within a session.
37+
* @param string $formattedParent The resource name of the parent property where this Key Event
38+
* will be created. Format: properties/123
39+
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
40+
*/
41+
function create_key_event_sample(int $keyEventCountingMethod, string $formattedParent): void
42+
{
43+
// Create a client.
44+
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
45+
46+
// Prepare the request message.
47+
$keyEvent = (new KeyEvent())
48+
->setCountingMethod($keyEventCountingMethod);
49+
$request = (new CreateKeyEventRequest())
50+
->setKeyEvent($keyEvent)
51+
->setParent($formattedParent);
52+
53+
// Call the API and handle any network failures.
54+
try {
55+
/** @var KeyEvent $response */
56+
$response = $analyticsAdminServiceClient->createKeyEvent($request);
57+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
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+
$keyEventCountingMethod = CountingMethod::COUNTING_METHOD_UNSPECIFIED;
75+
$formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
76+
77+
create_key_event_sample($keyEventCountingMethod, $formattedParent);
78+
}
79+
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateKeyEvent_sync]

0 commit comments

Comments
 (0)