Skip to content

Latest commit

 

History

History
148 lines (95 loc) · 3.7 KB

File metadata and controls

148 lines (95 loc) · 3.7 KB

\TrackAPI

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

Method HTTP request Description
GetTrackById Get /api/v1/track/{id}
ListTrack Get /api/v1/track

GetTrackById

TrackResource GetTrackById(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	lidarrClient "github.com/devopsarr/lidarr-go/lidarr"
)

func main() {
	id := int32(56) // int32 | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32

Other Parameters

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

Name Type Description Notes

Return type

TrackResource

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain, application/json, text/json

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

ListTrack

[]TrackResource ListTrack(ctx).ArtistId(artistId).AlbumId(albumId).AlbumReleaseId(albumReleaseId).TrackIds(trackIds).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	lidarrClient "github.com/devopsarr/lidarr-go/lidarr"
)

func main() {
	artistId := int32(56) // int32 |  (optional)
	albumId := int32(56) // int32 |  (optional)
	albumReleaseId := int32(56) // int32 |  (optional)
	trackIds := []int32{int32(123)} // []int32 |  (optional)

	configuration := lidarrClient.NewConfiguration()
	apiClient := lidarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.TrackAPI.ListTrack(context.Background()).ArtistId(artistId).AlbumId(albumId).AlbumReleaseId(albumReleaseId).TrackIds(trackIds).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TrackAPI.ListTrack``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListTrack`: []TrackResource
	fmt.Fprintf(os.Stdout, "Response from `TrackAPI.ListTrack`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
artistId int32
albumId int32
albumReleaseId int32
trackIds []int32

Return type

[]TrackResource

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain, application/json, text/json

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