"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import typing
import yandex.cloud.datatransfer.v1.endpoint.common_pb2

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class OnPremiseMysql(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PORT_FIELD_NUMBER: builtins.int
    SUBNET_ID_FIELD_NUMBER: builtins.int
    HOSTS_FIELD_NUMBER: builtins.int
    TLS_MODE_FIELD_NUMBER: builtins.int
    port: builtins.int
    """Port for the database connection"""
    subnet_id: builtins.str
    """Identifier of the Yandex Cloud VPC subnetwork to user for accessing the
    database.
    If omitted, the server has to be accessible via Internet
    """
    @property
    def hosts(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of host names of the MySQL server. Exactly one host is expected"""

    @property
    def tls_mode(self) -> yandex.cloud.datatransfer.v1.endpoint.common_pb2.TLSMode:
        """TLS settings for server connection. Disabled by default."""

    def __init__(
        self,
        *,
        port: builtins.int = ...,
        subnet_id: builtins.str = ...,
        hosts: collections.abc.Iterable[builtins.str] | None = ...,
        tls_mode: yandex.cloud.datatransfer.v1.endpoint.common_pb2.TLSMode | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["tls_mode", b"tls_mode"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["hosts", b"hosts", "port", b"port", "subnet_id", b"subnet_id", "tls_mode", b"tls_mode"]) -> None: ...

global___OnPremiseMysql = OnPremiseMysql

@typing.final
class MysqlConnection(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    MDB_CLUSTER_ID_FIELD_NUMBER: builtins.int
    ON_PREMISE_FIELD_NUMBER: builtins.int
    CONNECTION_MANAGER_CONNECTION_FIELD_NUMBER: builtins.int
    mdb_cluster_id: builtins.str
    """Managed Service for MySQL cluster ID"""
    @property
    def on_premise(self) -> global___OnPremiseMysql:
        """Connection options for on-premise MySQL"""

    @property
    def connection_manager_connection(self) -> yandex.cloud.datatransfer.v1.endpoint.common_pb2.ConnectionManagerConnection:
        """Get Mysql installation params and credentials from Connection Manager"""

    def __init__(
        self,
        *,
        mdb_cluster_id: builtins.str = ...,
        on_premise: global___OnPremiseMysql | None = ...,
        connection_manager_connection: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ConnectionManagerConnection | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["connection", b"connection", "connection_manager_connection", b"connection_manager_connection", "mdb_cluster_id", b"mdb_cluster_id", "on_premise", b"on_premise"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["connection", b"connection", "connection_manager_connection", b"connection_manager_connection", "mdb_cluster_id", b"mdb_cluster_id", "on_premise", b"on_premise"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["connection", b"connection"]) -> typing.Literal["mdb_cluster_id", "on_premise", "connection_manager_connection"] | None: ...

global___MysqlConnection = MysqlConnection

@typing.final
class MysqlObjectTransferSettings(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    VIEW_FIELD_NUMBER: builtins.int
    ROUTINE_FIELD_NUMBER: builtins.int
    TRIGGER_FIELD_NUMBER: builtins.int
    TABLES_FIELD_NUMBER: builtins.int
    view: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType
    """Views

    CREATE VIEW ...
    """
    routine: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType
    """Routines

    CREATE PROCEDURE ... ; CREATE FUNCTION ... ;
    """
    trigger: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType
    """Triggers

    CREATE TRIGGER ...
    """
    tables: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType
    def __init__(
        self,
        *,
        view: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType = ...,
        routine: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType = ...,
        trigger: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType = ...,
        tables: yandex.cloud.datatransfer.v1.endpoint.common_pb2.ObjectTransferStage.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["routine", b"routine", "tables", b"tables", "trigger", b"trigger", "view", b"view"]) -> None: ...

global___MysqlObjectTransferSettings = MysqlObjectTransferSettings

@typing.final
class MysqlSource(google.protobuf.message.Message):
    """Settings specific to the MySQL source endpoint"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CONNECTION_FIELD_NUMBER: builtins.int
    DATABASE_FIELD_NUMBER: builtins.int
    USER_FIELD_NUMBER: builtins.int
    PASSWORD_FIELD_NUMBER: builtins.int
    TIMEZONE_FIELD_NUMBER: builtins.int
    OBJECT_TRANSFER_SETTINGS_FIELD_NUMBER: builtins.int
    INCLUDE_TABLES_REGEX_FIELD_NUMBER: builtins.int
    EXCLUDE_TABLES_REGEX_FIELD_NUMBER: builtins.int
    SECURITY_GROUPS_FIELD_NUMBER: builtins.int
    SERVICE_DATABASE_FIELD_NUMBER: builtins.int
    database: builtins.str
    """Name of the database to transfer

    You can leave it empty, then it will be possible to transfer tables from several
    databases at the same time from this source.
    """
    user: builtins.str
    """User for database access. Required unless connection manager connection is used"""
    timezone: builtins.str
    """Database timezone

    Is used for parsing timestamps for saving source timezones. Accepts values from
    IANA timezone database. Default: local timezone.
    """
    service_database: builtins.str
    """Database for service tables
    Default: data source database. Here created technical tables (__tm_keeper,
    __tm_gtid_keeper).
    """
    @property
    def connection(self) -> global___MysqlConnection:
        """Database connection settings"""

    @property
    def password(self) -> yandex.cloud.datatransfer.v1.endpoint.common_pb2.Secret:
        """Password for database access."""

    @property
    def object_transfer_settings(self) -> global___MysqlObjectTransferSettings:
        """Schema migration
        Defines which database schema objects should be transferred, e.g. views,
        routines, etc. 
        All of the attrubutes in the block are optional and should be either
        `BEFORE_DATA`, `AFTER_DATA` or `NEVER`."
        """

    @property
    def include_tables_regex(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of regular expressions of table names which should be transferred. A table
        name is formatted as schemaname.tablename. For example, a single regular
        expression may look like `^mydb.employees$`
        """

    @property
    def exclude_tables_regex(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Opposite of `include_table_regex`. The tables matching the specified regular
        expressions will not be transferred
        """

    @property
    def security_groups(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of security groups that the transfer associated with this endpoint should
        use
        """

    def __init__(
        self,
        *,
        connection: global___MysqlConnection | None = ...,
        database: builtins.str = ...,
        user: builtins.str = ...,
        password: yandex.cloud.datatransfer.v1.endpoint.common_pb2.Secret | None = ...,
        timezone: builtins.str = ...,
        object_transfer_settings: global___MysqlObjectTransferSettings | None = ...,
        include_tables_regex: collections.abc.Iterable[builtins.str] | None = ...,
        exclude_tables_regex: collections.abc.Iterable[builtins.str] | None = ...,
        security_groups: collections.abc.Iterable[builtins.str] | None = ...,
        service_database: builtins.str = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["connection", b"connection", "object_transfer_settings", b"object_transfer_settings", "password", b"password"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["connection", b"connection", "database", b"database", "exclude_tables_regex", b"exclude_tables_regex", "include_tables_regex", b"include_tables_regex", "object_transfer_settings", b"object_transfer_settings", "password", b"password", "security_groups", b"security_groups", "service_database", b"service_database", "timezone", b"timezone", "user", b"user"]) -> None: ...

global___MysqlSource = MysqlSource

@typing.final
class MysqlTarget(google.protobuf.message.Message):
    """Settings specific to the MySQL target endpoint"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CONNECTION_FIELD_NUMBER: builtins.int
    DATABASE_FIELD_NUMBER: builtins.int
    USER_FIELD_NUMBER: builtins.int
    PASSWORD_FIELD_NUMBER: builtins.int
    SQL_MODE_FIELD_NUMBER: builtins.int
    SKIP_CONSTRAINT_CHECKS_FIELD_NUMBER: builtins.int
    TIMEZONE_FIELD_NUMBER: builtins.int
    CLEANUP_POLICY_FIELD_NUMBER: builtins.int
    SERVICE_DATABASE_FIELD_NUMBER: builtins.int
    SECURITY_GROUPS_FIELD_NUMBER: builtins.int
    IS_SCHEMA_MIGRATION_DISABLED_FIELD_NUMBER: builtins.int
    database: builtins.str
    """Database name

    Allowed to leave it empty, then the tables will be created in databases with the
    same names as on the source. If this field is empty, then you must fill below db
    schema for service table.
    """
    user: builtins.str
    """User for database access. Required unless connection manager connection is used"""
    sql_mode: builtins.str
    """[sql_mode](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) to use when
    interacting with the server. 
    Defaults to `NO_AUTO_VALUE_ON_ZERO,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION`
    """
    skip_constraint_checks: builtins.bool
    """Disable constraints checks
    When `true`, disables foreign key checks and unique checks. `False` by default.
    See
    [foreign_key_checks](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_foreign_key_checks).
    Recommend to disable for increase replication speed unless schema contains
    cascading operations
    """
    timezone: builtins.str
    """Database timezone

    Is used for parsing timestamps for saving source timezones. Accepts values from
    IANA timezone database. Default: local timezone.
    """
    cleanup_policy: yandex.cloud.datatransfer.v1.endpoint.common_pb2.CleanupPolicy.ValueType
    """Cleanup policy for activate, reactivate and reupload processes.  
    One of `DISABLED`, `DROP` or `TRUNCATE` Default is `DISABLED`.
    """
    service_database: builtins.str
    """Database schema for service table
    Default: db name. Here created technical tables (__tm_keeper, __tm_gtid_keeper).
    """
    is_schema_migration_disabled: builtins.bool
    """Whether can change table schema if schema changed on source"""
    @property
    def connection(self) -> global___MysqlConnection:
        """Database connection settings"""

    @property
    def password(self) -> yandex.cloud.datatransfer.v1.endpoint.common_pb2.Secret:
        """Password for database access."""

    @property
    def security_groups(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of security groups that the transfer associated with this endpoint should
        use
        """

    def __init__(
        self,
        *,
        connection: global___MysqlConnection | None = ...,
        database: builtins.str = ...,
        user: builtins.str = ...,
        password: yandex.cloud.datatransfer.v1.endpoint.common_pb2.Secret | None = ...,
        sql_mode: builtins.str = ...,
        skip_constraint_checks: builtins.bool = ...,
        timezone: builtins.str = ...,
        cleanup_policy: yandex.cloud.datatransfer.v1.endpoint.common_pb2.CleanupPolicy.ValueType = ...,
        service_database: builtins.str = ...,
        security_groups: collections.abc.Iterable[builtins.str] | None = ...,
        is_schema_migration_disabled: builtins.bool = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["connection", b"connection", "password", b"password"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["cleanup_policy", b"cleanup_policy", "connection", b"connection", "database", b"database", "is_schema_migration_disabled", b"is_schema_migration_disabled", "password", b"password", "security_groups", b"security_groups", "service_database", b"service_database", "skip_constraint_checks", b"skip_constraint_checks", "sql_mode", b"sql_mode", "timezone", b"timezone", "user", b"user"]) -> None: ...

global___MysqlTarget = MysqlTarget
