"""
@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

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

    CAS_FIELD_NUMBER: builtins.int
    @property
    def cas(self) -> global___BatchCompareAndSwapRequest: ...
    def __init__(
        self,
        *,
        cas: global___BatchCompareAndSwapRequest | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["cas", b"cas", "request", b"request"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["cas", b"cas", "request", b"request"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["request", b"request"]) -> typing.Literal["cas"] | None: ...

global___IntegrityStoreRequest = IntegrityStoreRequest

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

    CAS_FIELD_NUMBER: builtins.int
    @property
    def cas(self) -> global___BatchCompareAndSwapResponse: ...
    def __init__(
        self,
        *,
        cas: global___BatchCompareAndSwapResponse | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["cas", b"cas", "response", b"response"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["cas", b"cas", "response", b"response"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["response", b"response"]) -> typing.Literal["cas"] | None: ...

global___IntegrityStoreResponse = IntegrityStoreResponse

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

    REQUESTS_FIELD_NUMBER: builtins.int
    @property
    def requests(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CompareAndSwapRequest]: ...
    def __init__(
        self,
        *,
        requests: collections.abc.Iterable[global___CompareAndSwapRequest] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["requests", b"requests"]) -> None: ...

global___BatchCompareAndSwapRequest = BatchCompareAndSwapRequest

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

    RESPONSES_FIELD_NUMBER: builtins.int
    @property
    def responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CompareAndSwapResponse]: ...
    def __init__(
        self,
        *,
        responses: collections.abc.Iterable[global___CompareAndSwapResponse] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["responses", b"responses"]) -> None: ...

global___BatchCompareAndSwapResponse = BatchCompareAndSwapResponse

@typing.final
class CompareAndSwapRequest(google.protobuf.message.Message):
    """Try to store an entry under the given id.
    If 'expectedCasIndex' is null, the request will only succeed if there is no existing entry stored under that id.
    Otherwise, the store will check that the existing entry is at `expectedCasIndex`, and if it is, it is swapped with 'newValue'.
    If 'newValue' is null then the entry is tombstoned instead. Note that both initial insertion and deletion are atomic as
    well, i.e. two parallel insertions or deletions will have only one succeed.

    Creating an entry -> expectedCasIndex == null, newEntry != null
    Getting an entry -> expectedCasIndex == null, newEntry == null
    Deleting an entry -> expectedCasIndex != null, newEntry == null
    Updating an entry -> expectedCasIndex != null, newEntry != null
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    ID_FIELD_NUMBER: builtins.int
    CONTENT_TYPE_FIELD_NUMBER: builtins.int
    EXPECTEDCASINDEX_FIELD_NUMBER: builtins.int
    NEWVALUE_FIELD_NUMBER: builtins.int
    id: builtins.str
    content_type: builtins.str
    expectedCasIndex: builtins.int
    @property
    def newValue(self) -> global___IntegrityStoreValue: ...
    def __init__(
        self,
        *,
        id: builtins.str = ...,
        content_type: builtins.str = ...,
        expectedCasIndex: builtins.int | None = ...,
        newValue: global___IntegrityStoreValue | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["_expectedCasIndex", b"_expectedCasIndex", "_newValue", b"_newValue", "expectedCasIndex", b"expectedCasIndex", "newValue", b"newValue"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["_expectedCasIndex", b"_expectedCasIndex", "_newValue", b"_newValue", "content_type", b"content_type", "expectedCasIndex", b"expectedCasIndex", "id", b"id", "newValue", b"newValue"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_expectedCasIndex", b"_expectedCasIndex"]) -> typing.Literal["expectedCasIndex"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_newValue", b"_newValue"]) -> typing.Literal["newValue"] | None: ...

global___CompareAndSwapRequest = CompareAndSwapRequest

@typing.final
class CompareAndSwapResponse(google.protobuf.message.Message):
    """Response of a CAS operation.
    'swapped' indicates whether the swapping operation was successful. Regardless of success the previous value is
    returned, null meaning that there was no value associated with the id.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SWAPPED_FIELD_NUMBER: builtins.int
    PREVIOUSCASINDEX_FIELD_NUMBER: builtins.int
    PREVIOUSVALUE_FIELD_NUMBER: builtins.int
    swapped: builtins.bool
    previousCasIndex: builtins.int
    @property
    def previousValue(self) -> global___IntegrityStoreValue: ...
    def __init__(
        self,
        *,
        swapped: builtins.bool = ...,
        previousCasIndex: builtins.int | None = ...,
        previousValue: global___IntegrityStoreValue | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["_previousCasIndex", b"_previousCasIndex", "_previousValue", b"_previousValue", "previousCasIndex", b"previousCasIndex", "previousValue", b"previousValue"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["_previousCasIndex", b"_previousCasIndex", "_previousValue", b"_previousValue", "previousCasIndex", b"previousCasIndex", "previousValue", b"previousValue", "swapped", b"swapped"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_previousCasIndex", b"_previousCasIndex"]) -> typing.Literal["previousCasIndex"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_previousValue", b"_previousValue"]) -> typing.Literal["previousValue"] | None: ...

global___CompareAndSwapResponse = CompareAndSwapResponse

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

    VERSION_FIELD_NUMBER: builtins.int
    PLAINTEXTCONTENT_FIELD_NUMBER: builtins.int
    PLAINTEXTSIGNATURE_FIELD_NUMBER: builtins.int
    ENCRYPTEDCONTENT_FIELD_NUMBER: builtins.int
    version: builtins.int
    """/ Specifies how to interpret the "content" and "signature" fields
    / (e.g. what algorithm was used when creating the signature).
    """
    plaintextContent: builtins.str
    """/ Generic stringified payload"""
    plaintextSignature: builtins.bytes
    """/ Signature over (content, contentType, version, id)"""
    encryptedContent: builtins.bytes
    """/ Encrypted payload"""
    def __init__(
        self,
        *,
        version: builtins.int = ...,
        plaintextContent: builtins.str | None = ...,
        plaintextSignature: builtins.bytes | None = ...,
        encryptedContent: builtins.bytes | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["_encryptedContent", b"_encryptedContent", "_plaintextContent", b"_plaintextContent", "_plaintextSignature", b"_plaintextSignature", "encryptedContent", b"encryptedContent", "plaintextContent", b"plaintextContent", "plaintextSignature", b"plaintextSignature"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["_encryptedContent", b"_encryptedContent", "_plaintextContent", b"_plaintextContent", "_plaintextSignature", b"_plaintextSignature", "encryptedContent", b"encryptedContent", "plaintextContent", b"plaintextContent", "plaintextSignature", b"plaintextSignature", "version", b"version"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_encryptedContent", b"_encryptedContent"]) -> typing.Literal["encryptedContent"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_plaintextContent", b"_plaintextContent"]) -> typing.Literal["plaintextContent"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["_plaintextSignature", b"_plaintextSignature"]) -> typing.Literal["plaintextSignature"] | None: ...

global___IntegrityStoreValue = IntegrityStoreValue
