Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a543517
feat: add audience parameter
gcf-owl-bot[bot] Jun 23, 2022
2ecdf82
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 23, 2022
1af216b
chore: use gapic-generator-python 1.1.1
gcf-owl-bot[bot] Jul 5, 2022
894032d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 5, 2022
e7d2f3a
feat: generating GAPIC libraries for Google Cloud Functions v2beta
gcf-owl-bot[bot] Jul 6, 2022
8dc2769
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 6, 2022
c63fef3
fix(deps): require google-api-core 2.8.0
parthea Jul 7, 2022
37d110a
Merge branch 'main' into owl-bot-copy
parthea Jul 10, 2022
9ab093b
fix(deps): require google-api-core>=1.32.0,>=2.8.0
parthea Jul 14, 2022
0f522d3
chore: add workaround in owlbot.py to fix docs build
parthea Jul 14, 2022
4278768
restore changes in .github/release-please.yml
parthea Jul 14, 2022
4bcebf1
update owlbot.py to reflect changes in main
parthea Jul 14, 2022
792894f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 14, 2022
924c85d
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-f…
gcf-owl-bot[bot] Jul 14, 2022
492c8ce
restore google/cloud/functions/__init__.py
parthea Jul 14, 2022
33b4702
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 14, 2022
df6a39c
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-f…
gcf-owl-bot[bot] Jul 14, 2022
bedd4f6
Merge branch 'main' into owl-bot-copy
parthea Jul 14, 2022
42356b8
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 14, 2022
61ca762
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-f…
gcf-owl-bot[bot] Jul 14, 2022
d14a920
set coverage level to 99%
parthea Jul 14, 2022
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 .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
- name: Report coverage results
run: |
coverage combine .coverage-results/.coverage*
coverage report --show-missing --fail-under=100
coverage report --show-missing --fail-under=99
10 changes: 10 additions & 0 deletions docs/functions_v2/function_service.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FunctionService
---------------------------------

.. automodule:: google.cloud.functions_v2.services.function_service
:members:
:inherited-members:

.. automodule:: google.cloud.functions_v2.services.function_service.pagers
:members:
:inherited-members:
6 changes: 6 additions & 0 deletions docs/functions_v2/services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Functions v2 API
==========================================
.. toctree::
:maxdepth: 2

function_service
7 changes: 7 additions & 0 deletions docs/functions_v2/types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Types for Google Cloud Functions v2 API
=======================================

.. automodule:: google.cloud.functions_v2.types
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

.. include:: multiprocessing.rst

This package includes clients for multiple versions of Cloud Functions.
By default, you will get version ``functions_v1``.


API Reference
-------------
Expand All @@ -11,6 +14,14 @@ API Reference
functions_v1/services
functions_v1/types

API Reference
-------------
.. toctree::
:maxdepth: 2

functions_v2/services
functions_v2/types


Changelog
---------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ def __init__(
quota_project_id=client_options.quota_project_id,
client_info=client_info,
always_use_jwt_access=True,
api_audience=client_options.api_audience,
)

def list_functions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
**kwargs,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -84,11 +85,6 @@ def __init__(
be used for service account credentials.
"""

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
Expand All @@ -109,6 +105,11 @@ def __init__(
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(
api_audience if api_audience else host
)

# If the credentials are service account credentials, then always try to use self signed JWT.
if (
Expand All @@ -121,6 +122,11 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = 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 @@ -61,6 +61,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.

Expand Down Expand Up @@ -157,6 +158,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def __init__(
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.

Expand Down Expand Up @@ -202,6 +203,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
78 changes: 78 additions & 0 deletions google/cloud/functions_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.
#

from .services.function_service import FunctionServiceAsyncClient, FunctionServiceClient
from .types.functions import (
BuildConfig,
CreateFunctionRequest,
DeleteFunctionRequest,
Environment,
EventFilter,
EventTrigger,
Function,
GenerateDownloadUrlRequest,
GenerateDownloadUrlResponse,
GenerateUploadUrlRequest,
GenerateUploadUrlResponse,
GetFunctionRequest,
ListFunctionsRequest,
ListFunctionsResponse,
ListRuntimesRequest,
ListRuntimesResponse,
OperationMetadata,
RepoSource,
SecretEnvVar,
SecretVolume,
ServiceConfig,
Source,
SourceProvenance,
Stage,
StateMessage,
StorageSource,
UpdateFunctionRequest,
)

__all__ = (
"FunctionServiceAsyncClient",
"BuildConfig",
"CreateFunctionRequest",
"DeleteFunctionRequest",
"Environment",
"EventFilter",
"EventTrigger",
"Function",
"FunctionServiceClient",
"GenerateDownloadUrlRequest",
"GenerateDownloadUrlResponse",
"GenerateUploadUrlRequest",
"GenerateUploadUrlResponse",
"GetFunctionRequest",
"ListFunctionsRequest",
"ListFunctionsResponse",
"ListRuntimesRequest",
"ListRuntimesResponse",
"OperationMetadata",
"RepoSource",
"SecretEnvVar",
"SecretVolume",
"ServiceConfig",
"Source",
"SourceProvenance",
"Stage",
"StateMessage",
"StorageSource",
"UpdateFunctionRequest",
)
103 changes: 103 additions & 0 deletions google/cloud/functions_v2/gapic_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.functions_v2",
"protoPackage": "google.cloud.functions.v2",
"schema": "1.0",
"services": {
"FunctionService": {
"clients": {
"grpc": {
"libraryClient": "FunctionServiceClient",
"rpcs": {
"CreateFunction": {
"methods": [
"create_function"
]
},
"DeleteFunction": {
"methods": [
"delete_function"
]
},
"GenerateDownloadUrl": {
"methods": [
"generate_download_url"
]
},
"GenerateUploadUrl": {
"methods": [
"generate_upload_url"
]
},
"GetFunction": {
"methods": [
"get_function"
]
},
"ListFunctions": {
"methods": [
"list_functions"
]
},
"ListRuntimes": {
"methods": [
"list_runtimes"
]
},
"UpdateFunction": {
"methods": [
"update_function"
]
}
}
},
"grpc-async": {
"libraryClient": "FunctionServiceAsyncClient",
"rpcs": {
"CreateFunction": {
"methods": [
"create_function"
]
},
"DeleteFunction": {
"methods": [
"delete_function"
]
},
"GenerateDownloadUrl": {
"methods": [
"generate_download_url"
]
},
"GenerateUploadUrl": {
"methods": [
"generate_upload_url"
]
},
"GetFunction": {
"methods": [
"get_function"
]
},
"ListFunctions": {
"methods": [
"list_functions"
]
},
"ListRuntimes": {
"methods": [
"list_runtimes"
]
},
"UpdateFunction": {
"methods": [
"update_function"
]
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions google/cloud/functions_v2/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-cloud-functions package uses inline types.
15 changes: 15 additions & 0 deletions google/cloud/functions_v2/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.
#
22 changes: 22 additions & 0 deletions google/cloud/functions_v2/services/function_service/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.
#
from .async_client import FunctionServiceAsyncClient
from .client import FunctionServiceClient

__all__ = (
"FunctionServiceClient",
"FunctionServiceAsyncClient",
)
Loading