Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

feat: enable "rest" transport in Python for services supporting numeric enums #491

Merged
merged 8 commits into from
Feb 28, 2023
175 changes: 175 additions & 0 deletions google/cloud/dlp_v2/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,181 @@
]
}
}
},
"rest": {
"libraryClient": "DlpServiceClient",
"rpcs": {
"ActivateJobTrigger": {
"methods": [
"activate_job_trigger"
]
},
"CancelDlpJob": {
"methods": [
"cancel_dlp_job"
]
},
"CreateDeidentifyTemplate": {
"methods": [
"create_deidentify_template"
]
},
"CreateDlpJob": {
"methods": [
"create_dlp_job"
]
},
"CreateInspectTemplate": {
"methods": [
"create_inspect_template"
]
},
"CreateJobTrigger": {
"methods": [
"create_job_trigger"
]
},
"CreateStoredInfoType": {
"methods": [
"create_stored_info_type"
]
},
"DeidentifyContent": {
"methods": [
"deidentify_content"
]
},
"DeleteDeidentifyTemplate": {
"methods": [
"delete_deidentify_template"
]
},
"DeleteDlpJob": {
"methods": [
"delete_dlp_job"
]
},
"DeleteInspectTemplate": {
"methods": [
"delete_inspect_template"
]
},
"DeleteJobTrigger": {
"methods": [
"delete_job_trigger"
]
},
"DeleteStoredInfoType": {
"methods": [
"delete_stored_info_type"
]
},
"FinishDlpJob": {
"methods": [
"finish_dlp_job"
]
},
"GetDeidentifyTemplate": {
"methods": [
"get_deidentify_template"
]
},
"GetDlpJob": {
"methods": [
"get_dlp_job"
]
},
"GetInspectTemplate": {
"methods": [
"get_inspect_template"
]
},
"GetJobTrigger": {
"methods": [
"get_job_trigger"
]
},
"GetStoredInfoType": {
"methods": [
"get_stored_info_type"
]
},
"HybridInspectDlpJob": {
"methods": [
"hybrid_inspect_dlp_job"
]
},
"HybridInspectJobTrigger": {
"methods": [
"hybrid_inspect_job_trigger"
]
},
"InspectContent": {
"methods": [
"inspect_content"
]
},
"ListDeidentifyTemplates": {
"methods": [
"list_deidentify_templates"
]
},
"ListDlpJobs": {
"methods": [
"list_dlp_jobs"
]
},
"ListInfoTypes": {
"methods": [
"list_info_types"
]
},
"ListInspectTemplates": {
"methods": [
"list_inspect_templates"
]
},
"ListJobTriggers": {
"methods": [
"list_job_triggers"
]
},
"ListStoredInfoTypes": {
"methods": [
"list_stored_info_types"
]
},
"RedactImage": {
"methods": [
"redact_image"
]
},
"ReidentifyContent": {
"methods": [
"reidentify_content"
]
},
"UpdateDeidentifyTemplate": {
"methods": [
"update_deidentify_template"
]
},
"UpdateInspectTemplate": {
"methods": [
"update_inspect_template"
]
},
"UpdateJobTrigger": {
"methods": [
"update_job_trigger"
]
},
"UpdateStoredInfoType": {
"methods": [
"update_stored_info_type"
]
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions google/cloud/dlp_v2/services/dlp_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.location import locations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/dlp_v2/services/dlp_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.location import locations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand All @@ -55,6 +56,7 @@
from .transports.base import DEFAULT_CLIENT_INFO, DlpServiceTransport
from .transports.grpc import DlpServiceGrpcTransport
from .transports.grpc_asyncio import DlpServiceGrpcAsyncIOTransport
from .transports.rest import DlpServiceRestTransport


class DlpServiceClientMeta(type):
Expand All @@ -68,6 +70,7 @@ class DlpServiceClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[DlpServiceTransport]]
_transport_registry["grpc"] = DlpServiceGrpcTransport
_transport_registry["grpc_asyncio"] = DlpServiceGrpcAsyncIOTransport
_transport_registry["rest"] = DlpServiceRestTransport

def get_transport_class(
cls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
from .base import DlpServiceTransport
from .grpc import DlpServiceGrpcTransport
from .grpc_asyncio import DlpServiceGrpcAsyncIOTransport
from .rest import DlpServiceRestInterceptor, DlpServiceRestTransport

# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[DlpServiceTransport]]
_transport_registry["grpc"] = DlpServiceGrpcTransport
_transport_registry["grpc_asyncio"] = DlpServiceGrpcAsyncIOTransport
_transport_registry["rest"] = DlpServiceRestTransport

__all__ = (
"DlpServiceTransport",
"DlpServiceGrpcTransport",
"DlpServiceGrpcAsyncIOTransport",
"DlpServiceRestTransport",
"DlpServiceRestInterceptor",
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from google.api_core import retry as retries
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.oauth2 import service_account # type: ignore
from google.protobuf import empty_pb2 # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
import grpc # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from google.api_core import gapic_v1, grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down
Loading