@@ -2,77 +2,97 @@ package api
22
33import (
44 "fmt"
5- graphql "github.com/cli/shurcooL-graphql"
65 "reflect"
6+
7+ graphql "github.com/cli/shurcooL-graphql"
78)
89
910const (
10- ActionTypeEmail string = "EmailAction"
11- ActionTypeHumioRepo string = "HumioRepoAction"
12- ActionTypeOpsGenie string = "OpsGenieAction"
13- ActionTypePagerDuty string = "PagerDutyAction"
14- ActionTypeSlack string = "SlackAction"
11+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
12+ ActionTypeEmail string = "EmailAction"
13+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
14+ ActionTypeHumioRepo string = "HumioRepoAction"
15+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
16+ ActionTypeOpsGenie string = "OpsGenieAction"
17+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
18+ ActionTypePagerDuty string = "PagerDutyAction"
19+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
20+ ActionTypeSlack string = "SlackAction"
21+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
1522 ActionTypeSlackPostMessage string = "SlackPostMessageAction"
16- ActionTypeVictorOps string = "VictorOpsAction"
17- ActionTypeWebhook string = "WebhookAction"
23+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
24+ ActionTypeVictorOps string = "VictorOpsAction"
25+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
26+ ActionTypeWebhook string = "WebhookAction"
1827)
1928
29+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
2030type Actions struct {
2131 client * Client
2232}
2333
34+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
2435type EmailAction struct {
2536 Recipients []string `graphql:"emailRecipients: recipients" yaml:"recipients,omitempty" json:"recipients,omitempty"`
2637 SubjectTemplate string `graphql:"emailSubjectTemplate: subjectTemplate" yaml:"subjectTemplate,omitempty" json:"subjectTemplate,omitempty"`
2738 BodyTemplate string `graphql:"emailBodyTemplate: bodyTemplate" yaml:"bodyTemplate,omitempty" json:"bodyTemplate,omitempty"`
2839 UseProxy bool `graphql:"emailUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
2940}
3041
42+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
3143type HumioRepoAction struct {
3244 IngestToken string `graphql:"humioRepoIngestToken: ingestToken" yaml:"ingestToken,omitempty" json:"ingestToken,omitempty"`
3345}
3446
47+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
3548type OpsGenieAction struct {
3649 ApiUrl string `graphql:"opsGenieApiUrl: apiUrl" yaml:"apiUrl,omitempty" json:"apiUrl,omitempty"`
3750 GenieKey string `graphql:"opsGenieGenieKey: genieKey" yaml:"genieKey,omitempty" json:"genieKey,omitempty"`
3851 UseProxy bool `graphql:"opsGenieUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
3952}
4053
54+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
4155type PagerDutyAction struct {
4256 Severity string `graphql:"pagerDutySeverity: severity" yaml:"severity,omitempty" json:"severity,omitempty"`
4357 RoutingKey string `graphql:"pagerDutyRoutingKey: routingKey" yaml:"routingKey,omitempty" json:"routingKey,omitempty"`
4458 UseProxy bool `graphql:"pagerDutyUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
4559}
4660
61+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
4762type SlackFieldEntryInput struct {
4863 FieldName string `graphql:"fieldName" yaml:"fieldName" json:"fieldName"`
4964 Value string `graphql:"value" yaml:"value" json:"value"`
5065}
5166
67+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
5268type SlackAction struct {
5369 Url string `graphql:"slackUrl: url" yaml:"url,omitempty" json:"url,omitempty"`
5470 Fields []SlackFieldEntryInput `graphql:"slackFields: fields" yaml:"fields,omitempty" json:"fields,omitempty"`
5571 UseProxy bool `graphql:"slackUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
5672}
5773
74+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
5875type SlackPostMessageAction struct {
5976 ApiToken string `graphql:"slackPostMessageApiToken: apiToken" yaml:"apiToken,omitempty" json:"apiToken,omitempty"`
6077 Channels []string `graphql:"slackPostMessageChannels: channels" yaml:"channels,omitempty" json:"channels,omitempty"`
6178 Fields []SlackFieldEntryInput `graphql:"slackPostMessageFields: fields" yaml:"fields,omitempty" json:"fields,omitempty"`
6279 UseProxy bool `graphql:"slackPostMessageUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
6380}
6481
82+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
6583type VictorOpsAction struct {
6684 MessageType string `graphql:"victorOpsMessageType: messageType" yaml:"messageType,omitempty" json:"messageType,omitempty"`
6785 NotifyUrl string `graphql:"victorOpsNotifyUrl: notifyUrl" yaml:"notifyUrl,omitempty" json:"notifyUrl,omitempty"`
6886 UseProxy bool `graphql:"victorOpsUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
6987}
7088
89+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
7190type HttpHeaderEntryInput struct {
7291 Header string `graphql:"header" yaml:"header" json:"header"`
7392 Value string `graphql:"value" yaml:"value" json:"value"`
7493}
7594
95+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
7696type WebhookAction struct {
7797 Method string `graphql:"webhookMethod: method" yaml:"method,omitempty" json:"method,omitempty"`
7898 Url string `graphql:"webhookUrl: url" yaml:"url,omitempty" json:"url,omitempty"`
@@ -82,6 +102,7 @@ type WebhookAction struct {
82102 UseProxy bool `graphql:"webhookUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
83103}
84104
105+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
85106type Action struct {
86107 Type string `graphql:"__typename" yaml:"type" json:"type"`
87108 ID string `graphql:"id" yaml:"-" json:"id"`
@@ -97,8 +118,10 @@ type Action struct {
97118 WebhookAction WebhookAction `graphql:"... on WebhookAction" yaml:"webhookAction,omitempty" json:"webhookAction,omitempty"`
98119}
99120
121+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
100122func (c * Client ) Actions () * Actions { return & Actions {client : c } }
101123
124+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
102125func (n * Actions ) List (viewName string ) ([]Action , error ) {
103126 var query struct {
104127 SearchDomain struct {
@@ -114,6 +137,7 @@ func (n *Actions) List(viewName string) ([]Action, error) {
114137 return query .SearchDomain .Actions , err
115138}
116139
140+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
117141func (n * Actions ) Update (viewName string , newAction * Action ) (* Action , error ) {
118142 if newAction == nil {
119143 return nil , fmt .Errorf ("action must not be nil" )
@@ -454,6 +478,7 @@ func (n *Actions) Update(viewName string, newAction *Action) (*Action, error) {
454478 return nil , fmt .Errorf ("no action details specified or unsupported action type used" )
455479}
456480
481+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
457482func (n * Actions ) Add (viewName string , newAction * Action ) (* Action , error ) {
458483 if newAction == nil {
459484 return nil , fmt .Errorf ("action must not be nil" )
@@ -781,6 +806,7 @@ func (n *Actions) Add(viewName string, newAction *Action) (*Action, error) {
781806 return nil , fmt .Errorf ("no action details specified or unsupported action type used" )
782807}
783808
809+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
784810func (n * Actions ) Get (viewName , actionName string ) (* Action , error ) {
785811 actions , err := n .List (viewName )
786812 if err != nil {
@@ -795,6 +821,7 @@ func (n *Actions) Get(viewName, actionName string) (*Action, error) {
795821 return nil , ActionNotFound (actionName )
796822}
797823
824+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
798825func (n * Actions ) GetByID (viewName , actionID string ) (* Action , error ) {
799826 var query struct {
800827 SearchDomain struct {
@@ -819,6 +846,7 @@ func (n *Actions) GetByID(viewName, actionID string) (*Action, error) {
819846 return query .SearchDomain .Action , err
820847}
821848
849+ // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example
822850func (n * Actions ) Delete (viewName , actionName string ) error {
823851 actions , err := n .List (viewName )
824852 if err != nil {
0 commit comments