- Create services/contracts workspace package with module magnetflix. - Reconfigure buf.gen.yaml to output stubs once into services/contracts/src. - Remove stubs and docs/api_spec.md from .gitignore and track in Git. - Add public seam tests in tests/test_contracts.py. Closes #1
328 lines
13 KiB
Python
328 lines
13 KiB
Python
"""
|
|
@generated by mypy-protobuf. Do not edit manually!
|
|
isort:skip_file
|
|
"""
|
|
|
|
from collections import abc as _abc
|
|
from google.protobuf import descriptor as _descriptor
|
|
from google.protobuf import message as _message
|
|
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
from google.protobuf.internal import containers as _containers
|
|
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
import builtins as _builtins
|
|
import sys
|
|
import typing as _typing
|
|
|
|
if sys.version_info >= (3, 11):
|
|
from typing import TypeAlias as _TypeAlias, Never as _Never
|
|
else:
|
|
from typing_extensions import TypeAlias as _TypeAlias, Never as _Never
|
|
|
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
|
|
class _JobState:
|
|
ValueType = _typing.NewType("ValueType", _builtins.int)
|
|
V: _TypeAlias = ValueType # noqa: Y015
|
|
|
|
class _JobStateEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_JobState.ValueType], _builtins.type):
|
|
DESCRIPTOR: _descriptor.EnumDescriptor
|
|
JOB_STATE_UNSPECIFIED: _JobState.ValueType # 0
|
|
JOB_STATE_QUEUED: _JobState.ValueType # 1
|
|
JOB_STATE_DOWNLOADING: _JobState.ValueType # 2
|
|
JOB_STATE_SCANNING: _JobState.ValueType # 3
|
|
JOB_STATE_VERIFYING_METADATA: _JobState.ValueType # 4
|
|
JOB_STATE_ORGANIZING: _JobState.ValueType # 5
|
|
JOB_STATE_COMPLETED: _JobState.ValueType # 6
|
|
JOB_STATE_FAILED: _JobState.ValueType # 7
|
|
|
|
class JobState(_JobState, metaclass=_JobStateEnumTypeWrapper):
|
|
"""State enumeration of a download job lifecycle."""
|
|
|
|
JOB_STATE_UNSPECIFIED: JobState.ValueType # 0
|
|
JOB_STATE_QUEUED: JobState.ValueType # 1
|
|
JOB_STATE_DOWNLOADING: JobState.ValueType # 2
|
|
JOB_STATE_SCANNING: JobState.ValueType # 3
|
|
JOB_STATE_VERIFYING_METADATA: JobState.ValueType # 4
|
|
JOB_STATE_ORGANIZING: JobState.ValueType # 5
|
|
JOB_STATE_COMPLETED: JobState.ValueType # 6
|
|
JOB_STATE_FAILED: JobState.ValueType # 7
|
|
Global___JobState: _TypeAlias = JobState # noqa: Y015
|
|
|
|
@_typing.final
|
|
class SubmitDownloadRequest(_message.Message):
|
|
"""Request to submit a new movie download."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
MAGNET_URI_FIELD_NUMBER: _builtins.int
|
|
IMDB_ID_FIELD_NUMBER: _builtins.int
|
|
REQUESTED_BY_FIELD_NUMBER: _builtins.int
|
|
magnet_uri: _builtins.str
|
|
"""Magnet URI of the torrent to fetch."""
|
|
imdb_id: _builtins.str
|
|
"""IMDb ID of the movie (e.g., "tt1375666")."""
|
|
requested_by: _builtins.str
|
|
"""Username of the user requesting the download (from Authelia Remote-User)."""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
magnet_uri: _builtins.str = ...,
|
|
imdb_id: _builtins.str = ...,
|
|
requested_by: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["imdb_id", b"imdb_id", "magnet_uri", b"magnet_uri", "requested_by", b"requested_by"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___SubmitDownloadRequest: _TypeAlias = SubmitDownloadRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class SubmitDownloadResponse(_message.Message):
|
|
"""Response acknowledging the job submission."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_ID_FIELD_NUMBER: _builtins.int
|
|
MESSAGE_FIELD_NUMBER: _builtins.int
|
|
job_id: _builtins.str
|
|
"""Unique identifier for the created job."""
|
|
message: _builtins.str
|
|
"""Human-readable message."""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job_id: _builtins.str = ...,
|
|
message: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["job_id", b"job_id", "message", b"message"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___SubmitDownloadResponse: _TypeAlias = SubmitDownloadResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class GetJobRequest(_message.Message):
|
|
"""Request to fetch a specific job by ID."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_ID_FIELD_NUMBER: _builtins.int
|
|
job_id: _builtins.str
|
|
"""Unique job identifier."""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job_id: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["job_id", b"job_id"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___GetJobRequest: _TypeAlias = GetJobRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class GetJobResponse(_message.Message):
|
|
"""Response containing the status of the requested job."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def job(self) -> Global___JobStatus:
|
|
"""The retrieved job details."""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job: Global___JobStatus | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["job", b"job"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["job", b"job"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___GetJobResponse: _TypeAlias = GetJobResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class StreamJobStatusRequest(_message.Message):
|
|
"""Request to stream job updates."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_ID_FIELD_NUMBER: _builtins.int
|
|
job_id: _builtins.str
|
|
"""Optional job ID to filter updates for a single job; if empty, streams all active jobs."""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job_id: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["job_id", b"job_id"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___StreamJobStatusRequest: _TypeAlias = StreamJobStatusRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class StreamJobStatusResponse(_message.Message):
|
|
"""Real-time job status event stream frame."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_FIELD_NUMBER: _builtins.int
|
|
@_builtins.property
|
|
def job(self) -> Global___JobStatus:
|
|
"""Current job status update."""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job: Global___JobStatus | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["job", b"job"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["job", b"job"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___StreamJobStatusResponse: _TypeAlias = StreamJobStatusResponse # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ListJobsRequest(_message.Message):
|
|
"""Request to list jobs with pagination and state filtering."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
PAGE_SIZE_FIELD_NUMBER: _builtins.int
|
|
PAGE_TOKEN_FIELD_NUMBER: _builtins.int
|
|
STATE_FILTER_FIELD_NUMBER: _builtins.int
|
|
page_size: _builtins.int
|
|
"""Maximum number of jobs to return per page (default: 20, max: 100)."""
|
|
page_token: _builtins.str
|
|
"""Page token received from a previous ListJobsResponse next_page_token."""
|
|
state_filter: Global___JobState.ValueType
|
|
"""Optional filter by job state."""
|
|
def __init__(
|
|
self,
|
|
*,
|
|
page_size: _builtins.int = ...,
|
|
page_token: _builtins.str = ...,
|
|
state_filter: Global___JobState.ValueType = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["page_size", b"page_size", "page_token", b"page_token", "state_filter", b"state_filter"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___ListJobsRequest: _TypeAlias = ListJobsRequest # noqa: Y015
|
|
|
|
@_typing.final
|
|
class JobStatus(_message.Message):
|
|
"""Full status information for a download job."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOB_ID_FIELD_NUMBER: _builtins.int
|
|
IMDB_ID_FIELD_NUMBER: _builtins.int
|
|
TITLE_FIELD_NUMBER: _builtins.int
|
|
YEAR_FIELD_NUMBER: _builtins.int
|
|
REQUESTED_BY_FIELD_NUMBER: _builtins.int
|
|
STATE_FIELD_NUMBER: _builtins.int
|
|
PROGRESS_PCT_FIELD_NUMBER: _builtins.int
|
|
DOWNLOAD_RATE_BYTES_FIELD_NUMBER: _builtins.int
|
|
ERROR_MESSAGE_FIELD_NUMBER: _builtins.int
|
|
CREATED_AT_FIELD_NUMBER: _builtins.int
|
|
UPDATED_AT_FIELD_NUMBER: _builtins.int
|
|
COMPLETED_AT_FIELD_NUMBER: _builtins.int
|
|
job_id: _builtins.str
|
|
"""Unique job ID."""
|
|
imdb_id: _builtins.str
|
|
"""IMDb ID."""
|
|
title: _builtins.str
|
|
"""Resolved movie title from TMDB (if available)."""
|
|
year: _builtins.int
|
|
"""Resolved release year from TMDB (if available)."""
|
|
requested_by: _builtins.str
|
|
"""User who requested the download."""
|
|
state: Global___JobState.ValueType
|
|
"""Current state in the pipeline."""
|
|
progress_pct: _builtins.float
|
|
"""Download progress percentage (0.0 to 100.0)."""
|
|
download_rate_bytes: _builtins.int
|
|
"""Download speed in bytes per second."""
|
|
error_message: _builtins.str
|
|
"""Detailed error message if the job failed."""
|
|
@_builtins.property
|
|
def created_at(self) -> _timestamp_pb2.Timestamp:
|
|
"""Timestamp when the job was enqueued."""
|
|
|
|
@_builtins.property
|
|
def updated_at(self) -> _timestamp_pb2.Timestamp:
|
|
"""Timestamp when the job status or progress was last updated."""
|
|
|
|
@_builtins.property
|
|
def completed_at(self) -> _timestamp_pb2.Timestamp:
|
|
"""Timestamp when terminal processing finished (COMPLETED or FAILED)."""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
job_id: _builtins.str = ...,
|
|
imdb_id: _builtins.str = ...,
|
|
title: _builtins.str = ...,
|
|
year: _builtins.int = ...,
|
|
requested_by: _builtins.str = ...,
|
|
state: Global___JobState.ValueType = ...,
|
|
progress_pct: _builtins.float = ...,
|
|
download_rate_bytes: _builtins.int = ...,
|
|
error_message: _builtins.str = ...,
|
|
created_at: _timestamp_pb2.Timestamp | None = ...,
|
|
updated_at: _timestamp_pb2.Timestamp | None = ...,
|
|
completed_at: _timestamp_pb2.Timestamp | None = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _typing.Literal["completed_at", b"completed_at", "created_at", b"created_at", "updated_at", b"updated_at"] # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["completed_at", b"completed_at", "created_at", b"created_at", "download_rate_bytes", b"download_rate_bytes", "error_message", b"error_message", "imdb_id", b"imdb_id", "job_id", b"job_id", "progress_pct", b"progress_pct", "requested_by", b"requested_by", "state", b"state", "title", b"title", "updated_at", b"updated_at", "year", b"year"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___JobStatus: _TypeAlias = JobStatus # noqa: Y015
|
|
|
|
@_typing.final
|
|
class ListJobsResponse(_message.Message):
|
|
"""Paginated response containing a list of download jobs."""
|
|
|
|
DESCRIPTOR: _descriptor.Descriptor
|
|
|
|
JOBS_FIELD_NUMBER: _builtins.int
|
|
NEXT_PAGE_TOKEN_FIELD_NUMBER: _builtins.int
|
|
next_page_token: _builtins.str
|
|
"""Token to retrieve the next page of results, or empty if no more results."""
|
|
@_builtins.property
|
|
def jobs(self) -> _containers.RepeatedCompositeFieldContainer[Global___JobStatus]:
|
|
"""List of matching jobs for the current page."""
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
jobs: _abc.Iterable[Global___JobStatus] | None = ...,
|
|
next_page_token: _builtins.str = ...,
|
|
) -> None: ...
|
|
_HasFieldArgType: _TypeAlias = _Never # noqa: Y015
|
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
_ClearFieldArgType: _TypeAlias = _typing.Literal["jobs", b"jobs", "next_page_token", b"next_page_token"] # noqa: Y015
|
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
def WhichOneof(self, oneof_group: _Never) -> None: ...
|
|
|
|
Global___ListJobsResponse: _TypeAlias = ListJobsResponse # noqa: Y015
|