Skip to content
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 DatabaseCenter/metadata/V1Beta/Maintenance.php
Binary file not shown.
Binary file modified DatabaseCenter/metadata/V1Beta/Service.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/*
* Copyright 2026 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 databasecenter_v1beta_generated_DatabaseCenter_QueryIssues_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\DatabaseCenter\V1beta\Client\DatabaseCenterClient;
use Google\Cloud\DatabaseCenter\V1beta\DatabaseResourceIssue;
use Google\Cloud\DatabaseCenter\V1beta\QueryIssuesRequest;

/**
* QueryIssues provides a list of issues and recommendations
* that a user has access to and that are within the requested scope.
*
* @param string $parent Parent can be a project, a folder, or an organization. The list
* is limited to the one attached to resources within the `scope` that a user
* has access to.
*
* The allowed values are:
*
* * projects/{PROJECT_ID} (e.g., "projects/foo-bar")
* * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
* * folders/{FOLDER_NUMBER} (e.g., "folders/1234567")
* * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
*/
function query_issues_sample(string $parent): void
{
// Create a client.
$databaseCenterClient = new DatabaseCenterClient();

// Prepare the request message.
$request = (new QueryIssuesRequest())
->setParent($parent);

// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $databaseCenterClient->queryIssues($request);

/** @var DatabaseResourceIssue $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$parent = '[PARENT]';

query_issues_sample($parent);
}
// [END databasecenter_v1beta_generated_DatabaseCenter_QueryIssues_sync]
60 changes: 32 additions & 28 deletions DatabaseCenter/src/V1beta/AggregateFleetRequest.php

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

3 changes: 2 additions & 1 deletion DatabaseCenter/src/V1beta/AggregateFleetResponse.php

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

32 changes: 16 additions & 16 deletions DatabaseCenter/src/V1beta/AggregateIssueStatsRequest.php

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

31 changes: 31 additions & 0 deletions DatabaseCenter/src/V1beta/Client/DatabaseCenterClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Google\Cloud\DatabaseCenter\V1beta\AggregateIssueStatsRequest;
use Google\Cloud\DatabaseCenter\V1beta\AggregateIssueStatsResponse;
use Google\Cloud\DatabaseCenter\V1beta\QueryDatabaseResourceGroupsRequest;
use Google\Cloud\DatabaseCenter\V1beta\QueryIssuesRequest;
use Google\Cloud\DatabaseCenter\V1beta\QueryProductsRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;
Expand All @@ -54,6 +55,7 @@
* @method PromiseInterface<PagedListResponse> aggregateFleetAsync(AggregateFleetRequest $request, array $optionalArgs = [])
* @method PromiseInterface<AggregateIssueStatsResponse> aggregateIssueStatsAsync(AggregateIssueStatsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> queryDatabaseResourceGroupsAsync(QueryDatabaseResourceGroupsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> queryIssuesAsync(QueryIssuesRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> queryProductsAsync(QueryProductsRequest $request, array $optionalArgs = [])
*/
final class DatabaseCenterClient
Expand Down Expand Up @@ -278,6 +280,35 @@ public function queryDatabaseResourceGroups(
return $this->startApiCall('QueryDatabaseResourceGroups', $request, $callOptions);
}

/**
* QueryIssues provides a list of issues and recommendations
* that a user has access to and that are within the requested scope.
*
* The async variant is {@see DatabaseCenterClient::queryIssuesAsync()} .
*
* @example samples/V1beta/DatabaseCenterClient/query_issues.php
*
* @param QueryIssuesRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return PagedListResponse
*
* @throws ApiException Thrown if the API call fails.
*
* @experimental
*/
public function queryIssues(QueryIssuesRequest $request, array $callOptions = []): PagedListResponse
{
return $this->startApiCall('QueryIssues', $request, $callOptions);
}

/**
* QueryProducts provides a list of all possible products which can be used to
* filter database resources.
Expand Down
Loading
Loading