Skip to content

Latest commit

 

History

History
346 lines (221 loc) · 8.81 KB

File metadata and controls

346 lines (221 loc) · 8.81 KB

\AuthorAPI

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

Method HTTP request Description
CreateAuthor Post /api/v1/author
DeleteAuthor Delete /api/v1/author/{id}
GetAuthorById Get /api/v1/author/{id}
ListAuthor Get /api/v1/author
UpdateAuthor Put /api/v1/author/{id}

CreateAuthor

AuthorResource CreateAuthor(ctx).AuthorResource(authorResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	readarrClient "github.com/devopsarr/readarr-go/readarr"
)

func main() {
	authorResource := *readarrClient.NewAuthorResource() // AuthorResource |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
authorResource AuthorResource

Return type

AuthorResource

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: text/plain, application/json, text/json

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

DeleteAuthor

DeleteAuthor(ctx, id).DeleteFiles(deleteFiles).AddImportListExclusion(addImportListExclusion).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	readarrClient "github.com/devopsarr/readarr-go/readarr"
)

func main() {
	id := int32(56) // int32 | 
	deleteFiles := true // bool |  (optional) (default to false)
	addImportListExclusion := true // bool |  (optional) (default to false)

	configuration := readarrClient.NewConfiguration()
	apiClient := readarrClient.NewAPIClient(configuration)
	r, err := apiClient.AuthorAPI.DeleteAuthor(context.Background(), id).DeleteFiles(deleteFiles).AddImportListExclusion(addImportListExclusion).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthorAPI.DeleteAuthor``: %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.
id int32

Other Parameters

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

Name Type Description Notes

deleteFiles | bool | | [default to false] addImportListExclusion | bool | | [default to false]

Return type

(empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

GetAuthorById

AuthorResource GetAuthorById(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	readarrClient "github.com/devopsarr/readarr-go/readarr"
)

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

	configuration := readarrClient.NewConfiguration()
	apiClient := readarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthorAPI.GetAuthorById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthorAPI.GetAuthorById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAuthorById`: AuthorResource
	fmt.Fprintf(os.Stdout, "Response from `AuthorAPI.GetAuthorById`: %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 apiGetAuthorByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

AuthorResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

ListAuthor

[]AuthorResource ListAuthor(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	readarrClient "github.com/devopsarr/readarr-go/readarr"
)

func main() {

	configuration := readarrClient.NewConfiguration()
	apiClient := readarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthorAPI.ListAuthor(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthorAPI.ListAuthor``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListAuthor`: []AuthorResource
	fmt.Fprintf(os.Stdout, "Response from `AuthorAPI.ListAuthor`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]AuthorResource

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]

UpdateAuthor

AuthorResource UpdateAuthor(ctx, id).MoveFiles(moveFiles).AuthorResource(authorResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	readarrClient "github.com/devopsarr/readarr-go/readarr"
)

func main() {
	id := "id_example" // string | 
	moveFiles := true // bool |  (optional) (default to false)
	authorResource := *readarrClient.NewAuthorResource() // AuthorResource |  (optional)

	configuration := readarrClient.NewConfiguration()
	apiClient := readarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthorAPI.UpdateAuthor(context.Background(), id).MoveFiles(moveFiles).AuthorResource(authorResource).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthorAPI.UpdateAuthor``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateAuthor`: AuthorResource
	fmt.Fprintf(os.Stdout, "Response from `AuthorAPI.UpdateAuthor`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

moveFiles | bool | | [default to false] authorResource | AuthorResource | |

Return type

AuthorResource

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: text/plain, application/json, text/json

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