# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import proto  # type: ignore

from google.cloud.sql_v1.types import cloud_sql_resources


__protobuf__ = proto.module(
    package='google.cloud.sql.v1',
    manifest={
        'SqlSslCertsDeleteRequest',
        'SqlSslCertsGetRequest',
        'SqlSslCertsInsertRequest',
        'SqlSslCertsListRequest',
        'SslCertsInsertRequest',
        'SslCertsInsertResponse',
        'SslCertsListResponse',
    },
)


class SqlSslCertsDeleteRequest(proto.Message):
    r"""

    Attributes:
        instance (str):
            Cloud SQL instance ID. This does not include
            the project ID.
        project (str):
            Project ID of the project that contains the
            instance.
        sha1_fingerprint (str):
            Sha1 FingerPrint.
    """

    instance = proto.Field(
        proto.STRING,
        number=1,
    )
    project = proto.Field(
        proto.STRING,
        number=2,
    )
    sha1_fingerprint = proto.Field(
        proto.STRING,
        number=3,
    )


class SqlSslCertsGetRequest(proto.Message):
    r"""

    Attributes:
        instance (str):
            Cloud SQL instance ID. This does not include
            the project ID.
        project (str):
            Project ID of the project that contains the
            instance.
        sha1_fingerprint (str):
            Sha1 FingerPrint.
    """

    instance = proto.Field(
        proto.STRING,
        number=1,
    )
    project = proto.Field(
        proto.STRING,
        number=2,
    )
    sha1_fingerprint = proto.Field(
        proto.STRING,
        number=3,
    )


class SqlSslCertsInsertRequest(proto.Message):
    r"""

    Attributes:
        instance (str):
            Cloud SQL instance ID. This does not include
            the project ID.
        project (str):
            Project ID of the project that contains the
            instance.
        body (google.cloud.sql_v1.types.SslCertsInsertRequest):

    """

    instance = proto.Field(
        proto.STRING,
        number=1,
    )
    project = proto.Field(
        proto.STRING,
        number=2,
    )
    body = proto.Field(
        proto.MESSAGE,
        number=100,
        message='SslCertsInsertRequest',
    )


class SqlSslCertsListRequest(proto.Message):
    r"""

    Attributes:
        instance (str):
            Cloud SQL instance ID. This does not include
            the project ID.
        project (str):
            Project ID of the project that contains the
            instance.
    """

    instance = proto.Field(
        proto.STRING,
        number=1,
    )
    project = proto.Field(
        proto.STRING,
        number=2,
    )


class SslCertsInsertRequest(proto.Message):
    r"""SslCerts insert request.

    Attributes:
        common_name (str):
            User supplied name.  Must be a distinct name
            from the other certificates for this instance.
    """

    common_name = proto.Field(
        proto.STRING,
        number=1,
    )


class SslCertsInsertResponse(proto.Message):
    r"""SslCert insert response.

    Attributes:
        kind (str):
            This is always **sql#sslCertsInsert**.
        operation (google.cloud.sql_v1.types.Operation):
            The operation to track the ssl certs insert
            request.
        server_ca_cert (google.cloud.sql_v1.types.SslCert):
            The server Certificate Authority's
            certificate.  If this is missing you can force a
            new one to be generated by calling
            resetSslConfig method on instances resource.
        client_cert (google.cloud.sql_v1.types.SslCertDetail):
            The new client certificate and private key.
    """

    kind = proto.Field(
        proto.STRING,
        number=1,
    )
    operation = proto.Field(
        proto.MESSAGE,
        number=2,
        message=cloud_sql_resources.Operation,
    )
    server_ca_cert = proto.Field(
        proto.MESSAGE,
        number=3,
        message=cloud_sql_resources.SslCert,
    )
    client_cert = proto.Field(
        proto.MESSAGE,
        number=4,
        message=cloud_sql_resources.SslCertDetail,
    )


class SslCertsListResponse(proto.Message):
    r"""SslCerts list response.

    Attributes:
        kind (str):
            This is always **sql#sslCertsList**.
        items (Sequence[google.cloud.sql_v1.types.SslCert]):
            List of client certificates for the instance.
    """

    kind = proto.Field(
        proto.STRING,
        number=1,
    )
    items = proto.RepeatedField(
        proto.MESSAGE,
        number=2,
        message=cloud_sql_resources.SslCert,
    )


__all__ = tuple(sorted(__protobuf__.manifest))
