Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class KeyManagementServiceAsyncClient:

crypto_key_path = staticmethod(KeyManagementServiceClient.crypto_key_path)

import_job_path = staticmethod(KeyManagementServiceClient.import_job_path)
key_ring_path = staticmethod(KeyManagementServiceClient.key_ring_path)

crypto_key_version_path = staticmethod(
KeyManagementServiceClient.crypto_key_version_path
)

key_ring_path = staticmethod(KeyManagementServiceClient.key_ring_path)
import_job_path = staticmethod(KeyManagementServiceClient.import_job_path)

from_service_account_file = KeyManagementServiceClient.from_service_account_file
from_service_account_json = from_service_account_file
Expand Down
92 changes: 91 additions & 1 deletion synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-kms.git",
"sha": "9edcc9abceb6f790f4d1968aef3ba61903e30824"
"sha": "93b9c08e6f29281cfde4679534ea2bac405f3e90"
}
},
{
Expand Down Expand Up @@ -40,5 +40,95 @@
"generator": "bazel"
}
}
],
"generatedFiles": [
".flake8",
".github/CONTRIBUTING.md",
".github/ISSUE_TEMPLATE/bug_report.md",
".github/ISSUE_TEMPLATE/feature_request.md",
".github/ISSUE_TEMPLATE/support_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/release-please.yml",
".gitignore",
".kokoro/build.sh",
".kokoro/continuous/common.cfg",
".kokoro/continuous/continuous.cfg",
".kokoro/docker/docs/Dockerfile",
".kokoro/docker/docs/fetch_gpg_keys.sh",
".kokoro/docs/common.cfg",
".kokoro/docs/docs-presubmit.cfg",
".kokoro/docs/docs.cfg",
".kokoro/presubmit/common.cfg",
".kokoro/presubmit/presubmit.cfg",
".kokoro/publish-docs.sh",
".kokoro/release.sh",
".kokoro/release/common.cfg",
".kokoro/release/release.cfg",
".kokoro/samples/lint/common.cfg",
".kokoro/samples/lint/continuous.cfg",
".kokoro/samples/lint/periodic.cfg",
".kokoro/samples/lint/presubmit.cfg",
".kokoro/samples/python3.6/common.cfg",
".kokoro/samples/python3.6/continuous.cfg",
".kokoro/samples/python3.6/periodic.cfg",
".kokoro/samples/python3.6/presubmit.cfg",
".kokoro/samples/python3.7/common.cfg",
".kokoro/samples/python3.7/continuous.cfg",
".kokoro/samples/python3.7/periodic.cfg",
".kokoro/samples/python3.7/presubmit.cfg",
".kokoro/samples/python3.8/common.cfg",
".kokoro/samples/python3.8/continuous.cfg",
".kokoro/samples/python3.8/periodic.cfg",
".kokoro/samples/python3.8/presubmit.cfg",
".kokoro/test-samples.sh",
".kokoro/trampoline.sh",
".kokoro/trampoline_v2.sh",
".trampolinerc",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.rst",
"LICENSE",
"MANIFEST.in",
"docs/_static/custom.css",
"docs/_templates/layout.html",
"docs/conf.py",
"docs/kms_v1/services.rst",
"docs/kms_v1/types.rst",
"docs/multiprocessing.rst",
"google/cloud/kms/__init__.py",
"google/cloud/kms/py.typed",
"google/cloud/kms_v1/__init__.py",
"google/cloud/kms_v1/proto/resources.proto",
"google/cloud/kms_v1/proto/service.proto",
"google/cloud/kms_v1/py.typed",
"google/cloud/kms_v1/services/__init__.py",
"google/cloud/kms_v1/services/key_management_service/__init__.py",
"google/cloud/kms_v1/services/key_management_service/async_client.py",
"google/cloud/kms_v1/services/key_management_service/client.py",
"google/cloud/kms_v1/services/key_management_service/pagers.py",
"google/cloud/kms_v1/services/key_management_service/transports/__init__.py",
"google/cloud/kms_v1/services/key_management_service/transports/base.py",
"google/cloud/kms_v1/services/key_management_service/transports/grpc.py",
"google/cloud/kms_v1/services/key_management_service/transports/grpc_asyncio.py",
"google/cloud/kms_v1/types/__init__.py",
"google/cloud/kms_v1/types/resources.py",
"google/cloud/kms_v1/types/service.py",
"mypy.ini",
"noxfile.py",
"renovate.json",
"samples/AUTHORING_GUIDE.md",
"samples/CONTRIBUTING.md",
"samples/snippets/README.md",
"scripts/decrypt-secrets.sh",
"scripts/fixup_kms_v1_keywords.py",
"scripts/readme-gen/readme_gen.py",
"scripts/readme-gen/templates/README.tmpl.rst",
"scripts/readme-gen/templates/auth.tmpl.rst",
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
"scripts/readme-gen/templates/install_deps.tmpl.rst",
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
"setup.cfg",
"testing/.gitignore",
"tests/unit/gapic/kms_v1/__init__.py",
"tests/unit/gapic/kms_v1/test_key_management_service.py"
]
}
48 changes: 24 additions & 24 deletions tests/unit/gapic/kms_v1/test_key_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6503,32 +6503,28 @@ def test_parse_crypto_key_path():
assert expected == actual


def test_import_job_path():
def test_key_ring_path():
project = "squid"
location = "clam"
key_ring = "whelk"
import_job = "octopus"

expected = "projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}".format(
project=project, location=location, key_ring=key_ring, import_job=import_job,
)
actual = KeyManagementServiceClient.import_job_path(
project, location, key_ring, import_job
expected = "projects/{project}/locations/{location}/keyRings/{key_ring}".format(
project=project, location=location, key_ring=key_ring,
)
actual = KeyManagementServiceClient.key_ring_path(project, location, key_ring)
assert expected == actual


def test_parse_import_job_path():
def test_parse_key_ring_path():
expected = {
"project": "oyster",
"location": "nudibranch",
"key_ring": "cuttlefish",
"import_job": "mussel",
"project": "octopus",
"location": "oyster",
"key_ring": "nudibranch",
}
path = KeyManagementServiceClient.import_job_path(**expected)
path = KeyManagementServiceClient.key_ring_path(**expected)

# Check that the path construction is reversible.
actual = KeyManagementServiceClient.parse_import_job_path(path)
actual = KeyManagementServiceClient.parse_key_ring_path(path)
assert expected == actual


Expand Down Expand Up @@ -6567,28 +6563,32 @@ def test_parse_crypto_key_version_path():
assert expected == actual


def test_key_ring_path():
def test_import_job_path():
project = "squid"
location = "clam"
key_ring = "whelk"
import_job = "octopus"

expected = "projects/{project}/locations/{location}/keyRings/{key_ring}".format(
project=project, location=location, key_ring=key_ring,
expected = "projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}".format(
project=project, location=location, key_ring=key_ring, import_job=import_job,
)
actual = KeyManagementServiceClient.import_job_path(
project, location, key_ring, import_job
)
actual = KeyManagementServiceClient.key_ring_path(project, location, key_ring)
assert expected == actual


def test_parse_key_ring_path():
def test_parse_import_job_path():
expected = {
"project": "octopus",
"location": "oyster",
"key_ring": "nudibranch",
"project": "oyster",
"location": "nudibranch",
"key_ring": "cuttlefish",
"import_job": "mussel",
}
path = KeyManagementServiceClient.key_ring_path(**expected)
path = KeyManagementServiceClient.import_job_path(**expected)

# Check that the path construction is reversible.
actual = KeyManagementServiceClient.parse_key_ring_path(path)
actual = KeyManagementServiceClient.parse_import_job_path(path)
assert expected == actual


Expand Down