Categorygithub.com/devopsarr/sonarr-go
module
1.0.0
Repository: https://github.com/devopsarr/sonarr-go.git
Documentation: pkg.go.dev

# README

Go API client for sonarr

Sonarr API docs - The v3 API docs apply to both v3 and v4 versions of Sonarr. Some functionality may only be available in v4 of the Sonarr application.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v4.0.1.929
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sonarr "github.com/devopsarr/sonarr-go/sonarr"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sonarr.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sonarr.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sonarr.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sonarr.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sonarr.ContextOperationServerIndices and sonarr.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sonarr.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sonarr.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost:8989

ClassMethodHTTP requestDescription
ApiInfoAPIGetApiGet /api
AuthenticationAPICreateLoginPost /login
AuthenticationAPIGetLogoutGet /logout
AutoTaggingAPICreateAutoTaggingPost /api/v3/autotagging
AutoTaggingAPIDeleteAutoTaggingDelete /api/v3/autotagging/{id}
AutoTaggingAPIGetAutoTaggingByIdGet /api/v3/autotagging/{id}
AutoTaggingAPIListAutoTaggingGet /api/v3/autotagging
AutoTaggingAPIListAutoTaggingSchemaGet /api/v3/autotagging/schema
AutoTaggingAPIUpdateAutoTaggingPut /api/v3/autotagging/{id}
BackupAPICreateSystemBackupRestoreByIdPost /api/v3/system/backup/restore/{id}
BackupAPICreateSystemBackupRestoreUploadPost /api/v3/system/backup/restore/upload
BackupAPIDeleteSystemBackupDelete /api/v3/system/backup/{id}
BackupAPIListSystemBackupGet /api/v3/system/backup
BlocklistAPIDeleteBlocklistDelete /api/v3/blocklist/{id}
BlocklistAPIDeleteBlocklistBulkDelete /api/v3/blocklist/bulk
BlocklistAPIGetBlocklistGet /api/v3/blocklist
CalendarAPIGetCalendarByIdGet /api/v3/calendar/{id}
CalendarAPIListCalendarGet /api/v3/calendar
CalendarFeedAPIGetFeedV3CalendarSonarrIcsGet /feed/v3/calendar/sonarr.ics
CommandAPICreateCommandPost /api/v3/command
CommandAPIDeleteCommandDelete /api/v3/command/{id}
CommandAPIGetCommandByIdGet /api/v3/command/{id}
CommandAPIListCommandGet /api/v3/command
CustomFilterAPICreateCustomFilterPost /api/v3/customfilter
CustomFilterAPIDeleteCustomFilterDelete /api/v3/customfilter/{id}
CustomFilterAPIGetCustomFilterByIdGet /api/v3/customfilter/{id}
CustomFilterAPIListCustomFilterGet /api/v3/customfilter
CustomFilterAPIUpdateCustomFilterPut /api/v3/customfilter/{id}
CustomFormatAPICreateCustomFormatPost /api/v3/customformat
CustomFormatAPIDeleteCustomFormatDelete /api/v3/customformat/{id}
CustomFormatAPIGetCustomFormatByIdGet /api/v3/customformat/{id}
CustomFormatAPIListCustomFormatGet /api/v3/customformat
CustomFormatAPIListCustomFormatSchemaGet /api/v3/customformat/schema
CustomFormatAPIUpdateCustomFormatPut /api/v3/customformat/{id}
CutoffAPIGetWantedCutoffGet /api/v3/wanted/cutoff
CutoffAPIGetWantedCutoffByIdGet /api/v3/wanted/cutoff/{id}
DelayProfileAPICreateDelayProfilePost /api/v3/delayprofile
DelayProfileAPIDeleteDelayProfileDelete /api/v3/delayprofile/{id}
DelayProfileAPIGetDelayProfileByIdGet /api/v3/delayprofile/{id}
DelayProfileAPIListDelayProfileGet /api/v3/delayprofile
DelayProfileAPIUpdateDelayProfilePut /api/v3/delayprofile/{id}
DelayProfileAPIUpdateDelayProfileReorderPut /api/v3/delayprofile/reorder/{id}
DiskSpaceAPIListDiskSpaceGet /api/v3/diskspace
DownloadClientAPICreateDownloadClientPost /api/v3/downloadclient
DownloadClientAPICreateDownloadClientActionByNamePost /api/v3/downloadclient/action/{name}
DownloadClientAPIDeleteDownloadClientDelete /api/v3/downloadclient/{id}
DownloadClientAPIDeleteDownloadClientBulkDelete /api/v3/downloadclient/bulk
DownloadClientAPIGetDownloadClientByIdGet /api/v3/downloadclient/{id}
DownloadClientAPIListDownloadClientGet /api/v3/downloadclient
DownloadClientAPIListDownloadClientSchemaGet /api/v3/downloadclient/schema
DownloadClientAPIPutDownloadClientBulkPut /api/v3/downloadclient/bulk
DownloadClientAPITestDownloadClientPost /api/v3/downloadclient/test
DownloadClientAPITestallDownloadClientPost /api/v3/downloadclient/testall
DownloadClientAPIUpdateDownloadClientPut /api/v3/downloadclient/{id}
DownloadClientConfigAPIGetDownloadClientConfigGet /api/v3/config/downloadclient
DownloadClientConfigAPIGetDownloadClientConfigByIdGet /api/v3/config/downloadclient/{id}
DownloadClientConfigAPIUpdateDownloadClientConfigPut /api/v3/config/downloadclient/{id}
EpisodeAPIGetEpisodeByIdGet /api/v3/episode/{id}
EpisodeAPIListEpisodeGet /api/v3/episode
EpisodeAPIPutEpisodeMonitorPut /api/v3/episode/monitor
EpisodeAPIUpdateEpisodePut /api/v3/episode/{id}
EpisodeFileAPIDeleteEpisodeFileDelete /api/v3/episodefile/{id}
EpisodeFileAPIDeleteEpisodeFileBulkDelete /api/v3/episodefile/bulk
EpisodeFileAPIGetEpisodeFileByIdGet /api/v3/episodefile/{id}
EpisodeFileAPIListEpisodeFileGet /api/v3/episodefile
EpisodeFileAPIPutEpisodeFileBulkPut /api/v3/episodefile/bulk
EpisodeFileAPIPutEpisodeFileEditorPut /api/v3/episodefile/editor
EpisodeFileAPIUpdateEpisodeFilePut /api/v3/episodefile/{id}
FileSystemAPIGetFileSystemGet /api/v3/filesystem
FileSystemAPIGetFileSystemMediafilesGet /api/v3/filesystem/mediafiles
FileSystemAPIGetFileSystemTypeGet /api/v3/filesystem/type
HealthAPIListHealthGet /api/v3/health
HistoryAPICreateHistoryFailedByIdPost /api/v3/history/failed/{id}
HistoryAPIGetHistoryGet /api/v3/history
HistoryAPIListHistorySeriesGet /api/v3/history/series
HistoryAPIListHistorySinceGet /api/v3/history/since
HostConfigAPIGetHostConfigGet /api/v3/config/host
HostConfigAPIGetHostConfigByIdGet /api/v3/config/host/{id}
HostConfigAPIUpdateHostConfigPut /api/v3/config/host/{id}
ImportListAPICreateImportListPost /api/v3/importlist
ImportListAPICreateImportListActionByNamePost /api/v3/importlist/action/{name}
ImportListAPIDeleteImportListDelete /api/v3/importlist/{id}
ImportListAPIDeleteImportListBulkDelete /api/v3/importlist/bulk
ImportListAPIGetImportListByIdGet /api/v3/importlist/{id}
ImportListAPIListImportListGet /api/v3/importlist
ImportListAPIListImportListSchemaGet /api/v3/importlist/schema
ImportListAPIPutImportListBulkPut /api/v3/importlist/bulk
ImportListAPITestImportListPost /api/v3/importlist/test
ImportListAPITestallImportListPost /api/v3/importlist/testall
ImportListAPIUpdateImportListPut /api/v3/importlist/{id}
ImportListExclusionAPICreateImportListExclusionPost /api/v3/importlistexclusion
ImportListExclusionAPIDeleteImportListExclusionDelete /api/v3/importlistexclusion/{id}
ImportListExclusionAPIGetImportListExclusionByIdGet /api/v3/importlistexclusion/{id}
ImportListExclusionAPIListImportListExclusionGet /api/v3/importlistexclusion
ImportListExclusionAPIUpdateImportListExclusionPut /api/v3/importlistexclusion/{id}
IndexerAPICreateIndexerPost /api/v3/indexer
IndexerAPICreateIndexerActionByNamePost /api/v3/indexer/action/{name}
IndexerAPIDeleteIndexerDelete /api/v3/indexer/{id}
IndexerAPIDeleteIndexerBulkDelete /api/v3/indexer/bulk
IndexerAPIGetIndexerByIdGet /api/v3/indexer/{id}
IndexerAPIListIndexerGet /api/v3/indexer
IndexerAPIListIndexerSchemaGet /api/v3/indexer/schema
IndexerAPIPutIndexerBulkPut /api/v3/indexer/bulk
IndexerAPITestIndexerPost /api/v3/indexer/test
IndexerAPITestallIndexerPost /api/v3/indexer/testall
IndexerAPIUpdateIndexerPut /api/v3/indexer/{id}
IndexerConfigAPIGetIndexerConfigGet /api/v3/config/indexer
IndexerConfigAPIGetIndexerConfigByIdGet /api/v3/config/indexer/{id}
IndexerConfigAPIUpdateIndexerConfigPut /api/v3/config/indexer/{id}
LanguageAPIGetLanguageByIdGet /api/v3/language/{id}
LanguageAPIListLanguageGet /api/v3/language
LanguageProfileAPICreateLanguageProfilePost /api/v3/languageprofile
LanguageProfileAPIDeleteLanguageProfileDelete /api/v3/languageprofile/{id}
LanguageProfileAPIGetLanguageProfileByIdGet /api/v3/languageprofile/{id}
LanguageProfileAPIListLanguageProfileGet /api/v3/languageprofile
LanguageProfileAPIUpdateLanguageProfilePut /api/v3/languageprofile/{id}
LanguageProfileSchemaAPIGetLanguageprofileSchemaGet /api/v3/languageprofile/schema
LocalizationAPIGetLocalizationGet /api/v3/localization
LocalizationAPIGetLocalizationByIdGet /api/v3/localization/{id}
LocalizationAPIGetLocalizationLanguageGet /api/v3/localization/language
LogAPIGetLogGet /api/v3/log
LogFileAPIGetLogFileByFilenameGet /api/v3/log/file/{filename}
LogFileAPIListLogFileGet /api/v3/log/file
ManualImportAPICreateManualImportPost /api/v3/manualimport
ManualImportAPIListManualImportGet /api/v3/manualimport
MediaCoverAPIGetMediaCoverByFilenameGet /api/v3/mediacover/{seriesId}/{filename}
MediaManagementConfigAPIGetMediaManagementConfigGet /api/v3/config/mediamanagement
MediaManagementConfigAPIGetMediaManagementConfigByIdGet /api/v3/config/mediamanagement/{id}
MediaManagementConfigAPIUpdateMediaManagementConfigPut /api/v3/config/mediamanagement/{id}
MetadataAPICreateMetadataPost /api/v3/metadata
MetadataAPICreateMetadataActionByNamePost /api/v3/metadata/action/{name}
MetadataAPIDeleteMetadataDelete /api/v3/metadata/{id}
MetadataAPIGetMetadataByIdGet /api/v3/metadata/{id}
MetadataAPIListMetadataGet /api/v3/metadata
MetadataAPIListMetadataSchemaGet /api/v3/metadata/schema
MetadataAPITestMetadataPost /api/v3/metadata/test
MetadataAPITestallMetadataPost /api/v3/metadata/testall
MetadataAPIUpdateMetadataPut /api/v3/metadata/{id}
MissingAPIGetWantedMissingGet /api/v3/wanted/missing
MissingAPIGetWantedMissingByIdGet /api/v3/wanted/missing/{id}
NamingConfigAPIGetNamingConfigGet /api/v3/config/naming
NamingConfigAPIGetNamingConfigByIdGet /api/v3/config/naming/{id}
NamingConfigAPIGetNamingConfigExamplesGet /api/v3/config/naming/examples
NamingConfigAPIUpdateNamingConfigPut /api/v3/config/naming/{id}
NotificationAPICreateNotificationPost /api/v3/notification
NotificationAPICreateNotificationActionByNamePost /api/v3/notification/action/{name}
NotificationAPIDeleteNotificationDelete /api/v3/notification/{id}
NotificationAPIGetNotificationByIdGet /api/v3/notification/{id}
NotificationAPIListNotificationGet /api/v3/notification
NotificationAPIListNotificationSchemaGet /api/v3/notification/schema
NotificationAPITestNotificationPost /api/v3/notification/test
NotificationAPITestallNotificationPost /api/v3/notification/testall
NotificationAPIUpdateNotificationPut /api/v3/notification/{id}
ParseAPIGetParseGet /api/v3/parse
PingAPIGetPingGet /ping
QualityDefinitionAPIGetQualityDefinitionByIdGet /api/v3/qualitydefinition/{id}
QualityDefinitionAPIListQualityDefinitionGet /api/v3/qualitydefinition
QualityDefinitionAPIPutQualityDefinitionUpdatePut /api/v3/qualitydefinition/update
QualityDefinitionAPIUpdateQualityDefinitionPut /api/v3/qualitydefinition/{id}
QualityProfileAPICreateQualityProfilePost /api/v3/qualityprofile
QualityProfileAPIDeleteQualityProfileDelete /api/v3/qualityprofile/{id}
QualityProfileAPIGetQualityProfileByIdGet /api/v3/qualityprofile/{id}
QualityProfileAPIListQualityProfileGet /api/v3/qualityprofile
QualityProfileAPIUpdateQualityProfilePut /api/v3/qualityprofile/{id}
QualityProfileSchemaAPIGetQualityprofileSchemaGet /api/v3/qualityprofile/schema
QueueAPIDeleteQueueDelete /api/v3/queue/{id}
QueueAPIDeleteQueueBulkDelete /api/v3/queue/bulk
QueueAPIGetQueueGet /api/v3/queue
QueueActionAPICreateQueueGrabBulkPost /api/v3/queue/grab/bulk
QueueActionAPICreateQueueGrabByIdPost /api/v3/queue/grab/{id}
QueueDetailsAPIListQueueDetailsGet /api/v3/queue/details
QueueStatusAPIGetQueueStatusGet /api/v3/queue/status
ReleaseAPICreateReleasePost /api/v3/release
ReleaseAPIListReleaseGet /api/v3/release
ReleaseProfileAPICreateReleaseProfilePost /api/v3/releaseprofile
ReleaseProfileAPIDeleteReleaseProfileDelete /api/v3/releaseprofile/{id}
ReleaseProfileAPIGetReleaseProfileByIdGet /api/v3/releaseprofile/{id}
ReleaseProfileAPIListReleaseProfileGet /api/v3/releaseprofile
ReleaseProfileAPIUpdateReleaseProfilePut /api/v3/releaseprofile/{id}
ReleasePushAPICreateReleasePushPost /api/v3/release/push
RemotePathMappingAPICreateRemotePathMappingPost /api/v3/remotepathmapping
RemotePathMappingAPIDeleteRemotePathMappingDelete /api/v3/remotepathmapping/{id}
RemotePathMappingAPIGetRemotePathMappingByIdGet /api/v3/remotepathmapping/{id}
RemotePathMappingAPIListRemotePathMappingGet /api/v3/remotepathmapping
RemotePathMappingAPIUpdateRemotePathMappingPut /api/v3/remotepathmapping/{id}
RenameEpisodeAPIListRenameGet /api/v3/rename
RootFolderAPICreateRootFolderPost /api/v3/rootfolder
RootFolderAPIDeleteRootFolderDelete /api/v3/rootfolder/{id}
RootFolderAPIGetRootFolderByIdGet /api/v3/rootfolder/{id}
RootFolderAPIListRootFolderGet /api/v3/rootfolder
SeasonPassAPICreateSeasonPassPost /api/v3/seasonpass
SeriesAPICreateSeriesPost /api/v3/series
SeriesAPIDeleteSeriesDelete /api/v3/series/{id}
SeriesAPIGetSeriesByIdGet /api/v3/series/{id}
SeriesAPIListSeriesGet /api/v3/series
SeriesAPIUpdateSeriesPut /api/v3/series/{id}
SeriesEditorAPIDeleteSeriesEditorDelete /api/v3/series/editor
SeriesEditorAPIPutSeriesEditorPut /api/v3/series/editor
SeriesImportAPICreateSeriesImportPost /api/v3/series/import
SeriesLookupAPIListSeriesLookupGet /api/v3/series/lookup
StaticResourceAPIGetGet /
StaticResourceAPIGetByPathGet /{path}
StaticResourceAPIGetContentByPathGet /content/{path}
StaticResourceAPIGetLoginGet /login
SystemAPICreateSystemRestartPost /api/v3/system/restart
SystemAPICreateSystemShutdownPost /api/v3/system/shutdown
SystemAPIGetSystemRoutesGet /api/v3/system/routes
SystemAPIGetSystemRoutesDuplicateGet /api/v3/system/routes/duplicate
SystemAPIGetSystemStatusGet /api/v3/system/status
TagAPICreateTagPost /api/v3/tag
TagAPIDeleteTagDelete /api/v3/tag/{id}
TagAPIGetTagByIdGet /api/v3/tag/{id}
TagAPIListTagGet /api/v3/tag
TagAPIUpdateTagPut /api/v3/tag/{id}
TagDetailsAPIGetTagDetailByIdGet /api/v3/tag/detail/{id}
TagDetailsAPIListTagDetailGet /api/v3/tag/detail
TaskAPIGetSystemTaskByIdGet /api/v3/system/task/{id}
TaskAPIListSystemTaskGet /api/v3/system/task
UiConfigAPIGetUiConfigGet /api/v3/config/ui
UiConfigAPIGetUiConfigByIdGet /api/v3/config/ui/{id}
UiConfigAPIUpdateUiConfigPut /api/v3/config/ui/{id}
UpdateAPIListUpdateGet /api/v3/update
UpdateLogFileAPIGetLogFileUpdateByFilenameGet /api/v3/log/file/update/{filename}
UpdateLogFileAPIListLogFileUpdateGet /api/v3/log/file/update

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

X-Api-Key

  • Type: API key
  • API key parameter name: X-Api-Key
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: X-Api-Key and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		sonarr.ContextAPIKeys,
		map[string]sonarr.APIKey{
			"X-Api-Key": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

apikey

  • Type: API key
  • API key parameter name: apikey
  • Location: URL query string

Note, each API key must be added to a map of map[string]APIKey where the key is: apikey and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		sonarr.ContextAPIKeys,
		map[string]sonarr.APIKey{
			"apikey": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

# Packages

No description provided by the author