Skip to content

Commit

Permalink
feat: [AnalyticsAdmin] add AccessBinding and ExpandedDataset methods (#…
Browse files Browse the repository at this point in the history
…5886)

feat: add `CreateAccessBinding`, `GetAccessBinding`, `UpdateAccessBinding`, `DeleteAccessBinding`, `ListAccessBindings`, `BatchCreateAccessBindings`, `BatchGetAccessBindings`, `BatchUpdateAccessBindings`, `BatchDeleteAccessBindings` methods to the Admin API v1alpha

feat: add `GetExpandedDataSet`, `ListExpandedDataSets`, `CreateExpandedDataSet`, `UpdateExpandedDataSet`, `DeleteExpandedDataSet` methods to the Admin API v1alpha
feat: add `AccessBinding`, `ExpandedDataSet`, `ExpandedDataSetFilter`, `ExpandedDataSetFilterExpression`, `ExpandedDataSetFilterExpressionList` resource types to the Admin API v1alpha
PiperOrigin-RevId: 510499799
Source-Link: googleapis/googleapis@82655ad
Source-Link: googleapis/googleapis-gen@4a83c47
Copy-Tag: eyJwIjoiQW5hbHl0aWNzQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6IjRhODNjNDc0YzM3NGRlZTU5YjE1NDVlMTRhNTRmNGQ5NjAzMjQ4ZmMifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Feb 18, 2023
1 parent 8f648c7 commit 23d3751
Show file tree
Hide file tree
Showing 47 changed files with 5,721 additions and 95 deletions.
83 changes: 78 additions & 5 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 @@ -31,7 +31,8 @@
* Acknowledges the terms of user data collection for the specified property.
*
* This acknowledgement must be completed (either in the Google Analytics UI
* or via this API) before MeasurementProtocolSecret resources may be created.
* or through this API) before MeasurementProtocolSecret resources may be
* created.
*
* @param string $formattedProperty The property for which to acknowledge user data collection. Please see
* {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/*
* Copyright 2023 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_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_sync]
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BatchCreateAccessBindingsResponse;
use Google\Analytics\Admin\V1alpha\CreateAccessBindingRequest;
use Google\ApiCore\ApiException;

/**
* Creates information about multiple access bindings to an account or
* property.
*
* This method is transactional. If any AccessBinding cannot be created, none
* of the AccessBindings will be created.
*
* @param string $formattedParent The account or property that owns the access bindings. The parent
* field in the CreateAccessBindingRequest messages must either be empty or
* match this field. Formats:
* - accounts/{account}
* - properties/{property}
* Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
* @param string $formattedRequestsParent Formats:
* - accounts/{account}
* - properties/{property}
* Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
*/
function batch_create_access_bindings_sample(
string $formattedParent,
string $formattedRequestsParent
): void {
// Create a client.
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

// Prepare any non-scalar elements to be passed along with the request.
$requestsAccessBinding = new AccessBinding();
$createAccessBindingRequest = (new CreateAccessBindingRequest())
->setParent($formattedRequestsParent)
->setAccessBinding($requestsAccessBinding);
$requests = [$createAccessBindingRequest,];

// Call the API and handle any network failures.
try {
/** @var BatchCreateAccessBindingsResponse $response */
$response = $analyticsAdminServiceClient->batchCreateAccessBindings($formattedParent, $requests);
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
{
$formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');
$formattedRequestsParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

batch_create_access_bindings_sample($formattedParent, $formattedRequestsParent);
}
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateAccessBindings_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2023 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_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_sync]
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DeleteAccessBindingRequest;
use Google\ApiCore\ApiException;

/**
* Deletes information about multiple users' links to an account or property.
*
* @param string $formattedParent The account or property that owns the access bindings. The parent
* field in the DeleteAccessBindingRequest messages must either be empty or
* match this field. Formats:
* - accounts/{account}
* - properties/{property}
* Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
* @param string $formattedRequestsName Formats:
* - accounts/{account}/accessBindings/{accessBinding}
* - properties/{property}/accessBindings/{accessBinding}
* Please see {@see AnalyticsAdminServiceClient::accessBindingName()} for help formatting this field.
*/
function batch_delete_access_bindings_sample(
string $formattedParent,
string $formattedRequestsName
): void {
// Create a client.
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

// Prepare any non-scalar elements to be passed along with the request.
$deleteAccessBindingRequest = (new DeleteAccessBindingRequest())
->setName($formattedRequestsName);
$requests = [$deleteAccessBindingRequest,];

// Call the API and handle any network failures.
try {
$analyticsAdminServiceClient->batchDeleteAccessBindings($formattedParent, $requests);
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
{
$formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');
$formattedRequestsName = AnalyticsAdminServiceClient::accessBindingName(
'[ACCOUNT]',
'[ACCESS_BINDING]'
);

batch_delete_access_bindings_sample($formattedParent, $formattedRequestsName);
}
// [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteAccessBindings_sync]
Loading

0 comments on commit 23d3751

Please sign in to comment.