GCP¶
Validated types for Google Cloud Platform resource identifiers.
GCP cloud resource types.
Modules:
-
compute–GCP compute types.
-
containers–GCP container types.
-
database–GCP database types.
-
identity–GCP identity types.
-
messaging–GCP messaging types.
-
region–GCP region and zone types.
-
security–GCP security types.
-
storage–GCP storage types.
Classes:
-
ArtifactRegistryImageUri–A validated GCP Artifact Registry image URI.
-
BigQueryTableId–A validated BigQuery fully-qualified table ID.
-
GcsUri–A validated Google Cloud Storage URI (gs://bucket/key).
-
KmsKeyName–A validated GCP KMS key name.
-
PubSubSubscriptionName–A validated GCP Pub/Sub subscription name.
-
PubSubTopicName–A validated GCP Pub/Sub topic name (projects/{project}/topics/{topic}).
-
Region–GCP cloud regions.
-
SecretManagerSecretName–A validated GCP Secret Manager secret name (projects/{project}/secrets/{secret}).
-
SecretManagerVersionName–A validated GCP Secret Manager version name.
-
ServiceAccountEmail–A validated GCP service account email.
-
Zone–A validated GCP zone (e.g. us-central1-a).
Attributes:
-
BigQueryDatasetId–A GCP BigQuery dataset ID (e.g.
my_dataset). -
BillingAccountId–A GCP billing account ID (e.g.
01A2B3-C4D5E6-F7G8H9). -
CloudFunctionName–A GCP Cloud Function name (1-49 lowercase chars) (e.g.
my-function). -
CloudRunServiceName–A GCP Cloud Run service name (1-49 lowercase chars) (e.g.
my-service). -
CloudSqlInstanceId–A GCP Cloud SQL instance ID (max 84 chars) (e.g.
my-sql-instance). -
ComputeResourceName–A GCP Compute Engine resource name (1-63 lowercase chars) (e.g.
my-vm-instance). -
GcsBucketName–A GCP Cloud Storage bucket name (e.g.
my-bucket). -
OrganizationId–A GCP organization ID (e.g.
123456789012). -
ProjectId–A GCP project ID (6-30 lowercase chars) (e.g.
my-project-123). -
ProjectNumber–A GCP project number (e.g.
123456789012). -
SpannerDatabaseId–A GCP Spanner database ID (2-30 chars) (e.g.
my-spanner-db). -
SpannerInstanceId–A GCP Spanner instance ID (2-64 chars) (e.g.
my-spanner-instance).
BigQueryDatasetId
module-attribute
¶
BigQueryDatasetId = Annotated[str, AfterValidator(_validate_bigquery_dataset_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP BigQuery dataset ID.', 'examples': ['my_dataset'], 'title': 'BigQueryDatasetId'})]
A GCP BigQuery dataset ID (e.g. my_dataset).
BillingAccountId
module-attribute
¶
BillingAccountId = Annotated[str, AfterValidator(_validate_billing_account_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP billing account ID.', 'examples': ['01A2B3-C4D5E6-F7G8H9'], 'title': 'BillingAccountId'})]
A GCP billing account ID (e.g. 01A2B3-C4D5E6-F7G8H9).
CloudFunctionName
module-attribute
¶
CloudFunctionName = Annotated[str, AfterValidator(_validate_cloud_function_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Cloud Function name (1-49 lowercase chars).', 'examples': ['my-function'], 'title': 'CloudFunctionName'})]
A GCP Cloud Function name (1-49 lowercase chars) (e.g. my-function).
CloudRunServiceName
module-attribute
¶
CloudRunServiceName = Annotated[str, AfterValidator(_validate_cloud_run_service_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Cloud Run service name (1-49 lowercase chars).', 'examples': ['my-service'], 'title': 'CloudRunServiceName'})]
A GCP Cloud Run service name (1-49 lowercase chars) (e.g. my-service).
CloudSqlInstanceId
module-attribute
¶
CloudSqlInstanceId = Annotated[str, AfterValidator(_validate_cloud_sql_instance_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Cloud SQL instance ID (max 84 chars).', 'examples': ['my-sql-instance'], 'title': 'CloudSqlInstanceId'})]
A GCP Cloud SQL instance ID (max 84 chars) (e.g. my-sql-instance).
ComputeResourceName
module-attribute
¶
ComputeResourceName = Annotated[str, AfterValidator(_validate_compute_resource_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Compute Engine resource name (1-63 lowercase chars).', 'examples': ['my-vm-instance'], 'title': 'ComputeResourceName'})]
A GCP Compute Engine resource name (1-63 lowercase chars) (e.g. my-vm-instance).
GcsBucketName
module-attribute
¶
GcsBucketName = Annotated[str, AfterValidator(_validate_gcs_bucket_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Cloud Storage bucket name.', 'examples': ['my-bucket'], 'title': 'GcsBucketName', 'minLength': 3, 'maxLength': 63})]
A GCP Cloud Storage bucket name (e.g. my-bucket).
OrganizationId
module-attribute
¶
OrganizationId = Annotated[str, AfterValidator(_validate_organization_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP organization ID.', 'examples': ['123456789012'], 'title': 'OrganizationId'})]
A GCP organization ID (e.g. 123456789012).
ProjectId
module-attribute
¶
ProjectId = Annotated[str, AfterValidator(_validate_project_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP project ID (6-30 lowercase chars).', 'examples': ['my-project-123'], 'title': 'ProjectId'})]
A GCP project ID (6-30 lowercase chars) (e.g. my-project-123).
ProjectNumber
module-attribute
¶
ProjectNumber = Annotated[str, AfterValidator(_validate_project_number), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP project number.', 'examples': ['123456789012'], 'title': 'ProjectNumber'})]
A GCP project number (e.g. 123456789012).
SpannerDatabaseId
module-attribute
¶
SpannerDatabaseId = Annotated[str, AfterValidator(_validate_spanner_database_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Spanner database ID (2-30 chars).', 'examples': ['my-spanner-db'], 'title': 'SpannerDatabaseId', 'minLength': 2, 'maxLength': 30})]
A GCP Spanner database ID (2-30 chars) (e.g. my-spanner-db).
SpannerInstanceId
module-attribute
¶
SpannerInstanceId = Annotated[str, AfterValidator(_validate_spanner_instance_id), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A GCP Spanner instance ID (2-64 chars).', 'examples': ['my-spanner-instance'], 'title': 'SpannerInstanceId', 'minLength': 2, 'maxLength': 64})]
A GCP Spanner instance ID (2-64 chars) (e.g. my-spanner-instance).
ArtifactRegistryImageUri
¶
Bases: str
A validated GCP Artifact Registry image URI.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for ArtifactRegistryImageUri.
-
__get_pydantic_json_schema__–Return the JSON schema for ArtifactRegistryImageUri.
-
__new__–Create and validate a new ArtifactRegistryImageUri instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for ArtifactRegistryImageUri.
Source code in src/pydantypes/cloud/gcp/containers.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for ArtifactRegistryImageUri.
Source code in src/pydantypes/cloud/gcp/containers.py
__new__
¶
__new__(value: str) -> ArtifactRegistryImageUri
Create and validate a new ArtifactRegistryImageUri instance.
Source code in src/pydantypes/cloud/gcp/containers.py
BigQueryTableId
¶
Bases: str
A validated BigQuery fully-qualified table ID.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for BigQueryTableId.
-
__get_pydantic_json_schema__–Return the JSON schema for BigQueryTableId.
-
__new__–Create and validate a new BigQueryTableId instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for BigQueryTableId.
Source code in src/pydantypes/cloud/gcp/database.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for BigQueryTableId.
Source code in src/pydantypes/cloud/gcp/database.py
__new__
¶
__new__(value: str) -> BigQueryTableId
Create and validate a new BigQueryTableId instance.
Source code in src/pydantypes/cloud/gcp/database.py
GcsUri
¶
Bases: CloudStorageUri
A validated Google Cloud Storage URI (gs://bucket/key).
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for GcsUri.
-
__get_pydantic_json_schema__–Return the JSON schema for GcsUri.
-
__new__–Create and validate a new GcsUri instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for GcsUri.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for GcsUri.
Source code in src/pydantypes/cloud/gcp/storage.py
__new__
¶
__new__(value: str) -> GcsUri
Create and validate a new GcsUri instance.
Source code in src/pydantypes/cloud/gcp/storage.py
KmsKeyName
¶
Bases: str
A validated GCP KMS key name.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for KmsKeyName.
-
__get_pydantic_json_schema__–Return the JSON schema for KmsKeyName.
-
__new__–Create and validate a new KmsKeyName instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for KmsKeyName.
Source code in src/pydantypes/cloud/gcp/security.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for KmsKeyName.
Source code in src/pydantypes/cloud/gcp/security.py
__new__
¶
__new__(value: str) -> KmsKeyName
Create and validate a new KmsKeyName instance.
Source code in src/pydantypes/cloud/gcp/security.py
PubSubSubscriptionName
¶
Bases: str
A validated GCP Pub/Sub subscription name.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for PubSubSubscriptionName.
-
__get_pydantic_json_schema__–Return the JSON schema for PubSubSubscriptionName.
-
__new__–Create and validate a new PubSubSubscriptionName instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for PubSubSubscriptionName.
Source code in src/pydantypes/cloud/gcp/messaging.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for PubSubSubscriptionName.
Source code in src/pydantypes/cloud/gcp/messaging.py
__new__
¶
__new__(value: str) -> PubSubSubscriptionName
Create and validate a new PubSubSubscriptionName instance.
Source code in src/pydantypes/cloud/gcp/messaging.py
PubSubTopicName
¶
Bases: str
A validated GCP Pub/Sub topic name (projects/{project}/topics/{topic}).
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for PubSubTopicName.
-
__get_pydantic_json_schema__–Return the JSON schema for PubSubTopicName.
-
__new__–Create and validate a new PubSubTopicName instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for PubSubTopicName.
Source code in src/pydantypes/cloud/gcp/messaging.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for PubSubTopicName.
Source code in src/pydantypes/cloud/gcp/messaging.py
__new__
¶
__new__(value: str) -> PubSubTopicName
Create and validate a new PubSubTopicName instance.
Source code in src/pydantypes/cloud/gcp/messaging.py
Region
¶
Bases: StrEnum
GCP cloud regions.
SecretManagerSecretName
¶
Bases: str
A validated GCP Secret Manager secret name (projects/{project}/secrets/{secret}).
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for SecretManagerSecretName.
-
__get_pydantic_json_schema__–Return the JSON schema for SecretManagerSecretName.
-
__new__–Create and validate a new SecretManagerSecretName instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for SecretManagerSecretName.
Source code in src/pydantypes/cloud/gcp/security.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for SecretManagerSecretName.
Source code in src/pydantypes/cloud/gcp/security.py
__new__
¶
__new__(value: str) -> SecretManagerSecretName
Create and validate a new SecretManagerSecretName instance.
Source code in src/pydantypes/cloud/gcp/security.py
SecretManagerVersionName
¶
Bases: str
A validated GCP Secret Manager version name.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for SecretManagerVersionName.
-
__get_pydantic_json_schema__–Return the JSON schema for SecretManagerVersionName.
-
__new__–Create and validate a new SecretManagerVersionName instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for SecretManagerVersionName.
Source code in src/pydantypes/cloud/gcp/security.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for SecretManagerVersionName.
Source code in src/pydantypes/cloud/gcp/security.py
__new__
¶
__new__(value: str) -> SecretManagerVersionName
Create and validate a new SecretManagerVersionName instance.
Source code in src/pydantypes/cloud/gcp/security.py
ServiceAccountEmail
¶
Bases: str
A validated GCP service account email.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for ServiceAccountEmail.
-
__get_pydantic_json_schema__–Return the JSON schema for ServiceAccountEmail.
-
__new__–Create and validate a new ServiceAccountEmail instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for ServiceAccountEmail.
Source code in src/pydantypes/cloud/gcp/identity.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for ServiceAccountEmail.
Source code in src/pydantypes/cloud/gcp/identity.py
__new__
¶
__new__(value: str) -> ServiceAccountEmail
Create and validate a new ServiceAccountEmail instance.
Source code in src/pydantypes/cloud/gcp/identity.py
Zone
¶
Bases: str
A validated GCP zone (e.g. us-central1-a).
GCP zones use globally consistent names ({region}-{letter}), unlike AWS and Azure where zone names are randomly mapped per account/subscription. This makes GCP zones the only cloud provider zones worth validating as a type with parsed properties (.region, .zone_letter).
Source: https://cloud.google.com/compute/docs/regions-zones
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for Zone.
-
__get_pydantic_json_schema__–Return the JSON schema for Zone.
-
__new__–Create and validate a new Zone instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for Zone.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for Zone.
Source code in src/pydantypes/cloud/gcp/region.py
__new__
¶
__new__(value: str) -> Zone
Create and validate a new Zone instance.