github.com/newrelic/newrelic-client-go@v1.1.0/docs/pkg/notifications/README.md (about) 1 # notifications 2 -- 3 import "github.com/newrelic/newrelic-client-go/pkg/notifications" 4 5 ## Usage 6 7 #### type Notifications 8 9 ```go 10 type Notifications struct { 11 } 12 ``` 13 14 Notifications is used to communicate with New Relic Notifications. 15 16 #### func New 17 18 ```go 19 func New(config config.Config) Notifications 20 ``` 21 New is used to create a new Notifications' client instance. 22 23 ### Destinations 24 25 #### func TestNotificationMutationDestination 26 27 ```go 28 func TestNotificationMutationDestination(t *testing.T) 29 ``` 30 31 #### type AiNotificationsDestination 32 33 ```go 34 type AiNotificationsDestination struct { 35 AccountID int `json:"accountId"` 36 Active bool `json:"active"` 37 Auth ai.AiNotificationsAuth `json:"auth,omitempty"` 38 CreatedAt nrtime.DateTime `json:"createdAt"` 39 ID string `json:"id"` 40 IsUserAuthenticated bool `json:"isUserAuthenticated"` 41 LastSent nrtime.DateTime `json:"lastSent,omitempty"` 42 Name string `json:"name"` 43 Properties []AiNotificationsProperty `json:"properties"` 44 Status AiNotificationsDestinationStatus `json:"status"` 45 Type AiNotificationsDestinationType `json:"type"` 46 UpdatedAt nrtime.DateTime `json:"updatedAt"` 47 UpdatedBy int `json:"updatedBy"` 48 } 49 ``` 50 51 AiNotificationsDestination represents a New Relic notification destination. 52 53 #### func (*Notifications) AiNotificationsCreateDestination 54 55 ```go 56 func (a *Notifications) AiNotificationsCreateDestination(accountID int,destination AiNotificationsDestinationInput) (*AiNotificationsDestinationResponse, error) 57 ``` 58 AiNotificationsCreateDestination creates a new notification destination for a given account. 59 60 #### func (*Notifications) GetDestinations 61 62 ```go 63 func (a *Notifications) GetDestinations(accountID int,cursor string, filters ai.AiNotificationsDestinationFilter, sorter AiNotificationsDestinationSorter) (*AiNotificationsDestinationsResponse, error) 64 ``` 65 GetDestinations returns a list of notifications destinations for a given account. You can filter by ID. 66 67 #### func (*Notifications) AiNotificationsUpdateDestination 68 69 ```go 70 func (a *Notifications) AiNotificationsUpdateDestination(accountID int,destination AiNotificationsDestinationUpdate, destinationId string) (*AiNotificationsDestinationResponse, error) 71 ``` 72 AiNotificationsUpdateDestination update a notification destination for a given account. 73 74 #### type AiNotificationsDeleteDestination 75 76 ```go 77 func (a *Notifications) AiNotificationsDeleteDestination(accountID int, destinationId string) (*AiNotificationsDeleteResponse, error) 78 ``` 79 80 AiNotificationsDeleteDestination delete a notification destination for a given account. 81 82 ### Channels 83 #### func TestNotificationMutationChannel 84 85 ```go 86 func TestNotificationMutationChannel(t *testing.T) 87 ``` 88 89 #### type AiNotificationsChannel 90 91 ```go 92 type AiNotificationsChannel struct { 93 AccountID int `json:"accountId"` 94 Active bool `json:"active"` 95 CreatedAt nrtime.DateTime `json:"createdAt"` 96 DestinationId string `json:"destinationId"` 97 ID string `json:"id"` 98 Name string `json:"name"` 99 Product AiNotificationsProduct `json:"product"` 100 Properties []AiNotificationsProperty `json:"properties"` 101 Status AiNotificationsChannelStatus `json:"status"` 102 Type AiNotificationsChannelType `json:"type"` 103 UpdatedAt nrtime.DateTime `json:"updatedAt"` 104 UpdatedBy int `json:"updatedBy"` 105 } 106 ``` 107 108 AiNotificationsChannel represents a New Relic notification channel. 109 110 #### func (*Notifications) AiNotificationsCreateChannel 111 112 ```go 113 func (a *Notifications) AiNotificationsCreateChannel(accountID int, destination AiNotificationsChannelInput) (*AiNotificationsChannelResponse, error) 114 ``` 115 AiNotificationsCreateChannel creates a new notification channel for a given account. 116 117 #### func (*Notifications) GetChannels 118 119 ```go 120 func (a *Notifications) GetChannels(accountID int,cursor string, filters ai.AiNotificationsChannelFilter, sorter AiNotificationsChannelSorter) (*AiNotificationsChannelsResponse, error) 121 ``` 122 GetChannels returns a list of notifications channels for a given account. You can filter by ID. 123 124 #### func (*Notifications) AiNotificationsUpdateChannel 125 126 ```go 127 func (a *Notifications) AiNotificationsUpdateChannel(accountID int, destination AiNotificationsChannelUpdate, channelId string) (*AiNotificationsChannelResponse, error) 128 ``` 129 AiNotificationsUpdateChannel update a notification channel for a given account. 130 131 #### type AiNotificationsDeleteChannel 132 133 ```go 134 func (a *Notifications) AiNotificationsDeleteChannel(accountID int, channelId string) (*AiNotificationsDeleteResponse, error) 135 ``` 136 137 AiNotificationsDeleteChannel delete a notification channel for a given account.