Skip to content

Latest commit

 

History

History
596 lines (378 loc) · 15.4 KB

NotificationAPI.md

File metadata and controls

596 lines (378 loc) · 15.4 KB

\NotificationAPI

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

Method HTTP request Description
CreateNotification Post /api/v3/notification
CreateNotificationActionByName Post /api/v3/notification/action/{name}
DeleteNotification Delete /api/v3/notification/{id}
GetNotificationById Get /api/v3/notification/{id}
ListNotification Get /api/v3/notification
ListNotificationSchema Get /api/v3/notification/schema
TestNotification Post /api/v3/notification/test
TestallNotification Post /api/v3/notification/testall
UpdateNotification Put /api/v3/notification/{id}

CreateNotification

NotificationResource CreateNotification(ctx).ForceSave(forceSave).NotificationResource(notificationResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	forceSave := true // bool |  (optional) (default to false)
	notificationResource := *sonarrClient.NewNotificationResource() // NotificationResource |  (optional)

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.NotificationAPI.CreateNotification(context.Background()).ForceSave(forceSave).NotificationResource(notificationResource).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `NotificationAPI.CreateNotification``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateNotification`: NotificationResource
	fmt.Fprintf(os.Stdout, "Response from `NotificationAPI.CreateNotification`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
forceSave bool [default to false]
notificationResource NotificationResource

Return type

NotificationResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

CreateNotificationActionByName

CreateNotificationActionByName(ctx, name).NotificationResource(notificationResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	name := "name_example" // string | 
	notificationResource := *sonarrClient.NewNotificationResource() // NotificationResource |  (optional)

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	r, err := apiClient.NotificationAPI.CreateNotificationActionByName(context.Background(), name).NotificationResource(notificationResource).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `NotificationAPI.CreateNotificationActionByName``: %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.
name string

Other Parameters

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

Name Type Description Notes

notificationResource | NotificationResource | |

Return type

(empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

DeleteNotification

DeleteNotification(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

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

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	r, err := apiClient.NotificationAPI.DeleteNotification(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `NotificationAPI.DeleteNotification``: %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 apiDeleteNotificationRequest struct via the builder pattern

Name Type Description Notes

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]

GetNotificationById

NotificationResource GetNotificationById(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

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

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

Name Type Description Notes

Return type

NotificationResource

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]

ListNotification

[]NotificationResource ListNotification(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]NotificationResource

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]

ListNotificationSchema

[]NotificationResource ListNotificationSchema(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]NotificationResource

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]

TestNotification

TestNotification(ctx).ForceTest(forceTest).NotificationResource(notificationResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	forceTest := true // bool |  (optional) (default to false)
	notificationResource := *sonarrClient.NewNotificationResource() // NotificationResource |  (optional)

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	r, err := apiClient.NotificationAPI.TestNotification(context.Background()).ForceTest(forceTest).NotificationResource(notificationResource).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `NotificationAPI.TestNotification``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
forceTest bool [default to false]
notificationResource NotificationResource

Return type

(empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

TestallNotification

TestallNotification(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

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]

UpdateNotification

NotificationResource UpdateNotification(ctx, id).ForceSave(forceSave).NotificationResource(notificationResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	id := int32(56) // int32 | 
	forceSave := true // bool |  (optional) (default to false)
	notificationResource := *sonarrClient.NewNotificationResource() // NotificationResource |  (optional)

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

Name Type Description Notes

forceSave | bool | | [default to false] notificationResource | NotificationResource | |

Return type

NotificationResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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