-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [AnalyticsAdmin] add AccessBinding and ExpandedDataset methods (#…
…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
1 parent
8f648c7
commit 23d3751
Showing
47 changed files
with
5,721 additions
and
95 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
AnalyticsAdmin/samples/V1alpha/AnalyticsAdminServiceClient/batch_create_access_bindings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
84 changes: 84 additions & 0 deletions
84
AnalyticsAdmin/samples/V1alpha/AnalyticsAdminServiceClient/batch_delete_access_bindings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
Oops, something went wrong.