Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#5): httpuri to string #7

Merged
merged 3 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ docs/HistoryResource.md
docs/HistoryResourcePagingResource.md
docs/HostConfigApi.md
docs/HostConfigResource.md
docs/HttpUri.md
docs/ImportListApi.md
docs/ImportListExclusionApi.md
docs/ImportListExclusionResource.md
Expand Down Expand Up @@ -178,7 +177,6 @@ docs/TagDetailsResource.md
docs/TagResource.md
docs/TaskApi.md
docs/TaskResource.md
docs/TimeSpan.md
docs/TrackedDownloadState.md
docs/TrackedDownloadStatus.md
docs/TrackedDownloadStatusMessage.md
Expand Down Expand Up @@ -306,7 +304,6 @@ sonarr/models/health_resource.py
sonarr/models/history_resource.py
sonarr/models/history_resource_paging_resource.py
sonarr/models/host_config_resource.py
sonarr/models/http_uri.py
sonarr/models/import_list_exclusion_resource.py
sonarr/models/import_list_resource.py
sonarr/models/import_list_type.py
Expand Down Expand Up @@ -379,7 +376,6 @@ sonarr/models/system_resource.py
sonarr/models/tag_details_resource.py
sonarr/models/tag_resource.py
sonarr/models/task_resource.py
sonarr/models/time_span.py
sonarr/models/tracked_download_state.py
sonarr/models/tracked_download_status.py
sonarr/models/tracked_download_status_message.py
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Sonarr API docs
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 3.0.0
- Package version: 0.0.1
- Package version: 0.5.1
- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen

## Requirements.
Expand Down Expand Up @@ -295,7 +295,7 @@ Class | Method | HTTP request | Description
*SeriesEditorApi* | [**delete_series_editor**](docs/SeriesEditorApi.md#delete_series_editor) | **DELETE** /api/v3/series/editor |
*SeriesEditorApi* | [**put_series_editor**](docs/SeriesEditorApi.md#put_series_editor) | **PUT** /api/v3/series/editor |
*SeriesImportApi* | [**create_series_import**](docs/SeriesImportApi.md#create_series_import) | **POST** /api/v3/series/import |
*SeriesLookupApi* | [**get_series_lookup**](docs/SeriesLookupApi.md#get_series_lookup) | **GET** /api/v3/series/lookup |
*SeriesLookupApi* | [**list_series_lookup**](docs/SeriesLookupApi.md#list_series_lookup) | **GET** /api/v3/series/lookup |
*StaticResourceApi* | [**get**](docs/StaticResourceApi.md#get) | **GET** / |
*StaticResourceApi* | [**get_by_path**](docs/StaticResourceApi.md#get_by_path) | **GET** /{path} |
*StaticResourceApi* | [**get_content_by_path**](docs/StaticResourceApi.md#get_content_by_path) | **GET** /content/{path} |
Expand Down Expand Up @@ -364,7 +364,6 @@ Class | Method | HTTP request | Description
- [HistoryResource](docs/HistoryResource.md)
- [HistoryResourcePagingResource](docs/HistoryResourcePagingResource.md)
- [HostConfigResource](docs/HostConfigResource.md)
- [HttpUri](docs/HttpUri.md)
- [ImportListExclusionResource](docs/ImportListExclusionResource.md)
- [ImportListResource](docs/ImportListResource.md)
- [ImportListType](docs/ImportListType.md)
Expand Down Expand Up @@ -437,7 +436,6 @@ Class | Method | HTTP request | Description
- [TagDetailsResource](docs/TagDetailsResource.md)
- [TagResource](docs/TagResource.md)
- [TaskResource](docs/TaskResource.md)
- [TimeSpan](docs/TimeSpan.md)
- [TrackedDownloadState](docs/TrackedDownloadState.md)
- [TrackedDownloadStatus](docs/TrackedDownloadStatus.md)
- [TrackedDownloadStatusMessage](docs/TrackedDownloadStatusMessage.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/CommandResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Name | Type | Description | Notes
**queued** | **datetime** | | [optional]
**started** | **datetime** | | [optional]
**ended** | **datetime** | | [optional]
**duration** | [**TimeSpan**](TimeSpan.md) | | [optional]
**duration** | **str** | | [optional]
**exception** | **str** | | [optional]
**trigger** | [**CommandTrigger**](CommandTrigger.md) | | [optional]
**client_user_agent** | **str** | | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/HealthResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**source** | **str** | | [optional]
**type** | [**HealthCheckResult**](HealthCheckResult.md) | | [optional]
**message** | **str** | | [optional]
**wiki_url** | [**HttpUri**](HttpUri.md) | | [optional]
**wiki_url** | **str** | | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/ImportListResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Name | Type | Description | Notes
**season_folder** | **bool** | | [optional]
**list_type** | [**ImportListType**](ImportListType.md) | | [optional]
**list_order** | **int** | | [optional]
**min_refresh_interval** | [**TimeSpan**](TimeSpan.md) | | [optional]
**min_refresh_interval** | **str** | | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/QueueResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Name | Type | Description | Notes
**size** | **float** | | [optional]
**title** | **str** | | [optional]
**sizeleft** | **float** | | [optional]
**timeleft** | [**TimeSpan**](TimeSpan.md) | | [optional]
**timeleft** | **str** | | [optional]
**estimated_completion_time** | **datetime** | | [optional]
**status** | **str** | | [optional]
**tracked_download_status** | [**TrackedDownloadStatus**](TrackedDownloadStatus.md) | | [optional]
Expand Down
18 changes: 9 additions & 9 deletions docs/SeriesLookupApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *http://localhost:8989*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_series_lookup**](SeriesLookupApi.md#get_series_lookup) | **GET** /api/v3/series/lookup |
[**list_series_lookup**](SeriesLookupApi.md#list_series_lookup) | **GET** /api/v3/series/lookup |


# **get_series_lookup**
> List[SeriesResource] get_series_lookup(term=term)
# **list_series_lookup**
> List[SeriesResource] list_series_lookup(term=term)



Expand Down Expand Up @@ -52,11 +52,11 @@ with sonarr.ApiClient(configuration) as api_client:
term = 'term_example' # str | (optional)

try:
api_response = api_instance.get_series_lookup(term=term)
print("The response of SeriesLookupApi->get_series_lookup:\n")
api_response = api_instance.list_series_lookup(term=term)
print("The response of SeriesLookupApi->list_series_lookup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SeriesLookupApi->get_series_lookup: %s\n" % e)
print("Exception when calling SeriesLookupApi->list_series_lookup: %s\n" % e)
```

* Api Key Authentication (apikey):
Expand Down Expand Up @@ -97,11 +97,11 @@ with sonarr.ApiClient(configuration) as api_client:
term = 'term_example' # str | (optional)

try:
api_response = api_instance.get_series_lookup(term=term)
print("The response of SeriesLookupApi->get_series_lookup:\n")
api_response = api_instance.list_series_lookup(term=term)
print("The response of SeriesLookupApi->list_series_lookup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SeriesLookupApi->get_series_lookup: %s\n" % e)
print("Exception when calling SeriesLookupApi->list_series_lookup: %s\n" % e)
```

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/TaskResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**last_execution** | **datetime** | | [optional]
**last_start_time** | **datetime** | | [optional]
**next_execution** | **datetime** | | [optional]
**last_duration** | [**TimeSpan**](TimeSpan.md) | | [optional]
**last_duration** | **str** | | [optional]

## Example

Expand Down
4 changes: 1 addition & 3 deletions sonarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import absolute_import

__version__ = "0.0.1"
__version__ = "0.5.1"

# import apis into sdk package
from sonarr.api.api_info_api import ApiInfoApi
Expand Down Expand Up @@ -135,7 +135,6 @@
from sonarr.models.history_resource import HistoryResource
from sonarr.models.history_resource_paging_resource import HistoryResourcePagingResource
from sonarr.models.host_config_resource import HostConfigResource
from sonarr.models.http_uri import HttpUri
from sonarr.models.import_list_exclusion_resource import ImportListExclusionResource
from sonarr.models.import_list_resource import ImportListResource
from sonarr.models.import_list_type import ImportListType
Expand Down Expand Up @@ -208,7 +207,6 @@
from sonarr.models.tag_details_resource import TagDetailsResource
from sonarr.models.tag_resource import TagResource
from sonarr.models.task_resource import TaskResource
from sonarr.models.time_span import TimeSpan
from sonarr.models.tracked_download_state import TrackedDownloadState
from sonarr.models.tracked_download_status import TrackedDownloadStatus
from sonarr.models.tracked_download_status_message import TrackedDownloadStatusMessage
Expand Down
16 changes: 8 additions & 8 deletions sonarr/api/series_lookup_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ def __init__(self, api_client=None):
self.api_client = api_client

@validate_arguments
def get_series_lookup(self, term : Optional[StrictStr] = None, **kwargs) -> List[SeriesResource]: # noqa: E501
"""get_series_lookup # noqa: E501
def list_series_lookup(self, term : Optional[StrictStr] = None, **kwargs) -> List[SeriesResource]: # noqa: E501
"""list_series_lookup # noqa: E501

This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_series_lookup(term, async_req=True)
>>> thread = api.list_series_lookup(term, async_req=True)
>>> result = thread.get()

:param term:
Expand All @@ -70,16 +70,16 @@ def get_series_lookup(self, term : Optional[StrictStr] = None, **kwargs) -> List
:rtype: List[SeriesResource]
"""
kwargs['_return_http_data_only'] = True
return self.get_series_lookup_with_http_info(term, **kwargs) # noqa: E501
return self.list_series_lookup_with_http_info(term, **kwargs) # noqa: E501

@validate_arguments
def get_series_lookup_with_http_info(self, term : Optional[StrictStr] = None, **kwargs): # noqa: E501
"""get_series_lookup # noqa: E501
def list_series_lookup_with_http_info(self, term : Optional[StrictStr] = None, **kwargs): # noqa: E501
"""list_series_lookup # noqa: E501

This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_series_lookup_with_http_info(term, async_req=True)
>>> thread = api.list_series_lookup_with_http_info(term, async_req=True)
>>> result = thread.get()

:param term:
Expand Down Expand Up @@ -130,7 +130,7 @@ def get_series_lookup_with_http_info(self, term : Optional[StrictStr] = None, **
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_series_lookup" % _key
" to method list_series_lookup" % _key
)
_params[_key] = _val
del _params['kwargs']
Expand Down
4 changes: 2 additions & 2 deletions sonarr/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Sonarr-py/v0.0.1'
self.user_agent = 'sonarr-py/v0.5.1'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down Expand Up @@ -543,7 +543,7 @@ def parameters_to_url_query(self, params, collection_formats):
else:
new_params.append((k, v))

return "&".join(["=".join(item) for item in new_params])
return "&".join(["=".join(repr(item)) for item in new_params])

def files_parameters(self, files=None):
"""Builds form parameters.
Expand Down
2 changes: 1 addition & 1 deletion sonarr/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 3.0.0\n"\
"SDK Package Version: 0.0.1".\
"SDK Package Version: 0.5.1".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
2 changes: 0 additions & 2 deletions sonarr/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from sonarr.models.history_resource import HistoryResource
from sonarr.models.history_resource_paging_resource import HistoryResourcePagingResource
from sonarr.models.host_config_resource import HostConfigResource
from sonarr.models.http_uri import HttpUri
from sonarr.models.import_list_exclusion_resource import ImportListExclusionResource
from sonarr.models.import_list_resource import ImportListResource
from sonarr.models.import_list_type import ImportListType
Expand Down Expand Up @@ -128,7 +127,6 @@
from sonarr.models.tag_details_resource import TagDetailsResource
from sonarr.models.tag_resource import TagResource
from sonarr.models.task_resource import TaskResource
from sonarr.models.time_span import TimeSpan
from sonarr.models.tracked_download_state import TrackedDownloadState
from sonarr.models.tracked_download_status import TrackedDownloadStatus
from sonarr.models.tracked_download_status_message import TrackedDownloadStatusMessage
Expand Down
14 changes: 8 additions & 6 deletions sonarr/models/command_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from sonarr.models.command_priority import CommandPriority
from sonarr.models.command_status import CommandStatus
from sonarr.models.command_trigger import CommandTrigger
from sonarr.models.time_span import TimeSpan

class CommandResource(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand All @@ -41,7 +40,7 @@ class CommandResource(BaseModel):
queued: Optional[datetime]
started: Optional[datetime]
ended: Optional[datetime]
duration: Optional[TimeSpan]
duration: Optional[str]
exception: Optional[str]
trigger: Optional[CommandTrigger]
client_user_agent: Optional[str]
Expand All @@ -51,6 +50,12 @@ 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 Expand Up @@ -81,9 +86,6 @@ def to_dict(self):
# override the default output from pydantic by calling `to_dict()` of body
if self.body:
_dict['body'] = self.body.to_dict()
# override the default output from pydantic by calling `to_dict()` of duration
if self.duration:
_dict['duration'] = self.duration.to_dict()
# set to None if name (nullable) is None
if self.name is None:
_dict['name'] = None
Expand Down Expand Up @@ -142,7 +144,7 @@ def from_dict(cls, obj: dict) -> CommandResource:
"queued": obj.get("queued"),
"started": obj.get("started"),
"ended": obj.get("ended"),
"duration": TimeSpan.from_dict(obj.get("duration")) if obj.get("duration") is not None else None,
"duration": obj.get("duration"),
"exception": obj.get("exception"),
"trigger": obj.get("trigger"),
"client_user_agent": obj.get("clientUserAgent"),
Expand Down
8 changes: 2 additions & 6 deletions sonarr/models/health_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from typing import Optional
from pydantic import BaseModel
from sonarr.models.health_check_result import HealthCheckResult
from sonarr.models.http_uri import HttpUri

class HealthResource(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand All @@ -32,7 +31,7 @@ class HealthResource(BaseModel):
source: Optional[str]
type: Optional[HealthCheckResult]
message: Optional[str]
wiki_url: Optional[HttpUri]
wiki_url: Optional[str]
__properties = ["id", "source", "type", "message", "wikiUrl"]

class Config:
Expand Down Expand Up @@ -62,9 +61,6 @@ def to_dict(self):
exclude={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of wiki_url
if self.wiki_url:
_dict['wikiUrl'] = self.wiki_url.to_dict()
# set to None if source (nullable) is None
if self.source is None:
_dict['source'] = None
Expand All @@ -89,7 +85,7 @@ def from_dict(cls, obj: dict) -> HealthResource:
"source": obj.get("source"),
"type": obj.get("type"),
"message": obj.get("message"),
"wiki_url": HttpUri.from_dict(obj.get("wikiUrl")) if obj.get("wikiUrl") is not None else None
"wiki_url": obj.get("wikiUrl")
})
return _obj

Loading