Skip to content

Commit

Permalink
feat: add GetKeyEvent, CreateKeyEvent, ListKeyEvents, `UpdateKe…
Browse files Browse the repository at this point in the history
…yEvent`, `DeleteKeyEvent` methods to the Admin API v1beta (#7533)

feat: mark `GetConversionEvent`, `CreateConversionEvent`, `ListConversionEvents`, `UpdateConversionEvent`, `DeleteConversionEvent` methods as deprecated in the Admin API v1beta
feat: add the `default_conversion_value` field to the `ConversionEvent` resource in the Admin API v1beta
feat: add the `include_all_users` and `expand_groups` fields to the `RunAccessReportRequest` resource in the Admin API v1beta
feat: add the `gmp_organization` field to the `Account` resource in the Admin API v1beta
chore: update go_package to match open source code
docs: change comment for methods `DeleteAccount`, `DeleteProperty`, and `RunAccessReport` in service `AnalyticsAdminService`
docs: change comment in fields `account` and `property` in message `SearchChangeHistoryEventsRequest`
docs: change comment for field `property_type` in message `Property`
PiperOrigin-RevId: 653218190
Source-Link: googleapis/googleapis@b05173c
Source-Link: googleapis/googleapis-gen@b2881b6
Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6ImIyODgxYjY3NGUwMDA2NTI1ZTM3YTE2Njg5NDE1MjNjMGY3ZmQ5MTkifQ==
Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
gcf-owl-bot[bot] and bshaffer authored Jul 17, 2024
1 parent 36dafd7 commit db56239
Show file tree
Hide file tree
Showing 48 changed files with 3,554 additions and 67 deletions.
Binary file modified AnalyticsAdmin/metadata/V1Beta/AccessReport.php
Binary file not shown.
52 changes: 40 additions & 12 deletions AnalyticsAdmin/metadata/V1Beta/AnalyticsAdmin.php

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

Binary file modified AnalyticsAdmin/metadata/V1Beta/Resources.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Google\ApiCore\ApiException;

/**
* Deprecated: Use `CreateKeyEvent` instead.
* Creates a conversion event with the specified attributes.
*
* @param string $formattedParent The resource name of the parent property where this conversion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
* Properties can have at most one FirebaseLink.
*
* @param string $formattedParent Format: properties/{property_id}
* Example: properties/1234
*
* Example: `properties/1234`
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
*/
function create_firebase_link_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateKeyEvent_sync]
use Google\Analytics\Admin\V1beta\Client\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1beta\CreateKeyEventRequest;
use Google\Analytics\Admin\V1beta\KeyEvent;
use Google\Analytics\Admin\V1beta\KeyEvent\CountingMethod;
use Google\ApiCore\ApiException;

/**
* Creates a Key Event.
*
* @param int $keyEventCountingMethod The method by which Key Events will be counted across multiple
* events within a session.
* @param string $formattedParent The resource name of the parent property where this Key Event
* will be created. Format: properties/123
* Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
*/
function create_key_event_sample(int $keyEventCountingMethod, string $formattedParent): void
{
// Create a client.
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

// Prepare the request message.
$keyEvent = (new KeyEvent())
->setCountingMethod($keyEventCountingMethod);
$request = (new CreateKeyEventRequest())
->setKeyEvent($keyEvent)
->setParent($formattedParent);

// Call the API and handle any network failures.
try {
/** @var KeyEvent $response */
$response = $analyticsAdminServiceClient->createKeyEvent($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$keyEventCountingMethod = CountingMethod::COUNTING_METHOD_UNSPECIFIED;
$formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

create_key_event_sample($keyEventCountingMethod, $formattedParent);
}
// [END analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateKeyEvent_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* If the accounts are not restored before the expiration time, the account
* and all child resources (eg: Properties, GoogleAdsLinks, Streams,
* UserLinks) will be permanently purged.
* AccessBindings) will be permanently purged.
* https://support.google.com/analytics/answer/6154772
*
* Returns an error if the target is not found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use Google\ApiCore\ApiException;

/**
* Deprecated: Use `DeleteKeyEvent` instead.
* Deletes a conversion event in a property.
*
* @param string $formattedName The resource name of the conversion event to delete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
* Deletes a FirebaseLink on a property
*
* @param string $formattedName Format: properties/{property_id}/firebaseLinks/{firebase_link_id}
* Example: properties/1234/firebaseLinks/5678
*
* Example: `properties/1234/firebaseLinks/5678`
* Please see {@see AnalyticsAdminServiceClient::firebaseLinkName()} for help formatting this field.
*/
function delete_firebase_link_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteKeyEvent_sync]
use Google\Analytics\Admin\V1beta\Client\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1beta\DeleteKeyEventRequest;
use Google\ApiCore\ApiException;

/**
* Deletes a Key Event.
*
* @param string $formattedName The resource name of the Key Event to delete.
* Format: properties/{property}/keyEvents/{key_event}
* Example: "properties/123/keyEvents/456"
* Please see {@see AnalyticsAdminServiceClient::keyEventName()} for help formatting this field.
*/
function delete_key_event_sample(string $formattedName): void
{
// Create a client.
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

// Prepare the request message.
$request = (new DeleteKeyEventRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
$analyticsAdminServiceClient->deleteKeyEvent($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = AnalyticsAdminServiceClient::keyEventName('[PROPERTY]', '[KEY_EVENT]');

delete_key_event_sample($formattedName);
}
// [END analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteKeyEvent_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* However, they can be restored using the Trash Can UI.
*
* If the properties are not restored before the expiration time, the Property
* and all child resources (eg: GoogleAdsLinks, Streams, UserLinks)
* and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings)
* will be permanently purged.
* https://support.google.com/analytics/answer/6154772
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Google\ApiCore\ApiException;

/**
* Deprecated: Use `GetKeyEvent` instead.
* Retrieve a single conversion event.
*
* @param string $formattedName The resource name of the conversion event to retrieve.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
*
* @param string $formattedName The name of the settings to lookup.
* Format: accounts/{account}/dataSharingSettings
* Example: "accounts/1000/dataSharingSettings"
*
* Example: `accounts/1000/dataSharingSettings`
* Please see {@see AnalyticsAdminServiceClient::dataSharingSettingsName()} for help formatting this field.
*/
function get_data_sharing_settings_sample(string $formattedName): void
Expand Down
Loading

0 comments on commit db56239

Please sign in to comment.