Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: [ArtifactRegistry] use code font for resource name references #6736

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ArtifactRegistry/metadata/V1/Repository.php
Binary file not shown.
8 changes: 5 additions & 3 deletions ArtifactRegistry/metadata/V1/Service.php

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

Binary file modified ArtifactRegistry/metadata/V1/Version.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?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 artifactregistry_v1_generated_ArtifactRegistry_BatchDeleteVersions_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ArtifactRegistry\V1\BatchDeleteVersionsRequest;
use Google\Cloud\ArtifactRegistry\V1\Client\ArtifactRegistryClient;
use Google\Rpc\Status;

/**
* Deletes multiple versions across a repository. The returned operation will
* complete once the versions have been deleted.
*
* @param string $formattedNamesElement The names of the versions to delete.
* A maximum of 10000 versions can be deleted in a batch. Please see
* {@see ArtifactRegistryClient::versionName()} for help formatting this field.
*/
function batch_delete_versions_sample(string $formattedNamesElement): void
{
// Create a client.
$artifactRegistryClient = new ArtifactRegistryClient();

// Prepare the request message.
$formattedNames = [$formattedNamesElement,];
$request = (new BatchDeleteVersionsRequest())
->setNames($formattedNames);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $artifactRegistryClient->batchDeleteVersions($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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
{
$formattedNamesElement = ArtifactRegistryClient::versionName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PACKAGE]',
'[VERSION]'
);

batch_delete_versions_sample($formattedNamesElement);
}
// [END artifactregistry_v1_generated_ArtifactRegistry_BatchDeleteVersions_sync]
156 changes: 156 additions & 0 deletions ArtifactRegistry/src/V1/BatchDeleteVersionsRequest.php

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

Loading