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

chore!: promote Notebooks to v1 #7401

Merged
merged 2 commits into from
Jun 12, 2024
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
2 changes: 1 addition & 1 deletion .repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@
"Notebooks": {
"language": "php",
"distribution_name": "google/cloud-notebooks",
"release_level": "preview",
"release_level": "stable",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-notebooks/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "notebooks"
Expand Down
2 changes: 1 addition & 1 deletion Notebooks/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/cloud/notebooks/(v1|v1beta1|v2)/.*-php/(.*)
- source: /google/cloud/notebooks/(v2|v1)/.*-php/(.*)
dest: /owl-bot-staging/Notebooks/$1/$2
api-name: Notebooks
5 changes: 2 additions & 3 deletions Notebooks/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
Binary file removed Notebooks/metadata/V1Beta1/Environment.php
Binary file not shown.
Binary file removed Notebooks/metadata/V1Beta1/Instance.php
Binary file not shown.
153 changes: 0 additions & 153 deletions Notebooks/metadata/V1Beta1/Service.php

This file was deleted.

53 changes: 22 additions & 31 deletions Notebooks/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 @@ -32,34 +32,25 @@

php.owlbot_main(src=src, dest=dest)

# Change the wording for the deprecation warning.
# remove class_alias code
s.replace(
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

### [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)"
)
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

# format generated clients
subprocess.run([
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=120'])
22 changes: 13 additions & 9 deletions Notebooks/src/V1/Client/ManagedNotebookServiceClient.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 Down Expand Up @@ -116,9 +116,7 @@ final class ManagedNotebookServiceClient
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 @@ -164,7 +162,9 @@ 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;
Expand Down Expand Up @@ -477,8 +477,10 @@ public function listRuntimes(ListRuntimesRequest $request, array $callOptions =
*
* @throws ApiException Thrown if the API call fails.
*/
public function refreshRuntimeTokenInternal(RefreshRuntimeTokenInternalRequest $request, array $callOptions = []): RefreshRuntimeTokenInternalResponse
{
public function refreshRuntimeTokenInternal(
RefreshRuntimeTokenInternalRequest $request,
array $callOptions = []
): RefreshRuntimeTokenInternalResponse {
return $this->startApiCall('RefreshRuntimeTokenInternal', $request, $callOptions)->wait();
}

Expand Down Expand Up @@ -811,8 +813,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
*
* @throws ApiException Thrown if the API call fails.
*/
public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse
{
public function testIamPermissions(
TestIamPermissionsRequest $request,
array $callOptions = []
): TestIamPermissionsResponse {
return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait();
}
}
Loading
Loading