"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2025 Phonexia s.r.o.

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.

Phonexia Replay Attack Detection gRPC API.
"""

import builtins
import google.protobuf.descriptor
import google.protobuf.duration_pb2
import google.protobuf.message
import phonexia.grpc.common.core_pb2
import sys
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class DetectRequest(google.protobuf.message.Message):
    """The top level message sent by the client for the <code>Detect</code> method."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    AUDIO_FIELD_NUMBER: builtins.int
    @property
    def audio(self) -> phonexia.grpc.common.core_pb2.Audio:
        """Audio data for replay attack detection.
        Technically, the audio must have at least 0.05 seconds of speech. If the audio is shorter,
        the <code>result</code> will not be present in the output. Practically, at least few seconds
        of audio should be provided for better results.
        """

    def __init__(
        self,
        *,
        audio: phonexia.grpc.common.core_pb2.Audio | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["audio", b"audio"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["audio", b"audio"]) -> None: ...

Global___DetectRequest: typing_extensions.TypeAlias = DetectRequest

@typing.final
class DetectResponse(google.protobuf.message.Message):
    """The top level message returned to the client by the <code>Detect</code> method."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    RESULT_FIELD_NUMBER: builtins.int
    PROCESSED_AUDIO_LENGTH_FIELD_NUMBER: builtins.int
    @property
    def result(self) -> Global___DetectResult:
        """Result of replay attack detection. Will not be present if the audio is shorter than 0.05 seconds."""

    @property
    def processed_audio_length(self) -> google.protobuf.duration_pb2.Duration:
        """Total length of the processed audio."""

    def __init__(
        self,
        *,
        result: Global___DetectResult | None = ...,
        processed_audio_length: google.protobuf.duration_pb2.Duration | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["_result", b"_result", "processed_audio_length", b"processed_audio_length", "result", b"result"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["_result", b"_result", "processed_audio_length", b"processed_audio_length", "result", b"result"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["_result", b"_result"]) -> typing.Literal["result"] | None: ...

Global___DetectResponse: typing_extensions.TypeAlias = DetectResponse

@typing.final
class DetectResult(google.protobuf.message.Message):
    """Message representing the result of replay attack detection."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SCORE_FIELD_NUMBER: builtins.int
    score: builtins.float
    """Log-likelihood ratio (LLR) of the replay attack detection. The score is a
    floating-point value. A value greater than 0 indicates the audio likely contains
    a replay attack, while a value less than 0 indicates, that the audio probably does
    not contain a replay attack.
    """
    def __init__(
        self,
        *,
        score: builtins.float = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["score", b"score"]) -> None: ...

Global___DetectResult: typing_extensions.TypeAlias = DetectResult
