# generated by datamodel-codegen:
#   filename:  schema/security/credentials/gcsCredentials.json
#   timestamp: 2022-04-20T15:52:56+00:00

from __future__ import annotations

from typing import Optional, Union

from pydantic import AnyUrl, BaseModel, Extra, Field


class GCSValues(BaseModel):
    class Config:
        extra = Extra.forbid

    type: Optional[str] = Field(None, description='Google Cloud service account type.')
    projectId: Optional[str] = Field(None, description='Google Cloud project id.')
    privateKeyId: Optional[str] = Field(
        None, description='Google Cloud private key id.'
    )
    privateKey: Optional[str] = Field(None, description='Google Cloud private key.')
    clientEmail: Optional[str] = Field(None, description='Google Cloud email.')
    clientId: Optional[str] = Field(None, description='Google Cloud Client ID.')
    authUri: Optional[AnyUrl] = Field(None, description='Google Cloud auth uri.')
    tokenUri: Optional[AnyUrl] = Field(None, description='Google Cloud token uri.')
    authProviderX509CertUrl: Optional[AnyUrl] = Field(
        None, description='Google Cloud auth provider certificate.'
    )
    clientX509CertUrl: Optional[AnyUrl] = Field(
        None, description='Google Cloud client certificate uri.'
    )


class GCSCredentialsPath(BaseModel):
    __root__: str = Field(..., description='GCS Credentials Path.')


class GCSCredentials(BaseModel):
    class Config:
        extra = Extra.forbid

    gcsConfig: Union[GCSValues, GCSCredentialsPath] = Field(
        ..., description='GCS configs.'
    )
