diff --git a/README.md b/README.md index 99d9f18..0380538 100644 --- a/README.md +++ b/README.md @@ -421,7 +421,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) diff --git a/sonarr/.openapi-generator/FILES b/sonarr/.openapi-generator/FILES index 302b0d5..4965d35 100644 --- a/sonarr/.openapi-generator/FILES +++ b/sonarr/.openapi-generator/FILES @@ -247,7 +247,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 @@ -374,7 +373,6 @@ model_system_resource.go model_tag_details_resource.go model_tag_resource.go model_task_resource.go -model_time_span.go model_tracked_download_state.go model_tracked_download_status.go model_tracked_download_status_message.go diff --git a/sonarr/api/openapi.yaml b/sonarr/api/openapi.yaml index 648c880..0d4f427 100644 --- a/sonarr/api/openapi.yaml +++ b/sonarr/api/openapi.yaml @@ -6433,18 +6433,7 @@ components: sendUpdatesToClient: true updateScheduledTask: true priority: null - duration: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + duration: 2000-01-23T04:56:07.000+00:00 commandName: commandName name: name ended: 2000-01-23T04:56:07.000+00:00 @@ -6484,7 +6473,8 @@ components: nullable: true type: string duration: - $ref: '#/components/schemas/TimeSpan' + format: date-time + type: string exception: nullable: true type: string @@ -11560,18 +11550,7 @@ components: ImportListResource: additionalProperties: false example: - minRefreshInterval: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + minRefreshInterval: 2000-01-23T04:56:07.000+00:00 implementationName: implementationName rootFolderPath: rootFolderPath implementation: implementation @@ -11698,7 +11677,8 @@ components: format: int32 type: integer minRefreshInterval: - $ref: '#/components/schemas/TimeSpan' + format: date-time + type: string type: object ImportListType: enum: @@ -16941,18 +16921,7 @@ components: indexer: indexer episodeId: 1 title: title - timeleft: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + timeleft: 2000-01-23T04:56:07.000+00:00 trackedDownloadState: null trackedDownloadStatus: null seriesId: 6 @@ -17141,7 +17110,8 @@ components: format: double type: number timeleft: - $ref: '#/components/schemas/TimeSpan' + format: date-time + type: string estimatedCompletionTime: format: date-time nullable: true @@ -17845,18 +17815,7 @@ components: indexer: indexer episodeId: 1 title: title - timeleft: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + timeleft: 2000-01-23T04:56:07.000+00:00 trackedDownloadState: null trackedDownloadStatus: null seriesId: 6 @@ -18669,18 +18628,7 @@ components: indexer: indexer episodeId: 1 title: title - timeleft: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + timeleft: 2000-01-23T04:56:07.000+00:00 trackedDownloadState: null trackedDownloadStatus: null seriesId: 6 @@ -20428,18 +20376,7 @@ components: TaskResource: additionalProperties: false example: - lastDuration: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 + lastDuration: 2000-01-23T04:56:07.000+00:00 lastExecution: 2000-01-23T04:56:07.000+00:00 name: name lastStartTime: 2000-01-23T04:56:07.000+00:00 @@ -20470,67 +20407,12 @@ components: format: date-time type: string lastDuration: - $ref: '#/components/schemas/TimeSpan' + format: date-time + type: string type: object TimeSpan: - additionalProperties: false - example: - milliseconds: 5 - hours: 5 - seconds: 7 - totalDays: 9.301444243932576 - ticks: 6 - totalHours: 3.616076749251911 - totalMilliseconds: 2.027123023002322 - totalMinutes: 4.145608029883936 - minutes: 2 - days: 1 - totalSeconds: 7.386281948385884 - properties: - ticks: - format: int64 - type: integer - days: - format: int32 - readOnly: true - type: integer - hours: - format: int32 - readOnly: true - type: integer - milliseconds: - format: int32 - readOnly: true - type: integer - minutes: - format: int32 - readOnly: true - type: integer - seconds: - format: int32 - readOnly: true - type: integer - totalDays: - format: double - readOnly: true - type: number - totalHours: - format: double - readOnly: true - type: number - totalMilliseconds: - format: double - readOnly: true - type: number - totalMinutes: - format: double - readOnly: true - type: number - totalSeconds: - format: double - readOnly: true - type: number - type: object + format: date-time + type: string TrackedDownloadState: enum: - downloading diff --git a/sonarr/docs/CommandResource.md b/sonarr/docs/CommandResource.md index 903540c..ab43b0b 100644 --- a/sonarr/docs/CommandResource.md +++ b/sonarr/docs/CommandResource.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **Queued** | Pointer to **time.Time** | | [optional] **Started** | Pointer to **NullableTime** | | [optional] **Ended** | Pointer to **NullableTime** | | [optional] -**Duration** | Pointer to [**TimeSpan**](TimeSpan.md) | | [optional] +**Duration** | Pointer to **time.Time** | | [optional] **Exception** | Pointer to **NullableString** | | [optional] **Trigger** | Pointer to [**CommandTrigger**](CommandTrigger.md) | | [optional] **ClientUserAgent** | Pointer to **NullableString** | | [optional] @@ -344,20 +344,20 @@ HasEnded returns a boolean if a field has been set. UnsetEnded ensures that no value is present for Ended, not even an explicit nil ### GetDuration -`func (o *CommandResource) GetDuration() TimeSpan` +`func (o *CommandResource) GetDuration() time.Time` GetDuration returns the Duration field if non-nil, zero value otherwise. ### GetDurationOk -`func (o *CommandResource) GetDurationOk() (*TimeSpan, bool)` +`func (o *CommandResource) GetDurationOk() (*time.Time, bool)` GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDuration -`func (o *CommandResource) SetDuration(v TimeSpan)` +`func (o *CommandResource) SetDuration(v time.Time)` SetDuration sets Duration field to given value. diff --git a/sonarr/docs/ImportListResource.md b/sonarr/docs/ImportListResource.md index 198c0d6..e874f4d 100644 --- a/sonarr/docs/ImportListResource.md +++ b/sonarr/docs/ImportListResource.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes **SeasonFolder** | Pointer to **bool** | | [optional] **ListType** | Pointer to [**ImportListType**](ImportListType.md) | | [optional] **ListOrder** | Pointer to **int32** | | [optional] -**MinRefreshInterval** | Pointer to [**TimeSpan**](TimeSpan.md) | | [optional] +**MinRefreshInterval** | Pointer to **time.Time** | | [optional] ## Methods @@ -585,20 +585,20 @@ HasListOrder returns a boolean if a field has been set. ### GetMinRefreshInterval -`func (o *ImportListResource) GetMinRefreshInterval() TimeSpan` +`func (o *ImportListResource) GetMinRefreshInterval() time.Time` GetMinRefreshInterval returns the MinRefreshInterval field if non-nil, zero value otherwise. ### GetMinRefreshIntervalOk -`func (o *ImportListResource) GetMinRefreshIntervalOk() (*TimeSpan, bool)` +`func (o *ImportListResource) GetMinRefreshIntervalOk() (*time.Time, bool)` GetMinRefreshIntervalOk returns a tuple with the MinRefreshInterval field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMinRefreshInterval -`func (o *ImportListResource) SetMinRefreshInterval(v TimeSpan)` +`func (o *ImportListResource) SetMinRefreshInterval(v time.Time)` SetMinRefreshInterval sets MinRefreshInterval field to given value. diff --git a/sonarr/docs/QueueResource.md b/sonarr/docs/QueueResource.md index 955e19a..7774095 100644 --- a/sonarr/docs/QueueResource.md +++ b/sonarr/docs/QueueResource.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **Size** | Pointer to **float64** | | [optional] **Title** | Pointer to **NullableString** | | [optional] **Sizeleft** | Pointer to **float64** | | [optional] -**Timeleft** | Pointer to [**TimeSpan**](TimeSpan.md) | | [optional] +**Timeleft** | Pointer to **time.Time** | | [optional] **EstimatedCompletionTime** | Pointer to **NullableTime** | | [optional] **Status** | Pointer to **NullableString** | | [optional] **TrackedDownloadStatus** | Pointer to [**TrackedDownloadStatus**](TrackedDownloadStatus.md) | | [optional] @@ -374,20 +374,20 @@ HasSizeleft returns a boolean if a field has been set. ### GetTimeleft -`func (o *QueueResource) GetTimeleft() TimeSpan` +`func (o *QueueResource) GetTimeleft() time.Time` GetTimeleft returns the Timeleft field if non-nil, zero value otherwise. ### GetTimeleftOk -`func (o *QueueResource) GetTimeleftOk() (*TimeSpan, bool)` +`func (o *QueueResource) GetTimeleftOk() (*time.Time, bool)` GetTimeleftOk returns a tuple with the Timeleft field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimeleft -`func (o *QueueResource) SetTimeleft(v TimeSpan)` +`func (o *QueueResource) SetTimeleft(v time.Time)` SetTimeleft sets Timeleft field to given value. diff --git a/sonarr/docs/TaskResource.md b/sonarr/docs/TaskResource.md index 789363b..e76414c 100644 --- a/sonarr/docs/TaskResource.md +++ b/sonarr/docs/TaskResource.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **LastExecution** | Pointer to **time.Time** | | [optional] **LastStartTime** | Pointer to **time.Time** | | [optional] **NextExecution** | Pointer to **time.Time** | | [optional] -**LastDuration** | Pointer to [**TimeSpan**](TimeSpan.md) | | [optional] +**LastDuration** | Pointer to **time.Time** | | [optional] ## Methods @@ -229,20 +229,20 @@ HasNextExecution returns a boolean if a field has been set. ### GetLastDuration -`func (o *TaskResource) GetLastDuration() TimeSpan` +`func (o *TaskResource) GetLastDuration() time.Time` GetLastDuration returns the LastDuration field if non-nil, zero value otherwise. ### GetLastDurationOk -`func (o *TaskResource) GetLastDurationOk() (*TimeSpan, bool)` +`func (o *TaskResource) GetLastDurationOk() (*time.Time, bool)` GetLastDurationOk returns a tuple with the LastDuration field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLastDuration -`func (o *TaskResource) SetLastDuration(v TimeSpan)` +`func (o *TaskResource) SetLastDuration(v time.Time)` SetLastDuration sets LastDuration field to given value. diff --git a/sonarr/docs/TimeSpan.md b/sonarr/docs/TimeSpan.md deleted file mode 100644 index bed3c9a..0000000 --- a/sonarr/docs/TimeSpan.md +++ /dev/null @@ -1,316 +0,0 @@ -# TimeSpan - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Ticks** | Pointer to **int64** | | [optional] -**Days** | Pointer to **int32** | | [optional] [readonly] -**Hours** | Pointer to **int32** | | [optional] [readonly] -**Milliseconds** | Pointer to **int32** | | [optional] [readonly] -**Minutes** | Pointer to **int32** | | [optional] [readonly] -**Seconds** | Pointer to **int32** | | [optional] [readonly] -**TotalDays** | Pointer to **float64** | | [optional] [readonly] -**TotalHours** | Pointer to **float64** | | [optional] [readonly] -**TotalMilliseconds** | Pointer to **float64** | | [optional] [readonly] -**TotalMinutes** | Pointer to **float64** | | [optional] [readonly] -**TotalSeconds** | Pointer to **float64** | | [optional] [readonly] - -## Methods - -### NewTimeSpan - -`func NewTimeSpan() *TimeSpan` - -NewTimeSpan instantiates a new TimeSpan object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTimeSpanWithDefaults - -`func NewTimeSpanWithDefaults() *TimeSpan` - -NewTimeSpanWithDefaults instantiates a new TimeSpan object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTicks - -`func (o *TimeSpan) GetTicks() int64` - -GetTicks returns the Ticks field if non-nil, zero value otherwise. - -### GetTicksOk - -`func (o *TimeSpan) GetTicksOk() (*int64, bool)` - -GetTicksOk returns a tuple with the Ticks field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTicks - -`func (o *TimeSpan) SetTicks(v int64)` - -SetTicks sets Ticks field to given value. - -### HasTicks - -`func (o *TimeSpan) HasTicks() bool` - -HasTicks returns a boolean if a field has been set. - -### GetDays - -`func (o *TimeSpan) GetDays() int32` - -GetDays returns the Days field if non-nil, zero value otherwise. - -### GetDaysOk - -`func (o *TimeSpan) GetDaysOk() (*int32, bool)` - -GetDaysOk returns a tuple with the Days field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDays - -`func (o *TimeSpan) SetDays(v int32)` - -SetDays sets Days field to given value. - -### HasDays - -`func (o *TimeSpan) HasDays() bool` - -HasDays returns a boolean if a field has been set. - -### GetHours - -`func (o *TimeSpan) GetHours() int32` - -GetHours returns the Hours field if non-nil, zero value otherwise. - -### GetHoursOk - -`func (o *TimeSpan) GetHoursOk() (*int32, bool)` - -GetHoursOk returns a tuple with the Hours field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetHours - -`func (o *TimeSpan) SetHours(v int32)` - -SetHours sets Hours field to given value. - -### HasHours - -`func (o *TimeSpan) HasHours() bool` - -HasHours returns a boolean if a field has been set. - -### GetMilliseconds - -`func (o *TimeSpan) GetMilliseconds() int32` - -GetMilliseconds returns the Milliseconds field if non-nil, zero value otherwise. - -### GetMillisecondsOk - -`func (o *TimeSpan) GetMillisecondsOk() (*int32, bool)` - -GetMillisecondsOk returns a tuple with the Milliseconds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMilliseconds - -`func (o *TimeSpan) SetMilliseconds(v int32)` - -SetMilliseconds sets Milliseconds field to given value. - -### HasMilliseconds - -`func (o *TimeSpan) HasMilliseconds() bool` - -HasMilliseconds returns a boolean if a field has been set. - -### GetMinutes - -`func (o *TimeSpan) GetMinutes() int32` - -GetMinutes returns the Minutes field if non-nil, zero value otherwise. - -### GetMinutesOk - -`func (o *TimeSpan) GetMinutesOk() (*int32, bool)` - -GetMinutesOk returns a tuple with the Minutes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMinutes - -`func (o *TimeSpan) SetMinutes(v int32)` - -SetMinutes sets Minutes field to given value. - -### HasMinutes - -`func (o *TimeSpan) HasMinutes() bool` - -HasMinutes returns a boolean if a field has been set. - -### GetSeconds - -`func (o *TimeSpan) GetSeconds() int32` - -GetSeconds returns the Seconds field if non-nil, zero value otherwise. - -### GetSecondsOk - -`func (o *TimeSpan) GetSecondsOk() (*int32, bool)` - -GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeconds - -`func (o *TimeSpan) SetSeconds(v int32)` - -SetSeconds sets Seconds field to given value. - -### HasSeconds - -`func (o *TimeSpan) HasSeconds() bool` - -HasSeconds returns a boolean if a field has been set. - -### GetTotalDays - -`func (o *TimeSpan) GetTotalDays() float64` - -GetTotalDays returns the TotalDays field if non-nil, zero value otherwise. - -### GetTotalDaysOk - -`func (o *TimeSpan) GetTotalDaysOk() (*float64, bool)` - -GetTotalDaysOk returns a tuple with the TotalDays field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalDays - -`func (o *TimeSpan) SetTotalDays(v float64)` - -SetTotalDays sets TotalDays field to given value. - -### HasTotalDays - -`func (o *TimeSpan) HasTotalDays() bool` - -HasTotalDays returns a boolean if a field has been set. - -### GetTotalHours - -`func (o *TimeSpan) GetTotalHours() float64` - -GetTotalHours returns the TotalHours field if non-nil, zero value otherwise. - -### GetTotalHoursOk - -`func (o *TimeSpan) GetTotalHoursOk() (*float64, bool)` - -GetTotalHoursOk returns a tuple with the TotalHours field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalHours - -`func (o *TimeSpan) SetTotalHours(v float64)` - -SetTotalHours sets TotalHours field to given value. - -### HasTotalHours - -`func (o *TimeSpan) HasTotalHours() bool` - -HasTotalHours returns a boolean if a field has been set. - -### GetTotalMilliseconds - -`func (o *TimeSpan) GetTotalMilliseconds() float64` - -GetTotalMilliseconds returns the TotalMilliseconds field if non-nil, zero value otherwise. - -### GetTotalMillisecondsOk - -`func (o *TimeSpan) GetTotalMillisecondsOk() (*float64, bool)` - -GetTotalMillisecondsOk returns a tuple with the TotalMilliseconds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalMilliseconds - -`func (o *TimeSpan) SetTotalMilliseconds(v float64)` - -SetTotalMilliseconds sets TotalMilliseconds field to given value. - -### HasTotalMilliseconds - -`func (o *TimeSpan) HasTotalMilliseconds() bool` - -HasTotalMilliseconds returns a boolean if a field has been set. - -### GetTotalMinutes - -`func (o *TimeSpan) GetTotalMinutes() float64` - -GetTotalMinutes returns the TotalMinutes field if non-nil, zero value otherwise. - -### GetTotalMinutesOk - -`func (o *TimeSpan) GetTotalMinutesOk() (*float64, bool)` - -GetTotalMinutesOk returns a tuple with the TotalMinutes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalMinutes - -`func (o *TimeSpan) SetTotalMinutes(v float64)` - -SetTotalMinutes sets TotalMinutes field to given value. - -### HasTotalMinutes - -`func (o *TimeSpan) HasTotalMinutes() bool` - -HasTotalMinutes returns a boolean if a field has been set. - -### GetTotalSeconds - -`func (o *TimeSpan) GetTotalSeconds() float64` - -GetTotalSeconds returns the TotalSeconds field if non-nil, zero value otherwise. - -### GetTotalSecondsOk - -`func (o *TimeSpan) GetTotalSecondsOk() (*float64, bool)` - -GetTotalSecondsOk returns a tuple with the TotalSeconds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotalSeconds - -`func (o *TimeSpan) SetTotalSeconds(v float64)` - -SetTotalSeconds sets TotalSeconds field to given value. - -### HasTotalSeconds - -`func (o *TimeSpan) HasTotalSeconds() bool` - -HasTotalSeconds returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sonarr/model_command_resource.go b/sonarr/model_command_resource.go index bac44d5..b42d317 100644 --- a/sonarr/model_command_resource.go +++ b/sonarr/model_command_resource.go @@ -27,7 +27,7 @@ type CommandResource struct { Queued *time.Time `json:"queued,omitempty"` Started NullableTime `json:"started,omitempty"` Ended NullableTime `json:"ended,omitempty"` - Duration *TimeSpan `json:"duration,omitempty"` + Duration *time.Time `json:"duration,omitempty"` Exception NullableString `json:"exception,omitempty"` Trigger *CommandTrigger `json:"trigger,omitempty"` ClientUserAgent NullableString `json:"clientUserAgent,omitempty"` @@ -425,9 +425,9 @@ func (o *CommandResource) UnsetEnded() { } // GetDuration returns the Duration field value if set, zero value otherwise. -func (o *CommandResource) GetDuration() TimeSpan { +func (o *CommandResource) GetDuration() time.Time { if o == nil || isNil(o.Duration) { - var ret TimeSpan + var ret time.Time return ret } return *o.Duration @@ -435,7 +435,7 @@ func (o *CommandResource) GetDuration() TimeSpan { // GetDurationOk returns a tuple with the Duration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandResource) GetDurationOk() (*TimeSpan, bool) { +func (o *CommandResource) GetDurationOk() (*time.Time, bool) { if o == nil || isNil(o.Duration) { return nil, false } @@ -451,8 +451,8 @@ func (o *CommandResource) HasDuration() bool { return false } -// SetDuration gets a reference to the given TimeSpan and assigns it to the Duration field. -func (o *CommandResource) SetDuration(v TimeSpan) { +// SetDuration gets a reference to the given time.Time and assigns it to the Duration field. +func (o *CommandResource) SetDuration(v time.Time) { o.Duration = &v } diff --git a/sonarr/model_import_list_resource.go b/sonarr/model_import_list_resource.go index 946191b..3f2ca9d 100644 --- a/sonarr/model_import_list_resource.go +++ b/sonarr/model_import_list_resource.go @@ -12,6 +12,7 @@ package sonarr import ( "encoding/json" + "time" ) // ImportListResource struct for ImportListResource @@ -34,7 +35,7 @@ type ImportListResource struct { SeasonFolder *bool `json:"seasonFolder,omitempty"` ListType *ImportListType `json:"listType,omitempty"` ListOrder *int32 `json:"listOrder,omitempty"` - MinRefreshInterval *TimeSpan `json:"minRefreshInterval,omitempty"` + MinRefreshInterval *time.Time `json:"minRefreshInterval,omitempty"` } // NewImportListResource instantiates a new ImportListResource object @@ -694,9 +695,9 @@ func (o *ImportListResource) SetListOrder(v int32) { } // GetMinRefreshInterval returns the MinRefreshInterval field value if set, zero value otherwise. -func (o *ImportListResource) GetMinRefreshInterval() TimeSpan { +func (o *ImportListResource) GetMinRefreshInterval() time.Time { if o == nil || isNil(o.MinRefreshInterval) { - var ret TimeSpan + var ret time.Time return ret } return *o.MinRefreshInterval @@ -704,7 +705,7 @@ func (o *ImportListResource) GetMinRefreshInterval() TimeSpan { // GetMinRefreshIntervalOk returns a tuple with the MinRefreshInterval field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportListResource) GetMinRefreshIntervalOk() (*TimeSpan, bool) { +func (o *ImportListResource) GetMinRefreshIntervalOk() (*time.Time, bool) { if o == nil || isNil(o.MinRefreshInterval) { return nil, false } @@ -720,8 +721,8 @@ func (o *ImportListResource) HasMinRefreshInterval() bool { return false } -// SetMinRefreshInterval gets a reference to the given TimeSpan and assigns it to the MinRefreshInterval field. -func (o *ImportListResource) SetMinRefreshInterval(v TimeSpan) { +// SetMinRefreshInterval gets a reference to the given time.Time and assigns it to the MinRefreshInterval field. +func (o *ImportListResource) SetMinRefreshInterval(v time.Time) { o.MinRefreshInterval = &v } diff --git a/sonarr/model_queue_resource.go b/sonarr/model_queue_resource.go index 1da6d61..52cb554 100644 --- a/sonarr/model_queue_resource.go +++ b/sonarr/model_queue_resource.go @@ -28,7 +28,7 @@ type QueueResource struct { Size *float64 `json:"size,omitempty"` Title NullableString `json:"title,omitempty"` Sizeleft *float64 `json:"sizeleft,omitempty"` - Timeleft *TimeSpan `json:"timeleft,omitempty"` + Timeleft *time.Time `json:"timeleft,omitempty"` EstimatedCompletionTime NullableTime `json:"estimatedCompletionTime,omitempty"` Status NullableString `json:"status,omitempty"` TrackedDownloadStatus *TrackedDownloadStatus `json:"trackedDownloadStatus,omitempty"` @@ -444,9 +444,9 @@ func (o *QueueResource) SetSizeleft(v float64) { } // GetTimeleft returns the Timeleft field value if set, zero value otherwise. -func (o *QueueResource) GetTimeleft() TimeSpan { +func (o *QueueResource) GetTimeleft() time.Time { if o == nil || isNil(o.Timeleft) { - var ret TimeSpan + var ret time.Time return ret } return *o.Timeleft @@ -454,7 +454,7 @@ func (o *QueueResource) GetTimeleft() TimeSpan { // GetTimeleftOk returns a tuple with the Timeleft field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *QueueResource) GetTimeleftOk() (*TimeSpan, bool) { +func (o *QueueResource) GetTimeleftOk() (*time.Time, bool) { if o == nil || isNil(o.Timeleft) { return nil, false } @@ -470,8 +470,8 @@ func (o *QueueResource) HasTimeleft() bool { return false } -// SetTimeleft gets a reference to the given TimeSpan and assigns it to the Timeleft field. -func (o *QueueResource) SetTimeleft(v TimeSpan) { +// SetTimeleft gets a reference to the given time.Time and assigns it to the Timeleft field. +func (o *QueueResource) SetTimeleft(v time.Time) { o.Timeleft = &v } diff --git a/sonarr/model_task_resource.go b/sonarr/model_task_resource.go index f8e943b..2bd99e7 100644 --- a/sonarr/model_task_resource.go +++ b/sonarr/model_task_resource.go @@ -24,7 +24,7 @@ type TaskResource struct { LastExecution *time.Time `json:"lastExecution,omitempty"` LastStartTime *time.Time `json:"lastStartTime,omitempty"` NextExecution *time.Time `json:"nextExecution,omitempty"` - LastDuration *TimeSpan `json:"lastDuration,omitempty"` + LastDuration *time.Time `json:"lastDuration,omitempty"` } // NewTaskResource instantiates a new TaskResource object @@ -289,9 +289,9 @@ func (o *TaskResource) SetNextExecution(v time.Time) { } // GetLastDuration returns the LastDuration field value if set, zero value otherwise. -func (o *TaskResource) GetLastDuration() TimeSpan { +func (o *TaskResource) GetLastDuration() time.Time { if o == nil || isNil(o.LastDuration) { - var ret TimeSpan + var ret time.Time return ret } return *o.LastDuration @@ -299,7 +299,7 @@ func (o *TaskResource) GetLastDuration() TimeSpan { // GetLastDurationOk returns a tuple with the LastDuration field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskResource) GetLastDurationOk() (*TimeSpan, bool) { +func (o *TaskResource) GetLastDurationOk() (*time.Time, bool) { if o == nil || isNil(o.LastDuration) { return nil, false } @@ -315,8 +315,8 @@ func (o *TaskResource) HasLastDuration() bool { return false } -// SetLastDuration gets a reference to the given TimeSpan and assigns it to the LastDuration field. -func (o *TaskResource) SetLastDuration(v TimeSpan) { +// SetLastDuration gets a reference to the given time.Time and assigns it to the LastDuration field. +func (o *TaskResource) SetLastDuration(v time.Time) { o.LastDuration = &v } diff --git a/sonarr/model_time_span.go b/sonarr/model_time_span.go deleted file mode 100644 index 31627b9..0000000 --- a/sonarr/model_time_span.go +++ /dev/null @@ -1,475 +0,0 @@ -/* -Sonarr - -Sonarr API docs - -API version: 3.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package sonarr - -import ( - "encoding/json" -) - -// TimeSpan struct for TimeSpan -type TimeSpan struct { - Ticks *int64 `json:"ticks,omitempty"` - Days *int32 `json:"days,omitempty"` - Hours *int32 `json:"hours,omitempty"` - Milliseconds *int32 `json:"milliseconds,omitempty"` - Minutes *int32 `json:"minutes,omitempty"` - Seconds *int32 `json:"seconds,omitempty"` - TotalDays *float64 `json:"totalDays,omitempty"` - TotalHours *float64 `json:"totalHours,omitempty"` - TotalMilliseconds *float64 `json:"totalMilliseconds,omitempty"` - TotalMinutes *float64 `json:"totalMinutes,omitempty"` - TotalSeconds *float64 `json:"totalSeconds,omitempty"` -} - -// NewTimeSpan instantiates a new TimeSpan object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTimeSpan() *TimeSpan { - this := TimeSpan{} - return &this -} - -// NewTimeSpanWithDefaults instantiates a new TimeSpan object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTimeSpanWithDefaults() *TimeSpan { - this := TimeSpan{} - return &this -} - -// GetTicks returns the Ticks field value if set, zero value otherwise. -func (o *TimeSpan) GetTicks() int64 { - if o == nil || isNil(o.Ticks) { - var ret int64 - return ret - } - return *o.Ticks -} - -// GetTicksOk returns a tuple with the Ticks field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTicksOk() (*int64, bool) { - if o == nil || isNil(o.Ticks) { - return nil, false - } - return o.Ticks, true -} - -// HasTicks returns a boolean if a field has been set. -func (o *TimeSpan) HasTicks() bool { - if o != nil && !isNil(o.Ticks) { - return true - } - - return false -} - -// SetTicks gets a reference to the given int64 and assigns it to the Ticks field. -func (o *TimeSpan) SetTicks(v int64) { - o.Ticks = &v -} - -// GetDays returns the Days field value if set, zero value otherwise. -func (o *TimeSpan) GetDays() int32 { - if o == nil || isNil(o.Days) { - var ret int32 - return ret - } - return *o.Days -} - -// GetDaysOk returns a tuple with the Days field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetDaysOk() (*int32, bool) { - if o == nil || isNil(o.Days) { - return nil, false - } - return o.Days, true -} - -// HasDays returns a boolean if a field has been set. -func (o *TimeSpan) HasDays() bool { - if o != nil && !isNil(o.Days) { - return true - } - - return false -} - -// SetDays gets a reference to the given int32 and assigns it to the Days field. -func (o *TimeSpan) SetDays(v int32) { - o.Days = &v -} - -// GetHours returns the Hours field value if set, zero value otherwise. -func (o *TimeSpan) GetHours() int32 { - if o == nil || isNil(o.Hours) { - var ret int32 - return ret - } - return *o.Hours -} - -// GetHoursOk returns a tuple with the Hours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetHoursOk() (*int32, bool) { - if o == nil || isNil(o.Hours) { - return nil, false - } - return o.Hours, true -} - -// HasHours returns a boolean if a field has been set. -func (o *TimeSpan) HasHours() bool { - if o != nil && !isNil(o.Hours) { - return true - } - - return false -} - -// SetHours gets a reference to the given int32 and assigns it to the Hours field. -func (o *TimeSpan) SetHours(v int32) { - o.Hours = &v -} - -// GetMilliseconds returns the Milliseconds field value if set, zero value otherwise. -func (o *TimeSpan) GetMilliseconds() int32 { - if o == nil || isNil(o.Milliseconds) { - var ret int32 - return ret - } - return *o.Milliseconds -} - -// GetMillisecondsOk returns a tuple with the Milliseconds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetMillisecondsOk() (*int32, bool) { - if o == nil || isNil(o.Milliseconds) { - return nil, false - } - return o.Milliseconds, true -} - -// HasMilliseconds returns a boolean if a field has been set. -func (o *TimeSpan) HasMilliseconds() bool { - if o != nil && !isNil(o.Milliseconds) { - return true - } - - return false -} - -// SetMilliseconds gets a reference to the given int32 and assigns it to the Milliseconds field. -func (o *TimeSpan) SetMilliseconds(v int32) { - o.Milliseconds = &v -} - -// GetMinutes returns the Minutes field value if set, zero value otherwise. -func (o *TimeSpan) GetMinutes() int32 { - if o == nil || isNil(o.Minutes) { - var ret int32 - return ret - } - return *o.Minutes -} - -// GetMinutesOk returns a tuple with the Minutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetMinutesOk() (*int32, bool) { - if o == nil || isNil(o.Minutes) { - return nil, false - } - return o.Minutes, true -} - -// HasMinutes returns a boolean if a field has been set. -func (o *TimeSpan) HasMinutes() bool { - if o != nil && !isNil(o.Minutes) { - return true - } - - return false -} - -// SetMinutes gets a reference to the given int32 and assigns it to the Minutes field. -func (o *TimeSpan) SetMinutes(v int32) { - o.Minutes = &v -} - -// GetSeconds returns the Seconds field value if set, zero value otherwise. -func (o *TimeSpan) GetSeconds() int32 { - if o == nil || isNil(o.Seconds) { - var ret int32 - return ret - } - return *o.Seconds -} - -// GetSecondsOk returns a tuple with the Seconds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetSecondsOk() (*int32, bool) { - if o == nil || isNil(o.Seconds) { - return nil, false - } - return o.Seconds, true -} - -// HasSeconds returns a boolean if a field has been set. -func (o *TimeSpan) HasSeconds() bool { - if o != nil && !isNil(o.Seconds) { - return true - } - - return false -} - -// SetSeconds gets a reference to the given int32 and assigns it to the Seconds field. -func (o *TimeSpan) SetSeconds(v int32) { - o.Seconds = &v -} - -// GetTotalDays returns the TotalDays field value if set, zero value otherwise. -func (o *TimeSpan) GetTotalDays() float64 { - if o == nil || isNil(o.TotalDays) { - var ret float64 - return ret - } - return *o.TotalDays -} - -// GetTotalDaysOk returns a tuple with the TotalDays field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTotalDaysOk() (*float64, bool) { - if o == nil || isNil(o.TotalDays) { - return nil, false - } - return o.TotalDays, true -} - -// HasTotalDays returns a boolean if a field has been set. -func (o *TimeSpan) HasTotalDays() bool { - if o != nil && !isNil(o.TotalDays) { - return true - } - - return false -} - -// SetTotalDays gets a reference to the given float64 and assigns it to the TotalDays field. -func (o *TimeSpan) SetTotalDays(v float64) { - o.TotalDays = &v -} - -// GetTotalHours returns the TotalHours field value if set, zero value otherwise. -func (o *TimeSpan) GetTotalHours() float64 { - if o == nil || isNil(o.TotalHours) { - var ret float64 - return ret - } - return *o.TotalHours -} - -// GetTotalHoursOk returns a tuple with the TotalHours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTotalHoursOk() (*float64, bool) { - if o == nil || isNil(o.TotalHours) { - return nil, false - } - return o.TotalHours, true -} - -// HasTotalHours returns a boolean if a field has been set. -func (o *TimeSpan) HasTotalHours() bool { - if o != nil && !isNil(o.TotalHours) { - return true - } - - return false -} - -// SetTotalHours gets a reference to the given float64 and assigns it to the TotalHours field. -func (o *TimeSpan) SetTotalHours(v float64) { - o.TotalHours = &v -} - -// GetTotalMilliseconds returns the TotalMilliseconds field value if set, zero value otherwise. -func (o *TimeSpan) GetTotalMilliseconds() float64 { - if o == nil || isNil(o.TotalMilliseconds) { - var ret float64 - return ret - } - return *o.TotalMilliseconds -} - -// GetTotalMillisecondsOk returns a tuple with the TotalMilliseconds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTotalMillisecondsOk() (*float64, bool) { - if o == nil || isNil(o.TotalMilliseconds) { - return nil, false - } - return o.TotalMilliseconds, true -} - -// HasTotalMilliseconds returns a boolean if a field has been set. -func (o *TimeSpan) HasTotalMilliseconds() bool { - if o != nil && !isNil(o.TotalMilliseconds) { - return true - } - - return false -} - -// SetTotalMilliseconds gets a reference to the given float64 and assigns it to the TotalMilliseconds field. -func (o *TimeSpan) SetTotalMilliseconds(v float64) { - o.TotalMilliseconds = &v -} - -// GetTotalMinutes returns the TotalMinutes field value if set, zero value otherwise. -func (o *TimeSpan) GetTotalMinutes() float64 { - if o == nil || isNil(o.TotalMinutes) { - var ret float64 - return ret - } - return *o.TotalMinutes -} - -// GetTotalMinutesOk returns a tuple with the TotalMinutes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTotalMinutesOk() (*float64, bool) { - if o == nil || isNil(o.TotalMinutes) { - return nil, false - } - return o.TotalMinutes, true -} - -// HasTotalMinutes returns a boolean if a field has been set. -func (o *TimeSpan) HasTotalMinutes() bool { - if o != nil && !isNil(o.TotalMinutes) { - return true - } - - return false -} - -// SetTotalMinutes gets a reference to the given float64 and assigns it to the TotalMinutes field. -func (o *TimeSpan) SetTotalMinutes(v float64) { - o.TotalMinutes = &v -} - -// GetTotalSeconds returns the TotalSeconds field value if set, zero value otherwise. -func (o *TimeSpan) GetTotalSeconds() float64 { - if o == nil || isNil(o.TotalSeconds) { - var ret float64 - return ret - } - return *o.TotalSeconds -} - -// GetTotalSecondsOk returns a tuple with the TotalSeconds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TimeSpan) GetTotalSecondsOk() (*float64, bool) { - if o == nil || isNil(o.TotalSeconds) { - return nil, false - } - return o.TotalSeconds, true -} - -// HasTotalSeconds returns a boolean if a field has been set. -func (o *TimeSpan) HasTotalSeconds() bool { - if o != nil && !isNil(o.TotalSeconds) { - return true - } - - return false -} - -// SetTotalSeconds gets a reference to the given float64 and assigns it to the TotalSeconds field. -func (o *TimeSpan) SetTotalSeconds(v float64) { - o.TotalSeconds = &v -} - -func (o TimeSpan) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Ticks) { - toSerialize["ticks"] = o.Ticks - } - if !isNil(o.Days) { - toSerialize["days"] = o.Days - } - if !isNil(o.Hours) { - toSerialize["hours"] = o.Hours - } - if !isNil(o.Milliseconds) { - toSerialize["milliseconds"] = o.Milliseconds - } - if !isNil(o.Minutes) { - toSerialize["minutes"] = o.Minutes - } - if !isNil(o.Seconds) { - toSerialize["seconds"] = o.Seconds - } - if !isNil(o.TotalDays) { - toSerialize["totalDays"] = o.TotalDays - } - if !isNil(o.TotalHours) { - toSerialize["totalHours"] = o.TotalHours - } - if !isNil(o.TotalMilliseconds) { - toSerialize["totalMilliseconds"] = o.TotalMilliseconds - } - if !isNil(o.TotalMinutes) { - toSerialize["totalMinutes"] = o.TotalMinutes - } - if !isNil(o.TotalSeconds) { - toSerialize["totalSeconds"] = o.TotalSeconds - } - return json.Marshal(toSerialize) -} - -type NullableTimeSpan struct { - value *TimeSpan - isSet bool -} - -func (v NullableTimeSpan) Get() *TimeSpan { - return v.value -} - -func (v *NullableTimeSpan) Set(val *TimeSpan) { - v.value = val - v.isSet = true -} - -func (v NullableTimeSpan) IsSet() bool { - return v.isSet -} - -func (v *NullableTimeSpan) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTimeSpan(val *TimeSpan) *NullableTimeSpan { - return &NullableTimeSpan{value: val, isSet: true} -} - -func (v NullableTimeSpan) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTimeSpan) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -