Skip to content

Commit

Permalink
Merge pull request #9 from devopsarr/feature/code-generation
Browse files Browse the repository at this point in the history
fix(devopsarr/sonarr-py#6): remove timespan validator
  • Loading branch information
devopsarr[bot] committed Mar 27, 2023
2 parents bfd230e + fc6e380 commit f42a8ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
8 changes: 1 addition & 7 deletions radarr/models/command_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, validator
from pydantic import BaseModel
from radarr.models.command import Command
from radarr.models.command_priority import CommandPriority
from radarr.models.command_status import CommandStatus
Expand Down Expand Up @@ -50,12 +50,6 @@ class CommandResource(BaseModel):
last_execution_time: Optional[datetime]
__properties = ["id", "name", "commandName", "message", "body", "priority", "status", "queued", "started", "ended", "duration", "exception", "trigger", "clientUserAgent", "stateChangeTime", "sendUpdatesToClient", "updateScheduledTask", "lastExecutionTime"]

@validator('duration')
def duration_validate_regular_expression(cls, v):
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
return v

class Config:
allow_population_by_field_name = True
validate_assignment = True
Expand Down
8 changes: 1 addition & 7 deletions radarr/models/queue_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, validator
from pydantic import BaseModel
from radarr.models.custom_format_resource import CustomFormatResource
from radarr.models.download_protocol import DownloadProtocol
from radarr.models.language import Language
Expand Down Expand Up @@ -57,12 +57,6 @@ class QueueResource(BaseModel):
output_path: Optional[str]
__properties = ["id", "movieId", "movie", "languages", "quality", "customFormats", "size", "title", "sizeleft", "timeleft", "estimatedCompletionTime", "status", "trackedDownloadStatus", "trackedDownloadState", "statusMessages", "errorMessage", "downloadId", "protocol", "downloadClient", "indexer", "outputPath"]

@validator('timeleft')
def timeleft_validate_regular_expression(cls, v):
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
return v

class Config:
allow_population_by_field_name = True
validate_assignment = True
Expand Down
8 changes: 1 addition & 7 deletions radarr/models/task_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, validator
from pydantic import BaseModel

class TaskResource(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand All @@ -36,12 +36,6 @@ class TaskResource(BaseModel):
last_duration: Optional[str]
__properties = ["id", "name", "taskName", "interval", "lastExecution", "lastStartTime", "nextExecution", "lastDuration"]

@validator('last_duration')
def last_duration_validate_regular_expression(cls, v):
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
return v

class Config:
allow_population_by_field_name = True
validate_assignment = True
Expand Down

0 comments on commit f42a8ee

Please sign in to comment.