Skip to content

Latest commit

 

History

History
297 lines (189 loc) · 7.63 KB

MediaAPI.md

File metadata and controls

297 lines (189 loc) · 7.63 KB

\MediaAPI

All URIs are relative to http://localhost:5055/api/v1

Method HTTP request Description
CreateMediaByStatus Post /media/{mediaId}/{status} Update media status
DeleteMedia Delete /media/{mediaId} Delete media item
GetMedia Get /media Get media
GetMediaWatchData Get /media/{mediaId}/watch_data Get watch data

CreateMediaByStatus

MediaInfo CreateMediaByStatus(ctx, mediaId, status).CreateMediaByStatusRequest(createMediaByStatusRequest).Execute()

Update media status

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	mediaId := "1" // string | Media ID
	status := "available" // string | New status
	createMediaByStatusRequest := *overseerrClient.NewCreateMediaByStatusRequest() // CreateMediaByStatusRequest |  (optional)

	configuration := overseerrClient.NewConfiguration()
	apiClient := overseerrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.MediaAPI.CreateMediaByStatus(context.Background(), mediaId, status).CreateMediaByStatusRequest(createMediaByStatusRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MediaAPI.CreateMediaByStatus``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateMediaByStatus`: MediaInfo
	fmt.Fprintf(os.Stdout, "Response from `MediaAPI.CreateMediaByStatus`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
mediaId string Media ID
status string New status

Other Parameters

Other parameters are passed through a pointer to a apiCreateMediaByStatusRequest struct via the builder pattern

Name Type Description Notes

createMediaByStatusRequest | CreateMediaByStatusRequest | |

Return type

MediaInfo

Authorization

apiKey, cookieAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteMedia

DeleteMedia(ctx, mediaId).Execute()

Delete media item

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	mediaId := "1" // string | Media ID

	configuration := overseerrClient.NewConfiguration()
	apiClient := overseerrClient.NewAPIClient(configuration)
	r, err := apiClient.MediaAPI.DeleteMedia(context.Background(), mediaId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MediaAPI.DeleteMedia``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
mediaId string Media ID

Other Parameters

Other parameters are passed through a pointer to a apiDeleteMediaRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiKey, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMedia

GetMedia2XXResponse GetMedia(ctx).Take(take).Skip(skip).Filter(filter).Sort(sort).Execute()

Get media

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	take := float32(20) // float32 |  (optional)
	skip := float32(0) // float32 |  (optional)
	filter := "filter_example" // string |  (optional)
	sort := "sort_example" // string |  (optional) (default to "added")

	configuration := overseerrClient.NewConfiguration()
	apiClient := overseerrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.MediaAPI.GetMedia(context.Background()).Take(take).Skip(skip).Filter(filter).Sort(sort).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MediaAPI.GetMedia``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMedia`: GetMedia2XXResponse
	fmt.Fprintf(os.Stdout, "Response from `MediaAPI.GetMedia`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetMediaRequest struct via the builder pattern

Name Type Description Notes
take float32
skip float32
filter string
sort string [default to "added"]

Return type

GetMedia2XXResponse

Authorization

apiKey, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMediaWatchData

GetMediaWatchData2XXResponse GetMediaWatchData(ctx, mediaId).Execute()

Get watch data

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	mediaId := "1" // string | Media ID

	configuration := overseerrClient.NewConfiguration()
	apiClient := overseerrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.MediaAPI.GetMediaWatchData(context.Background(), mediaId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MediaAPI.GetMediaWatchData``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMediaWatchData`: GetMediaWatchData2XXResponse
	fmt.Fprintf(os.Stdout, "Response from `MediaAPI.GetMediaWatchData`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
mediaId string Media ID

Other Parameters

Other parameters are passed through a pointer to a apiGetMediaWatchDataRequest struct via the builder pattern

Name Type Description Notes

Return type

GetMediaWatchData2XXResponse

Authorization

apiKey, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]