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

feat(v1beta1): Allow users to explicitly configure universe domain #12324

Merged
merged 1 commit into from
Feb 16, 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: 2 additions & 0 deletions packages/google-cloud-gke-hub/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ deep-preserve-regex:
deep-copy-regex:
- source: /google/cloud/gkehub/(v1)/gkehub-v1-py
dest: /owl-bot-staging/google-cloud-gke-hub/$1
- source: /google/cloud/gkehub/(v1beta1)/gkehub-v1beta1-py
dest: /owl-bot-staging/google-cloud-gke-hub/$1
- source: /google/cloud/gkehub/v1/multiclusteringress/multiclusteringress-v1-py/google/cloud/gkehub/(multiclusteringress_v1)
dest: /owl-bot-staging/google-cloud-gke-hub/v1/google/cloud/gkehub_v1/$1
- source: /google/cloud/gkehub/v1/configmanagement/configmanagement-v1-py/google/cloud/gkehub/(configmanagement_v1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
Copy link
Contributor Author

@parthea parthea Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this bug to update the copyright year: googleapis/gapic-generator-python#1911

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.12.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(
Args:
host (Optional[str]):
The hostname to connect to.
The hostname to connect to (default: 'gkehub.googleapis.com').
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
Expand Down Expand Up @@ -123,6 +123,10 @@ def __init__(
host += ":443"
self._host = host

@property
def host(self):
return self._host

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
Args:
host (Optional[str]):
The hostname to connect to.
The hostname to connect to (default: 'gkehub.googleapis.com').
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(
Args:
host (Optional[str]):
The hostname to connect to.
The hostname to connect to (default: 'gkehub.googleapis.com').
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
from requests import __version__ as requests_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore
OptionalRetry = Union[retries.Retry, object, None] # type: ignore


from google.longrunning import operations_pb2 # type: ignore
Expand Down Expand Up @@ -578,7 +578,7 @@ def __init__(

Args:
host (Optional[str]):
The hostname to connect to.
The hostname to connect to (default: 'gkehub.googleapis.com').
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
Expand Down Expand Up @@ -749,9 +749,7 @@ def __call__(
# Jsonify the request body

body = json_format.MessageToJson(
transcoded_request["body"],
including_default_value_fields=False,
use_integers_for_enums=True,
transcoded_request["body"], use_integers_for_enums=True
)
uri = transcoded_request["uri"]
method = transcoded_request["method"]
Expand All @@ -760,7 +758,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -851,7 +848,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -942,7 +938,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -1035,7 +1030,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -1124,7 +1118,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -1215,7 +1208,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -1306,9 +1298,7 @@ def __call__(
# Jsonify the request body

body = json_format.MessageToJson(
transcoded_request["body"],
including_default_value_fields=False,
use_integers_for_enums=True,
transcoded_request["body"], use_integers_for_enums=True
)
uri = transcoded_request["uri"]
method = transcoded_request["method"]
Expand All @@ -1317,7 +1307,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down Expand Up @@ -1410,7 +1399,6 @@ def __call__(
query_params = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=True,
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# 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
#
# http://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. DO NOT EDIT!
#
# Snippet for CreateMembership
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-gke-hub


# [START gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_async]
# This snippet 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 as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import gkehub_v1beta1


async def sample_create_membership():
# Create a client
client = gkehub_v1beta1.GkeHubMembershipServiceAsyncClient()

# Initialize request argument(s)
request = gkehub_v1beta1.CreateMembershipRequest(
parent="parent_value",
membership_id="membership_id_value",
)

# Make the request
operation = client.create_membership(request=request)

print("Waiting for operation to complete...")

response = (await operation).result()

# Handle the response
print(response)

# [END gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# 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
#
# http://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. DO NOT EDIT!
#
# Snippet for CreateMembership
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-gke-hub


# [START gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_sync]
# This snippet 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 as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import gkehub_v1beta1


def sample_create_membership():
# Create a client
client = gkehub_v1beta1.GkeHubMembershipServiceClient()

# Initialize request argument(s)
request = gkehub_v1beta1.CreateMembershipRequest(
parent="parent_value",
membership_id="membership_id_value",
)

# Make the request
operation = client.create_membership(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
# 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
#
# http://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. DO NOT EDIT!
#
# Snippet for DeleteMembership
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-gke-hub


# [START gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_async]
# This snippet 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 as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import gkehub_v1beta1


async def sample_delete_membership():
# Create a client
client = gkehub_v1beta1.GkeHubMembershipServiceAsyncClient()

# Initialize request argument(s)
request = gkehub_v1beta1.DeleteMembershipRequest(
name="name_value",
)

# Make the request
operation = client.delete_membership(request=request)

print("Waiting for operation to complete...")

response = (await operation).result()

# Handle the response
print(response)

# [END gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
# 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
#
# http://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. DO NOT EDIT!
#
# Snippet for DeleteMembership
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-gke-hub


# [START gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_sync]
# This snippet 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 as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import gkehub_v1beta1


def sample_delete_membership():
# Create a client
client = gkehub_v1beta1.GkeHubMembershipServiceClient()

# Initialize request argument(s)
request = gkehub_v1beta1.DeleteMembershipRequest(
name="name_value",
)

# Make the request
operation = client.delete_membership(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_sync]
Loading
Loading