Skip to content

Commit

Permalink
fix(#6): remove timespan validator
Browse files Browse the repository at this point in the history
  • Loading branch information
devopsarr[bot] committed Mar 27, 2023
1 parent fbdaa0f commit b961b16
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions sonarr/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 sonarr.models.command import Command
from sonarr.models.command_priority import CommandPriority
from sonarr.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 sonarr/models/import_list_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


from typing import List, Optional
from pydantic import BaseModel, validator
from pydantic import BaseModel
from sonarr.models.field import Field
from sonarr.models.import_list_type import ImportListType
from sonarr.models.monitor_types import MonitorTypes
Expand Down Expand Up @@ -52,12 +52,6 @@ class ImportListResource(BaseModel):
min_refresh_interval: Optional[str]
__properties = ["id", "name", "fields", "implementationName", "implementation", "configContract", "infoLink", "message", "tags", "presets", "enableAutomaticAdd", "shouldMonitor", "rootFolderPath", "qualityProfileId", "seriesType", "seasonFolder", "listType", "listOrder", "minRefreshInterval"]

@validator('min_refresh_interval')
def min_refresh_interval_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 sonarr/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 sonarr.models.custom_format_resource import CustomFormatResource
from sonarr.models.download_protocol import DownloadProtocol
from sonarr.models.episode_resource import EpisodeResource
Expand Down Expand Up @@ -60,12 +60,6 @@ class QueueResource(BaseModel):
output_path: Optional[str]
__properties = ["id", "seriesId", "episodeId", "series", "episode", "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 sonarr/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 b961b16

Please sign in to comment.