Skip to content

Commit

Permalink
chore!: promote DataFusion to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Jun 10, 2024
1 parent e583f71 commit 4bd0c2b
Show file tree
Hide file tree
Showing 31 changed files with 184 additions and 2,204 deletions.
2 changes: 1 addition & 1 deletion .repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"DataFusion": {
"language": "php",
"distribution_name": "google/cloud-data-fusion",
"release_level": "preview",
"release_level": "stable",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-data-fusion/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "datafusion"
Expand Down
5 changes: 2 additions & 3 deletions DataFusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki

### Version

This component is considered beta. As such, it should be expected to be mostly
stable and we're working towards a release candidate. We will address issues
and requests with a higher priority.
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
any minor or patch releases. We will address issues and requests with the highest priority.

### Next Steps

Expand Down
34 changes: 4 additions & 30 deletions DataFusion/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# 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.
Expand Down Expand Up @@ -34,7 +34,7 @@
src=src,
dest=dest,
copy_excludes=[
src / "**/[A-Z]*_*.php"
src / "**/[A-Z]*_*.php",
]
)

Expand All @@ -47,32 +47,6 @@
+ "\n",
'')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)

# format generated clients
subprocess.run([
'npm',
Expand All @@ -81,8 +55,8 @@
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Gapic/*',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=80'])
'--print-width=120'])
2 changes: 1 addition & 1 deletion DataFusion/samples/V1/DataFusionClient/create_instance.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
2 changes: 1 addition & 1 deletion DataFusion/samples/V1/DataFusionClient/delete_instance.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
2 changes: 1 addition & 1 deletion DataFusion/samples/V1/DataFusionClient/get_instance.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
2 changes: 1 addition & 1 deletion DataFusion/samples/V1/DataFusionClient/list_instances.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
2 changes: 1 addition & 1 deletion DataFusion/samples/V1/DataFusionClient/update_instance.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2022 Google LLC
* 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.
Expand Down
4 changes: 2 additions & 2 deletions DataFusion/src/V1/Accelerator.php

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

37 changes: 29 additions & 8 deletions DataFusion/src/V1/Client/DataFusionClient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* 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.
Expand All @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand All @@ -43,6 +42,7 @@
use Google\Cloud\DataFusion\V1\ListInstancesRequest;
use Google\Cloud\DataFusion\V1\RestartInstanceRequest;
use Google\Cloud\DataFusion\V1\UpdateInstanceRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -92,9 +92,7 @@ final class DataFusionClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];

private $operationsClient;

Expand Down Expand Up @@ -140,12 +138,33 @@ public function getOperationsClient()
*/
public function resumeOperation($operationName, $methodName = null)
{
$options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];
$options = isset($this->descriptors[$methodName]['longRunning'])
? $this->descriptors[$methodName]['longRunning']
: [];
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
$operation->reload();
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a crypto_key
* resource.
Expand Down Expand Up @@ -401,8 +420,10 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = []
*
* @throws ApiException Thrown if the API call fails.
*/
public function listAvailableVersions(ListAvailableVersionsRequest $request, array $callOptions = []): PagedListResponse
{
public function listAvailableVersions(
ListAvailableVersionsRequest $request,
array $callOptions = []
): PagedListResponse {
return $this->startApiCall('ListAvailableVersions', $request, $callOptions);
}

Expand Down
6 changes: 3 additions & 3 deletions DataFusion/src/V1/CreateInstanceRequest.php

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

2 changes: 1 addition & 1 deletion DataFusion/src/V1/CryptoKeyConfig.php

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

34 changes: 0 additions & 34 deletions DataFusion/src/V1/DataFusionClient.php

This file was deleted.

Loading

0 comments on commit 4bd0c2b

Please sign in to comment.