diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f40a2e20..36bf71bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,7 +24,7 @@ jobs: run: | export PATH=$PATH:$(go env GOPATH)/bin go install github.com/securego/gosec/v2/cmd/gosec@latest - gosec ./... + gosec -exclude-dir api -exclude-generated ./... - name: Run Staticcheck uses: dominikh/staticcheck-action@v1.3.1 with: diff --git a/Makefile b/Makefile index adb69138..b7f32b49 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ GOFILES=$(wildcard *.go) BIN_NAME=humioctl BIN_PATH=bin/$(BIN_NAME) CLI_COMMAND ?= "" +SCHEMA_CLUSTER?=${HUMIO_ENDPOINT} +SCHEMA_CLUSTER_API_TOKEN?=${HUMIO_TOKEN} $(BIN_PATH): $(GOFILES) @@ -24,6 +26,10 @@ snapshot: run: $(BIN_PATH) $(BIN_PATH) $(CLI_COMMAND) +update-schema: + go run github.com/suessflorian/gqlfetch/gqlfetch@607d6757018016bba0ba7fd1cb9fed6aefa853b5 --endpoint ${SCHEMA_CLUSTER}/graphql --header "Authorization=Bearer ${SCHEMA_CLUSTER_API_TOKEN}" > internal/api/humiographql/schema/_schema.graphql + printf "# Fetched from version %s" $$(curl --silent --location '${SCHEMA_CLUSTER}/api/v1/status' | jq -r ".version") >> internal/api/humiographql/schema/_schema.graphql + e2e: $(BIN_PATH) ./e2e/run.bash diff --git a/api/actions.go b/api/actions.go index 95c71293..817158ce 100644 --- a/api/actions.go +++ b/api/actions.go @@ -2,25 +2,36 @@ package api import ( "fmt" - graphql "github.com/cli/shurcooL-graphql" "reflect" + + graphql "github.com/cli/shurcooL-graphql" ) const ( - ActionTypeEmail string = "EmailAction" - ActionTypeHumioRepo string = "HumioRepoAction" - ActionTypeOpsGenie string = "OpsGenieAction" - ActionTypePagerDuty string = "PagerDutyAction" - ActionTypeSlack string = "SlackAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeEmail string = "EmailAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeHumioRepo string = "HumioRepoAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeOpsGenie string = "OpsGenieAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypePagerDuty string = "PagerDutyAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeSlack string = "SlackAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example ActionTypeSlackPostMessage string = "SlackPostMessageAction" - ActionTypeVictorOps string = "VictorOpsAction" - ActionTypeWebhook string = "WebhookAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeVictorOps string = "VictorOpsAction" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + ActionTypeWebhook string = "WebhookAction" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Actions struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type EmailAction struct { Recipients []string `graphql:"emailRecipients: recipients" yaml:"recipients,omitempty" json:"recipients,omitempty"` SubjectTemplate string `graphql:"emailSubjectTemplate: subjectTemplate" yaml:"subjectTemplate,omitempty" json:"subjectTemplate,omitempty"` @@ -28,33 +39,39 @@ type EmailAction struct { UseProxy bool `graphql:"emailUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type HumioRepoAction struct { IngestToken string `graphql:"humioRepoIngestToken: ingestToken" yaml:"ingestToken,omitempty" json:"ingestToken,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type OpsGenieAction struct { ApiUrl string `graphql:"opsGenieApiUrl: apiUrl" yaml:"apiUrl,omitempty" json:"apiUrl,omitempty"` GenieKey string `graphql:"opsGenieGenieKey: genieKey" yaml:"genieKey,omitempty" json:"genieKey,omitempty"` UseProxy bool `graphql:"opsGenieUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type PagerDutyAction struct { Severity string `graphql:"pagerDutySeverity: severity" yaml:"severity,omitempty" json:"severity,omitempty"` RoutingKey string `graphql:"pagerDutyRoutingKey: routingKey" yaml:"routingKey,omitempty" json:"routingKey,omitempty"` UseProxy bool `graphql:"pagerDutyUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SlackFieldEntryInput struct { FieldName string `graphql:"fieldName" yaml:"fieldName" json:"fieldName"` Value string `graphql:"value" yaml:"value" json:"value"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SlackAction struct { Url string `graphql:"slackUrl: url" yaml:"url,omitempty" json:"url,omitempty"` Fields []SlackFieldEntryInput `graphql:"slackFields: fields" yaml:"fields,omitempty" json:"fields,omitempty"` UseProxy bool `graphql:"slackUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SlackPostMessageAction struct { ApiToken string `graphql:"slackPostMessageApiToken: apiToken" yaml:"apiToken,omitempty" json:"apiToken,omitempty"` Channels []string `graphql:"slackPostMessageChannels: channels" yaml:"channels,omitempty" json:"channels,omitempty"` @@ -62,17 +79,20 @@ type SlackPostMessageAction struct { UseProxy bool `graphql:"slackPostMessageUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type VictorOpsAction struct { MessageType string `graphql:"victorOpsMessageType: messageType" yaml:"messageType,omitempty" json:"messageType,omitempty"` NotifyUrl string `graphql:"victorOpsNotifyUrl: notifyUrl" yaml:"notifyUrl,omitempty" json:"notifyUrl,omitempty"` UseProxy bool `graphql:"victorOpsUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type HttpHeaderEntryInput struct { Header string `graphql:"header" yaml:"header" json:"header"` Value string `graphql:"value" yaml:"value" json:"value"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type WebhookAction struct { Method string `graphql:"webhookMethod: method" yaml:"method,omitempty" json:"method,omitempty"` Url string `graphql:"webhookUrl: url" yaml:"url,omitempty" json:"url,omitempty"` @@ -82,6 +102,7 @@ type WebhookAction struct { UseProxy bool `graphql:"webhookUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Action struct { Type string `graphql:"__typename" yaml:"type" json:"type"` ID string `graphql:"id" yaml:"-" json:"id"` @@ -97,8 +118,10 @@ type Action struct { WebhookAction WebhookAction `graphql:"... on WebhookAction" yaml:"webhookAction,omitempty" json:"webhookAction,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Actions() *Actions { return &Actions{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) List(viewName string) ([]Action, error) { var query struct { SearchDomain struct { @@ -114,6 +137,7 @@ func (n *Actions) List(viewName string) ([]Action, error) { return query.SearchDomain.Actions, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) Update(viewName string, newAction *Action) (*Action, error) { if newAction == nil { return nil, fmt.Errorf("action must not be nil") @@ -454,6 +478,7 @@ func (n *Actions) Update(viewName string, newAction *Action) (*Action, error) { return nil, fmt.Errorf("no action details specified or unsupported action type used") } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) Add(viewName string, newAction *Action) (*Action, error) { if newAction == nil { return nil, fmt.Errorf("action must not be nil") @@ -781,6 +806,7 @@ func (n *Actions) Add(viewName string, newAction *Action) (*Action, error) { return nil, fmt.Errorf("no action details specified or unsupported action type used") } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) Get(viewName, actionName string) (*Action, error) { actions, err := n.List(viewName) if err != nil { @@ -795,6 +821,7 @@ func (n *Actions) Get(viewName, actionName string) (*Action, error) { return nil, ActionNotFound(actionName) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) GetByID(viewName, actionID string) (*Action, error) { var query struct { SearchDomain struct { @@ -819,6 +846,7 @@ func (n *Actions) GetByID(viewName, actionID string) (*Action, error) { return query.SearchDomain.Action, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *Actions) Delete(viewName, actionName string) error { actions, err := n.List(viewName) if err != nil { diff --git a/api/aggregate-alerts.go b/api/aggregate-alerts.go index 0ab409ec..5dfdef1c 100644 --- a/api/aggregate-alerts.go +++ b/api/aggregate-alerts.go @@ -2,10 +2,12 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type AggregateAlert struct { ID string `graphql:"id" yaml:"-" json:"id"` Name string `graphql:"name" yaml:"name" json:"name"` @@ -23,12 +25,15 @@ type AggregateAlert struct { RunAsUserID string `graphql:"runAsUserId" yaml:"runAsUserId,omitempty" json:"runAsUserId,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type AggregateAlerts struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) AggregateAlerts() *AggregateAlerts { return &AggregateAlerts{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *AggregateAlerts) List(viewName string) ([]*AggregateAlert, error) { if viewName == "" { return nil, fmt.Errorf("viewName must not be empty") @@ -58,6 +63,7 @@ func (a *AggregateAlerts) List(viewName string) ([]*AggregateAlert, error) { return aggregateAlerts, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *AggregateAlerts) Update(viewName string, updatedAggregateAlert *AggregateAlert) (*AggregateAlert, error) { if viewName == "" { return nil, fmt.Errorf("viewName must not be empty") @@ -117,6 +123,7 @@ func (a *AggregateAlerts) Update(viewName string, updatedAggregateAlert *Aggrega return &aggregateAlert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *AggregateAlerts) Create(viewName string, newAggregateAlert *AggregateAlert) (*AggregateAlert, error) { if viewName == "" { return nil, fmt.Errorf("viewName must not be empty") @@ -171,6 +178,7 @@ func (a *AggregateAlerts) Create(viewName string, newAggregateAlert *AggregateAl return &aggregateAlert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *AggregateAlerts) Delete(viewName, aggregateAlertID string) error { if viewName == "" { return fmt.Errorf("viewName must not be empty") @@ -198,6 +206,7 @@ func (a *AggregateAlerts) Delete(viewName, aggregateAlertID string) error { return err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *AggregateAlerts) Get(viewName string, aggregateAlertID string) (*AggregateAlert, error) { var query struct { SearchDomain struct { diff --git a/api/alerts.go b/api/alerts.go index 95dd423c..5e6a8945 100644 --- a/api/alerts.go +++ b/api/alerts.go @@ -2,10 +2,12 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Alert struct { ID string `graphql:"id" yaml:"-" json:"id"` Name string `graphql:"name" yaml:"name" json:"name"` @@ -25,16 +27,21 @@ type Alert struct { } const ( - QueryOwnershipTypeUser string = "User" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + QueryOwnershipTypeUser string = "User" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example QueryOwnershipTypeOrganization string = "Organization" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Alerts struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Alerts() *Alerts { return &Alerts{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *Alerts) List(viewName string) ([]Alert, error) { var query struct { SearchDomain struct { @@ -55,6 +62,7 @@ func (a *Alerts) List(viewName string) ([]Alert, error) { return alerts, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *Alerts) Update(viewName string, newAlert *Alert) (*Alert, error) { if newAlert == nil { return nil, fmt.Errorf("newAlert must not be nil") @@ -108,6 +116,7 @@ func (a *Alerts) Update(viewName string, newAlert *Alert) (*Alert, error) { return &alert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *Alerts) Add(viewName string, newAlert *Alert) (*Alert, error) { if newAlert == nil { return nil, fmt.Errorf("newAlert must not be nil") @@ -155,6 +164,7 @@ func (a *Alerts) Add(viewName string, newAlert *Alert) (*Alert, error) { return &alert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *Alerts) Get(viewName, alertName string) (*Alert, error) { alerts, err := a.List(viewName) if err != nil { @@ -169,6 +179,7 @@ func (a *Alerts) Get(viewName, alertName string) (*Alert, error) { return nil, AlertNotFound(alertName) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *Alerts) Delete(viewName, alertName string) error { actions, err := a.List(viewName) if err != nil { diff --git a/api/client.go b/api/client.go index ee2f11af..063c1baf 100644 --- a/api/client.go +++ b/api/client.go @@ -4,21 +4,24 @@ import ( "bytes" "context" "fmt" - graphql "github.com/cli/shurcooL-graphql" "io" "net" "net/http" "net/url" "strings" + + graphql "github.com/cli/shurcooL-graphql" ) const defaultUserAgent = "Humio-go-client/unknown" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Client struct { config Config httpTransport *http.Transport } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Config struct { Address *url.URL UserAgent string @@ -29,37 +32,45 @@ type Config struct { DialContext func(ctx context.Context, network, addr string) (net.Conn, error) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func DefaultConfig() Config { config := Config{} return config } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Address() *url.URL { return c.config.Address } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Token() string { return c.config.Token } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) CACertificate() string { return c.config.CACertificatePEM } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Insecure() bool { return c.config.Insecure } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Config() Config { return c.config } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func NewClient(config Config) *Client { httpTransport := NewHttpTransport(config) return NewClientWithTransport(config, httpTransport) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func NewClientWithTransport(config Config, httpTransport *http.Transport) *Client { if config.Address != nil && !strings.HasSuffix(config.Address.Path, "/") { config.Address.Path = config.Address.Path + "/" @@ -75,6 +86,7 @@ func NewClientWithTransport(config Config, httpTransport *http.Transport) *Clien } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) headers() map[string]string { headers := map[string]string{} @@ -93,6 +105,7 @@ func (c *Client) headers() map[string]string { return headers } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) newGraphQLClient() (*graphql.Client, error) { httpClient := c.newHTTPClientWithHeaders(c.headers()) graphqlURL, err := c.Address().Parse("graphql") @@ -102,6 +115,7 @@ func (c *Client) newGraphQLClient() (*graphql.Client, error) { return graphql.NewClient(graphqlURL.String(), httpClient), nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Query(query interface{}, variables map[string]interface{}) error { client, err := c.newGraphQLClient() if err != nil { @@ -110,6 +124,7 @@ func (c *Client) Query(query interface{}, variables map[string]interface{}) erro return client.Query(context.Background(), query, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Mutate(mutation interface{}, variables map[string]interface{}) error { client, err := c.newGraphQLClient() if err != nil { @@ -119,13 +134,18 @@ func (c *Client) Mutate(mutation interface{}, variables map[string]interface{}) } // JSONContentType is "application/json" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example const JSONContentType string = "application/json" + +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example const ZIPContentType string = "application/zip" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) HTTPRequest(httpMethod string, path string, body io.Reader) (*http.Response, error) { return c.HTTPRequestContext(context.Background(), httpMethod, path, body, JSONContentType) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) HTTPRequestContext(ctx context.Context, httpMethod string, path string, body io.Reader, contentType string) (*http.Response, error) { if body == nil { body = bytes.NewReader(nil) diff --git a/api/cluster.go b/api/cluster.go index c5f4271b..7823eec6 100644 --- a/api/cluster.go +++ b/api/cluster.go @@ -2,14 +2,17 @@ package api import ( "fmt" - graphql "github.com/cli/shurcooL-graphql" "math" + + graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Clusters struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ClusterNode struct { Id int Name string @@ -35,11 +38,13 @@ type ClusterNode struct { Zone string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type IngestPartition struct { Id int NodeIds []int } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Cluster struct { Nodes []ClusterNode ClusterInfoAgeSeconds float64 @@ -54,8 +59,10 @@ type Cluster struct { IngestPartitions []IngestPartition } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Clusters() *Clusters { return &Clusters{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Clusters) Get() (Cluster, error) { var query struct { Cluster Cluster @@ -65,12 +72,15 @@ func (c *Clusters) Get() (Cluster, error) { return query.Cluster, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ClusterNodes struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) ClusterNodes() *ClusterNodes { return &ClusterNodes{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *ClusterNodes) List() ([]ClusterNode, error) { var query struct { Cluster struct { @@ -82,6 +92,7 @@ func (n *ClusterNodes) List() ([]ClusterNode, error) { return query.Cluster.Nodes, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *ClusterNodes) Get(nodeID int) (ClusterNode, error) { var query struct { Cluster struct { @@ -103,6 +114,7 @@ func (n *ClusterNodes) Get(nodeID int) (ClusterNode, error) { return ClusterNode{}, fmt.Errorf("node id not found in cluster") } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (n *ClusterNodes) Unregister(nodeID int, force bool) error { if nodeID > math.MaxInt32 { return fmt.Errorf("node id too large") diff --git a/api/error.go b/api/error.go index 9a78cb34..a2bd54b5 100644 --- a/api/error.go +++ b/api/error.go @@ -4,42 +4,59 @@ import ( "fmt" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type EntityType string const ( - EntityTypeSearchDomain EntityType = "search-domain" - EntityTypeRepository EntityType = "repository" - EntityTypeView EntityType = "view" - EntityTypeIngestToken EntityType = "ingest-token" - EntityTypeParser EntityType = "parser" - EntityTypeAction EntityType = "action" - EntityTypeAlert EntityType = "alert" - EntityTypeFilterAlert EntityType = "filter-alert" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeSearchDomain EntityType = "search-domain" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeRepository EntityType = "repository" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeView EntityType = "view" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeIngestToken EntityType = "ingest-token" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeParser EntityType = "parser" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeAction EntityType = "action" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeAlert EntityType = "alert" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeFilterAlert EntityType = "filter-alert" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example EntityTypeScheduledSearch EntityType = "scheduled-search" - EntityTypeAggregateAlert EntityType = "aggregate-alert" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + EntityTypeAggregateAlert EntityType = "aggregate-alert" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e EntityType) String() string { return string(e) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type EntityNotFound struct { entityType EntityType key string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e EntityNotFound) EntityType() EntityType { return e.entityType } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e EntityNotFound) Key() string { return e.key } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e EntityNotFound) Error() string { return fmt.Sprintf("%s %q not found", e.entityType.String(), e.key) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func SearchDomainNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeSearchDomain, @@ -47,6 +64,7 @@ func SearchDomainNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func RepositoryNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeRepository, @@ -54,6 +72,7 @@ func RepositoryNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func ViewNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeView, @@ -61,6 +80,7 @@ func ViewNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func IngestTokenNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeIngestToken, @@ -68,6 +88,7 @@ func IngestTokenNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func ParserNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeParser, @@ -75,6 +96,7 @@ func ParserNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func ActionNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeAction, @@ -82,6 +104,7 @@ func ActionNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func AlertNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeAlert, @@ -89,6 +112,7 @@ func AlertNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func FilterAlertNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeFilterAlert, @@ -96,6 +120,7 @@ func FilterAlertNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func ScheduledSearchNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeScheduledSearch, @@ -103,6 +128,7 @@ func ScheduledSearchNotFound(name string) error { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func AggregateAlertNotFound(name string) error { return EntityNotFound{ entityType: EntityTypeAggregateAlert, diff --git a/api/featureflag.go b/api/featureflag.go index 35ae7413..713b205a 100644 --- a/api/featureflag.go +++ b/api/featureflag.go @@ -2,16 +2,20 @@ package api import graphql "github.com/cli/shurcooL-graphql" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type FeatureFlag string +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type FeatureFlags struct { c *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) FeatureFlags() *FeatureFlags { return &FeatureFlags{c: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) SupportedFlags() ([]FeatureFlag, error) { var query struct { Type struct { @@ -34,6 +38,7 @@ func (f *FeatureFlags) SupportedFlags() ([]FeatureFlag, error) { return result, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) EnableGlobally(flag FeatureFlag) error { var mutation struct { EnableFeature bool `graphql:"enableFeature(feature: $feature)"` @@ -46,6 +51,7 @@ func (f *FeatureFlags) EnableGlobally(flag FeatureFlag) error { return f.c.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) DisableGlobally(flag FeatureFlag) error { var mutation struct { DisableFeature bool `graphql:"disableFeature(feature: $feature)"` @@ -58,6 +64,7 @@ func (f *FeatureFlags) DisableGlobally(flag FeatureFlag) error { return f.c.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) EnableForOrganization(organizationID string, flag FeatureFlag) error { var mutation struct { EnableFeature bool `graphql:"enableFeatureForOrg(feature: $feature, orgId: $orgId)"` @@ -71,6 +78,7 @@ func (f *FeatureFlags) EnableForOrganization(organizationID string, flag Feature return f.c.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) DisableForOrganization(organizationID string, flag FeatureFlag) error { var mutation struct { DisableFeature bool `graphql:"disableFeatureForOrg(feature: $feature, orgId: $orgId)"` @@ -84,6 +92,7 @@ func (f *FeatureFlags) DisableForOrganization(organizationID string, flag Featur return f.c.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) EnableForUser(userID string, flag FeatureFlag) error { var mutation struct { EnableFeature bool `graphql:"enableFeatureForUser(feature: $feature, userId: $userId)"` @@ -97,6 +106,7 @@ func (f *FeatureFlags) EnableForUser(userID string, flag FeatureFlag) error { return f.c.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *FeatureFlags) DisableForUser(userID string, flag FeatureFlag) error { var mutation struct { DisableFeature bool `graphql:"disableFeatureForUser(feature: $feature, userId: $userId)"` diff --git a/api/files.go b/api/files.go index 6ca6b73d..005db5af 100644 --- a/api/files.go +++ b/api/files.go @@ -3,27 +3,32 @@ package api import ( "context" "fmt" - graphql "github.com/cli/shurcooL-graphql" "io" "mime/multipart" "net/http" "net/url" + graphql "github.com/cli/shurcooL-graphql" + "golang.org/x/sync/errgroup" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Files struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type File struct { ID string Name string ContentHash string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Files() *Files { return &Files{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *Files) List(viewName string) ([]File, error) { var query struct { SearchDomain struct { @@ -39,6 +44,7 @@ func (f *Files) List(viewName string) ([]File, error) { return query.SearchDomain.Files, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *Files) Delete(viewName string, fileName string) error { var query struct { RemoveFile struct { @@ -55,6 +61,7 @@ func (f *Files) Delete(viewName string, fileName string) error { return f.client.Mutate(&query, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *Files) Upload(viewName string, fileName string, reader io.Reader) error { pr, pw := io.Pipe() @@ -98,6 +105,7 @@ func (f *Files) Upload(viewName string, fileName string, reader io.Reader) error return nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (f *Files) Download(viewName string, fileName string) (io.Reader, error) { resp, err := f.client.HTTPRequest(http.MethodGet, fmt.Sprintf("api/v1/dataspaces/%s/files/%s", url.PathEscape(viewName), url.PathEscape(fileName)), nil) if err != nil { diff --git a/api/filter-alerts.go b/api/filter-alerts.go index 73781922..3990ecc5 100644 --- a/api/filter-alerts.go +++ b/api/filter-alerts.go @@ -2,10 +2,12 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type FilterAlert struct { ID string `graphql:"id" yaml:"-" json:"id"` Name string `graphql:"name" yaml:"name" json:"name"` @@ -20,12 +22,15 @@ type FilterAlert struct { RunAsUserID string `graphql:"runAsUserId" yaml:"runAsUserId,omitempty" json:"runAsUserId,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type FilterAlerts struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) FilterAlerts() *FilterAlerts { return &FilterAlerts{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (fa *FilterAlerts) List(viewName string) ([]FilterAlert, error) { var query struct { SearchDomain struct { @@ -50,6 +55,7 @@ func (fa *FilterAlerts) List(viewName string) ([]FilterAlert, error) { return filterAlerts, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (fa *FilterAlerts) Update(viewName string, updatedFilterAlert *FilterAlert) (*FilterAlert, error) { if updatedFilterAlert == nil { return nil, fmt.Errorf("updatedFilterAlert must not be nil") @@ -102,6 +108,7 @@ func (fa *FilterAlerts) Update(viewName string, updatedFilterAlert *FilterAlert) return &filterAlert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (fa *FilterAlerts) Create(viewName string, newFilterAlert *FilterAlert) (*FilterAlert, error) { if newFilterAlert == nil { return nil, fmt.Errorf("newFilterAlert must not be nil") @@ -149,6 +156,7 @@ func (fa *FilterAlerts) Create(viewName string, newFilterAlert *FilterAlert) (*F return &filterAlert, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (fa *FilterAlerts) Delete(viewName, filterAlertID string) error { if filterAlertID == "" { return fmt.Errorf("filterAlertID is empty") @@ -172,6 +180,7 @@ func (fa *FilterAlerts) Delete(viewName, filterAlertID string) error { return err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (fa *FilterAlerts) Get(viewName string, filterAlertID string) (*FilterAlert, error) { var query struct { SearchDomain struct { diff --git a/api/groups.go b/api/groups.go index 30c676f7..240a5b98 100644 --- a/api/groups.go +++ b/api/groups.go @@ -2,22 +2,28 @@ package api import ( "errors" + graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Groups struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Group struct { ID string DisplayName string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Groups() *Groups { return &Groups{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example var ErrUserNotFound = errors.New("user not found") +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (g *Groups) List() ([]Group, error) { var query struct { Page struct { @@ -33,6 +39,7 @@ func (g *Groups) List() ([]Group, error) { return query.Page.Groups, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (g *Groups) AddUserToGroup(groupID string, userID string) error { var mutation struct { AddUsersToGroup struct { @@ -69,6 +76,7 @@ func (g *Groups) AddUserToGroup(groupID string, userID string) error { return nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (g *Groups) RemoveUserFromGroup(groupID string, userID string) error { var mutation struct { RemoveUsersFromGroup struct { diff --git a/api/health.go b/api/health.go index 52f936ed..854fc2bc 100644 --- a/api/health.go +++ b/api/health.go @@ -8,14 +8,19 @@ import ( "net/http" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type StatusValue string const ( - StatusOK StatusValue = "OK" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + StatusOK StatusValue = "OK" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example StatusWarn StatusValue = "WARN" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example StatusDown StatusValue = "DOWN" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type HealthCheck struct { Name string `json:"name"` Status StatusValue `json:"status"` @@ -23,6 +28,7 @@ type HealthCheck struct { Fields map[string]interface{} `json:"fields"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Health struct { Status StatusValue `json:"status"` StatusMessage string `json:"statusMessage"` @@ -34,6 +40,7 @@ type Health struct { rawJson []byte } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) HealthString() (string, error) { resp, err := c.HTTPRequest(http.MethodGet, "api/v1/health", nil) if err != nil { @@ -48,6 +55,7 @@ func (c *Client) HealthString() (string, error) { return string(bytes), nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Health() (Health, error) { resp, err := c.HTTPRequest(http.MethodGet, "api/v1/health-json", nil) if err != nil { @@ -80,6 +88,7 @@ func (c *Client) Health() (Health, error) { return health, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (h *Health) ChecksMap() map[string]HealthCheck { m := map[string]HealthCheck{} @@ -92,6 +101,7 @@ func (h *Health) ChecksMap() map[string]HealthCheck { return m } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (h *Health) Json() []byte { return h.rawJson } diff --git a/api/httpclient.go b/api/httpclient.go index b0cbcadc..40120913 100644 --- a/api/httpclient.go +++ b/api/httpclient.go @@ -16,6 +16,7 @@ type headerTransport struct { headers map[string]string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func NewHttpTransport(config Config) *http.Transport { dialContext := config.DialContext if dialContext == nil { @@ -86,6 +87,7 @@ func (c *Client) newHTTPClientWithHeaders(headers map[string]string) *http.Clien } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) { req2 := CloneRequest(req) for key, val := range h.headers { @@ -97,6 +99,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) { // CloneRequest and CloneHeader copied from https://github.com/kubernetes/apimachinery/blob/a76b7114b20a2e56fd698bba815b1e2c82ec4bff/pkg/util/net/http.go#L469-L491 // CloneRequest creates a shallow copy of the request along with a deep copy of the Headers. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func CloneRequest(req *http.Request) *http.Request { r := new(http.Request) @@ -110,6 +113,7 @@ func CloneRequest(req *http.Request) *http.Request { } // CloneHeader creates a deep copy of an http.Header. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func CloneHeader(in http.Header) http.Header { out := make(http.Header, len(in)) for key, values := range in { diff --git a/api/ingest-tokens.go b/api/ingest-tokens.go index 28da72ac..92964950 100644 --- a/api/ingest-tokens.go +++ b/api/ingest-tokens.go @@ -4,16 +4,19 @@ import ( graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type IngestTokens struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type IngestToken struct { Name string `json:"name"` Token string `json:"token"` AssignedParser string `json:"parser"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) IngestTokens() *IngestTokens { return &IngestTokens{client: c} } type ingestTokenData struct { @@ -24,6 +27,7 @@ type ingestTokenData struct { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (i *IngestTokens) List(repo string) ([]IngestToken, error) { var query struct { Result struct { @@ -48,6 +52,7 @@ func (i *IngestTokens) List(repo string) ([]IngestToken, error) { return tokens, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (i *IngestTokens) Get(repoName, tokenName string) (*IngestToken, error) { tokensInRepo, err := i.List(repoName) if err != nil { @@ -76,6 +81,7 @@ func toIngestToken(data ingestTokenData) *IngestToken { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (i *IngestTokens) Add(repositoryName string, tokenName string, parser string) (*IngestToken, error) { variables := map[string]interface{}{ "tokenName": graphql.String(tokenName), @@ -111,6 +117,7 @@ func (i *IngestTokens) Add(repositoryName string, tokenName string, parser strin return &ingestToken, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (i *IngestTokens) Update(repositoryName string, tokenName string, parser string) (*IngestToken, error) { if parser == "" { var mutation struct { @@ -152,6 +159,7 @@ func (i *IngestTokens) Update(repositoryName string, tokenName string, parser st return i.Get(repositoryName, tokenName) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (i *IngestTokens) Remove(repositoryName string, tokenName string) error { var mutation struct { Result struct { diff --git a/api/internal/humiographql/parsers.go b/api/internal/humiographql/parsers.go index 109d8a32..3c75cbf8 100644 --- a/api/internal/humiographql/parsers.go +++ b/api/internal/humiographql/parsers.go @@ -60,7 +60,7 @@ type Parser struct { ID graphql.String `graphql:"id"` Name graphql.String `graphql:"name"` DisplayName graphql.String `graphql:"displayName"` - Description graphql.String `graphql:"description""` + Description graphql.String `graphql:"description"` IsBuiltIn graphql.Boolean `graphql:"isBuiltIn"` Script graphql.String `graphql:"script"` FieldsToTag []graphql.String `graphql:"fieldsToTag"` @@ -70,7 +70,7 @@ type Parser struct { type CreateParserInputV2 struct { Name graphql.String `json:"name"` - Script graphql.String `json:"script""` + Script graphql.String `json:"script"` TestCases []ParserTestCaseInput `json:"testCases"` RepositoryName RepoOrViewName `json:"repositoryName"` FieldsToTag []graphql.String `json:"fieldsToTag"` diff --git a/api/license.go b/api/license.go index 7fbad224..1193cd2f 100644 --- a/api/license.go +++ b/api/license.go @@ -2,15 +2,18 @@ package api import graphql "github.com/cli/shurcooL-graphql" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Licenses struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type License interface { ExpiresAt() string IssuedAt() string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type OnPremLicense struct { ID string ExpiresAtVal string @@ -19,16 +22,20 @@ type OnPremLicense struct { NumberOfSeats int } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (l OnPremLicense) IssuedAt() string { return l.IssuedAtVal } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (l OnPremLicense) ExpiresAt() string { return l.ExpiresAtVal } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Licenses() *Licenses { return &Licenses{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (l *Licenses) Install(license string) error { var mutation struct { @@ -44,6 +51,7 @@ func (l *Licenses) Install(license string) error { return l.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (l *Licenses) Get() (License, error) { var query struct { InstalledLicense struct { diff --git a/api/organizations.go b/api/organizations.go index 0632fb71..e8ec4ae4 100644 --- a/api/organizations.go +++ b/api/organizations.go @@ -2,18 +2,22 @@ package api import graphql "github.com/cli/shurcooL-graphql" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Organizations struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Organization struct { ID string Name string Description *string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Organizations() *Organizations { return &Organizations{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (o *Organizations) CreateOrganization(name string) (Organization, error) { var mutation struct { CreateOrganization Organization `graphql:"createEmptyOrganization(name: $name)"` diff --git a/api/packages.go b/api/packages.go index fd31a3e9..ed33836e 100644 --- a/api/packages.go +++ b/api/packages.go @@ -5,7 +5,6 @@ import ( "context" "encoding/json" "fmt" - graphql "github.com/cli/shurcooL-graphql" "io" "net/http" "net/url" @@ -13,28 +12,35 @@ import ( "path" "path/filepath" "strings" + + graphql "github.com/cli/shurcooL-graphql" ) // Packages is a API client for working with Humio packages. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Packages struct { client *Client } // Packages constructs a Packages API client. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Packages() *Packages { return &Packages{client: c} } // ValidationResponse contain the results of a package validation. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ValidationResponse struct { InstallationErrors []string `json:"installationErrors"` ParseErrors []string `json:"parseErrors"` } // IsValid returns true if there are no errors in the package +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (resp *ValidationResponse) IsValid() bool { return (len(resp.InstallationErrors) == 0) && (len(resp.ParseErrors) == 0) } // InstalledPackage contain the details of an installed package +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type InstalledPackage struct { ID string InstalledBy *struct { @@ -59,6 +65,7 @@ func isDirectory(path string) (bool, error) { // Validate checks a package declaration validity against a Humio // server. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) Validate(viewName string, absPath string) (*ValidationResponse, error) { var zipFilePath string var err error @@ -106,6 +113,7 @@ func (p *Packages) Validate(viewName string, absPath string) (*ValidationRespons } // ListInstalled returns a list of installed packages +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) ListInstalled(viewName string) ([]InstalledPackage, error) { var query struct { Repository struct { @@ -122,6 +130,7 @@ func (p *Packages) ListInstalled(viewName string) ([]InstalledPackage, error) { } // InstallArchive installs a local package (zip file). +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) InstallArchive(viewName string, pathToZip string) (*ValidationResponse, error) { // #nosec G304 fileReader, err := os.Open(pathToZip) @@ -175,6 +184,7 @@ func detailedInstallationError(response *http.Response) error { return fmt.Errorf("%s", strings.Join(formattedErrors, "")) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type InstallationErrors struct { InstallationErrors []string `json:"installationErrors"` ParseErrors []string `json:"parseErrors"` @@ -183,12 +193,15 @@ type InstallationErrors struct { type ( // VersionedPackageSpecifier is the ID and version of a package, e.g foo/bar@2.0.1 + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example VersionedPackageSpecifier string // UnversionedPackageSpecifier is the ID of a package, e.g foo/bar + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example UnversionedPackageSpecifier string ) // UninstallPackage uninstalls a package by name. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) UninstallPackage(viewName string, packageID string) error { var mutation struct { @@ -207,6 +220,7 @@ func (p *Packages) UninstallPackage(viewName string, packageID string) error { } // CreateArchive creates a archive by bundling the files in packageDirPath in a zip file. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) CreateArchive(packageDirPath string, targetFileName string) error { // #nosec G304 outFile, err := os.Create(targetFileName) @@ -220,6 +234,7 @@ func (p *Packages) CreateArchive(packageDirPath string, targetFileName string) e } // InstallFromDirectory installs a package from a directory containing the package files. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Packages) InstallFromDirectory(packageDirPath string, targetRepoOrView string) (*ValidationResponse, error) { zipFilePath, err := createTempZipFromFolder(packageDirPath) if err != nil { diff --git a/api/parsers.go b/api/parsers.go index b74560e9..c2c92f87 100644 --- a/api/parsers.go +++ b/api/parsers.go @@ -2,27 +2,33 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example const LogScaleVersionWithParserAPIv2 = "1.129.0" +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ParserTestEvent struct { RawString string `json:"rawString" yaml:"rawString"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ParserTestCaseAssertions struct { OutputEventIndex int `json:"outputEventIndex" yaml:"outputEventIndex"` FieldsNotPresent []string `json:"fieldsNotPresent" yaml:"fieldsNotPresent"` FieldsHaveValues map[string]string `json:"fieldsHaveValues" yaml:"fieldsHaveValues"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ParserTestCase struct { Event ParserTestEvent `json:"event" yaml:"event"` Assertions []ParserTestCaseAssertions `json:"assertions" yaml:"assertions"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Parser struct { ID string Name string @@ -32,18 +38,22 @@ type Parser struct { FieldsToBeRemovedBeforeParsing []string `json:"fieldsToBeRemovedBeforeParsing,omitempty" yaml:"fieldsToBeRemovedBeforeParsing"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Parsers struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Parsers() *Parsers { return &Parsers{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ParserListItem struct { ID string Name string IsBuiltIn bool } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Parsers) List(repositoryName string) ([]ParserListItem, error) { var query struct { Repository struct { @@ -63,6 +73,7 @@ func (p *Parsers) List(repositoryName string) ([]ParserListItem, error) { return parsers, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Parsers) Delete(repositoryName string, parserName string) error { status, err := p.client.Status() if err != nil { @@ -114,6 +125,7 @@ func (p *Parsers) Delete(repositoryName string, parserName string) error { return p.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Parsers) Add(repositoryName string, newParser *Parser, allowOverwritingExistingParser bool) (*Parser, error) { if newParser == nil { return nil, fmt.Errorf("newFilterAlert must not be nil") @@ -233,6 +245,7 @@ func mapParserTestCaseToInput(p ParserTestCase) humiographql.ParserTestCaseInput } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Parsers) Get(repositoryName string, parserName string) (*Parser, error) { status, err := p.client.Status() if err != nil { @@ -322,6 +335,7 @@ func (p *Parsers) Get(repositoryName string, parserName string) (*Parser, error) return &parser, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (p *Parsers) Export(repositoryName string, parserName string) (string, error) { var query struct { diff --git a/api/repositories.go b/api/repositories.go index 753107bd..beeba6d8 100644 --- a/api/repositories.go +++ b/api/repositories.go @@ -8,10 +8,12 @@ import ( "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Repositories struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Repository struct { ID string Name string @@ -24,8 +26,10 @@ type Repository struct { AutomaticSearch bool `graphql:"automaticSearch"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Repositories() *Repositories { return &Repositories{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) Get(name string) (Repository, error) { var query struct { Repository Repository `graphql:"repository(name: $name)"` @@ -44,12 +48,14 @@ func (r *Repositories) Get(name string) (Repository, error) { return query.Repository, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type RepoListItem struct { ID string Name string SpaceUsed int64 `graphql:"compressedByteSize"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) List() ([]RepoListItem, error) { var query struct { Repositories []RepoListItem `graphql:"repositories"` @@ -59,6 +65,7 @@ func (r *Repositories) List() ([]RepoListItem, error) { return query.Repositories, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) Create(name string) error { var mutation struct { CreateRepository struct { @@ -79,6 +86,7 @@ func (r *Repositories) Create(name string) error { return nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) Delete(name, reason string, allowDataDeletion bool) error { _, err := r.Get(name) if err != nil { @@ -103,18 +111,24 @@ func (r *Repositories) Delete(name, reason string, allowDataDeletion bool) error return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type DefaultGroupEnum string const ( - DefaultGroupEnumMember DefaultGroupEnum = "Member" - DefaultGroupEnumAdmin DefaultGroupEnum = "Admin" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + DefaultGroupEnumMember DefaultGroupEnum = "Member" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example + DefaultGroupEnumAdmin DefaultGroupEnum = "Admin" + // Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example DefaultGroupEnumEliminator DefaultGroupEnum = "Eliminator" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e DefaultGroupEnum) String() string { return string(e) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e *DefaultGroupEnum) ParseString(s string) bool { switch strings.ToLower(s) { case "member": @@ -131,6 +145,7 @@ func (e *DefaultGroupEnum) ParseString(s string) bool { } } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateUserGroup(name, username string, groups ...DefaultGroupEnum) error { if len(groups) == 0 { return fmt.Errorf("at least one group must be defined") @@ -151,6 +166,7 @@ func (r *Repositories) UpdateUserGroup(name, username string, groups ...DefaultG return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateTimeBasedRetention(name string, retentionInDays float64, allowDataDeletion bool) error { existingRepo, err := r.Get(name) if err != nil { @@ -179,6 +195,7 @@ func (r *Repositories) UpdateTimeBasedRetention(name string, retentionInDays flo return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateStorageBasedRetention(name string, storageInGB float64, allowDataDeletion bool) error { existingRepo, err := r.Get(name) if err != nil { @@ -207,6 +224,7 @@ func (r *Repositories) UpdateStorageBasedRetention(name string, storageInGB floa return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateIngestBasedRetention(name string, ingestInGB float64, allowDataDeletion bool) error { existingRepo, err := r.Get(name) if err != nil { @@ -235,6 +253,7 @@ func (r *Repositories) UpdateIngestBasedRetention(name string, ingestInGB float6 return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateDescription(name, description string) error { _, err := r.Get(name) if err != nil { @@ -256,6 +275,7 @@ func (r *Repositories) UpdateDescription(name, description string) error { return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) EnableS3Archiving(name string) error { existingRepo, err := r.Get(name) if err != nil { @@ -280,6 +300,7 @@ func (r *Repositories) EnableS3Archiving(name string) error { return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) DisableS3Archiving(name string) error { existingRepo, err := r.Get(name) if err != nil { @@ -304,6 +325,7 @@ func (r *Repositories) DisableS3Archiving(name string) error { return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateS3ArchivingConfiguration(name string, bucket string, region string, format string) error { _, err := r.Get(name) if err != nil { @@ -340,6 +362,7 @@ func (r *Repositories) UpdateS3ArchivingConfiguration(name string, bucket string return r.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Repositories) UpdateAutomaticSearch(name string, automaticSearch bool) error { _, err := r.Get(name) if err != nil { diff --git a/api/roles.go b/api/roles.go index 6979aad9..1ce80144 100644 --- a/api/roles.go +++ b/api/roles.go @@ -2,13 +2,16 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Roles struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Role struct { ID string `graphql:"id"` DisplayName string `graphql:"displayName"` @@ -19,8 +22,10 @@ type Role struct { OrgPermissions []string `graphql:"organizationPermissions"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Roles() *Roles { return &Roles{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) List() ([]Role, error) { var query struct { Roles struct { @@ -38,6 +43,7 @@ func (r *Roles) List() ([]Role, error) { return RolesList, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) Create(role *Role) error { var mutation struct { Role `graphql:"createRole(input: {displayName: $displayName, viewPermissions: $permissions, color: $color, systemPermissions: $systemPermissions, organizationPermissions: $orgPermissions})"` @@ -70,6 +76,7 @@ func (r *Roles) Create(role *Role) error { return r.client.Mutate(mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) Update(rolename string, newRole *Role) error { roleId, err := r.GetRoleID(rolename) if roleId == "" || err != nil { @@ -112,6 +119,7 @@ func (r *Roles) Update(rolename string, newRole *Role) error { return r.client.Mutate(mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) RemoveRole(rolename string) error { var mutation struct { RemoveRole struct { @@ -132,6 +140,7 @@ func (r *Roles) RemoveRole(rolename string) error { return r.client.Mutate(mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) Get(rolename string) (*Role, error) { roleId, err := r.GetRoleID(rolename) if roleId == "" || err != nil { @@ -154,6 +163,7 @@ func (r *Roles) Get(rolename string) (*Role, error) { return &query.Role, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (r *Roles) GetRoleID(rolename string) (string, error) { roles, err := r.List() if err != nil { diff --git a/api/scheduled-search.go b/api/scheduled-search.go index cba1ade1..d0cae80c 100644 --- a/api/scheduled-search.go +++ b/api/scheduled-search.go @@ -2,10 +2,12 @@ package api import ( "fmt" + graphql "github.com/cli/shurcooL-graphql" "github.com/humio/cli/api/internal/humiographql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ScheduledSearch struct { ID string `graphql:"id" yaml:"-" json:"id"` Name string `graphql:"name" yaml:"name" json:"name"` @@ -23,12 +25,15 @@ type ScheduledSearch struct { QueryOwnershipType string `graphql:"queryOwnership" yaml:"queryOwnershipType" json:"queryOwnershipType"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ScheduledSearches struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) ScheduledSearches() *ScheduledSearches { return &ScheduledSearches{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *ScheduledSearches) List(viewName string) ([]ScheduledSearch, error) { var query struct { SearchDomain struct { @@ -53,6 +58,7 @@ func (a *ScheduledSearches) List(viewName string) ([]ScheduledSearch, error) { return scheduledSearches, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *ScheduledSearches) Update(viewName string, updateScheduledSearch *ScheduledSearch) (*ScheduledSearch, error) { if updateScheduledSearch == nil { return nil, fmt.Errorf("updateScheduledSearch must not be nil") @@ -108,6 +114,7 @@ func (a *ScheduledSearches) Update(viewName string, updateScheduledSearch *Sched return &scheduledSearch, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *ScheduledSearches) Create(viewName string, newScheduledSearch *ScheduledSearch) (*ScheduledSearch, error) { if newScheduledSearch == nil { return nil, fmt.Errorf("newScheduledSearch must not be nil") @@ -158,6 +165,7 @@ func (a *ScheduledSearches) Create(viewName string, newScheduledSearch *Schedule return &scheduledSearch, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *ScheduledSearches) Delete(viewName, scheduledSearchID string) error { if scheduledSearchID == "" { return fmt.Errorf("scheduledSearchID is empty") @@ -181,6 +189,7 @@ func (a *ScheduledSearches) Delete(viewName, scheduledSearchID string) error { return err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (a *ScheduledSearches) Get(viewName string, scheduledSearchId string) (*ScheduledSearch, error) { var query struct { SearchDomain struct { diff --git a/api/search.go b/api/search.go index 35536afc..4bf1e01a 100644 --- a/api/search.go +++ b/api/search.go @@ -10,12 +10,15 @@ import ( "net/url" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type QueryJobs struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) QueryJobs() *QueryJobs { return &QueryJobs{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Query struct { QueryString string `json:"queryString"` Start string `json:"start,omitempty"` @@ -26,6 +29,7 @@ type Query struct { ShowQueryEventDistribution bool `json:"showQueryEventDistribution,omitempty"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type QueryResultMetadata struct { EventCount uint64 `json:"eventCount"` ExtraData map[string]interface{} `json:"extraData"` @@ -42,6 +46,7 @@ type QueryResultMetadata struct { WorkDone uint64 `json:"workDone"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type QueryResult struct { Cancelled bool `json:"cancelled"` Done bool `json:"done"` @@ -49,14 +54,17 @@ type QueryResult struct { Metadata QueryResultMetadata `json:"metaData"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type QueryError struct { error string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (e QueryError) Error() string { return e.error } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (q QueryJobs) Create(repository string, query Query) (string, error) { var buf bytes.Buffer err := json.NewEncoder(&buf).Encode(query) @@ -96,10 +104,12 @@ func (q QueryJobs) Create(repository string, query Query) (string, error) { return jsonResponse.ID, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (q *QueryJobs) Poll(repository string, id string) (QueryResult, error) { return q.PollContext(context.Background(), repository, id) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (q *QueryJobs) PollContext(ctx context.Context, repository string, id string) (QueryResult, error) { resp, err := q.client.HTTPRequestContext(ctx, http.MethodGet, "api/v1/repositories/"+url.QueryEscape(repository)+"/queryjobs/"+id, nil, JSONContentType) @@ -118,6 +128,7 @@ func (q *QueryJobs) PollContext(ctx context.Context, repository string, id strin return result, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (q *QueryJobs) Delete(repository string, id string) error { _, err := q.client.HTTPRequest(http.MethodDelete, "api/v1/repositories/"+url.QueryEscape(repository)+"/queryjobs/"+id, nil) return err diff --git a/api/searchdomains.go b/api/searchdomains.go index 2dcb8e11..f659a97d 100644 --- a/api/searchdomains.go +++ b/api/searchdomains.go @@ -7,10 +7,12 @@ import ( graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SearchDomains struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SearchDomainsQueryData struct { Name string Description string @@ -18,14 +20,17 @@ type SearchDomainsQueryData struct { Typename graphql.String `graphql:"__typename"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SearchDomain struct { Name string Description string AutomaticSearch bool } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (s *Client) SearchDomains() *SearchDomains { return &SearchDomains{client: s} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (s *SearchDomains) Get(name string) (*SearchDomain, error) { var query struct { Result SearchDomainsQueryData `graphql:"searchDomain(name: $name)"` @@ -49,12 +54,14 @@ func (s *SearchDomains) Get(name string) (*SearchDomain, error) { return &searchDomain, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type SearchDomainListItem struct { Name string Typename string `graphql:"__typename"` AutomaticSearch bool } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (s *SearchDomains) List() ([]SearchDomainListItem, error) { var query struct { SearchDomain []SearchDomainListItem `graphql:"searchDomains"` diff --git a/api/status.go b/api/status.go index 3b1eb975..24bee3ca 100644 --- a/api/status.go +++ b/api/status.go @@ -10,15 +10,18 @@ import ( "github.com/Masterminds/semver/v3" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type StatusResponse struct { Status string Version string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (s StatusResponse) IsDown() bool { return s.Status != "OK" && s.Status != "WARN" } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (s StatusResponse) AtLeast(ver string) (bool, error) { assumeLatest := true version := strings.Split(s.Version, "-") @@ -34,6 +37,7 @@ func (s StatusResponse) AtLeast(ver string) (bool, error) { return constraint.Check(semverVersion), nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Status() (*StatusResponse, error) { resp, err := c.HTTPRequest(http.MethodGet, "api/v1/status", nil) diff --git a/api/users.go b/api/users.go index 152f4134..c525f6c2 100644 --- a/api/users.go +++ b/api/users.go @@ -2,13 +2,16 @@ package api import ( "errors" + graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Users struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type User struct { ID string Username string @@ -21,6 +24,7 @@ type User struct { CreatedAt string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type UserChangeSet struct { IsRoot *bool FullName *string @@ -30,8 +34,10 @@ type UserChangeSet struct { Email *string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Users() *Users { return &Users{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) List() ([]User, error) { var query struct { Users []User `graphql:"users"` @@ -41,6 +47,7 @@ func (u *Users) List() ([]User, error) { return query.Users, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) Get(username string) (User, error) { var query struct { Users []User `graphql:"users(search: $username)"` @@ -64,6 +71,7 @@ func (u *Users) Get(username string) (User, error) { return User{}, errors.New("user not found") } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) Update(username string, changeset UserChangeSet) (User, error) { var mutation struct { Result struct{ User User } `graphql:"updateUser(input: {username: $username, company: $company, isRoot: $isRoot, fullName: $fullName, picture: $picture, email: $email, countryCode: $countryCode})"` @@ -73,6 +81,7 @@ func (u *Users) Update(username string, changeset UserChangeSet) (User, error) { return mutation.Result.User, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) Add(username string, changeset UserChangeSet) (User, error) { var mutation struct { Result struct { @@ -89,6 +98,7 @@ func (u *Users) Add(username string, changeset UserChangeSet) (User, error) { return u.Get(username) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) Remove(username string) (User, error) { var mutation struct { Result struct { @@ -104,6 +114,7 @@ func (u *Users) Remove(username string) (User, error) { return mutation.Result.User, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (u *Users) RotateToken(userID string) (string, error) { var mutation struct { Token string `graphql:"rotateToken(input:{id:$id})"` @@ -121,6 +132,7 @@ func (u *Users) RotateToken(userID string) (string, error) { return mutation.Token, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func userChangesetToVars(username string, changeset UserChangeSet) map[string]interface{} { return map[string]interface{}{ "username": graphql.String(username), diff --git a/api/viewer.go b/api/viewer.go index f08c1f34..bfdd1784 100644 --- a/api/viewer.go +++ b/api/viewer.go @@ -1,12 +1,15 @@ package api +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Viewer struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Viewer() *Viewer { return &Viewer{client: c} } // Username fetches the username associated with the API Token in use. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Viewer) Username() (string, error) { var query struct { Viewer struct { @@ -19,6 +22,7 @@ func (c *Viewer) Username() (string, error) { } // ApiToken fetches the api token for the user who is currently authenticated. +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Viewer) ApiToken() (string, error) { var query struct { Viewer struct { diff --git a/api/views.go b/api/views.go index 6a9c5ed4..814b6caf 100644 --- a/api/views.go +++ b/api/views.go @@ -1,22 +1,26 @@ package api import ( - "github.com/humio/cli/api/internal/humiographql" "sort" "strings" + "github.com/humio/cli/api/internal/humiographql" + graphql "github.com/cli/shurcooL-graphql" ) +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type Views struct { client *Client } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ViewConnection struct { RepoName string Filter string } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ViewQueryData struct { Name string Description string @@ -30,6 +34,7 @@ type ViewQueryData struct { Typename graphql.String `graphql:"__typename"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type View struct { Name string Description string @@ -37,8 +42,10 @@ type View struct { AutomaticSearch bool } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Client) Views() *Views { return &Views{client: c} } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) Get(name string) (*View, error) { var query struct { Result ViewQueryData `graphql:"searchDomain(name: $name)"` @@ -74,12 +81,14 @@ func (c *Views) Get(name string) (*View, error) { return &view, nil } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ViewListItem struct { Name string Typename string `graphql:"__typename"` AutomaticSearch bool } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) List() ([]ViewListItem, error) { var query struct { View []ViewListItem `graphql:"searchDomains"` @@ -101,11 +110,13 @@ func (c *Views) List() ([]ViewListItem, error) { return viewsList, err } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example type ViewConnectionInput struct { RepositoryName graphql.String `json:"repositoryName"` Filter graphql.String `json:"filter"` } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) Create(name, description string, connections []ViewConnectionInput) error { var mutation struct { CreateView struct { @@ -123,6 +134,7 @@ func (c *Views) Create(name, description string, connections []ViewConnectionInp return c.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) Delete(name, reason string) error { _, err := c.Get(name) if err != nil { @@ -143,6 +155,7 @@ func (c *Views) Delete(name, reason string) error { return c.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) UpdateConnections(name string, connections []ViewConnectionInput) error { var mutation struct { View struct { @@ -158,6 +171,7 @@ func (c *Views) UpdateConnections(name string, connections []ViewConnectionInput return c.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) UpdateDescription(name string, description string) error { _, err := c.Get(name) if err != nil { @@ -179,6 +193,7 @@ func (c *Views) UpdateDescription(name string, description string) error { return c.client.Mutate(&mutation, variables) } +// Deprecated: Should no longer be used. https://github.com/CrowdStrike/logscale-go-api-client-example func (c *Views) UpdateAutomaticSearch(name string, automaticSearch bool) error { _, err := c.Get(name) if err != nil { diff --git a/cmd/humioctl/actions_export.go b/cmd/humioctl/actions_export.go index 962150aa..7c519217 100644 --- a/cmd/humioctl/actions_export.go +++ b/cmd/humioctl/actions_export.go @@ -15,9 +15,9 @@ package main import ( - "github.com/humio/cli/api" "os" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -71,10 +71,10 @@ func newActionsExportAllCmd() *cobra.Command { actions, err := client.Actions().List(view) exitOnError(cmd, err, "Error fetching actions") - for _, action := range actions { - yamlData, err := yaml.Marshal(&action) + for i := range actions { + yamlData, err := yaml.Marshal(&actions[i]) exitOnError(cmd, err, "Failed to serialize the action") - actionFilename := sanitizeTriggerName(action.Name) + ".yaml" + actionFilename := sanitizeTriggerName(actions[i].Name) + ".yaml" var outFilePath string if outputDirectory != "" { diff --git a/cmd/humioctl/actions_install.go b/cmd/humioctl/actions_install.go index fede4213..c31550bc 100644 --- a/cmd/humioctl/actions_install.go +++ b/cmd/humioctl/actions_install.go @@ -20,7 +20,7 @@ import ( "net/http" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -101,6 +101,10 @@ func getURLAction(url string) ([]byte, error) { return nil, err } + if response == nil { + return nil, fmt.Errorf("failed to get response") + } + defer func() { _ = response.Body.Close() }() diff --git a/cmd/humioctl/actions_list.go b/cmd/humioctl/actions_list.go index 4c2b4105..745d6296 100644 --- a/cmd/humioctl/actions_list.go +++ b/cmd/humioctl/actions_list.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/actions_show.go b/cmd/humioctl/actions_show.go index 92fcc0c0..1a0547b5 100644 --- a/cmd/humioctl/actions_show.go +++ b/cmd/humioctl/actions_show.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/aggregate_alerts_export.go b/cmd/humioctl/aggregate_alerts_export.go index cf2db496..3baa5c82 100644 --- a/cmd/humioctl/aggregate_alerts_export.go +++ b/cmd/humioctl/aggregate_alerts_export.go @@ -15,9 +15,9 @@ package main import ( - "github.com/humio/cli/api" "os" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -41,7 +41,7 @@ func newAggregateAlertsExportCmd() *cobra.Command { aggregateAlerts, err := client.AggregateAlerts().List(view) exitOnError(cmd, err, "Could not list aggregate alerts") - var aggregateAlert *api.AggregateAlert + var aggregateAlert api.AggregateAlert for _, fa := range aggregateAlerts { if fa.Name == aggregateAlertName { aggregateAlert = fa @@ -78,14 +78,14 @@ func newAggregateAlertsExportAllCmd() *cobra.Command { view := args[0] client := NewApiClient(cmd) - var aggregateAlerts []*api.AggregateAlert + var aggregateAlerts []api.AggregateAlert aggregateAlerts, err := client.AggregateAlerts().List(view) exitOnError(cmd, err, "Error fetching aggregate alerts") - for _, aggregateAlert := range aggregateAlerts { - yamlData, err := yaml.Marshal(&aggregateAlert) + for i := range aggregateAlerts { + yamlData, err := yaml.Marshal(&aggregateAlerts[i]) exitOnError(cmd, err, "Failed to serialize the aggregate alert") - alertFilename := sanitizeTriggerName(aggregateAlert.Name) + ".yaml" + alertFilename := sanitizeTriggerName(aggregateAlerts[i].Name) + ".yaml" var outFilePath string if outputDirectory != "" { diff --git a/cmd/humioctl/aggregate_alerts_install.go b/cmd/humioctl/aggregate_alerts_install.go index 80b860f4..9f67ebcb 100644 --- a/cmd/humioctl/aggregate_alerts_install.go +++ b/cmd/humioctl/aggregate_alerts_install.go @@ -18,15 +18,13 @@ import ( "fmt" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) func newAggregateAlertsInstallCmd() *cobra.Command { - var ( - filePath, url string - ) + var filePath, url, name string cmd := cobra.Command{ Use: "install [flags] ", @@ -65,6 +63,10 @@ The install command allows you to install aggregate alerts from a URL or from a err = yaml.Unmarshal(content, &aggregateAlert) exitOnError(cmd, err, "Could not unmarshal the aggregate alert") + if name != "" { + aggregateAlert.Name = name + } + _, err = client.AggregateAlerts().Create(viewName, &aggregateAlert) exitOnError(cmd, err, "Could not create the aggregate alert") @@ -74,6 +76,8 @@ The install command allows you to install aggregate alerts from a URL or from a cmd.Flags().StringVar(&filePath, "file", "", "The local file path to the aggregate alert to install.") cmd.Flags().StringVar(&url, "url", "", "A URL to fetch the aggregate alert file from.") + cmd.Flags().StringVarP(&name, "name", "n", "", "Install the action under a specific name, ignoring the `name` attribute in the action file.") + cmd.MarkFlagsMutuallyExclusive("file", "url") return &cmd } diff --git a/cmd/humioctl/aggregate_alerts_list.go b/cmd/humioctl/aggregate_alerts_list.go index 1927450a..b2b0f295 100644 --- a/cmd/humioctl/aggregate_alerts_list.go +++ b/cmd/humioctl/aggregate_alerts_list.go @@ -15,9 +15,10 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "strings" + + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) func newAggregateAlertsListCmd() *cobra.Command { @@ -38,16 +39,16 @@ func newAggregateAlertsListCmd() *cobra.Command { rows[i] = []format.Value{ format.String(aggregateAlert.ID), format.String(aggregateAlert.Name), - format.String(aggregateAlert.Description), + format.StringPtr(aggregateAlert.Description), format.String(strings.Join(aggregateAlert.ActionNames, ", ")), format.String(strings.Join(aggregateAlert.Labels, ", ")), format.Bool(aggregateAlert.Enabled), - format.String(aggregateAlert.ThrottleField), + format.StringPtr(aggregateAlert.ThrottleField), format.Int(aggregateAlert.ThrottleTimeSeconds), format.Int(aggregateAlert.SearchIntervalSeconds), format.String(aggregateAlert.QueryTimestampType), format.String(aggregateAlert.TriggerMode), - format.String(aggregateAlert.RunAsUserID), + format.String(aggregateAlert.OwnershipRunAsID), format.String(aggregateAlert.QueryOwnershipType), } } diff --git a/cmd/humioctl/aggregate_alerts_remove.go b/cmd/humioctl/aggregate_alerts_remove.go index d25c96fc..c0a786ee 100644 --- a/cmd/humioctl/aggregate_alerts_remove.go +++ b/cmd/humioctl/aggregate_alerts_remove.go @@ -16,8 +16,8 @@ package main import ( "fmt" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) @@ -35,7 +35,7 @@ func newAggregateAlertsRemoveCmd() *cobra.Command { aggregateAlerts, err := client.AggregateAlerts().List(viewName) exitOnError(cmd, err, "Could not list aggregate alerts") - var aggregateAlert *api.AggregateAlert + var aggregateAlert api.AggregateAlert for _, fa := range aggregateAlerts { if fa.Name == aggregateAlertName { aggregateAlert = fa diff --git a/cmd/humioctl/aggregate_alerts_show.go b/cmd/humioctl/aggregate_alerts_show.go index aeaef592..b9d22323 100644 --- a/cmd/humioctl/aggregate_alerts_show.go +++ b/cmd/humioctl/aggregate_alerts_show.go @@ -15,10 +15,11 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "strings" + + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) func newAggregateAlertsShowCmd() *cobra.Command { @@ -34,7 +35,7 @@ func newAggregateAlertsShowCmd() *cobra.Command { aggregateAlerts, err := client.AggregateAlerts().List(view) exitOnError(cmd, err, "Could not list aggregate alert") - var aggregateAlert *api.AggregateAlert + var aggregateAlert api.AggregateAlert for _, fa := range aggregateAlerts { if fa.Name == name { aggregateAlert = fa @@ -48,17 +49,17 @@ func newAggregateAlertsShowCmd() *cobra.Command { details := [][]format.Value{ {format.String("ID"), format.String(aggregateAlert.ID)}, {format.String("Name"), format.String(aggregateAlert.Name)}, - {format.String("Description"), format.String(aggregateAlert.Description)}, + {format.String("Description"), format.StringPtr(aggregateAlert.Description)}, {format.String("Query String"), format.String(aggregateAlert.QueryString)}, {format.String("Search Interval Seconds"), format.Int(aggregateAlert.SearchIntervalSeconds)}, {format.String("Actions"), format.String(strings.Join(aggregateAlert.ActionNames, ", "))}, {format.String("Labels"), format.String(strings.Join(aggregateAlert.Labels, ", "))}, {format.String("Enabled"), format.Bool(aggregateAlert.Enabled)}, - {format.String("Throttle Field"), format.String(aggregateAlert.ThrottleField)}, + {format.String("Throttle Field"), format.StringPtr(aggregateAlert.ThrottleField)}, {format.String("Throttle Time Seconds"), format.Int(aggregateAlert.ThrottleTimeSeconds)}, {format.String("Query Timestamp Type"), format.String(aggregateAlert.QueryTimestampType)}, {format.String("Trigger Mode"), format.String(aggregateAlert.TriggerMode)}, - {format.String("Run As User ID"), format.String(aggregateAlert.RunAsUserID)}, + {format.String("Run As User ID"), format.String(aggregateAlert.OwnershipRunAsID)}, {format.String("Query Ownership Type"), format.String(aggregateAlert.QueryOwnershipType)}, } diff --git a/cmd/humioctl/alerts_export.go b/cmd/humioctl/alerts_export.go index 0ebc8bc4..069be621 100644 --- a/cmd/humioctl/alerts_export.go +++ b/cmd/humioctl/alerts_export.go @@ -15,10 +15,11 @@ package main import ( - "github.com/humio/cli/api" + "os" + + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" - "os" ) func newAlertsExportCmd() *cobra.Command { @@ -70,10 +71,10 @@ func newAlertsExportAllCmd() *cobra.Command { alerts, err := client.Alerts().List(view) exitOnError(cmd, err, "Error fetching alerts") - for _, alert := range alerts { - yamlData, err := yaml.Marshal(&alert) + for i := range alerts { + yamlData, err := yaml.Marshal(&alerts[i]) exitOnError(cmd, err, "Failed to serialize the alert") - alertFilename := sanitizeTriggerName(alert.Name) + ".yaml" + alertFilename := sanitizeTriggerName(alerts[i].Name) + ".yaml" var outFilePath string if outputDirectory != "" { diff --git a/cmd/humioctl/alerts_install.go b/cmd/humioctl/alerts_install.go index b7503215..f0832235 100644 --- a/cmd/humioctl/alerts_install.go +++ b/cmd/humioctl/alerts_install.go @@ -18,7 +18,7 @@ import ( "fmt" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) diff --git a/cmd/humioctl/alerts_list.go b/cmd/humioctl/alerts_list.go index e43a5be8..2f7d6c83 100644 --- a/cmd/humioctl/alerts_list.go +++ b/cmd/humioctl/alerts_list.go @@ -17,7 +17,7 @@ package main import ( "strings" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -51,7 +51,7 @@ func newAlertsListCmd() *cobra.Command { rows = append(rows, []format.Value{ format.String(alert.Name), format.Bool(alert.Enabled), - format.String(alert.Description), + format.StringPtr(alert.Description), format.String(strings.Join(notifierNames, ", "))}) } diff --git a/cmd/humioctl/alerts_show.go b/cmd/humioctl/alerts_show.go index 559b445f..91bd8e18 100644 --- a/cmd/humioctl/alerts_show.go +++ b/cmd/humioctl/alerts_show.go @@ -17,7 +17,7 @@ package main import ( "strings" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -38,15 +38,15 @@ func newAlertsShowCmd() *cobra.Command { {format.String("ID"), format.String(alert.ID)}, {format.String("Name"), format.String(alert.Name)}, {format.String("Enabled"), format.Bool(alert.Enabled)}, - {format.String("Description"), format.String(alert.Description)}, + {format.String("Description"), format.StringPtr(alert.Description)}, {format.String("Query Start"), format.String(alert.QueryStart)}, {format.String("Query String"), format.String(alert.QueryString)}, {format.String("Labels"), format.String(strings.Join(alert.Labels, ", "))}, {format.String("Throttle Time Millis"), format.Int(alert.ThrottleTimeMillis)}, {format.String("Is Starred"), format.Bool(alert.IsStarred)}, - {format.String("Last Error"), format.String(alert.LastError)}, - {format.String("Throttle Field"), format.String(alert.ThrottleField)}, - {format.String("Time Of Last Trigger"), format.Int(alert.TimeOfLastTrigger)}, + {format.String("Last Error"), format.StringPtr(alert.LastError)}, + {format.String("Throttle Field"), format.StringPtr(alert.ThrottleField)}, + {format.String("Time Of Last Trigger"), format.IntPtr(alert.TimeOfLastTrigger)}, {format.String("Run As User ID"), format.String(alert.RunAsUserID)}, {format.String("Query Ownership Type"), format.String(alert.QueryOwnershipType)}, } diff --git a/cmd/humioctl/cluster_nodes.go b/cmd/humioctl/cluster_nodes.go index 0751926f..9023751b 100644 --- a/cmd/humioctl/cluster_nodes.go +++ b/cmd/humioctl/cluster_nodes.go @@ -15,8 +15,8 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -55,7 +55,7 @@ func printClusterNodeDetailsTable(cmd *cobra.Command, node api.ClusterNode) { {format.String("Solitary segment size"), ByteCountDecimal(node.SolitarySegmentSize)}, {format.String("Is available"), format.Bool(node.IsAvailable)}, {format.String("Last heartbeat"), format.String(node.LastHeartbeat)}, - {format.String("Availability Zone"), format.String(node.Zone)}, + {format.String("Availability Zone"), format.StringPtr(node.Zone)}, } printDetailsTable(cmd, details) diff --git a/cmd/humioctl/cluster_nodes_list.go b/cmd/humioctl/cluster_nodes_list.go index 3ab18eac..b1f6e5f0 100644 --- a/cmd/humioctl/cluster_nodes_list.go +++ b/cmd/humioctl/cluster_nodes_list.go @@ -17,8 +17,7 @@ package main import ( "sort" - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -35,10 +34,7 @@ func newClusterNodesListCmd() *cobra.Command { exitOnError(cmd, err, "Error fetching cluster nodes") sort.Slice(nodes, func(i, j int) bool { - var a, b api.ClusterNode - a = nodes[j] - b = nodes[j] - return a.Name < b.Name + return nodes[i].Name < nodes[j].Name }) rows := make([][]format.Value, len(nodes)) @@ -47,7 +43,7 @@ func newClusterNodesListCmd() *cobra.Command { format.Int(node.Id), format.String(node.Name), format.Bool(node.CanBeSafelyUnregistered), - format.String(node.Zone), + format.StringPtr(node.Zone), } } diff --git a/cmd/humioctl/cluster_show.go b/cmd/humioctl/cluster_show.go index f6a96bb5..502fa06b 100644 --- a/cmd/humioctl/cluster_show.go +++ b/cmd/humioctl/cluster_show.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/featureflags_enable.go b/cmd/humioctl/featureflags_enable.go index 2f46b8e4..ce4b846b 100644 --- a/cmd/humioctl/featureflags_enable.go +++ b/cmd/humioctl/featureflags_enable.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) @@ -38,7 +38,7 @@ func newFeatureFlagsDisableCmd() *cobra.Command { cmd := &cobra.Command{ Use: "disable [--global | --user | --organization ] ", - Short: "disable a feature flag", + Short: "Disable a feature flag", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { enableDisableFeatureFlag(cmd, args, global, organizationID, userID, false) @@ -60,7 +60,7 @@ func enableDisableFeatureFlag(cmd *cobra.Command, args []string, global bool, or postTense = "Enabled" } - flag := api.FeatureFlag(args[0]) + flag := api.FeatureFlagName(args[0]) if global && len(organizationID) > 0 && len(userID) > 0 { cmd.PrintErrln("cannot specify --global, --user and --organization at the same time") @@ -94,7 +94,7 @@ func enableDisableFeatureFlag(cmd *cobra.Command, args []string, global bool, or var foundFlag bool for _, f := range flags { - if f == flag { + if f.Flag == flag { foundFlag = true break } diff --git a/cmd/humioctl/featureflags_supported.go b/cmd/humioctl/featureflags_supported.go index cf7455fd..36b3ca7c 100644 --- a/cmd/humioctl/featureflags_supported.go +++ b/cmd/humioctl/featureflags_supported.go @@ -1,7 +1,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -18,10 +18,14 @@ func newFeatureFlagsSupportedCmd() *cobra.Command { var rows [][]format.Value for _, flag := range flags { - rows = append(rows, []format.Value{format.String(flag)}) + rows = append(rows, []format.Value{ + format.String(flag.Flag), + format.Bool(flag.Experimental), + format.String(flag.Description), + }) } - printOverviewTable(cmd, []string{"Feature Flag"}, rows) + printOverviewTable(cmd, []string{"Feature Flag", "Experimental", "Description"}, rows) }, } diff --git a/cmd/humioctl/files.go b/cmd/humioctl/files.go index b2c92bd5..1d3d9c0d 100644 --- a/cmd/humioctl/files.go +++ b/cmd/humioctl/files.go @@ -7,7 +7,7 @@ import ( func newFilesCmd() *cobra.Command { cmd := &cobra.Command{ Use: "files", - Short: "Manage files", + Short: "Manage lookup files", } cmd.AddCommand(newFilesListCmd()) diff --git a/cmd/humioctl/files_download.go b/cmd/humioctl/files_download.go index 4e6f8001..ca973d46 100644 --- a/cmd/humioctl/files_download.go +++ b/cmd/humioctl/files_download.go @@ -13,9 +13,10 @@ func newFilesDownloadCmd() *cobra.Command { ) cmd := &cobra.Command{ - Use: "download ", - Long: `Download a file.`, - Args: cobra.ExactArgs(2), + Use: "download ", + Long: `Download a file.`, + Short: "Download a file.", + Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { viewName := args[0] fileName := args[1] diff --git a/cmd/humioctl/files_list.go b/cmd/humioctl/files_list.go index a7929dea..e0f6fe3d 100644 --- a/cmd/humioctl/files_list.go +++ b/cmd/humioctl/files_list.go @@ -1,7 +1,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -22,11 +22,10 @@ func newFilesListCmd() *cobra.Command { rows = append(rows, []format.Value{ format.String(file.Name), format.String(file.ContentHash), - format.String(file.ID), }) } - printOverviewTable(cmd, []string{"Name", "Content Hash", "ID"}, rows) + printOverviewTable(cmd, []string{"Name", "Content Hash"}, rows) }, } diff --git a/cmd/humioctl/files_upload.go b/cmd/humioctl/files_upload.go index b5cccbf3..04eef8a2 100644 --- a/cmd/humioctl/files_upload.go +++ b/cmd/humioctl/files_upload.go @@ -18,7 +18,8 @@ func newFilesUploadCmd() *cobra.Command { Long: `Upload a file to a view. Specify '-' as the input file to read from stdin.`, - Args: cobra.ExactArgs(2), + Short: "Upload a file.", + Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { if args[1] == "-" && saveAsFileName == "" { cmd.PrintErr("When the input file is stdin, the file name must be provided with --name.\n") diff --git a/cmd/humioctl/filter_alerts_export.go b/cmd/humioctl/filter_alerts_export.go index e759e5cb..12220dca 100644 --- a/cmd/humioctl/filter_alerts_export.go +++ b/cmd/humioctl/filter_alerts_export.go @@ -15,9 +15,9 @@ package main import ( - "github.com/humio/cli/api" "os" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -82,10 +82,10 @@ func newFilterAlertsExportAllCmd() *cobra.Command { filterAlerts, err := client.FilterAlerts().List(view) exitOnError(cmd, err, "Error fetching filter alerts") - for _, filterAlert := range filterAlerts { - yamlData, err := yaml.Marshal(&filterAlert) + for i := range filterAlerts { + yamlData, err := yaml.Marshal(&filterAlerts[i]) exitOnError(cmd, err, "Failed to serialize the filter alert") - filterAlertFilename := sanitizeTriggerName(filterAlert.Name) + ".yaml" + filterAlertFilename := sanitizeTriggerName(filterAlerts[i].Name) + ".yaml" var outFilePath string if outputDirectory != "" { diff --git a/cmd/humioctl/filter_alerts_install.go b/cmd/humioctl/filter_alerts_install.go index 99871276..daf998d6 100644 --- a/cmd/humioctl/filter_alerts_install.go +++ b/cmd/humioctl/filter_alerts_install.go @@ -18,15 +18,13 @@ import ( "fmt" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) func newFilterAlertsInstallCmd() *cobra.Command { - var ( - filePath, url string - ) + var filePath, url, name string cmd := cobra.Command{ Use: "install [flags] ", @@ -65,6 +63,10 @@ The install command allows you to install filter alerts from a URL or from a loc err = yaml.Unmarshal(content, &filterAlert) exitOnError(cmd, err, "Could not unmarshal the filter alert") + if name != "" { + filterAlert.Name = name + } + _, err = client.FilterAlerts().Create(viewName, &filterAlert) exitOnError(cmd, err, "Could not create the filter alert") @@ -74,6 +76,7 @@ The install command allows you to install filter alerts from a URL or from a loc cmd.Flags().StringVar(&filePath, "file", "", "The local file path to the filter alert to install.") cmd.Flags().StringVar(&url, "url", "", "A URL to fetch the filter alert file from.") + cmd.Flags().StringVarP(&name, "name", "n", "", "Install the alert under a specific name, ignoring the `name` attribute in the alert file.") cmd.MarkFlagsMutuallyExclusive("file", "url") return &cmd } diff --git a/cmd/humioctl/filter_alerts_list.go b/cmd/humioctl/filter_alerts_list.go index b7f96e6b..ce9d266f 100644 --- a/cmd/humioctl/filter_alerts_list.go +++ b/cmd/humioctl/filter_alerts_list.go @@ -17,7 +17,7 @@ package main import ( "strings" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -40,12 +40,12 @@ func newFilterAlertsListCmd() *cobra.Command { format.String(filterAlert.ID), format.String(filterAlert.Name), format.Bool(filterAlert.Enabled), - format.String(filterAlert.Description), + format.StringPtr(filterAlert.Description), format.String(strings.Join(filterAlert.ActionNames, ", ")), format.String(strings.Join(filterAlert.Labels, ", ")), - format.Int(filterAlert.ThrottleTimeSeconds), - format.String(filterAlert.ThrottleField), - format.String(filterAlert.RunAsUserID), + format.IntPtr(filterAlert.ThrottleTimeSeconds), + format.StringPtr(filterAlert.ThrottleField), + format.String(filterAlert.OwnershipRunAsID), format.String(filterAlert.QueryOwnershipType), } } diff --git a/cmd/humioctl/filter_alerts_remove.go b/cmd/humioctl/filter_alerts_remove.go index e1289732..800e5001 100644 --- a/cmd/humioctl/filter_alerts_remove.go +++ b/cmd/humioctl/filter_alerts_remove.go @@ -16,8 +16,8 @@ package main import ( "fmt" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/filter_alerts_show.go b/cmd/humioctl/filter_alerts_show.go index 07f00bc4..1d45cfc0 100644 --- a/cmd/humioctl/filter_alerts_show.go +++ b/cmd/humioctl/filter_alerts_show.go @@ -15,10 +15,10 @@ package main import ( - "github.com/humio/cli/api" "strings" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -50,13 +50,13 @@ func newFilterAlertsShowCmd() *cobra.Command { {format.String("ID"), format.String(filterAlert.ID)}, {format.String("Name"), format.String(filterAlert.Name)}, {format.String("Enabled"), format.Bool(filterAlert.Enabled)}, - {format.String("Description"), format.String(filterAlert.Description)}, + {format.String("Description"), format.StringPtr(filterAlert.Description)}, {format.String("Query String"), format.String(filterAlert.QueryString)}, {format.String("Labels"), format.String(strings.Join(filterAlert.Labels, ", "))}, {format.String("Actions"), format.String(strings.Join(filterAlert.ActionNames, ", "))}, - {format.String("Throttle Time Seconds"), format.Int(filterAlert.ThrottleTimeSeconds)}, - {format.String("Throttle Field"), format.String(filterAlert.ThrottleField)}, - {format.String("Run As User ID"), format.String(filterAlert.RunAsUserID)}, + {format.String("Throttle Time Seconds"), format.IntPtr(filterAlert.ThrottleTimeSeconds)}, + {format.String("Throttle Field"), format.StringPtr(filterAlert.ThrottleField)}, + {format.String("Run As User ID"), format.String(filterAlert.OwnershipRunAsID)}, {format.String("Query Ownership Type"), format.String(filterAlert.QueryOwnershipType)}, } diff --git a/cmd/humioctl/groups_list.go b/cmd/humioctl/groups_list.go index 6694f2ae..10fa7954 100644 --- a/cmd/humioctl/groups_list.go +++ b/cmd/humioctl/groups_list.go @@ -1,7 +1,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/health.go b/cmd/humioctl/health.go index f07ae733..b8ca871a 100644 --- a/cmd/humioctl/health.go +++ b/cmd/humioctl/health.go @@ -7,8 +7,8 @@ import ( "sort" "strings" - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/ingest.go b/cmd/humioctl/ingest.go index c111c0f4..92515f63 100644 --- a/cmd/humioctl/ingest.go +++ b/cmd/humioctl/ingest.go @@ -14,7 +14,7 @@ import ( "github.com/gofrs/uuid" "github.com/hpcloud/tail" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/humio/cli/shipper" "github.com/skratchdot/open-golang/open" "github.com/spf13/cobra" diff --git a/cmd/humioctl/ingest_tokens_list.go b/cmd/humioctl/ingest_tokens_list.go index 6d6ec9e1..cae46e23 100644 --- a/cmd/humioctl/ingest_tokens_list.go +++ b/cmd/humioctl/ingest_tokens_list.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/ingest_tokens_show.go b/cmd/humioctl/ingest_tokens_show.go index 67791622..d581073d 100644 --- a/cmd/humioctl/ingest_tokens_show.go +++ b/cmd/humioctl/ingest_tokens_show.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/license.go b/cmd/humioctl/license.go index bb6193c2..d589fd74 100644 --- a/cmd/humioctl/license.go +++ b/cmd/humioctl/license.go @@ -15,8 +15,8 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -38,7 +38,9 @@ func printLicenseDetailsTable(cmd *cobra.Command, license api.License) { if onprem, ok := license.(api.OnPremLicense); ok { details = append(details, []format.Value{format.String("License ID"), format.String(onprem.ID)}) details = append(details, []format.Value{format.String("Issued To"), format.String(onprem.IssuedTo)}) - details = append(details, []format.Value{format.String("Number Of Seats"), format.Int(onprem.NumberOfSeats)}) + if onprem.NumberOfSeats != nil { + details = append(details, []format.Value{format.String("Number Of Seats"), format.Int(*onprem.NumberOfSeats)}) + } } details = append(details, []format.Value{format.String("Issued At"), format.String(license.IssuedAt())}) diff --git a/cmd/humioctl/license_show.go b/cmd/humioctl/license_show.go index 734cb34d..bb4b78a4 100644 --- a/cmd/humioctl/license_show.go +++ b/cmd/humioctl/license_show.go @@ -17,7 +17,7 @@ package main import ( "errors" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/output.go b/cmd/humioctl/output.go index 80afb450..da41f051 100644 --- a/cmd/humioctl/output.go +++ b/cmd/humioctl/output.go @@ -5,19 +5,6 @@ import ( "fmt" ) -type yesNo bool - -func (y yesNo) String() string { - if y { - return "yes" - } - return "no" -} - -func (y yesNo) MarshalJSON() ([]byte, error) { - return json.Marshal(bool(y)) -} - type checkmark bool func (c checkmark) String() string { diff --git a/cmd/humioctl/packages_install.go b/cmd/humioctl/packages_install.go index f8774c81..8f20942d 100644 --- a/cmd/humioctl/packages_install.go +++ b/cmd/humioctl/packages_install.go @@ -21,7 +21,7 @@ import ( "os" "strings" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) @@ -93,6 +93,9 @@ func getURLPackage(url string) (*os.File, error) { if err != nil { return nil, err } + if response == nil { + return nil, fmt.Errorf("failed to get response") + } if response.StatusCode >= 400 { return nil, fmt.Errorf("error downloading file %s: %s", zipBallURL, response.Status) diff --git a/cmd/humioctl/packages_list_installed.go b/cmd/humioctl/packages_list_installed.go index f399b844..f89b1c03 100644 --- a/cmd/humioctl/packages_list_installed.go +++ b/cmd/humioctl/packages_list_installed.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -38,7 +38,7 @@ func listInstalledPackagesCmd() *cobra.Command { format.String(installedPackage.InstalledBy.Username), valueOrEmpty(installedPackage.UpdatedBy.Username), format.String(installedPackage.Source), - valueOrEmpty(installedPackage.AvailableUpdate), + format.StringPtr(installedPackage.AvailableUpdate), }) } diff --git a/cmd/humioctl/packages_validate.go b/cmd/humioctl/packages_validate.go index 8b604ee9..f91f3c51 100644 --- a/cmd/humioctl/packages_validate.go +++ b/cmd/humioctl/packages_validate.go @@ -19,7 +19,7 @@ import ( "os" "path/filepath" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/parsers_get.go b/cmd/humioctl/parsers_get.go index e79a871b..c6424614 100644 --- a/cmd/humioctl/parsers_get.go +++ b/cmd/humioctl/parsers_get.go @@ -2,9 +2,10 @@ package main import ( "fmt" - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "strings" + + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) func newParsersShowCmd() *cobra.Command { @@ -26,7 +27,7 @@ func newParsersShowCmd() *cobra.Command { {format.String("Script"), format.String(parser.Script)}, {format.String("TagFields"), format.String(strings.Join(parser.FieldsToTag, "\n"))}, {format.String("FieldsToBeRemovedBeforeParsing"), format.String(strings.Join(parser.FieldsToBeRemovedBeforeParsing, "\n"))}, - {format.String("TestCases"), format.String(fmt.Sprintf("%+v", parser.TestCases))}, + {format.String("TestCasesRAW"), format.String(fmt.Sprintf("%+v", parser.TestCases))}, } printDetailsTable(cmd, details) diff --git a/cmd/humioctl/parsers_install.go b/cmd/humioctl/parsers_install.go index bb727bc9..b9144a9a 100644 --- a/cmd/humioctl/parsers_install.go +++ b/cmd/humioctl/parsers_install.go @@ -15,11 +15,12 @@ package main import ( + "fmt" "io" "net/http" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -94,6 +95,9 @@ func getURLParser(url string) ([]byte, error) { if err != nil { return nil, err } + if response == nil { + return nil, fmt.Errorf("failed to get response") + } defer func() { _ = response.Body.Close() }() diff --git a/cmd/humioctl/parsers_list.go b/cmd/humioctl/parsers_list.go index 52261d41..d0c361bb 100644 --- a/cmd/humioctl/parsers_list.go +++ b/cmd/humioctl/parsers_list.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/profiles.go b/cmd/humioctl/profiles.go index 35f59863..d861bb5d 100644 --- a/cmd/humioctl/profiles.go +++ b/cmd/humioctl/profiles.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/viperkey" "github.com/humio/cli/prompt" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/cmd/humioctl/profiles_add.go b/cmd/humioctl/profiles_add.go index 70ba18df..ae09d4a0 100644 --- a/cmd/humioctl/profiles_add.go +++ b/cmd/humioctl/profiles_add.go @@ -9,8 +9,8 @@ import ( "os" "path/filepath" - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/viperkey" "github.com/humio/cli/prompt" "github.com/skratchdot/open-golang/open" "github.com/spf13/cobra" @@ -62,6 +62,10 @@ func saveConfig() error { func addAccount(newName string, profile *login) { profiles := viper.GetStringMap(viperkey.Profiles) + if profiles == nil { + profiles = map[string]interface{}{} + } + profiles[newName] = map[string]interface{}{ viperkey.Address: profile.address, viperkey.Token: profile.token, diff --git a/cmd/humioctl/profiles_remove.go b/cmd/humioctl/profiles_remove.go index 5d4eabb2..1344ea15 100644 --- a/cmd/humioctl/profiles_remove.go +++ b/cmd/humioctl/profiles_remove.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/viperkey" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/humioctl/profiles_set_default.go b/cmd/humioctl/profiles_set_default.go index 1925b5c9..4a7f83b1 100644 --- a/cmd/humioctl/profiles_set_default.go +++ b/cmd/humioctl/profiles_set_default.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/viperkey" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/humioctl/repos.go b/cmd/humioctl/repos.go index 9527e5cd..53004f02 100644 --- a/cmd/humioctl/repos.go +++ b/cmd/humioctl/repos.go @@ -15,8 +15,8 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -31,20 +31,31 @@ func newReposCmd() *cobra.Command { cmd.AddCommand(newReposCreateCmd()) cmd.AddCommand(newReposUpdateCmd()) cmd.AddCommand(newReposDeleteCmd()) - cmd.AddCommand(newReposUpdateUserGroupCmd()) return cmd } func printRepoDetailsTable(cmd *cobra.Command, repo api.Repository) { + ingestRetention := float64(0) + if repo.IngestRetentionSizeGB != nil { + ingestRetention = *repo.IngestRetentionSizeGB + } + storageRetention := float64(0) + if repo.StorageRetentionSizeGB != nil { + storageRetention = *repo.StorageRetentionSizeGB + } + retentionDays := float64(0) + if repo.RetentionDays != nil { + retentionDays = *repo.RetentionDays + } details := [][]format.Value{ {format.String("ID"), format.String(repo.ID)}, {format.String("Name"), format.String(repo.Name)}, - {format.String("Description"), format.String(repo.Description)}, + {format.String("Description"), format.StringPtr(repo.Description)}, {format.String("Space Used"), ByteCountDecimal(repo.SpaceUsed)}, - {format.String("Ingest Retention (Size)"), ByteCountDecimal(repo.IngestRetentionSizeGB * 1e9)}, - {format.String("Storage Retention (Size)"), ByteCountDecimal(repo.StorageRetentionSizeGB * 1e9)}, - {format.String("Retention (Days)"), format.Int(repo.RetentionDays)}, + {format.String("Ingest Retention (Size)"), ByteCountDecimal(ingestRetention * 1e9)}, + {format.String("Storage Retention (Size)"), ByteCountDecimal(storageRetention * 1e9)}, + {format.String("Retention (Days)"), format.Float(retentionDays)}, {format.String("S3 Archiving Enabled"), format.Bool(repo.S3ArchivingConfiguration.IsEnabled())}, {format.String("S3 Archiving Bucket"), format.String(repo.S3ArchivingConfiguration.Bucket)}, {format.String("S3 Archiving Region"), format.String(repo.S3ArchivingConfiguration.Region)}, diff --git a/cmd/humioctl/repos_list.go b/cmd/humioctl/repos_list.go index 530cb2c3..40b2e7cf 100644 --- a/cmd/humioctl/repos_list.go +++ b/cmd/humioctl/repos_list.go @@ -17,8 +17,8 @@ package main import ( "sort" - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/repos_update.go b/cmd/humioctl/repos_update.go index 604db016..925d3e92 100644 --- a/cmd/humioctl/repos_update.go +++ b/cmd/humioctl/repos_update.go @@ -43,15 +43,15 @@ func newReposUpdateCmd() *cobra.Command { exitOnError(cmd, err, "Error updating repository description") } if retentionTimeFlag.value != nil { - err := client.Repositories().UpdateTimeBasedRetention(repoName, *retentionTimeFlag.value, allowDataDeletionFlag) + err := client.Repositories().UpdateTimeBasedRetention(repoName, retentionTimeFlag.value, allowDataDeletionFlag) exitOnError(cmd, err, "Error updating repository retention time in days") } if ingestSizeBasedRetentionFlag.value != nil { - err := client.Repositories().UpdateIngestBasedRetention(repoName, *ingestSizeBasedRetentionFlag.value, allowDataDeletionFlag) + err := client.Repositories().UpdateIngestBasedRetention(repoName, ingestSizeBasedRetentionFlag.value, allowDataDeletionFlag) exitOnError(cmd, err, "Error updating repository ingest size based retention") } if storageSizeBasedRetentionFlag.value != nil { - err := client.Repositories().UpdateStorageBasedRetention(repoName, *storageSizeBasedRetentionFlag.value, allowDataDeletionFlag) + err := client.Repositories().UpdateStorageBasedRetention(repoName, storageSizeBasedRetentionFlag.value, allowDataDeletionFlag) exitOnError(cmd, err, "Error updating repository storage size based retention") } diff --git a/cmd/humioctl/repos_update_user_group.go b/cmd/humioctl/repos_update_user_group.go deleted file mode 100644 index 57243252..00000000 --- a/cmd/humioctl/repos_update_user_group.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "os" - - "github.com/humio/cli/api" - "github.com/spf13/cobra" -) - -func newReposUpdateUserGroupCmd() *cobra.Command { - var groups []string - cmd := cobra.Command{ - Use: "update-user-group [flags] ", - Short: "Updates the users permissions to a repository based on default groups", - Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { - repoName := args[0] - userName := args[1] - client := NewApiClient(cmd) - - var defaultGroups []api.DefaultGroupEnum - for _, group := range groups { - var defaultGroup api.DefaultGroupEnum - if !defaultGroup.ParseString(group) { - cmd.PrintErrf("The group '%s' was not valid (must be either 'Member', 'Admin' or 'Eliminator')\n", group) - os.Exit(1) - } - defaultGroups = append(defaultGroups, defaultGroup) - } - - err := client.Repositories().UpdateUserGroup(repoName, userName, defaultGroups...) - exitOnError(cmd, err, "Error adding user") - }, - } - cmd.Flags().StringSliceVarP(&groups, "groups", "g", []string{api.DefaultGroupEnumMember.String()}, "the groups that the user should be added in") - - return &cmd -} diff --git a/cmd/humioctl/root.go b/cmd/humioctl/root.go index 8ebef863..442615c6 100644 --- a/cmd/humioctl/root.go +++ b/cmd/humioctl/root.go @@ -20,8 +20,8 @@ import ( "os" "path" - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/viperkey" "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -128,6 +128,7 @@ Common Management Commands: rootCmd.AddCommand(newGroupsCmd()) rootCmd.AddCommand(newFilesCmd()) rootCmd.AddCommand(newFeatureFlagsCmd()) + rootCmd.AddCommand(newTokensCmd()) // Hidden Commands rootCmd.AddCommand(newWelcomeCmd()) @@ -161,6 +162,10 @@ func initConfig() { if profileFlag != "" { profile, err := loadProfile(profileFlag) exitOnError(rootCmd, err, "Failed to load profile") + if profile == nil { + rootCmd.PrintErr("failed to load profile") + os.Exit(1) + } // Explicitly bound address or token have precedence if address == "" { diff --git a/cmd/humioctl/scheduled_searches_export.go b/cmd/humioctl/scheduled_searches_export.go index 92978dfa..04b0b941 100644 --- a/cmd/humioctl/scheduled_searches_export.go +++ b/cmd/humioctl/scheduled_searches_export.go @@ -15,9 +15,9 @@ package main import ( - "github.com/humio/cli/api" "os" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) @@ -82,10 +82,10 @@ func newScheduledSearchesExportAllCmd() *cobra.Command { scheduledSearches, err := client.ScheduledSearches().List(view) exitOnError(cmd, err, "Error fetching scheduled searches") - for _, scheduledSearch := range scheduledSearches { - yamlData, err := yaml.Marshal(&scheduledSearch) + for i := range scheduledSearches { + yamlData, err := yaml.Marshal(&scheduledSearches[i]) exitOnError(cmd, err, "Failed to serialize the scheduled search") - scheduledSearchFilename := sanitizeTriggerName(scheduledSearch.Name) + ".yaml" + scheduledSearchFilename := sanitizeTriggerName(scheduledSearches[i].Name) + ".yaml" var outFilePath string if outputDirectory != "" { diff --git a/cmd/humioctl/scheduled_searches_install.go b/cmd/humioctl/scheduled_searches_install.go index 2fd6f2d3..30e0ebea 100644 --- a/cmd/humioctl/scheduled_searches_install.go +++ b/cmd/humioctl/scheduled_searches_install.go @@ -18,15 +18,13 @@ import ( "fmt" "os" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) func newScheduledSearchesInstallCmd() *cobra.Command { - var ( - filePath, url string - ) + var filePath, url, name string cmd := cobra.Command{ Use: "install [flags] ", @@ -65,6 +63,10 @@ The install command allows you to install scheduled searches from a URL or from err = yaml.Unmarshal(content, &scheduledSearch) exitOnError(cmd, err, "Could not unmarshal the scheduled search") + if name != "" { + scheduledSearch.Name = name + } + _, err = client.ScheduledSearches().Create(viewName, &scheduledSearch) exitOnError(cmd, err, "Could not create the scheduled search") @@ -74,6 +76,7 @@ The install command allows you to install scheduled searches from a URL or from cmd.Flags().StringVar(&filePath, "file", "", "The local file path to the scheduled search to install.") cmd.Flags().StringVar(&url, "url", "", "A URL to fetch the scheduled search file from.") + cmd.Flags().StringVarP(&name, "name", "n", "", "Install the alert under a specific name, ignoring the `name` attribute in the alert file.") cmd.MarkFlagsMutuallyExclusive("file", "url") return &cmd } diff --git a/cmd/humioctl/scheduled_searches_list.go b/cmd/humioctl/scheduled_searches_list.go index cfb9e537..f8064cc2 100644 --- a/cmd/humioctl/scheduled_searches_list.go +++ b/cmd/humioctl/scheduled_searches_list.go @@ -15,9 +15,10 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "strings" + + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) func newScheduledSearchesListCmd() *cobra.Command { @@ -38,7 +39,7 @@ func newScheduledSearchesListCmd() *cobra.Command { rows[i] = []format.Value{ format.String(scheduledSearch.ID), format.String(scheduledSearch.Name), - format.String(scheduledSearch.Description), + format.StringPtr(scheduledSearch.Description), format.String(scheduledSearch.QueryStart), format.String(scheduledSearch.QueryEnd), format.String(scheduledSearch.TimeZone), @@ -47,7 +48,7 @@ func newScheduledSearchesListCmd() *cobra.Command { format.String(strings.Join(scheduledSearch.ActionNames, ", ")), format.String(strings.Join(scheduledSearch.Labels, ", ")), format.Bool(scheduledSearch.Enabled), - format.String(scheduledSearch.RunAsUserID), + format.String(scheduledSearch.OwnershipRunAsID), format.String(scheduledSearch.QueryOwnershipType), } } diff --git a/cmd/humioctl/scheduled_searches_remove.go b/cmd/humioctl/scheduled_searches_remove.go index 57322e64..115d6046 100644 --- a/cmd/humioctl/scheduled_searches_remove.go +++ b/cmd/humioctl/scheduled_searches_remove.go @@ -16,8 +16,8 @@ package main import ( "fmt" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/scheduled_searches_show.go b/cmd/humioctl/scheduled_searches_show.go index e65726f9..7d5971e4 100644 --- a/cmd/humioctl/scheduled_searches_show.go +++ b/cmd/humioctl/scheduled_searches_show.go @@ -15,10 +15,11 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "strings" + + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) func newScheduledSearchesShowCmd() *cobra.Command { @@ -48,7 +49,7 @@ func newScheduledSearchesShowCmd() *cobra.Command { details := [][]format.Value{ {format.String("ID"), format.String(scheduledSearch.ID)}, {format.String("Name"), format.String(scheduledSearch.Name)}, - {format.String("Description"), format.String(scheduledSearch.Description)}, + {format.String("Description"), format.StringPtr(scheduledSearch.Description)}, {format.String("Query String"), format.String(scheduledSearch.QueryString)}, {format.String("Query Start"), format.String(scheduledSearch.QueryStart)}, {format.String("Query End"), format.String(scheduledSearch.QueryEnd)}, @@ -57,7 +58,7 @@ func newScheduledSearchesShowCmd() *cobra.Command { {format.String("Backfill Limit"), format.Int(scheduledSearch.BackfillLimit)}, {format.String("Enabled"), format.Bool(scheduledSearch.Enabled)}, {format.String("Actions"), format.String(strings.Join(scheduledSearch.ActionNames, ", "))}, - {format.String("Run As User ID"), format.String(scheduledSearch.RunAsUserID)}, + {format.String("Run As User ID"), format.String(scheduledSearch.OwnershipRunAsID)}, {format.String("Labels"), format.String(strings.Join(scheduledSearch.Labels, ", "))}, {format.String("Query Ownership Type"), format.String(scheduledSearch.QueryOwnershipType)}, } diff --git a/cmd/humioctl/search.go b/cmd/humioctl/search.go index 4a2ef2b0..ea6aeac5 100644 --- a/cmd/humioctl/search.go +++ b/cmd/humioctl/search.go @@ -13,7 +13,7 @@ import ( "syscall" "time" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "github.com/humio/cli/prompt" "github.com/olekukonko/tablewriter" "github.com/spf13/cobra" diff --git a/cmd/humioctl/status.go b/cmd/humioctl/status.go index 9d44c1a8..7ce4f0d8 100644 --- a/cmd/humioctl/status.go +++ b/cmd/humioctl/status.go @@ -18,8 +18,8 @@ import ( "encoding/json" "fmt" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" + "github.com/humio/cli/internal/viperkey" "github.com/humio/cli/prompt" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/cmd/humioctl/tokens.go b/cmd/humioctl/tokens.go new file mode 100644 index 00000000..a79dd32e --- /dev/null +++ b/cmd/humioctl/tokens.go @@ -0,0 +1,30 @@ +// Copyright © 2018 Humio Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "github.com/spf13/cobra" +) + +func newTokensCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokens", + Short: "Manage tokens", + } + + cmd.AddCommand(newTokensRotateApiTokenCmd()) + + return cmd +} diff --git a/cmd/humioctl/tokens_rotate_api_token.go b/cmd/humioctl/tokens_rotate_api_token.go new file mode 100644 index 00000000..23d24c49 --- /dev/null +++ b/cmd/humioctl/tokens_rotate_api_token.go @@ -0,0 +1,24 @@ +package main + +import ( + "github.com/spf13/cobra" +) + +func newTokensRotateApiTokenCmd() *cobra.Command { + cmd := cobra.Command{ + Use: "rotate-api-token ", + Short: "Rotate and retrieve an API token [Root Only]", + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + tokenID := args[0] + + client := NewApiClient(cmd) + newToken, apiErr := client.Tokens().Rotate(tokenID) + exitOnError(cmd, apiErr, "Error updating token") + + cmd.Printf("New API Token: %s\n", newToken) + }, + } + + return &cmd +} diff --git a/cmd/humioctl/users.go b/cmd/humioctl/users.go index b6bc962c..1e201f90 100644 --- a/cmd/humioctl/users.go +++ b/cmd/humioctl/users.go @@ -15,8 +15,8 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -31,7 +31,6 @@ func newUsersCmd() *cobra.Command { cmd.AddCommand(newUsersUpdateCmd()) cmd.AddCommand(newUsersListCmd()) cmd.AddCommand(newUsersShowCmd()) - cmd.AddCommand(newUsersRotateApiTokenCmd()) return cmd } @@ -39,12 +38,12 @@ func newUsersCmd() *cobra.Command { func printUserDetailsTable(cmd *cobra.Command, user api.User) { details := [][]format.Value{ {format.String("Username"), format.String(user.Username)}, - {format.String("Name"), format.String(user.FullName)}, - {format.String("Is Root"), yesNo(user.IsRoot)}, - {format.String("Email"), format.String(user.Email)}, + {format.String("Name"), format.StringPtr(user.FullName)}, + {format.String("Is Root"), format.Bool(user.IsRoot)}, + {format.String("Email"), format.StringPtr(user.Email)}, {format.String("Created At"), format.String(user.CreatedAt)}, - {format.String("Country Code"), format.String(user.CountryCode)}, - {format.String("Company"), format.String(user.Company)}, + {format.String("Country Code"), format.StringPtr(user.CountryCode)}, + {format.String("Company"), format.StringPtr(user.Company)}, {format.String("ID"), format.String(user.ID)}, } diff --git a/cmd/humioctl/users_add.go b/cmd/humioctl/users_add.go index fc54453f..07355987 100644 --- a/cmd/humioctl/users_add.go +++ b/cmd/humioctl/users_add.go @@ -17,7 +17,6 @@ package main import ( "fmt" - "github.com/humio/cli/api" "github.com/spf13/cobra" ) @@ -34,14 +33,15 @@ func newUsersAddCmd() *cobra.Command { username := args[0] client := NewApiClient(cmd) - _, err := client.Users().Add(username, api.UserChangeSet{ - IsRoot: rootFlag.value, - FullName: nameFlag.value, - Company: companyFlag.value, - CountryCode: countryCodeFlag.value, - Email: emailFlag.value, - Picture: pictureFlag.value, - }) + _, err := client.Users().Add( + username, + rootFlag.value, + nameFlag.value, + companyFlag.value, + countryCodeFlag.value, + emailFlag.value, + pictureFlag.value, + ) exitOnError(cmd, err, "Error creating the user") fmt.Fprintf(cmd.OutOrStdout(), "Successfully created user with username %q\n", username) diff --git a/cmd/humioctl/users_list.go b/cmd/humioctl/users_list.go index 95ca5e97..a9693aae 100644 --- a/cmd/humioctl/users_list.go +++ b/cmd/humioctl/users_list.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) @@ -33,8 +33,8 @@ func newUsersListCmd() *cobra.Command { for i, user := range users { rows[i] = []format.Value{ format.String(user.Username), - format.String(user.FullName), - yesNo(user.IsRoot), + format.StringPtr(user.FullName), + format.Bool(user.IsRoot), format.String(user.CreatedAt), format.String(user.ID), } diff --git a/cmd/humioctl/users_rotate_api_token.go b/cmd/humioctl/users_rotate_api_token.go deleted file mode 100644 index 41ccabad..00000000 --- a/cmd/humioctl/users_rotate_api_token.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "github.com/spf13/cobra" -) - -func newUsersRotateApiTokenCmd() *cobra.Command { - cmd := cobra.Command{ - Use: "rotate-api-token ", - Short: "Rotate and retrieve a user's API token [Root Only]", - Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { - userID := args[0] - - client := NewApiClient(cmd) - newToken, apiErr := client.Users().RotateToken(userID) - exitOnError(cmd, apiErr, "Error updating user") - - cmd.Printf("New API Token: %s\n", newToken) - }, - } - - return &cmd -} diff --git a/cmd/humioctl/users_update.go b/cmd/humioctl/users_update.go index cf8fe9f5..c1fa5efa 100644 --- a/cmd/humioctl/users_update.go +++ b/cmd/humioctl/users_update.go @@ -17,7 +17,6 @@ package main import ( "fmt" - "github.com/humio/cli/api" "github.com/spf13/cobra" ) @@ -34,14 +33,15 @@ func newUsersUpdateCmd() *cobra.Command { userName := args[0] client := NewApiClient(cmd) - _, apiErr := client.Users().Update(userName, api.UserChangeSet{ - IsRoot: rootFlag.value, - FullName: nameFlag.value, - Company: companyFlag.value, - CountryCode: countryCodeFlag.value, - Email: emailFlag.value, - Picture: pictureFlag.value, - }) + _, apiErr := client.Users().Update( + userName, + rootFlag.value, + nameFlag.value, + companyFlag.value, + countryCodeFlag.value, + emailFlag.value, + pictureFlag.value, + ) exitOnError(cmd, apiErr, "Error updating user") fmt.Fprintf(cmd.OutOrStdout(), "Successfully updated user with username %q\n", userName) diff --git a/cmd/humioctl/util.go b/cmd/humioctl/util.go index 843a3b95..8a19409b 100644 --- a/cmd/humioctl/util.go +++ b/cmd/humioctl/util.go @@ -3,14 +3,15 @@ package main import ( "errors" "fmt" - "github.com/humio/cli/cmd/internal/format" - "github.com/spf13/cobra" "io" "net/http" "net/url" "os" "regexp" "strconv" + + "github.com/humio/cli/internal/format" + "github.com/spf13/cobra" ) // GoReleaser will override these when building: https://goreleaser.com/customization/build/ @@ -152,6 +153,9 @@ func getBytesFromURL(url string) ([]byte, error) { if err != nil { return nil, err } + if response == nil { + return nil, fmt.Errorf("failed to get reponse") + } defer func() { _ = response.Body.Close() diff --git a/cmd/humioctl/views.go b/cmd/humioctl/views.go index 6dd69dd3..9edd2a72 100644 --- a/cmd/humioctl/views.go +++ b/cmd/humioctl/views.go @@ -15,8 +15,8 @@ package main import ( - "github.com/humio/cli/api" - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/api" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/views_create.go b/cmd/humioctl/views_create.go index 59aaa2b9..1e8c707c 100644 --- a/cmd/humioctl/views_create.go +++ b/cmd/humioctl/views_create.go @@ -16,10 +16,9 @@ package main import ( "fmt" - graphql "github.com/cli/shurcooL-graphql" - "github.com/humio/cli/api" "strings" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) @@ -63,8 +62,8 @@ namely "repo1" and "repo2": connections = append( connections, api.ViewConnectionInput{ - RepositoryName: graphql.String(repo), - Filter: graphql.String(filter), + RepositoryName: repo, + Filter: filter, }) } diff --git a/cmd/humioctl/views_list.go b/cmd/humioctl/views_list.go index aaf3fca3..29f603db 100644 --- a/cmd/humioctl/views_list.go +++ b/cmd/humioctl/views_list.go @@ -15,7 +15,7 @@ package main import ( - "github.com/humio/cli/cmd/internal/format" + "github.com/humio/cli/internal/format" "github.com/spf13/cobra" ) diff --git a/cmd/humioctl/views_update.go b/cmd/humioctl/views_update.go index 7554c695..d31905a8 100644 --- a/cmd/humioctl/views_update.go +++ b/cmd/humioctl/views_update.go @@ -18,9 +18,7 @@ import ( "fmt" "strings" - "github.com/humio/cli/api" - - graphql "github.com/cli/shurcooL-graphql" + "github.com/humio/cli/internal/api" "github.com/spf13/cobra" ) @@ -66,8 +64,8 @@ namely "repo1" and "repo2": connections = append( connections, api.ViewConnectionInput{ - RepositoryName: graphql.String(repo), - Filter: graphql.String(filter), + RepositoryName: repo, + Filter: filter, }) } err := client.Views().UpdateConnections(viewName, connections) diff --git a/cmd/humioctl/welcome.go b/cmd/humioctl/welcome.go index 113f4d6b..856d1f62 100644 --- a/cmd/humioctl/welcome.go +++ b/cmd/humioctl/welcome.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/humio/cli/cmd/humioctl/internal/viperkey" + "github.com/humio/cli/internal/viperkey" "github.com/humio/cli/prompt" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/go.mod b/go.mod index 73edf16c..b815dd4e 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,11 @@ module github.com/humio/cli -go 1.22 +go 1.22.0 + +toolchain go1.22.6 require ( + github.com/Khan/genqlient v0.7.0 github.com/Masterminds/semver/v3 v3.2.1 github.com/cli/shurcooL-graphql v0.0.4 github.com/gofrs/uuid v3.2.0+incompatible @@ -12,13 +15,17 @@ require ( github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.18.2 - golang.org/x/sync v0.5.0 - golang.org/x/sys v0.19.0 + github.com/vektah/gqlparser/v2 v2.5.16 + golang.org/x/sync v0.8.0 + golang.org/x/sys v0.23.0 golang.org/x/term v0.19.0 - gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v2 v2.4.0 ) require ( + github.com/agnivade/levenshtein v1.1.1 // indirect + github.com/alexflint/go-arg v1.5.1 // indirect + github.com/alexflint/go-scalar v1.2.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -35,7 +42,9 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.24.0 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index edd52469..d5d76deb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,19 @@ +github.com/Khan/genqlient v0.7.0 h1:GZ1meyRnzcDTK48EjqB8t3bcfYvHArCUUvgOwpz1D4w= +github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1kPBvSFM= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/alexflint/go-arg v1.5.1 h1:nBuWUCpuRy0snAG+uIJ6N0UvYxpxA0/ghA/AaHxlT8Y= +github.com/alexflint/go-arg v1.5.1/go.mod h1:A7vTJzvjoaSTypg4biM5uYNTkJ27SkNTArtYXnlqVO8= +github.com/alexflint/go-scalar v1.2.0 h1:WR7JPKkeNpnYIOfHRa7ivM21aWAdHD0gEWHCx+WQBRw= +github.com/alexflint/go-scalar v1.2.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/bradleyjkemp/cupaloy/v2 v2.6.0 h1:knToPYa2xtfg42U3I6punFEjaGFKWQRXJwj0JTv4mTs= +github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/cli/shurcooL-graphql v0.0.4 h1:6MogPnQJLjKkaXPyGqPRXOI2qCsQdqNfUY1QSJu2GuY= github.com/cli/shurcooL-graphql v0.0.4/go.mod h1:3waN4u02FiZivIV+p1y4d0Jo1jc6BViMA73C+sZo2fk= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -7,14 +21,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= @@ -47,6 +63,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e h1:VAzdS5Nw68fbf5RZ8RDVlUvPXNU6Z3jtPCK/qvm4FoQ= github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -64,24 +82,32 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= +github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -91,8 +117,8 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/api/actions.go b/internal/api/actions.go new file mode 100644 index 00000000..c599a582 --- /dev/null +++ b/internal/api/actions.go @@ -0,0 +1,566 @@ +package api + +import ( + "context" + "fmt" + "reflect" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Actions struct { + client *Client +} + +type EmailAction struct { + Recipients []string + SubjectTemplate *string + BodyTemplate *string + UseProxy bool +} + +type HumioRepoAction struct { + IngestToken string +} + +type OpsGenieAction struct { + ApiUrl string + GenieKey string + UseProxy bool +} + +type PagerDutyAction struct { + Severity string + RoutingKey string + UseProxy bool +} + +type SlackField struct { + FieldName string + Value string +} + +type SlackAction struct { + Url string + Fields []SlackField + UseProxy bool +} + +type SlackPostMessageAction struct { + ApiToken string + Channels []string + Fields []SlackField + UseProxy bool +} + +type UploadFileAction struct { + FileName string +} + +type VictorOpsAction struct { + MessageType string + NotifyUrl string + UseProxy bool +} + +type HttpHeader struct { + Header string + Value string +} + +type WebhookAction struct { + Method string + Url string + Headers []HttpHeader + BodyTemplate string + IgnoreSSL bool + UseProxy bool +} + +type Action struct { + Type string + ID string `yaml:"-"` + Name string + + EmailAction EmailAction `yaml:"emailAction,omitempty"` + HumioRepoAction HumioRepoAction `yaml:"humioRepoAction,omitempty"` + OpsGenieAction OpsGenieAction `yaml:"opsGenieAction,omitempty"` + PagerDutyAction PagerDutyAction `yaml:"pagerDutyAction,omitempty"` + SlackAction SlackAction `yaml:"slackAction,omitempty"` + SlackPostMessageAction SlackPostMessageAction `yaml:"slackPostMessageAction,omitempty"` + VictorOpsAction VictorOpsAction `yaml:"victorOpsAction,omitempty"` + UploadFileAction UploadFileAction `yaml:"uploadFileAction,omitempty"` + WebhookAction WebhookAction `yaml:"webhookAction,omitempty"` +} + +func (c *Client) Actions() *Actions { return &Actions{client: c} } + +func (n *Actions) List(searchDomainName string) ([]Action, error) { + resp, err := humiographql.ListActions(context.Background(), n.client, searchDomainName) + if err != nil { + return nil, err + } + respSearchDomain := resp.GetSearchDomain() + respSearchDomainActions := respSearchDomain.GetActions() + actions := make([]Action, len(respSearchDomainActions)) + for idx, action := range respSearchDomainActions { + switch v := action.(type) { + case *humiographql.ListActionsSearchDomainActionsEmailAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + EmailAction: EmailAction{ + Recipients: v.GetRecipients(), + SubjectTemplate: v.GetSubjectTemplate(), + BodyTemplate: v.GetEmailBodyTemplate(), + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsHumioRepoAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + HumioRepoAction: HumioRepoAction{ + IngestToken: v.GetIngestToken(), + }, + } + case *humiographql.ListActionsSearchDomainActionsOpsGenieAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + OpsGenieAction: OpsGenieAction{ + ApiUrl: v.GetApiUrl(), + GenieKey: v.GetGenieKey(), + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsPagerDutyAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + PagerDutyAction: PagerDutyAction{ + Severity: v.GetSeverity(), + RoutingKey: v.GetRoutingKey(), + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsSlackAction: + fields := make([]SlackField, len(v.GetFields())) + for jdx, field := range v.GetFields() { + fields[jdx] = SlackField{ + FieldName: field.GetFieldName(), + Value: field.GetValue(), + } + } + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + SlackAction: SlackAction{ + Url: v.GetUrl(), + Fields: fields, + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsSlackPostMessageAction: + fields := make([]SlackField, len(v.GetFields())) + for jdx, field := range v.GetFields() { + fields[jdx] = SlackField{ + FieldName: field.GetFieldName(), + Value: field.GetValue(), + } + } + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + SlackPostMessageAction: SlackPostMessageAction{ + ApiToken: v.GetApiToken(), + Channels: v.GetChannels(), + Fields: fields, + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsVictorOpsAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + VictorOpsAction: VictorOpsAction{ + MessageType: v.GetMessageType(), + NotifyUrl: v.GetNotifyUrl(), + UseProxy: v.GetUseProxy(), + }, + } + case *humiographql.ListActionsSearchDomainActionsUploadFileAction: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + UploadFileAction: UploadFileAction{ + FileName: v.GetFileName(), + }, + } + case *humiographql.ListActionsSearchDomainActionsWebhookAction: + headers := make([]HttpHeader, len(v.GetHeaders())) + for jdx, header := range v.GetHeaders() { + headers[jdx] = HttpHeader{ + Header: header.GetHeader(), + Value: header.GetValue(), + } + } + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + WebhookAction: WebhookAction{ + Method: v.GetMethod(), + Url: v.GetUrl(), + Headers: headers, + BodyTemplate: v.GetWebhookBodyTemplate(), + IgnoreSSL: v.GetIgnoreSSL(), + UseProxy: v.GetUseProxy(), + }, + } + default: + actions[idx] = Action{ + Type: *v.GetTypename(), + ID: v.GetId(), + Name: v.GetName(), + } + } + } + + return actions, nil +} + +func (n *Actions) Add(searchDomainName string, newAction *Action) (*Action, error) { + if newAction == nil { + return nil, fmt.Errorf("action must not be nil") + } + + if !reflect.ValueOf(newAction.EmailAction).IsZero() { + resp, err := humiographql.CreateEmailAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.EmailAction.Recipients, + newAction.EmailAction.SubjectTemplate, + newAction.EmailAction.BodyTemplate, + newAction.EmailAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateEmailAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + EmailAction: EmailAction{ + Recipients: respUpdate.GetRecipients(), + SubjectTemplate: respUpdate.GetSubjectTemplate(), + BodyTemplate: respUpdate.GetBodyTemplate(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.HumioRepoAction).IsZero() { + resp, err := humiographql.CreateHumioRepoAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.HumioRepoAction.IngestToken, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateHumioRepoAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + HumioRepoAction: HumioRepoAction{ + IngestToken: respUpdate.GetIngestToken(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.OpsGenieAction).IsZero() { + resp, err := humiographql.CreateOpsGenieAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.OpsGenieAction.ApiUrl, + newAction.OpsGenieAction.GenieKey, + newAction.OpsGenieAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateOpsGenieAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + OpsGenieAction: OpsGenieAction{ + ApiUrl: respUpdate.GetApiUrl(), + GenieKey: respUpdate.GetGenieKey(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.PagerDutyAction).IsZero() { + resp, err := humiographql.CreatePagerDutyAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.PagerDutyAction.Severity, + newAction.PagerDutyAction.RoutingKey, + newAction.PagerDutyAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreatePagerDutyAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + PagerDutyAction: PagerDutyAction{ + Severity: respUpdate.GetSeverity(), + RoutingKey: respUpdate.GetRoutingKey(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.SlackAction).IsZero() { + fields := make([]humiographql.SlackFieldEntryInput, len(newAction.SlackAction.Fields)) + for idx, field := range newAction.SlackAction.Fields { + fields[idx] = humiographql.SlackFieldEntryInput{ + FieldName: field.FieldName, + Value: field.Value, + } + } + resp, err := humiographql.CreateSlackAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + fields, + newAction.SlackAction.Url, + newAction.SlackAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateSlackAction() + respUpdateFields := respUpdate.GetFields() + fieldsUpdate := make([]SlackField, len(respUpdateFields)) + for idx, field := range respUpdateFields { + fieldsUpdate[idx] = SlackField{ + FieldName: field.GetFieldName(), + Value: field.GetValue(), + } + } + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + SlackAction: SlackAction{ + Fields: fieldsUpdate, + Url: respUpdate.GetUrl(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.SlackPostMessageAction).IsZero() { + fields := make([]humiographql.SlackFieldEntryInput, len(newAction.SlackPostMessageAction.Fields)) + for idx, field := range newAction.SlackPostMessageAction.Fields { + fields[idx] = humiographql.SlackFieldEntryInput{ + FieldName: field.FieldName, + Value: field.Value, + } + } + resp, err := humiographql.CreateSlackPostMessageAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.SlackPostMessageAction.ApiToken, + newAction.SlackPostMessageAction.Channels, + fields, + newAction.SlackPostMessageAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateSlackPostMessageAction() + respUpdateFields := respUpdate.GetFields() + fieldsUpdate := make([]SlackField, len(respUpdateFields)) + for idx, field := range respUpdateFields { + fieldsUpdate[idx] = SlackField{ + FieldName: field.GetFieldName(), + Value: field.GetValue(), + } + } + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + SlackPostMessageAction: SlackPostMessageAction{ + ApiToken: respUpdate.GetApiToken(), + Channels: respUpdate.GetChannels(), + Fields: fieldsUpdate, + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.VictorOpsAction).IsZero() { + resp, err := humiographql.CreateVictorOpsAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.VictorOpsAction.MessageType, + newAction.VictorOpsAction.NotifyUrl, + newAction.VictorOpsAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateVictorOpsAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + VictorOpsAction: VictorOpsAction{ + MessageType: respUpdate.GetMessageType(), + NotifyUrl: respUpdate.GetNotifyUrl(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.UploadFileAction).IsZero() { + resp, err := humiographql.CreateUploadFileAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.UploadFileAction.FileName, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateUploadFileAction() + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + UploadFileAction: UploadFileAction{ + FileName: respUpdate.GetFileName(), + }, + }, nil + } + + if !reflect.ValueOf(newAction.WebhookAction).IsZero() { + headers := make([]humiographql.HttpHeaderEntryInput, len(newAction.WebhookAction.Headers)) + for idx, header := range newAction.WebhookAction.Headers { + headers[idx] = humiographql.HttpHeaderEntryInput{ + Header: header.Header, + Value: header.Value, + } + } + resp, err := humiographql.CreateWebhookAction( + context.Background(), + n.client, + searchDomainName, + newAction.Name, + newAction.WebhookAction.Url, + newAction.WebhookAction.Method, + headers, + newAction.WebhookAction.BodyTemplate, + newAction.WebhookAction.IgnoreSSL, + newAction.WebhookAction.UseProxy, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateWebhookAction() + respUpdateHeaders := respUpdate.GetHeaders() + fieldsUpdate := make([]HttpHeader, len(respUpdateHeaders)) + for idx, header := range respUpdateHeaders { + fieldsUpdate[idx] = HttpHeader{ + Header: header.GetHeader(), + Value: header.GetValue(), + } + } + return &Action{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + WebhookAction: WebhookAction{ + Url: respUpdate.GetUrl(), + Method: respUpdate.GetMethod(), + Headers: fieldsUpdate, + BodyTemplate: respUpdate.GetBodyTemplate(), + IgnoreSSL: respUpdate.GetIgnoreSSL(), + UseProxy: respUpdate.GetUseProxy(), + }, + }, nil + } + + return nil, fmt.Errorf("no action details specified or unsupported action type used") +} + +func (n *Actions) Get(searchDomainName, actionName string) (*Action, error) { + actions, err := n.List(searchDomainName) + if err != nil { + return nil, fmt.Errorf("unable to list actions: %w", err) + } + for _, action := range actions { + if action.Name == actionName { + return &action, nil + } + } + + return nil, ActionNotFound(actionName) +} + +func (n *Actions) Delete(searchDomainName, actionName string) error { + actions, err := n.List(searchDomainName) + if err != nil { + return fmt.Errorf("unable to list actions: %w", err) + } + var actionID string + for _, action := range actions { + if action.Name == actionName { + actionID = action.ID + break + } + } + if actionID == "" { + return ActionNotFound(actionID) + } + + _, err = humiographql.DeleteActionByID(context.Background(), n.client, searchDomainName, actionID) + if err != nil { + return err + } + + return nil +} diff --git a/internal/api/aggregate-alerts.go b/internal/api/aggregate-alerts.go new file mode 100644 index 00000000..ca8fbb4f --- /dev/null +++ b/internal/api/aggregate-alerts.go @@ -0,0 +1,140 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type AggregateAlert struct { + ID string `yaml:"-"` + Name string + Description *string + QueryString string `yaml:"queryString"` + SearchIntervalSeconds int64 `yaml:"searchIntervalSeconds"` + ActionNames []string `yaml:"actionNames"` + Labels []string + Enabled bool + ThrottleField *string `yaml:"throttleField"` + ThrottleTimeSeconds int64 `yaml:"throttleTimeSeconds"` + QueryOwnershipType string `yaml:"queryOwnershipType"` + TriggerMode string `yaml:"triggerMode"` + QueryTimestampType string `yaml:"queryTimestampType"` + OwnershipRunAsID string `yaml:"ownershipRunAsID"` +} + +type AggregateAlerts struct { + client *Client +} + +func (c *Client) AggregateAlerts() *AggregateAlerts { return &AggregateAlerts{client: c} } + +func (a *AggregateAlerts) List(searchDomainName string) ([]AggregateAlert, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("searchDomainName must not be empty") + } + + resp, err := humiographql.ListAggregateAlerts(context.Background(), a.client, searchDomainName) + if err != nil { + return nil, err + } + respSearchDomain := resp.GetSearchDomain() + respAggregateAlerts := respSearchDomain.GetAggregateAlerts() + aggregateAlerts := make([]AggregateAlert, len(respAggregateAlerts)) + for idx, aggregateAlert := range respAggregateAlerts { + actionNames := make([]string, len(aggregateAlert.GetActions())) + for kdx, action := range aggregateAlert.GetActions() { + actionNames[kdx] = action.GetName() + } + aggregateAlerts[idx] = AggregateAlert{ + ID: aggregateAlert.GetId(), + Name: aggregateAlert.GetName(), + Description: aggregateAlert.GetDescription(), + QueryString: aggregateAlert.GetQueryString(), + SearchIntervalSeconds: aggregateAlert.GetSearchIntervalSeconds(), + ActionNames: actionNames, + Labels: aggregateAlert.GetLabels(), + Enabled: aggregateAlert.GetEnabled(), + ThrottleField: aggregateAlert.ThrottleField, + ThrottleTimeSeconds: aggregateAlert.GetThrottleTimeSeconds(), + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(aggregateAlert.GetQueryOwnership())), + TriggerMode: string(aggregateAlert.GetTriggerMode()), + QueryTimestampType: string(aggregateAlert.GetQueryTimestampType()), + OwnershipRunAsID: aggregateAlert.GetQueryOwnership().GetId(), + } + } + return aggregateAlerts, nil +} + +func (a *AggregateAlerts) Create(searchDomainName string, newAggregateAlert *AggregateAlert) (*AggregateAlert, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("viewName must not be empty") + } + + if newAggregateAlert == nil { + return nil, fmt.Errorf("newAggregateAlert must not be nil") + } + + var ownershipRunAsID *string + if humiographql.QueryOwnershipType(newAggregateAlert.QueryOwnershipType) == humiographql.QueryOwnershipTypeUser { + ownershipRunAsID = &newAggregateAlert.OwnershipRunAsID + } + + resp, err := humiographql.CreateAggregateAlert( + context.Background(), + a.client, + searchDomainName, + newAggregateAlert.Name, + newAggregateAlert.Description, + newAggregateAlert.QueryString, + newAggregateAlert.SearchIntervalSeconds, + newAggregateAlert.ActionNames, + newAggregateAlert.Labels, + newAggregateAlert.Enabled, + ownershipRunAsID, + newAggregateAlert.ThrottleField, + newAggregateAlert.ThrottleTimeSeconds, + humiographql.TriggerMode(newAggregateAlert.TriggerMode), + humiographql.QueryTimestampType(newAggregateAlert.QueryTimestampType), + humiographql.QueryOwnershipType(newAggregateAlert.QueryOwnershipType), + ) + if err != nil { + return nil, err + } + + respAggregateAlert := resp.GetCreateAggregateAlert() + actionNames := make([]string, len(respAggregateAlert.GetActions())) + for kdx, action := range respAggregateAlert.GetActions() { + actionNames[kdx] = action.GetName() + } + return &AggregateAlert{ + ID: respAggregateAlert.GetId(), + Name: respAggregateAlert.GetName(), + Description: respAggregateAlert.GetDescription(), + QueryString: respAggregateAlert.GetQueryString(), + SearchIntervalSeconds: respAggregateAlert.GetSearchIntervalSeconds(), + ActionNames: actionNames, + Labels: respAggregateAlert.GetLabels(), + Enabled: respAggregateAlert.GetEnabled(), + ThrottleField: respAggregateAlert.ThrottleField, + ThrottleTimeSeconds: respAggregateAlert.GetThrottleTimeSeconds(), + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(respAggregateAlert.GetQueryOwnership())), + TriggerMode: string(respAggregateAlert.GetTriggerMode()), + QueryTimestampType: string(respAggregateAlert.GetQueryTimestampType()), + OwnershipRunAsID: respAggregateAlert.GetQueryOwnership().GetId(), + }, nil +} + +func (a *AggregateAlerts) Delete(searchDomainName, aggregateAlertID string) error { + if searchDomainName == "" { + return fmt.Errorf("viewName must not be empty") + } + + if aggregateAlertID == "" { + return fmt.Errorf("aggregateAlertID is empty") + } + + _, err := humiographql.DeleteAggregateAlert(context.Background(), a.client, searchDomainName, aggregateAlertID) + return err +} diff --git a/internal/api/alerts.go b/internal/api/alerts.go new file mode 100644 index 00000000..1ebbffb2 --- /dev/null +++ b/internal/api/alerts.go @@ -0,0 +1,163 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Alert struct { + ID string `yaml:"-"` + Name string + QueryString string `yaml:"queryString"` + QueryStart string `yaml:"queryStart"` + ThrottleField *string `yaml:"throttleField"` + TimeOfLastTrigger *int64 `yaml:"timeOfLastTrigger"` + IsStarred bool `yaml:"isStarred"` + Description *string + ThrottleTimeMillis int64 `yaml:"throttleTimeMillis"` + Enabled bool + Actions []string + Labels []string + LastError *string `yaml:"lastError"` + RunAsUserID string `yaml:"runAsUserID"` + QueryOwnershipType string `yaml:"queryOwnershipType"` +} + +type Alerts struct { + client *Client +} + +func (c *Client) Alerts() *Alerts { return &Alerts{client: c} } + +func (a *Alerts) List(searchDomainName string) ([]Alert, error) { + resp, err := humiographql.ListAlerts(context.Background(), a.client, searchDomainName) + if err != nil { + return nil, err + } + respSearchDomain := resp.GetSearchDomain() + respAlerts := respSearchDomain.GetAlerts() + alerts := make([]Alert, len(respAlerts)) + for idx, alert := range respAlerts { + respOwnership := alert.GetQueryOwnership() + runAsUserID := "" + if respOwnership != nil { + runAsUserID = respOwnership.GetId() + } + alerts[idx] = Alert{ + ID: alert.GetId(), + Name: alert.GetName(), + QueryString: alert.GetQueryString(), + QueryStart: alert.GetQueryStart(), + ThrottleField: alert.GetThrottleField(), + TimeOfLastTrigger: alert.GetTimeOfLastTrigger(), + IsStarred: alert.GetIsStarred(), + Description: alert.GetDescription(), + ThrottleTimeMillis: alert.GetThrottleTimeMillis(), + Enabled: alert.GetEnabled(), + Actions: alert.GetActions(), + Labels: alert.GetLabels(), + LastError: alert.GetLastError(), + RunAsUserID: runAsUserID, + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(alert.GetQueryOwnership())), + } + } + return alerts, nil +} + +func (a *Alerts) Add(searchDomainName string, newAlert *Alert) (*Alert, error) { + if newAlert == nil { + return nil, fmt.Errorf("newAlert must not be nil") + } + + queryOwnershipType := humiographql.QueryOwnershipType(newAlert.QueryOwnershipType) + + var ownershipRunAsID *string + if queryOwnershipType == humiographql.QueryOwnershipTypeUser { + ownershipRunAsID = &newAlert.RunAsUserID + } + + resp, err := humiographql.CreateAlert( + context.Background(), + a.client, + searchDomainName, + newAlert.Name, + newAlert.Description, + newAlert.QueryString, + newAlert.QueryStart, + newAlert.ThrottleTimeMillis, + &newAlert.Enabled, + newAlert.Actions, + newAlert.Labels, + ownershipRunAsID, + &queryOwnershipType, + newAlert.ThrottleField, + ) + if err != nil { + return nil, err + } + + respUpdate := resp.GetCreateAlert() + respQueryOwnership := respUpdate.GetQueryOwnership() + respRunAsUserID := "" + respOwnershipType := "" + if respQueryOwnership != nil { + respRunAsUserID = respQueryOwnership.GetId() + respOwnershipTypename := respQueryOwnership.GetTypename() + if respOwnershipTypename != nil { + respOwnershipType = *respOwnershipTypename + } + } + return &Alert{ + ID: respUpdate.GetId(), + Name: respUpdate.GetName(), + QueryString: respUpdate.GetQueryString(), + QueryStart: respUpdate.GetQueryStart(), + ThrottleField: respUpdate.GetThrottleField(), + TimeOfLastTrigger: respUpdate.GetTimeOfLastTrigger(), + IsStarred: respUpdate.GetIsStarred(), + Description: respUpdate.GetDescription(), + ThrottleTimeMillis: respUpdate.GetThrottleTimeMillis(), + Enabled: respUpdate.GetEnabled(), + Actions: respUpdate.GetActions(), + Labels: respUpdate.GetLabels(), + LastError: respUpdate.LastError, + RunAsUserID: respRunAsUserID, + QueryOwnershipType: respOwnershipType, + }, nil +} + +func (a *Alerts) Get(viewName, alertName string) (*Alert, error) { + alerts, err := a.List(viewName) + if err != nil { + return nil, fmt.Errorf("unable to list alerts: %w", err) + } + for _, alert := range alerts { + if alert.Name == alertName { + return &alert, nil + } + } + + return nil, AlertNotFound(alertName) +} + +func (a *Alerts) Delete(searchDomainName, alertName string) error { + actions, err := a.List(searchDomainName) + if err != nil { + return fmt.Errorf("unable to list alerts: %w", err) + } + var alertId string + for _, alert := range actions { + if alert.Name == alertName { + alertId = alert.ID + break + } + } + if alertId == "" { + return AlertNotFound(alertName) + } + + _, err = humiographql.DeleteAlert(context.Background(), a.client, searchDomainName, alertName) + return err +} diff --git a/internal/api/client.go b/internal/api/client.go new file mode 100644 index 00000000..45a61d4a --- /dev/null +++ b/internal/api/client.go @@ -0,0 +1,279 @@ +package api + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/Khan/genqlient/graphql" + "github.com/humio/cli/internal/api/humiographql" + "github.com/vektah/gqlparser/v2/ast" + "github.com/vektah/gqlparser/v2/gqlerror" +) + +const defaultUserAgent = "Humio-go-client/unknown" + +type Client struct { + config Config + httpTransport *http.Transport +} + +type Response struct { + Data interface{} `json:"data"` + Extensions map[string]interface{} `json:"extensions,omitempty"` + Errors ErrorList `json:"errors,omitempty"` +} + +type ErrorList []*GraphqlError + +type GraphqlError struct { + Err error `json:"-"` + Message string `json:"message"` + Path ast.Path `json:"path,omitempty"` + Locations []gqlerror.Location `json:"locations,omitempty"` + Extensions map[string]interface{} `json:"extensions,omitempty"` + Rule string `json:"-"` + State map[string]string `json:"state,omitempty"` +} + +func (err *GraphqlError) Error() string { + var res bytes.Buffer + if err == nil { + return "" + } + filename, _ := err.Extensions["file"].(string) + if filename == "" { + filename = "input" + } + + res.WriteString(filename) + + if len(err.Locations) > 0 { + res.WriteByte(':') + res.WriteString(strconv.Itoa(err.Locations[0].Line)) + } + + res.WriteString(": ") + if ps := err.pathString(); ps != "" { + res.WriteString(ps) + res.WriteByte(' ') + } + + for key, value := range err.State { + res.WriteString(fmt.Sprintf("(%s: %s) ", key, value)) + } + + res.WriteString(err.Message) + + return res.String() +} +func (err *GraphqlError) pathString() string { + return err.Path.String() +} + +func (errs ErrorList) Error() string { + var buf bytes.Buffer + for _, err := range errs { + buf.WriteString(err.Error()) + buf.WriteByte('\n') + } + return buf.String() +} + +func (c *Client) MakeRequest(ctx context.Context, req *graphql.Request, resp *graphql.Response) error { + var httpReq *http.Request + var err error + + body, err := json.Marshal(req) + if err != nil { + return err + } + graphqlURL, err := c.Address().Parse("graphql") + if err != nil { + return nil + } + httpReq, err = http.NewRequest( + http.MethodPost, + graphqlURL.String(), + bytes.NewReader(body)) + if err != nil { + return err + } + + httpReq.Header.Set("Content-Type", "application/json") + + if ctx != nil { + httpReq = httpReq.WithContext(ctx) + } + httpClient := c.newHTTPClientWithHeaders(c.headers()) + httpResp, err := httpClient.Do(httpReq) + if err != nil { + return err + } + if httpResp == nil { + return fmt.Errorf("could not execute http request") + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusOK { + var respBody []byte + respBody, err = io.ReadAll(httpResp.Body) + if err != nil { + respBody = []byte(fmt.Sprintf("", err)) + } + return fmt.Errorf("returned error %v: %s", httpResp.Status, respBody) + } + + var actualResponse Response + actualResponse.Data = resp.Data + + err = json.NewDecoder(httpResp.Body).Decode(&actualResponse) + resp.Extensions = actualResponse.Extensions + for _, actualError := range actualResponse.Errors { + gqlError := gqlerror.Error{ + Err: actualError.Err, + Message: actualError.Message, + Path: actualError.Path, + Locations: actualError.Locations, + Extensions: actualError.Extensions, + Rule: actualError.Rule, + } + resp.Errors = append(resp.Errors, &gqlError) + } + if err != nil { + return err + } + + // This prints all extentions. To use this properly, use a logger + //if len(actualResponse.Extensions) > 0 { + // for _, extension := range resp.Extensions { + // fmt.Printf("%v\n", extension) + // } + //} + if len(actualResponse.Errors) > 0 { + return actualResponse.Errors + } + return nil +} + +type Config struct { + Address *url.URL + UserAgent string + Token string + CACertificatePEM string + Insecure bool + ProxyOrganization string + DialContext func(ctx context.Context, network, addr string) (net.Conn, error) +} + +func DefaultConfig() Config { + config := Config{} + + return config +} + +func (c *Client) Address() *url.URL { + return c.config.Address +} + +func (c *Client) Token() string { + return c.config.Token +} + +func (c *Client) CACertificate() string { + return c.config.CACertificatePEM +} + +func (c *Client) Insecure() bool { + return c.config.Insecure +} + +func (c *Client) Config() Config { + return c.config +} + +func NewClient(config Config) *Client { + httpTransport := NewHttpTransport(config) + return NewClientWithTransport(config, httpTransport) +} + +func NewClientWithTransport(config Config, httpTransport *http.Transport) *Client { + if config.Address != nil && !strings.HasSuffix(config.Address.Path, "/") { + config.Address.Path = config.Address.Path + "/" + } + + if config.UserAgent == "" { + config.UserAgent = defaultUserAgent + } + + return &Client{ + config: config, + httpTransport: httpTransport, + } +} + +func (c *Client) headers() map[string]string { + headers := map[string]string{} + + if c.Token() != "" { + headers["Authorization"] = fmt.Sprintf("Bearer %s", c.Token()) + } + + if c.config.ProxyOrganization != "" { + headers["ProxyOrganization"] = c.config.ProxyOrganization + } + + if c.config.UserAgent != "" { + headers["User-Agent"] = c.config.UserAgent + } + + return headers +} + +// JSONContentType is "application/json" +const JSONContentType string = "application/json" +const ZIPContentType string = "application/zip" + +func (c *Client) HTTPRequest(httpMethod string, path string, body io.Reader) (*http.Response, error) { + return c.HTTPRequestContext(context.Background(), httpMethod, path, body, JSONContentType) +} + +func (c *Client) HTTPRequestContext(ctx context.Context, httpMethod string, path string, body io.Reader, contentType string) (*http.Response, error) { + if body == nil { + body = bytes.NewReader(nil) + } + + url, err := c.Address().Parse(path) + if err != nil { + return nil, err + } + + req, reqErr := http.NewRequestWithContext(ctx, httpMethod, url.String(), body) + if reqErr != nil { + return nil, reqErr + } + + headers := c.headers() + headers["Content-Type"] = contentType + + var client = c.newHTTPClientWithHeaders(headers) + return client.Do(req) +} + +func queryOwnershipToQueryOwnershipType(o humiographql.SharedQueryOwnershipType) humiographql.QueryOwnershipType { + switch (o).(type) { + case *humiographql.SharedQueryOwnershipTypeUserOwnership: + return humiographql.QueryOwnershipTypeUser + case *humiographql.SharedQueryOwnershipTypeOrganizationOwnership: + return humiographql.QueryOwnershipTypeOrganization + default: + panic("unknown ownership type") + } +} diff --git a/internal/api/cluster.go b/internal/api/cluster.go new file mode 100644 index 00000000..578c47d9 --- /dev/null +++ b/internal/api/cluster.go @@ -0,0 +1,207 @@ +package api + +import ( + "context" + "strconv" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Clusters struct { + client *Client +} + +type ClusterNode struct { + Id int + Name string + Uri string + Uuid string + ClusterInfoAgeSeconds float64 + InboundSegmentSize float64 + OutboundSegmentSize float64 + CanBeSafelyUnregistered bool + CurrentSize float64 + PrimarySize float64 + SecondarySize float64 + TotalSizeOfPrimary float64 + TotalSizeOfSecondary float64 + FreeOnPrimary float64 + FreeOnSecondary float64 + WipSize float64 + TargetSize float64 + SolitarySegmentSize float64 + IsAvailable bool + LastHeartbeat string + // Zone holds the availability zone as configured in the `ZONE` configuration of the Humio server. + Zone *string +} + +type IngestPartition struct { + Id int + NodeIds []int +} + +type Cluster struct { + Nodes []ClusterNode + ClusterInfoAgeSeconds float64 + UnderReplicatedSegmentSize float64 + OverReplicatedSegmentSize float64 + MissingSegmentSize float64 + ProperlyReplicatedSegmentSize float64 + TargetUnderReplicatedSegmentSize float64 + TargetOverReplicatedSegmentSize float64 + TargetMissingSegmentSize float64 + TargetProperlyReplicatedSegmentSize float64 + IngestPartitions []IngestPartition +} + +func (c *Client) Clusters() *Clusters { return &Clusters{client: c} } + +func (c *Clusters) Get() (Cluster, error) { + resp, err := humiographql.GetCluster(context.Background(), c.client) + if err != nil { + return Cluster{}, err + } + + respCluster := resp.GetCluster() + respClusterNodes := respCluster.GetNodes() + clusterNodes := make([]ClusterNode, len(respClusterNodes)) + for idx, node := range respClusterNodes { + clusterNodes[idx] = ClusterNode{ + Id: node.GetId(), + Name: node.GetName(), + Uri: node.GetUri(), + Uuid: node.GetUuid(), + ClusterInfoAgeSeconds: node.GetClusterInfoAgeSeconds(), + InboundSegmentSize: node.GetInboundSegmentSize(), + OutboundSegmentSize: node.GetOutboundSegmentSize(), + CanBeSafelyUnregistered: node.GetCanBeSafelyUnregistered(), + CurrentSize: node.GetCurrentSize(), + PrimarySize: node.GetPrimarySize(), + SecondarySize: node.GetSecondarySize(), + TotalSizeOfPrimary: node.GetTotalSizeOfPrimary(), + TotalSizeOfSecondary: node.GetTotalSizeOfSecondary(), + FreeOnPrimary: node.GetFreeOnPrimary(), + FreeOnSecondary: node.GetFreeOnSecondary(), + WipSize: node.GetWipSize(), + TargetSize: node.GetTargetSize(), + SolitarySegmentSize: node.GetSolitarySegmentSize(), + IsAvailable: node.GetIsAvailable(), + LastHeartbeat: node.GetLastHeartbeat().String(), + Zone: node.GetZone(), + } + } + respIngestPartitions := respCluster.GetIngestPartitions() + ingestPartitions := make([]IngestPartition, len(respIngestPartitions)) + for idx, partition := range respIngestPartitions { + ingestPartitions[idx] = IngestPartition{ + Id: partition.GetId(), + NodeIds: partition.GetNodeIds(), + } + } + + return Cluster{ + Nodes: clusterNodes, + ClusterInfoAgeSeconds: respCluster.GetClusterInfoAgeSeconds(), + UnderReplicatedSegmentSize: respCluster.GetUnderReplicatedSegmentSize(), + OverReplicatedSegmentSize: respCluster.GetOverReplicatedSegmentSize(), + MissingSegmentSize: respCluster.GetMissingSegmentSize(), + ProperlyReplicatedSegmentSize: respCluster.GetProperlyReplicatedSegmentSize(), + TargetUnderReplicatedSegmentSize: respCluster.GetTargetUnderReplicatedSegmentSize(), + TargetOverReplicatedSegmentSize: respCluster.GetTargetOverReplicatedSegmentSize(), + TargetMissingSegmentSize: respCluster.GetTargetMissingSegmentSize(), + TargetProperlyReplicatedSegmentSize: respCluster.GetTargetProperlyReplicatedSegmentSize(), + IngestPartitions: ingestPartitions, + }, nil +} + +type ClusterNodes struct { + client *Client +} + +func (c *Client) ClusterNodes() *ClusterNodes { return &ClusterNodes{client: c} } + +func (n *ClusterNodes) List() ([]ClusterNode, error) { + resp, err := humiographql.GetCluster(context.Background(), n.client) + if err != nil { + return nil, err + } + + respCluster := resp.GetCluster() + respClusterNodes := respCluster.GetNodes() + clusterNodes := make([]ClusterNode, len(respClusterNodes)) + for idx, node := range respClusterNodes { + clusterNodes[idx] = ClusterNode{ + Id: node.GetId(), + Name: node.GetName(), + Uri: node.GetUri(), + Uuid: node.GetUuid(), + ClusterInfoAgeSeconds: node.GetClusterInfoAgeSeconds(), + InboundSegmentSize: node.GetInboundSegmentSize(), + OutboundSegmentSize: node.GetOutboundSegmentSize(), + CanBeSafelyUnregistered: node.GetCanBeSafelyUnregistered(), + CurrentSize: node.GetCurrentSize(), + PrimarySize: node.GetPrimarySize(), + SecondarySize: node.GetSecondarySize(), + TotalSizeOfPrimary: node.GetTotalSizeOfPrimary(), + TotalSizeOfSecondary: node.GetTotalSizeOfSecondary(), + FreeOnPrimary: node.GetFreeOnPrimary(), + FreeOnSecondary: node.GetFreeOnSecondary(), + WipSize: node.GetWipSize(), + TargetSize: node.GetTargetSize(), + SolitarySegmentSize: node.GetSolitarySegmentSize(), + IsAvailable: node.GetIsAvailable(), + LastHeartbeat: node.GetLastHeartbeat().String(), + Zone: node.GetZone(), + } + } + + return clusterNodes, nil +} + +func (n *ClusterNodes) Get(nodeID int) (ClusterNode, error) { + resp, err := humiographql.GetCluster(context.Background(), n.client) + if err != nil { + return ClusterNode{}, err + } + + respCluster := resp.GetCluster() + respClusterNodes := respCluster.GetNodes() + for _, node := range respClusterNodes { + if node.Id == nodeID { + return ClusterNode{ + Id: node.GetId(), + Name: node.GetName(), + Uri: node.GetUri(), + Uuid: node.GetUuid(), + ClusterInfoAgeSeconds: node.GetClusterInfoAgeSeconds(), + InboundSegmentSize: node.GetInboundSegmentSize(), + OutboundSegmentSize: node.GetOutboundSegmentSize(), + CanBeSafelyUnregistered: node.GetCanBeSafelyUnregistered(), + CurrentSize: node.GetCurrentSize(), + PrimarySize: node.GetPrimarySize(), + SecondarySize: node.GetSecondarySize(), + TotalSizeOfPrimary: node.GetTotalSizeOfPrimary(), + TotalSizeOfSecondary: node.GetTotalSizeOfSecondary(), + FreeOnPrimary: node.GetFreeOnPrimary(), + FreeOnSecondary: node.GetFreeOnSecondary(), + WipSize: node.GetWipSize(), + TargetSize: node.GetTargetSize(), + SolitarySegmentSize: node.GetSolitarySegmentSize(), + IsAvailable: node.GetIsAvailable(), + LastHeartbeat: node.GetLastHeartbeat().String(), + Zone: node.GetZone(), + }, nil + } + } + + return ClusterNode{}, ClusterNodeNotFound(strconv.Itoa(nodeID)) +} + +func (n *ClusterNodes) Unregister(nodeID int, force bool) error { + _, err := humiographql.UnregisterClusterNode(context.Background(), n.client, nodeID, force) + if err != nil { + return err + } + return nil +} diff --git a/internal/api/error.go b/internal/api/error.go new file mode 100644 index 00000000..c89258d0 --- /dev/null +++ b/internal/api/error.go @@ -0,0 +1,127 @@ +package api + +import ( + "fmt" +) + +type EntityType string + +const ( + EntityTypeSearchDomain EntityType = "search-domain" + EntityTypeRepository EntityType = "repository" + EntityTypeView EntityType = "view" + EntityTypeIngestToken EntityType = "ingest-token" + EntityTypeParser EntityType = "parser" + EntityTypeAction EntityType = "action" + EntityTypeAlert EntityType = "alert" + EntityTypeFilterAlert EntityType = "filter-alert" + EntityTypeScheduledSearch EntityType = "scheduled-search" + EntityTypeAggregateAlert EntityType = "aggregate-alert" + EntityTypeUser EntityType = "user" + EntityTypeClusterNode EntityType = "cluster-node" +) + +func (e EntityType) String() string { + return string(e) +} + +type EntityNotFound struct { + entityType EntityType + key string +} + +func (e EntityNotFound) EntityType() EntityType { + return e.entityType +} + +func (e EntityNotFound) Key() string { + return e.key +} + +func (e EntityNotFound) Error() string { + return fmt.Sprintf("%s %q not found", e.entityType.String(), e.key) +} + +func SearchDomainNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeSearchDomain, + key: name, + } +} + +func RepositoryNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeRepository, + key: name, + } +} + +func ViewNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeView, + key: name, + } +} + +func IngestTokenNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeIngestToken, + key: name, + } +} + +func ParserNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeParser, + key: name, + } +} + +func ActionNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeAction, + key: name, + } +} + +func AlertNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeAlert, + key: name, + } +} + +func FilterAlertNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeFilterAlert, + key: name, + } +} + +func ScheduledSearchNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeScheduledSearch, + key: name, + } +} + +func AggregateAlertNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeAggregateAlert, + key: name, + } +} + +func UserNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeUser, + key: name, + } +} + +func ClusterNodeNotFound(name string) error { + return EntityNotFound{ + entityType: EntityTypeClusterNode, + key: name, + } +} diff --git a/internal/api/featureflag.go b/internal/api/featureflag.go new file mode 100644 index 00000000..a0b65cb5 --- /dev/null +++ b/internal/api/featureflag.go @@ -0,0 +1,76 @@ +package api + +import ( + "context" + "sort" + + "github.com/humio/cli/internal/api/humiographql" +) + +type FeatureFlagName string + +type FeatureFlag struct { + Flag FeatureFlagName + Experimental bool + Description string +} + +type FeatureFlags struct { + client *Client +} + +func (c *Client) FeatureFlags() *FeatureFlags { + return &FeatureFlags{client: c} +} + +func (f *FeatureFlags) SupportedFlags() ([]FeatureFlag, error) { + resp, err := humiographql.GetSupportedFeatureFlags(context.Background(), f.client) + if err != nil { + return nil, err + } + + respFeatureFlags := resp.GetFeatureFlags() + supportedFlags := make([]FeatureFlag, len(respFeatureFlags)) + for idx, flag := range respFeatureFlags { + supportedFlags[idx] = FeatureFlag{ + Flag: FeatureFlagName(flag.GetFlag()), + Experimental: flag.GetExperimental(), + Description: flag.GetDescription(), + } + } + + sort.Slice(supportedFlags, func(i, j int) bool { + return supportedFlags[i].Flag < supportedFlags[j].Flag + }) + return supportedFlags, nil +} + +func (f *FeatureFlags) EnableGlobally(flag FeatureFlagName) error { + _, err := humiographql.EnableFeatureFlagGlobally(context.Background(), f.client, humiographql.FeatureFlag(flag)) + return err +} + +func (f *FeatureFlags) DisableGlobally(flag FeatureFlagName) error { + _, err := humiographql.DisableFeatureFlagGlobally(context.Background(), f.client, humiographql.FeatureFlag(flag)) + return err +} + +func (f *FeatureFlags) EnableForOrganization(organizationID string, flag FeatureFlagName) error { + _, err := humiographql.EnableFeatureFlagForOrganization(context.Background(), f.client, humiographql.FeatureFlag(flag), organizationID) + return err +} + +func (f *FeatureFlags) DisableForOrganization(organizationID string, flag FeatureFlagName) error { + _, err := humiographql.DisableFeatureFlagForOrganization(context.Background(), f.client, humiographql.FeatureFlag(flag), organizationID) + return err +} + +func (f *FeatureFlags) EnableForUser(userID string, flag FeatureFlagName) error { + _, err := humiographql.EnableFeatureFlagForUser(context.Background(), f.client, humiographql.FeatureFlag(flag), userID) + return err +} + +func (f *FeatureFlags) DisableForUser(userID string, flag FeatureFlagName) error { + _, err := humiographql.DisableFeatureFlagForUser(context.Background(), f.client, humiographql.FeatureFlag(flag), userID) + return err +} diff --git a/internal/api/files.go b/internal/api/files.go new file mode 100644 index 00000000..ae63f6d6 --- /dev/null +++ b/internal/api/files.go @@ -0,0 +1,112 @@ +package api + +import ( + "context" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + + "github.com/humio/cli/internal/api/humiographql" + "golang.org/x/sync/errgroup" +) + +type Files struct { + client *Client +} + +type File struct { + Name string + ContentHash string +} + +func (c *Client) Files() *Files { return &Files{client: c} } + +func (f *Files) List(searchDomainName string) ([]File, error) { + resp, err := humiographql.ListFiles(context.Background(), f.client, searchDomainName) + if err != nil { + return nil, err + } + + respFiles := resp.GetSearchDomain().GetFiles() + files := make([]File, len(respFiles)) + for i, file := range respFiles { + nameAndPath := file.GetNameAndPath() + files[i] = File{ + Name: nameAndPath.GetName(), + ContentHash: file.GetContentHash(), + } + } + return files, nil +} + +func (f *Files) Delete(searchDomainName string, fileName string) error { + _, err := humiographql.RemoveFile(context.Background(), f.client, searchDomainName, fileName) + return err +} + +func (f *Files) Upload(viewName string, fileName string, reader io.Reader) error { + pr, pw := io.Pipe() + + multipartWriter := multipart.NewWriter(pw) + + var resp *http.Response + + eg, ctx := errgroup.WithContext(context.Background()) + + eg.Go(func() error { + var err error + resp, err = f.client.HTTPRequestContext(ctx, http.MethodPost, fmt.Sprintf("api/v1/dataspaces/%s/files", url.PathEscape(viewName)), pr, multipartWriter.FormDataContentType()) + return err + }) + + eg.Go(func() error { + defer pw.Close() + + file, err := multipartWriter.CreateFormFile("file", fileName) + if err != nil { + return err + } + _, err = io.Copy(file, reader) + if err != nil { + return err + } + + return multipartWriter.Close() + }) + + err := eg.Wait() + if err != nil { + return err + } + + if resp == nil { + return fmt.Errorf("failed to get response") + } + + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return fmt.Errorf("server responded with %s: %s", resp.Status, string(body)) + } + + return nil +} + +func (f *Files) Download(viewName string, fileName string) (io.Reader, error) { + resp, err := f.client.HTTPRequest(http.MethodGet, fmt.Sprintf("api/v1/dataspaces/%s/files/%s", url.PathEscape(viewName), url.PathEscape(fileName)), nil) + if err != nil { + return nil, err + } + + if resp == nil { + return nil, fmt.Errorf("failed to get response") + } + + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return nil, fmt.Errorf("server responded with %s: %s", resp.Status, string(body)) + } + + return resp.Body, nil +} diff --git a/internal/api/filter-alerts.go b/internal/api/filter-alerts.go new file mode 100644 index 00000000..f510ca1c --- /dev/null +++ b/internal/api/filter-alerts.go @@ -0,0 +1,124 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type FilterAlert struct { + ID string `yaml:"-"` + Name string + Description *string + QueryString string `yaml:"queryString"` + ActionNames []string `yaml:"actionNames"` + Labels []string + Enabled bool + QueryOwnershipType string `yaml:"queryOwnershipType"` + ThrottleTimeSeconds *int64 `yaml:"throttleTimeSeconds"` + ThrottleField *string `yaml:"throttleField"` + OwnershipRunAsID string `yaml:"ownershipRunAsID"` +} + +type FilterAlerts struct { + client *Client +} + +func (c *Client) FilterAlerts() *FilterAlerts { return &FilterAlerts{client: c} } + +func (fa *FilterAlerts) List(searchDomainName string) ([]FilterAlert, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("searchDomainName must not be empty") + } + + resp, err := humiographql.ListFilterAlerts(context.Background(), fa.client, searchDomainName) + if err != nil { + return nil, err + } + respSearchDomain := resp.GetSearchDomain() + respFilterAlerts := respSearchDomain.GetFilterAlerts() + filterAlerts := make([]FilterAlert, len(respFilterAlerts)) + for idx, filterAlert := range respFilterAlerts { + actionNames := make([]string, len(filterAlert.GetActions())) + for kdx, action := range filterAlert.GetActions() { + actionNames[kdx] = action.GetName() + } + filterAlerts[idx] = FilterAlert{ + ID: filterAlert.GetId(), + Name: filterAlert.GetName(), + Description: filterAlert.GetDescription(), + QueryString: filterAlert.GetQueryString(), + ActionNames: actionNames, + Labels: filterAlert.GetLabels(), + Enabled: filterAlert.GetEnabled(), + ThrottleField: filterAlert.GetThrottleField(), + ThrottleTimeSeconds: filterAlert.GetThrottleTimeSeconds(), + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(filterAlert.GetQueryOwnership())), + OwnershipRunAsID: filterAlert.GetQueryOwnership().GetId(), + } + } + return filterAlerts, nil +} + +func (fa *FilterAlerts) Create(searchDomainName string, newFilterAlert *FilterAlert) (*FilterAlert, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("searchDomainName must not be empty") + } + + if newFilterAlert == nil { + return nil, fmt.Errorf("newFilterAlert must not be nil") + } + + var ownershipRunAsID *string + if humiographql.QueryOwnershipType(newFilterAlert.QueryOwnershipType) == humiographql.QueryOwnershipTypeUser { + ownershipRunAsID = &newFilterAlert.OwnershipRunAsID + } + + resp, err := humiographql.CreateFilterAlert( + context.Background(), + fa.client, + searchDomainName, + newFilterAlert.Name, + newFilterAlert.Description, + newFilterAlert.QueryString, + newFilterAlert.ActionNames, + newFilterAlert.Labels, + newFilterAlert.Enabled, + ownershipRunAsID, + newFilterAlert.ThrottleField, + *newFilterAlert.ThrottleTimeSeconds, + humiographql.QueryOwnershipType(newFilterAlert.QueryOwnershipType), + ) + if err != nil { + return nil, err + } + + respFilterAlert := resp.GetCreateFilterAlert() + actionNames := make([]string, len(respFilterAlert.GetActions())) + for kdx, action := range respFilterAlert.GetActions() { + actionNames[kdx] = action.GetName() + } + return &FilterAlert{ + ID: respFilterAlert.GetId(), + Name: respFilterAlert.GetName(), + Description: respFilterAlert.GetDescription(), + QueryString: respFilterAlert.GetQueryString(), + ActionNames: actionNames, + Labels: respFilterAlert.GetLabels(), + Enabled: respFilterAlert.GetEnabled(), + ThrottleField: respFilterAlert.ThrottleField, + ThrottleTimeSeconds: respFilterAlert.GetThrottleTimeSeconds(), + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(respFilterAlert.GetQueryOwnership())), + OwnershipRunAsID: respFilterAlert.GetQueryOwnership().GetId(), + }, nil +} + +func (fa *FilterAlerts) Delete(searchDomainName, filterAlertID string) error { + if filterAlertID == "" { + return fmt.Errorf("filterAlertID is empty") + } + + _, err := humiographql.DeleteFilterAlert(context.Background(), fa.client, searchDomainName, filterAlertID) + return err +} diff --git a/internal/api/groups.go b/internal/api/groups.go new file mode 100644 index 00000000..f8904b70 --- /dev/null +++ b/internal/api/groups.go @@ -0,0 +1,54 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Groups struct { + client *Client +} + +type Group struct { + ID string + DisplayName string +} + +func (c *Client) Groups() *Groups { return &Groups{client: c} } + +func (g *Groups) List() ([]Group, error) { + resp, err := humiographql.ListGroups(context.Background(), g.client) + if err != nil { + return nil, err + } + respGroups := resp.GetGroupsPage() + respGroupsPage := respGroups.GetPage() + groups := make([]Group, len(respGroupsPage)) + for idx, group := range respGroupsPage { + groups[idx] = Group{ + ID: group.GetId(), + DisplayName: group.GetDisplayName(), + } + } + + return groups, nil +} + +func (g *Groups) AddUserToGroup(groupID string, userID string) error { + _, err := humiographql.AddUserToGroup(context.Background(), g.client, groupID, userID) + if err != nil { + return err + } + + return nil +} + +func (g *Groups) RemoveUserFromGroup(groupID string, userID string) error { + _, err := humiographql.RemoveUserFromGroup(context.Background(), g.client, groupID, userID) + if err != nil { + return err + } + + return nil +} diff --git a/internal/api/health.go b/internal/api/health.go new file mode 100644 index 00000000..4837742a --- /dev/null +++ b/internal/api/health.go @@ -0,0 +1,83 @@ +package api + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" +) + +type StatusValue string + +const ( + StatusOK StatusValue = "OK" + StatusWarn StatusValue = "WARN" + StatusDown StatusValue = "DOWN" +) + +type HealthCheck struct { + Name string `json:"name"` + Status StatusValue `json:"status"` + StatusMessage string `json:"statusMessage"` + Fields map[string]interface{} `json:"fields"` +} + +type Health struct { + Status StatusValue `json:"status"` + StatusMessage string `json:"statusMessage"` + Uptime string `json:"uptime"` + Version string `json:"version"` + OK []HealthCheck `json:"oks"` + Warn []HealthCheck `json:"warnings"` + Down []HealthCheck `json:"down"` + rawJson []byte +} + +func (c *Client) Health() (Health, error) { + resp, err := c.HTTPRequest(http.MethodGet, "api/v1/health-json", nil) + if err != nil { + return Health{}, err + } + + if resp == nil { + return Health{}, fmt.Errorf("failed to get response") + } + + if resp.StatusCode != http.StatusOK { + return Health{}, fmt.Errorf("server responded with status code %d", resp.StatusCode) + } + + var rawJson bytes.Buffer + + var health Health + err = json.NewDecoder(io.TeeReader(resp.Body, &rawJson)).Decode(&health) + + if health.Down == nil { + health.Down = []HealthCheck{} + } + + if health.Warn == nil { + health.Warn = []HealthCheck{} + } + + if health.OK == nil { + health.OK = []HealthCheck{} + } + + health.rawJson = rawJson.Bytes() + + return health, err +} + +func (h *Health) ChecksMap() map[string]HealthCheck { + m := map[string]HealthCheck{} + + for _, l := range [][]HealthCheck{h.OK, h.Warn, h.Down} { + for _, c := range l { + m[c.Name] = c + } + } + + return m +} diff --git a/internal/api/httpclient.go b/internal/api/httpclient.go new file mode 100644 index 00000000..b0cbcadc --- /dev/null +++ b/internal/api/httpclient.go @@ -0,0 +1,121 @@ +package api + +import ( + "crypto/tls" + "crypto/x509" + "net" + "net/http" + "time" +) + +// We must our own http.Client which adds the authorization header in all requests sent to Humio. +// We use the approach described here: https://github.com/shurcooL/graphql/issues/28#issuecomment-464713908 + +type headerTransport struct { + base http.RoundTripper + headers map[string]string +} + +func NewHttpTransport(config Config) *http.Transport { + dialContext := config.DialContext + if dialContext == nil { + dialContext = (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext + } + + if config.Insecure { + // Return HTTP transport where we skip certificate verification + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: dialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: config.Insecure, // #nosec G402 + }, + } + } + + if len(config.CACertificatePEM) > 0 { + // Create a certificate pool and return a HTTP transport with the specified specified CA certificate. + caCertPool := x509.NewCertPool() + caCertPool.AppendCertsFromPEM([]byte(config.CACertificatePEM)) + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: dialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + + TLSClientConfig: &tls.Config{ + RootCAs: caCertPool, + InsecureSkipVerify: config.Insecure, // #nosec G402 + }, + } + } + + // Return a regular default HTTP client + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: dialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} + +// NewHTTPClientWithHeaders returns a *http.Client that attaches a defined set of Headers to all requests. +func (c *Client) newHTTPClientWithHeaders(headers map[string]string) *http.Client { + return &http.Client{ + Transport: &headerTransport{ + base: c.httpTransport, + headers: headers, + }, + Timeout: 30 * time.Second, + } +} + +func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) { + req2 := CloneRequest(req) + for key, val := range h.headers { + req2.Header.Set(key, val) + } + return h.base.RoundTrip(req2) +} + +// CloneRequest and CloneHeader copied from https://github.com/kubernetes/apimachinery/blob/a76b7114b20a2e56fd698bba815b1e2c82ec4bff/pkg/util/net/http.go#L469-L491 + +// CloneRequest creates a shallow copy of the request along with a deep copy of the Headers. +func CloneRequest(req *http.Request) *http.Request { + r := new(http.Request) + + // shallow clone + *r = *req + + // deep copy headers + r.Header = CloneHeader(req.Header) + + return r +} + +// CloneHeader creates a deep copy of an http.Header. +func CloneHeader(in http.Header) http.Header { + out := make(http.Header, len(in)) + for key, values := range in { + newValues := make([]string, len(values)) + copy(newValues, values) + out[key] = newValues + } + return out +} diff --git a/internal/api/humiographql/genqlient.yaml b/internal/api/humiographql/genqlient.yaml new file mode 100644 index 00000000..897a4c66 --- /dev/null +++ b/internal/api/humiographql/genqlient.yaml @@ -0,0 +1,42 @@ +schema: schema/_schema.graphql +operations: + - graphql/actions.graphql + - graphql/aggregate-alerts.graphql + - graphql/alerts.graphql + - graphql/cluster.graphql + - graphql/featureflags.graphql + - graphql/files.graphql + - graphql/filter-alerts.graphql + - graphql/fragments.graphql + - graphql/groups.graphql + - graphql/ingest-tokens.graphql + - graphql/license.graphql + - graphql/packages.graphql + - graphql/parsers.graphql + - graphql/repositories.graphql + - graphql/roles.graphql + - graphql/scheduled-search.graphql + - graphql/searchdomains.graphql + - graphql/token.graphql + - graphql/viewer.graphql + - graphql/views.graphql + - graphql/users.graphql +generated: humiographql.go + +bindings: + DateTime: + type: time.Time + RepoOrViewName: + type: string + Long: + type: int64 + VersionedPackageSpecifier: + type: string + UnversionedPackageSpecifier: + type: string + PackageVersion: + type: string + YAML: + type: string + +optional: pointer \ No newline at end of file diff --git a/internal/api/humiographql/graphql/actions.graphql b/internal/api/humiographql/graphql/actions.graphql new file mode 100644 index 00000000..d9b7fe3e --- /dev/null +++ b/internal/api/humiographql/graphql/actions.graphql @@ -0,0 +1,544 @@ +fragment ActionDetails on Action{ + id + name + + ... on EmailAction { + recipients + subjectTemplate + emailBodyTemplate: bodyTemplate + useProxy + + } + + ... on HumioRepoAction { + ingestToken + } + + ... on OpsGenieAction { + apiUrl + genieKey + useProxy + } + + ... on PagerDutyAction { + severity + routingKey + useProxy + } + + ... on SlackAction { + url + fields { + fieldName + value + } + useProxy + } + + ... on SlackPostMessageAction { + apiToken + channels + fields { + fieldName + value + } + useProxy + } + + ... on VictorOpsAction { + messageType + notifyUrl + useProxy + } + + ... on UploadFileAction { + fileName + } + + ... on WebhookAction { + method + url + headers { + header + value + } + WebhookBodyTemplate: bodyTemplate + ignoreSSL + useProxy + } +} + +query ListActions( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + actions { + ...ActionDetails + } + } +} + +query GetActionByID( + $SearchDomainName: String! + $ActionID: String! +) { + searchDomain( + name: $SearchDomainName + ) { + action( + id: $ActionID + ) { + ...ActionDetails + } + } +} + +mutation DeleteActionByID( + $SearchDomainName: String! + $ActionID: String! +) { + deleteAction(input: { + viewName: $SearchDomainName + id: $ActionID + }) +} + +mutation UpdateEmailAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $Recipients: [String!]! + $SubjectTemplate: String + $BodyTemplate: String + $UseProxy: Boolean! +) { + updateEmailAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + recipients: $Recipients + subjectTemplate: $SubjectTemplate + bodyTemplate: $BodyTemplate + useProxy: $UseProxy + }) { + id + name + recipients + subjectTemplate + bodyTemplate + useProxy + } +} + +mutation UpdateHumioRepoAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $IngestToken: String! +) { + updateHumioRepoAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + ingestToken: $IngestToken + }) { + id + name + ingestToken + } +} + +mutation UpdateOpsGenieAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $ApiUrl: String! + $GenieKey: String! + $UseProxy: Boolean! +) { + updateOpsGenieAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + apiUrl: $ApiUrl + genieKey: $GenieKey + useProxy: $UseProxy + }) { + id + name + apiUrl + genieKey + useProxy + } +} + +mutation UpdatePagerDutyAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $Severity: String! + $RoutingKey: String! + $UseProxy: Boolean! +) { + updatePagerDutyAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + severity: $Severity + routingKey: $RoutingKey + useProxy: $UseProxy + }) { + id + name + severity + routingKey + useProxy + } +} + +mutation UpdateSlackAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $Fields: [SlackFieldEntryInput!]! + $Url: String! + $UseProxy: Boolean! +) { + updateSlackAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + fields: $Fields + url: $Url + useProxy: $UseProxy + }) { + id + name + fields { + value + fieldName + } + url + useProxy + } +} + +mutation UpdateSlackPostMessageAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $ApiToken: String! + $Channels: [String!]! + $Fields: [SlackFieldEntryInput!]! + $UseProxy: Boolean! +) { + updateSlackPostMessageAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + apiToken: $ApiToken + channels: $Channels + fields: $Fields + useProxy: $UseProxy + }) { + id + name + apiToken + channels + fields { + value + fieldName + } + useProxy + } +} + +mutation UpdateVictorOpsAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $MessageType: String! + $NotifyUrl: String! + $UseProxy: Boolean! +) { + updateVictorOpsAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + messageType: $MessageType + notifyUrl: $NotifyUrl + useProxy: $UseProxy + }) { + id + name + messageType + notifyUrl + useProxy + } +} + +mutation UpdateUploadFileAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $FileName: String! +) { + updateUploadFileAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + fileName: $FileName + }) { + id + name + fileName + } +} + +mutation UpdateWebhookAction( + $SearchDomainName: String! + $ActionID: String! + $ActionName: String! + $Url: String! + $Method: String! + $Headers: [HttpHeaderEntryInput!]! + $BodyTemplate: String! + $IgnoreSSL: Boolean! + $UseProxy: Boolean! +) { + updateWebhookAction(input: { + viewName: $SearchDomainName + id: $ActionID + name: $ActionName + url: $Url + method: $Method + headers: $Headers + bodyTemplate: $BodyTemplate + ignoreSSL: $IgnoreSSL + useProxy: $UseProxy + }) { + id + name + url + method + headers { + value + header + } + bodyTemplate + ignoreSSL + useProxy + } +} + +mutation CreateEmailAction( + $SearchDomainName: String! + $ActionName: String! + $Recipients: [String!]! + $SubjectTemplate: String + $BodyTemplate: String + $UseProxy: Boolean! +) { + createEmailAction(input: { + viewName: $SearchDomainName + name: $ActionName + recipients: $Recipients + subjectTemplate: $SubjectTemplate + bodyTemplate: $BodyTemplate + useProxy: $UseProxy + }) { + id + name + recipients + subjectTemplate + bodyTemplate + useProxy + } +} + +mutation CreateHumioRepoAction( + $SearchDomainName: String! + $ActionName: String! + $IngestToken: String! +) { + createHumioRepoAction(input: { + viewName: $SearchDomainName + name: $ActionName + ingestToken: $IngestToken + }) { + id + name + ingestToken + } +} + +mutation CreateOpsGenieAction( + $SearchDomainName: String! + $ActionName: String! + $ApiUrl: String! + $GenieKey: String! + $UseProxy: Boolean! +) { + createOpsGenieAction(input: { + viewName: $SearchDomainName + name: $ActionName + apiUrl: $ApiUrl + genieKey: $GenieKey + useProxy: $UseProxy + }) { + id + name + apiUrl + genieKey + useProxy + } +} + +mutation CreatePagerDutyAction( + $SearchDomainName: String! + $ActionName: String! + $Severity: String! + $RoutingKey: String! + $UseProxy: Boolean! +) { + createPagerDutyAction(input: { + viewName: $SearchDomainName + name: $ActionName + severity: $Severity + routingKey: $RoutingKey + useProxy: $UseProxy + }) { + id + name + severity + routingKey + useProxy + } +} + +mutation CreateSlackAction( + $SearchDomainName: String! + $ActionName: String! + $Fields: [SlackFieldEntryInput!]! + $Url: String! + $UseProxy: Boolean! +) { + createSlackAction(input: { + viewName: $SearchDomainName + name: $ActionName + fields: $Fields + url: $Url + useProxy: $UseProxy + }) { + id + name + fields { + value + fieldName + } + url + useProxy + } +} + +mutation CreateSlackPostMessageAction( + $SearchDomainName: String! + $ActionName: String! + $ApiToken: String! + $Channels: [String!]! + $Fields: [SlackFieldEntryInput!]! + $UseProxy: Boolean! +) { + createSlackPostMessageAction(input: { + viewName: $SearchDomainName + name: $ActionName + apiToken: $ApiToken + channels: $Channels + fields: $Fields + useProxy: $UseProxy + }) { + id + name + apiToken + channels + fields { + value + fieldName + } + useProxy + } +} + +mutation CreateVictorOpsAction( + $SearchDomainName: String! + $ActionName: String! + $MessageType: String! + $NotifyUrl: String! + $UseProxy: Boolean! +) { + createVictorOpsAction(input: { + viewName: $SearchDomainName + name: $ActionName + messageType: $MessageType + notifyUrl: $NotifyUrl + useProxy: $UseProxy + }) { + id + name + messageType + notifyUrl + useProxy + } +} + +mutation CreateUploadFileAction( + $SearchDomainName: String! + $ActionName: String! + $FileName: String! +) { + createUploadFileAction(input: { + viewName: $SearchDomainName + name: $ActionName + fileName: $FileName + }) { + id + name + fileName + } +} + +mutation CreateWebhookAction( + $SearchDomainName: String! + $ActionName: String! + $Url: String! + $Method: String! + $Headers: [HttpHeaderEntryInput!]! + $BodyTemplate: String! + $IgnoreSSL: Boolean! + $UseProxy: Boolean! +) { + createWebhookAction(input: { + viewName: $SearchDomainName + name: $ActionName + url: $Url + method: $Method + headers: $Headers + bodyTemplate: $BodyTemplate + ignoreSSL: $IgnoreSSL + useProxy: $UseProxy + }) { + id + name + url + method + headers { + value + header + } + bodyTemplate + ignoreSSL + useProxy + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/aggregate-alerts.graphql b/internal/api/humiographql/graphql/aggregate-alerts.graphql new file mode 100644 index 00000000..a28421e6 --- /dev/null +++ b/internal/api/humiographql/graphql/aggregate-alerts.graphql @@ -0,0 +1,130 @@ +fragment AggregateAlertDetails on AggregateAlert { + id + name + description + queryString + searchIntervalSeconds + throttleTimeSeconds + throttleField + actions { + name + } + labels + enabled + triggerMode + queryTimestampType + + # @genqlient(typename: "SharedQueryOwnershipType") + queryOwnership { + ...QueryOwnership + } +} + +query ListAggregateAlerts( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + aggregateAlerts { + ...AggregateAlertDetails + } + } +} + +mutation UpdateAggregateAlert( + $SearchDomainName: RepoOrViewName! + $ID: String! + $Name: String! + $Description: String + $QueryString: String! + $SearchIntervalSeconds: Long! + $ActionIdsOrNames: [String!]! + $Labels: [String!]! + $Enabled: Boolean! + $RunAsUserID: String + $ThrottleField: String + $ThrottleTimeSeconds: Long! + $TriggerMode: TriggerMode! + $QueryTimestampMode: QueryTimestampType! + $QueryOwnershipType: QueryOwnershipType! +) { + updateAggregateAlert(input: { + viewName: $SearchDomainName + id: $ID + name: $Name + description: $Description + queryString: $QueryString + searchIntervalSeconds: $SearchIntervalSeconds + actionIdsOrNames: $ActionIdsOrNames + labels: $Labels + enabled: $Enabled + runAsUserId: $RunAsUserID + throttleField: $ThrottleField + throttleTimeSeconds: $ThrottleTimeSeconds + triggerMode: $TriggerMode + queryTimestampType: $QueryTimestampMode + queryOwnershipType: $QueryOwnershipType + }) { + ...AggregateAlertDetails + } +} + +mutation CreateAggregateAlert( + $SearchDomainName: RepoOrViewName! + $Name: String! + $Description: String + $QueryString: String! + $SearchIntervalSeconds: Long! + $ActionIdsOrNames: [String!]! + $Labels: [String!]! + $Enabled: Boolean! + $RunAsUserID: String + $ThrottleField: String + $ThrottleTimeSeconds: Long! + $TriggerMode: TriggerMode! + $QueryTimestampMode: QueryTimestampType! + $QueryOwnershipType: QueryOwnershipType! +) { + createAggregateAlert(input: { + viewName: $SearchDomainName + name: $Name + description: $Description + queryString: $QueryString + searchIntervalSeconds: $SearchIntervalSeconds + actionIdsOrNames: $ActionIdsOrNames + labels: $Labels + enabled: $Enabled + runAsUserId: $RunAsUserID + throttleField: $ThrottleField + throttleTimeSeconds: $ThrottleTimeSeconds + triggerMode: $TriggerMode + queryTimestampType: $QueryTimestampMode + queryOwnershipType: $QueryOwnershipType + }) { + ...AggregateAlertDetails + } +} + +mutation DeleteAggregateAlert( + $SearchDomainName: RepoOrViewName! + $AggregateAlertID: String! +) { + deleteAggregateAlert(input: { + id: $AggregateAlertID + viewName: $SearchDomainName + }) +} + +query GetAggregateAlertByID( + $SearchDomainName: String! + $AggregateAlertID: String! +) { + searchDomain( + name: $SearchDomainName + ) { + aggregateAlert(id: $AggregateAlertID) { + ...AggregateAlertDetails + } + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/alerts.graphql b/internal/api/humiographql/graphql/alerts.graphql new file mode 100644 index 00000000..0612bc45 --- /dev/null +++ b/internal/api/humiographql/graphql/alerts.graphql @@ -0,0 +1,108 @@ +fragment AlertDetails on Alert { + id + name + queryString + queryStart + throttleField + timeOfLastTrigger + isStarred + description + throttleTimeMillis + enabled + actions + labels + lastError + + # @genqlient(typename: "SharedQueryOwnershipType") + queryOwnership { + ...QueryOwnership + } +} + +query ListAlerts( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + alerts { + ...AlertDetails + } + } +} + +mutation UpdateAlert( + $SearchDomainName: String! + $AlertID: String! + $Name: String! + $Description: String + $QueryString: String! + $QueryStart: String! + $ThrottleTimeMillis: Long! + $Enabled: Boolean! + $Actions: [String!]! + $Labels: [String!]! + $RunAsUserID: String + $QueryOwnershipType: QueryOwnershipType + $ThrottleField: String +) { + updateAlert(input: { + id: $AlertID + viewName: $SearchDomainName + name: $Name + description: $Description + queryString: $QueryString + queryStart: $QueryStart + throttleTimeMillis: $ThrottleTimeMillis + enabled: $Enabled + actions: $Actions + labels: $Labels + runAsUserId: $RunAsUserID + queryOwnershipType: $QueryOwnershipType + throttleField: $ThrottleField + }) { + ...AlertDetails + } +} + +mutation CreateAlert( + $SearchDomainName: String! + $Name: String! + $Description: String + $QueryString: String! + $QueryStart: String! + $ThrottleTimeMillis: Long! + $Enabled: Boolean + $Actions: [String!]! + $Labels: [String!] + $RunAsUserID: String + $QueryOwnershipType: QueryOwnershipType + $ThrottleField: String +) { + createAlert(input: { + viewName: $SearchDomainName + name: $Name + description: $Description + queryString: $QueryString + queryStart: $QueryStart + throttleTimeMillis: $ThrottleTimeMillis + enabled: $Enabled + actions: $Actions + labels: $Labels + runAsUserId: $RunAsUserID + queryOwnershipType: $QueryOwnershipType + throttleField: $ThrottleField + }) { + ...AlertDetails + } +} + +mutation DeleteAlert( + $SearchDomainName: String! + $AlertID: String! +) { + deleteAlert(input: { + viewName: $SearchDomainName + id: $AlertID + }) +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/cluster.graphql b/internal/api/humiographql/graphql/cluster.graphql new file mode 100644 index 00000000..6d193764 --- /dev/null +++ b/internal/api/humiographql/graphql/cluster.graphql @@ -0,0 +1,62 @@ +fragment ClusterNode on Cluster { + nodes { + id + name + uri + uuid + clusterInfoAgeSeconds + inboundSegmentSize + outboundSegmentSize + canBeSafelyUnregistered + currentSize + primarySize + secondarySize + totalSizeOfPrimary + totalSizeOfSecondary + freeOnPrimary + freeOnSecondary + wipSize + targetSize + solitarySegmentSize + isAvailable + lastHeartbeat + zone + } +} + +query GetCluster { + cluster { + ...ClusterNode + clusterInfoAgeSeconds + underReplicatedSegmentSize + overReplicatedSegmentSize + missingSegmentSize + properlyReplicatedSegmentSize + targetUnderReplicatedSegmentSize + targetOverReplicatedSegmentSize + targetMissingSegmentSize + targetProperlyReplicatedSegmentSize + ingestPartitions { + id + nodeIds + } + } +} + +query ListClusterNodes { + cluster { + ...ClusterNode + } +} + +mutation UnregisterClusterNode( + $NodeID: Int! + $Force: Boolean! +) { + clusterUnregisterNode( + nodeID: $NodeID + force: $Force + ) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/featureflags.graphql b/internal/api/humiographql/graphql/featureflags.graphql new file mode 100644 index 00000000..7a92c1de --- /dev/null +++ b/internal/api/humiographql/graphql/featureflags.graphql @@ -0,0 +1,63 @@ +query GetSupportedFeatureFlags { + featureFlags(includeExperimentalFeatures: true) { + flag + experimental + description + } +} + +mutation EnableFeatureFlagGlobally( + $Flag: FeatureFlag! +) { + enableFeature( + feature: $Flag + ) +} + +mutation DisableFeatureFlagGlobally( + $Flag: FeatureFlag! +) { + disableFeature( + feature: $Flag + ) +} + +mutation EnableFeatureFlagForOrganization( + $Flag: FeatureFlag! + $OrganizationID: String! +) { + enableFeatureForOrg( + feature: $Flag + orgId: $OrganizationID + ) +} + +mutation DisableFeatureFlagForOrganization( + $Flag: FeatureFlag! + $OrganizationID: String! +) { + disableFeatureForOrg( + feature: $Flag + orgId: $OrganizationID + ) +} + +mutation EnableFeatureFlagForUser( + $Flag: FeatureFlag! + $UserID: String! +) { + enableFeatureForUser( + feature: $Flag + userId: $UserID + ) +} + +mutation DisableFeatureFlagForUser( + $Flag: FeatureFlag! + $UserID: String! +) { + disableFeatureForUser( + feature: $Flag + userId: $UserID + ) +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/files.graphql b/internal/api/humiographql/graphql/files.graphql new file mode 100644 index 00000000..ab93c859 --- /dev/null +++ b/internal/api/humiographql/graphql/files.graphql @@ -0,0 +1,23 @@ +query ListFiles( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + files { + contentHash + nameAndPath { + name + } + } + } +} + +mutation RemoveFile( + $SearchDomainName: String! + $FileName: String! +) { + removeFile(name: $SearchDomainName,fileName: $FileName) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/filter-alerts.graphql b/internal/api/humiographql/graphql/filter-alerts.graphql new file mode 100644 index 00000000..9da04018 --- /dev/null +++ b/internal/api/humiographql/graphql/filter-alerts.graphql @@ -0,0 +1,115 @@ +fragment FilterAlertDetails on FilterAlert { + id + name + description + queryString + throttleTimeSeconds + throttleField + actions { + name + } + labels + enabled + + # @genqlient(typename: "SharedQueryOwnershipType") + queryOwnership { + ...QueryOwnership + } +} + +query ListFilterAlerts( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + filterAlerts { + ...FilterAlertDetails + } + } +} + +mutation UpdateFilterAlert( + $SearchDomainName: RepoOrViewName! + $ID: String! + $Name: String! + $Description: String + $QueryString: String! + $ActionIdsOrNames: [String!]! + $Labels: [String!]! + $Enabled: Boolean! + $RunAsUserID: String + $ThrottleField: String + $ThrottleTimeSeconds: Long! + $QueryOwnershipType: QueryOwnershipType! +) { + updateFilterAlert(input: { + viewName: $SearchDomainName + id: $ID + name: $Name + description: $Description + queryString: $QueryString + actionIdsOrNames: $ActionIdsOrNames + labels: $Labels + enabled: $Enabled + runAsUserId: $RunAsUserID + throttleField: $ThrottleField + throttleTimeSeconds: $ThrottleTimeSeconds + queryOwnershipType: $QueryOwnershipType + }) { + ...FilterAlertDetails + } +} + +mutation CreateFilterAlert( + $SearchDomainName: RepoOrViewName! + $Name: String! + $Description: String + $QueryString: String! + $ActionIdsOrNames: [String!]! + $Labels: [String!]! + $Enabled: Boolean! + $RunAsUserID: String + $ThrottleField: String + $ThrottleTimeSeconds: Long! + $QueryOwnershipType: QueryOwnershipType! +) { + createFilterAlert(input: { + viewName: $SearchDomainName + name: $Name + description: $Description + queryString: $QueryString + actionIdsOrNames: $ActionIdsOrNames + labels: $Labels + enabled: $Enabled + runAsUserId: $RunAsUserID + throttleField: $ThrottleField + throttleTimeSeconds: $ThrottleTimeSeconds + queryOwnershipType: $QueryOwnershipType + }) { + ...FilterAlertDetails + } +} + +mutation DeleteFilterAlert( + $SearchDomainName: RepoOrViewName! + $FilterAlertID: String! +) { + deleteFilterAlert(input: { + id: $FilterAlertID + viewName: $SearchDomainName + }) +} + +query GetFilterAlertByID( + $SearchDomainName: String! + $FilterAlertID: String! +) { + searchDomain( + name: $SearchDomainName + ) { + filterAlert(id: $FilterAlertID) { + ...FilterAlertDetails + } + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/fragments.graphql b/internal/api/humiographql/graphql/fragments.graphql new file mode 100644 index 00000000..1ef73dbd --- /dev/null +++ b/internal/api/humiographql/graphql/fragments.graphql @@ -0,0 +1,3 @@ +fragment QueryOwnership on QueryOwnership { + id +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/groups.graphql b/internal/api/humiographql/graphql/groups.graphql new file mode 100644 index 00000000..8cd33f38 --- /dev/null +++ b/internal/api/humiographql/graphql/groups.graphql @@ -0,0 +1,36 @@ +query ListGroups { + groupsPage( + pageNumber: 1 + pageSize: 2147483647 + ) { + page { + id + displayName + } + } +} + + +mutation AddUserToGroup( + $GroupID: String! + $UserID: String! +) { + addUsersToGroup(input: { + groupId: $GroupID + users: [$UserID] + }) { + __typename + } +} + +mutation RemoveUserFromGroup( + $GroupID: String! + $UserID: String! +) { + removeUsersFromGroup(input: { + groupId: $GroupID + users: [$UserID] + }) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/ingest-tokens.graphql b/internal/api/humiographql/graphql/ingest-tokens.graphql new file mode 100644 index 00000000..df2452b9 --- /dev/null +++ b/internal/api/humiographql/graphql/ingest-tokens.graphql @@ -0,0 +1,71 @@ +fragment IngestTokenDetails on IngestToken { + name + token + parser { + name + } +} +query ListIngestTokens( + $RepositoryName: String! +) { + repository( + name: $RepositoryName + ) { + ingestTokens { + ...IngestTokenDetails + } + } +} + +mutation AddIngestToken( + $RepositoryName: String! + $Name: String! + $ParserName: String +) { + addIngestTokenV3(input: { + repositoryName: $RepositoryName + name: $Name + parser: $ParserName + }) { + ...IngestTokenDetails + } +} + +mutation AssignParserToIngestToken( + $RepositoryName: String! + $IngestTokenName: String! + $ParserName: String! +) { + assignParserToIngestTokenV2(input: { + repositoryName: $RepositoryName + parser: $ParserName + tokenName: $IngestTokenName + }) { + __typename + } +} + +mutation UnassignParserToIngestToken( + $RepositoryName: String! + $IngestTokenName: String! +) { + unassignIngestToken( + repositoryName: $RepositoryName + tokenName: $IngestTokenName + ) { + __typename + } +} + + +mutation RemoveIngestToken( + $RepositoryName: String! + $Name: String! +) { + removeIngestToken( + repositoryName: $RepositoryName + name: $Name + ) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/license.graphql b/internal/api/humiographql/graphql/license.graphql new file mode 100644 index 00000000..e5dacec9 --- /dev/null +++ b/internal/api/humiographql/graphql/license.graphql @@ -0,0 +1,19 @@ +query GetLicense { + installedLicense { + expiresAt + issuedAt + ... on OnPremLicense { + uid + owner + maxUsers + } + } +} + +mutation UpdateLicenseKey( + $LicenseKey: String! +) { + updateLicenseKey(license: $LicenseKey) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/packages.graphql b/internal/api/humiographql/graphql/packages.graphql new file mode 100644 index 00000000..6771bbbc --- /dev/null +++ b/internal/api/humiographql/graphql/packages.graphql @@ -0,0 +1,33 @@ +query ListInstalledPackages( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + installedPackages { + id + installedBy { + username + timestamp + } + updatedBy { + username + timestamp + } + source + availableUpdate + } + } +} + +mutation UninstallPackage( + $SearchDomainName: String! + $PackageID: UnversionedPackageSpecifier! +) { + uninstallPackage( + viewName: $SearchDomainName + packageId: $PackageID + ) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/parsers.graphql b/internal/api/humiographql/graphql/parsers.graphql new file mode 100644 index 00000000..9d8e6e9c --- /dev/null +++ b/internal/api/humiographql/graphql/parsers.graphql @@ -0,0 +1,157 @@ +fragment ParserDetails on Parser { + id + name + displayName + description + isBuiltIn + script + fieldsToTag + fieldsToBeRemovedBeforeParsing + testCases { + event { + rawString + } + outputAssertions { + assertions { + fieldsHaveValues { + fieldName + expectedValue + } + fieldsNotPresent + } + outputEventIndex + } + } +} + +query ListParsers( + $RepositoryName: String! +) { + repository( + name: $RepositoryName + ) { + parsers { + id + name + isBuiltIn + } + } +} + +mutation LegacyDeleteParserByID( + $RepositoryName: String! + $ParserID: String! +) { + removeParser(input: { + repositoryName: $RepositoryName + id: $ParserID + }) { + __typename + } +} + +mutation DeleteParserByID( + $RepositoryName: RepoOrViewName! + $ParserID: String! +) { + deleteParser(input: { + repositoryName: $RepositoryName + id: $ParserID + }) { + __typename + } +} +mutation LegacyCreateParser( + $RepositoryName: String! + $Name: String! + $TestData: [String!]! + $TagFields: [String!]! + $SourceCode: String! + $Force: Boolean! +) { + createParser(input: { + name: $Name + repositoryName: $RepositoryName + testData: $TestData + tagFields: $TagFields + sourceCode: $SourceCode + force: $Force + }) { + parser { + ...ParserDetails + } + } +} + + +mutation CreateParser( + $RepositoryName: RepoOrViewName! + $Name: String! + $Script: String! + $TestCases: [ParserTestCaseInput!]! + $FieldsToTag: [String!]! + $FieldsToBeRemovedBeforeParsing: [String!]! + $AllowOverridingExistingParser: Boolean! +) { + createParserV2(input: { + name: $Name + script: $Script + testCases: $TestCases + repositoryName: $RepositoryName + fieldsToTag: $FieldsToTag + fieldsToBeRemovedBeforeParsing: $FieldsToBeRemovedBeforeParsing + allowOverwritingExistingParser: $AllowOverridingExistingParser + }) { + ...ParserDetails + } +} + +query LegacyGetParser( + $RepositoryName: String! + $ParserName: String! +) { + repository( + name: $RepositoryName + ) { + parser( + name: $ParserName + ) { + id + name + sourceCode + testData + tagFields + } + } +} + +query GetParserByID( + $RepositoryName: String! + $ParserID: String! +) { + repository( + name: $RepositoryName + ) { + parser( + id: $ParserID + ) { + ...ParserDetails + } + } +} + +query GetParserYAMLByName( + $RepositoryName: String! + $ParserName: String! +) { + repository( + name: $RepositoryName + ) { + parser( + name: $ParserName + ) { + name + yamlTemplate + } + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/repositories.graphql b/internal/api/humiographql/graphql/repositories.graphql new file mode 100644 index 00000000..66e2734b --- /dev/null +++ b/internal/api/humiographql/graphql/repositories.graphql @@ -0,0 +1,118 @@ +fragment RepositoryDetails on Repository { + id + name + description + timeBasedRetention + ingestSizeBasedRetention + storageSizeBasedRetention + compressedByteSize + automaticSearch + s3ArchivingConfiguration { + bucket + region + disabled + format + } +} + +query GetRepository( + $RepositoryName: String! +) { + repository( + name: $RepositoryName + ) { + ...RepositoryDetails + } +} + +query ListRepositories +{ + repositories { + id + name + compressedByteSize + } +} + +mutation CreateRepository( + $RepositoryName: String! +) { + createRepository( + name: $RepositoryName + ) { + repository { + ...RepositoryDetails + } + } +} + +mutation UpdateTimeBasedRetention( + $RepositoryName: String! + $RetentionInDays: Float +) { + updateRetention( + repositoryName: $RepositoryName + timeBasedRetention: $RetentionInDays + ) { + __typename + } +} + +mutation UpdateStorageBasedRetention( + $RepositoryName: String! + $StorageInGB: Float +) { + updateRetention( + repositoryName: $RepositoryName + storageSizeBasedRetention: $StorageInGB + ) { + __typename + } +} + +mutation UpdateIngestBasedRetention( + $RepositoryName: String! + $IngestInGB: Float +) { + updateRetention( + repositoryName: $RepositoryName + ingestSizeBasedRetention: $IngestInGB + ) { + __typename + } +} + +mutation EnableS3Archiving( + $RepositoryName: String! +) { + s3EnableArchiving( + repositoryName: $RepositoryName + ) { + __typename + } +} + +mutation DisableS3Archiving( + $RepositoryName: String! +) { + s3DisableArchiving( + repositoryName: $RepositoryName + ) { + __typename + } +} + +mutation UpdateS3ArchivingConfiguration( + $RepositoryName: String! + $BucketName: String! + $BucketRegion: String! + $Format: S3ArchivingFormat! +) { + s3ConfigureArchiving(repositoryName: $RepositoryName + bucket: $BucketName + region: $BucketRegion + format: $Format + ) { + __typename + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/roles.graphql b/internal/api/humiographql/graphql/roles.graphql new file mode 100644 index 00000000..8289f784 --- /dev/null +++ b/internal/api/humiographql/graphql/roles.graphql @@ -0,0 +1,69 @@ +fragment RoleDetails on Role{ + id + displayName + viewPermissions + organizationPermissions + systemPermissions +} + +query ListRoles { + roles { + ...RoleDetails + } +} + +mutation CreateRole( + $RoleName: String! + $ViewPermissions: [Permission!]! + $OrganizationPermissions: [OrganizationPermission!] + $SystemPermissions: [SystemPermission!] +) { + createRole(input: { + displayName: $RoleName + viewPermissions: $ViewPermissions + organizationPermissions: $OrganizationPermissions + systemPermissions: $SystemPermissions + }) { + role { + ...RoleDetails + } + } +} + +mutation UpdateRole( + $RoleID: String! + $RoleName: String! + $ViewPermissions: [Permission!]! + $OrganizationPermissions: [OrganizationPermission!] + $SystemPermissions: [SystemPermission!] +) { + updateRole(input: { + roleId: $RoleID + displayName: $RoleName + viewPermissions: $ViewPermissions + organizationPermissions: $OrganizationPermissions + systemPermissions: $SystemPermissions + }) { + role { + ...RoleDetails + } + } +} + +mutation RemoveRoleByID( + $RoleID: String! +) { + removeRole(roleId: $RoleID) { + __typename + } +} + +query GetRoleByID( + $RoleID: String! +) { + role( + roleId: $RoleID + ) { + ...RoleDetails + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/scheduled-search.graphql b/internal/api/humiographql/graphql/scheduled-search.graphql new file mode 100644 index 00000000..2be8b888 --- /dev/null +++ b/internal/api/humiographql/graphql/scheduled-search.graphql @@ -0,0 +1,132 @@ +fragment ScheduledSearchDetails on ScheduledSearch { + id + name + description + queryString + start + end + timeZone + schedule + backfillLimit + enabled + actionsV2 { + name + } + labels + + # @genqlient(typename: "SharedQueryOwnershipType") + queryOwnership { + ...QueryOwnership + } +} + +query ListScheduledSearches( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + scheduledSearches { + ...ScheduledSearchDetails + } + } +} + +mutation UpdateScheduledSearch( + $SearchDomainName: String! + $ID: String! + $Name: String! + $Description: String + $QueryString: String! + $QueryStart: String! + $QueryEnd: String! + $Schedule: String! + $TimeZone: String! + $BackfillLimit: Int! + $Enabled: Boolean! + $ActionIdsOrNames: [String!]! + $RunAsUserID: String! + $Labels: [String!]! + $QueryOwnershipType: QueryOwnershipType +) { + updateScheduledSearch(input: { + viewName: $SearchDomainName + id: $ID + name: $Name + description: $Description + queryString: $QueryString + queryStart: $QueryStart + queryEnd: $QueryEnd + schedule: $Schedule + timeZone: $TimeZone + backfillLimit: $BackfillLimit + enabled: $Enabled + actions: $ActionIdsOrNames + runAsUserId: $RunAsUserID + labels: $Labels + queryOwnershipType: $QueryOwnershipType + }) { + ...ScheduledSearchDetails + } +} + +mutation CreateScheduledSearch( + $SearchDomainName: String! + $Name: String! + $Description: String + $QueryString: String! + $QueryStart: String! + $QueryEnd: String! + $Schedule: String! + $TimeZone: String! + $BackfillLimit: Int! + $Enabled: Boolean! + $ActionIdsOrNames: [String!]! + $RunAsUserID: String + $Labels: [String!]! + $QueryOwnershipType: QueryOwnershipType +) { + createScheduledSearch(input: { + viewName: $SearchDomainName + name: $Name + description: $Description + queryString: $QueryString + queryStart: $QueryStart + queryEnd: $QueryEnd + schedule: $Schedule + timeZone: $TimeZone + backfillLimit: $BackfillLimit + enabled: $Enabled + actions: $ActionIdsOrNames + runAsUserId: $RunAsUserID + labels: $Labels + queryOwnershipType: $QueryOwnershipType + }) { + ...ScheduledSearchDetails + } +} + +mutation DeleteScheduledSearchByID( + $SearchDomainName: String! + $ScheduledSearchID: String! +) { + deleteScheduledSearch(input: { + viewName: $SearchDomainName + id: $ScheduledSearchID + }) +} + +query GetScheduledSearchByID( + $SearchDomainName: String! + $ScheduledSearchID: String! +) { + searchDomain( + name: $SearchDomainName + ) { + scheduledSearch( + id: $ScheduledSearchID + ) { + ...ScheduledSearchDetails + } + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/searchdomains.graphql b/internal/api/humiographql/graphql/searchdomains.graphql new file mode 100644 index 00000000..6a6802e7 --- /dev/null +++ b/internal/api/humiographql/graphql/searchdomains.graphql @@ -0,0 +1,66 @@ +mutation DeleteSearchDomain( + $SearchDomainName: String! + $DeleteMessage: String! +) { + deleteSearchDomain( + name: $SearchDomainName + deleteMessage: $DeleteMessage + ) { + __typename + } +} + +mutation UpdateDescriptionForSearchDomain( + $SearchDomainName: String! + $NewDescription: String! +) { + updateDescriptionForSearchDomain( + name: $SearchDomainName + newDescription: $NewDescription + ) { + __typename + } +} + + +mutation SetAutomaticSearching( + $SearchDomainName: String! + $AutomaticSearch: Boolean! +) { + setAutomaticSearching( + name: $SearchDomainName + automaticSearch: $AutomaticSearch + ) { + __typename + } +} + +query GetSearchDomain( + $SearchDomainName: String! +) { + searchDomain( + name: $SearchDomainName + ) { + id + name + description + automaticSearch + ... on View { + connections { + repository { + name + } + filter + } + } + __typename + } +} + +query ListSearchDomains +{ + searchDomains { + name + automaticSearch + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/token.graphql b/internal/api/humiographql/graphql/token.graphql new file mode 100644 index 00000000..feedcae1 --- /dev/null +++ b/internal/api/humiographql/graphql/token.graphql @@ -0,0 +1,5 @@ +mutation RotateTokenByID( + $TokenID: String! +) { + rotateToken(input:{id:$TokenID}) +} diff --git a/internal/api/humiographql/graphql/users.graphql b/internal/api/humiographql/graphql/users.graphql new file mode 100644 index 00000000..48aeecf1 --- /dev/null +++ b/internal/api/humiographql/graphql/users.graphql @@ -0,0 +1,83 @@ +fragment UserDetails on User { + id + username + fullName + email + company + countryCode + picture + isRoot + createdAt +} + +query GetUsersByUsername( + $Username: String! +) { + users(search: $Username) { + ...UserDetails + } +} + +query ListUsers { + users { + ...UserDetails + } +} + +mutation AddUser( + $Username: String! + $Company: String + $IsRoot: Boolean + $FullName: String + $Picture: String + $Email: String + $CountryCode: String +) { + addUserV2(input: { + username: $Username + company: $Company + isRoot: $IsRoot + fullName: $FullName + picture: $Picture + email: $Email + countryCode: $CountryCode + }) { + ... on User { + ...UserDetails + } + } +} + +mutation UpdateUser( + $Username: String! + $Company: String + $IsRoot: Boolean + $FullName: String + $Picture: String + $Email: String + $CountryCode: String +) { + updateUser(input: { + username: $Username + company: $Company + isRoot: $IsRoot + fullName: $FullName + picture: $Picture + email: $Email + countryCode: $CountryCode + }) { + __typename + } +} + +mutation RemoveUser( + $Username: String! +) { + removeUser(input: { + username: $Username + }) { + user { + ...UserDetails + } + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/viewer.graphql b/internal/api/humiographql/graphql/viewer.graphql new file mode 100644 index 00000000..9ccd7118 --- /dev/null +++ b/internal/api/humiographql/graphql/viewer.graphql @@ -0,0 +1,5 @@ +query GetUsername { + viewer { + username + } +} \ No newline at end of file diff --git a/internal/api/humiographql/graphql/views.graphql b/internal/api/humiographql/graphql/views.graphql new file mode 100644 index 00000000..550e14e0 --- /dev/null +++ b/internal/api/humiographql/graphql/views.graphql @@ -0,0 +1,25 @@ +mutation CreateView( + $ViewName: String! + $Description: String + $Connections: [ViewConnectionInput!] +) { + createView( + name: $ViewName + description: $Description + connections: $Connections + ) { + __typename + } +} + +mutation UpdateViewConnections( + $ViewName: String! + $Connections: [ViewConnectionInput!]! +) { + updateView( + viewName: $ViewName + connections: $Connections + ) { + name + } +} \ No newline at end of file diff --git a/internal/api/humiographql/humiographql.go b/internal/api/humiographql/humiographql.go new file mode 100644 index 00000000..a5127702 --- /dev/null +++ b/internal/api/humiographql/humiographql.go @@ -0,0 +1,21987 @@ +// Code generated by github.com/Khan/genqlient, DO NOT EDIT. + +package humiographql + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/Khan/genqlient/graphql" +) + +// ActionDetails includes the GraphQL fields of Action requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +// +// ActionDetails is implemented by the following types: +// ActionDetailsEmailAction +// ActionDetailsHumioRepoAction +// ActionDetailsOpsGenieAction +// ActionDetailsPagerDutyAction +// ActionDetailsSlackAction +// ActionDetailsSlackPostMessageAction +// ActionDetailsUploadFileAction +// ActionDetailsVictorOpsAction +// ActionDetailsWebhookAction +type ActionDetails interface { + implementsGraphQLInterfaceActionDetails() + // GetId returns the interface-field "id" from its implementation. + // The GraphQL interface field's documentation follows. + // + // An action that can be invoked from a trigger. + GetId() string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // An action that can be invoked from a trigger. + GetName() string +} + +func (v *ActionDetailsEmailAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsHumioRepoAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsOpsGenieAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsPagerDutyAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsSlackAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsSlackPostMessageAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsUploadFileAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsVictorOpsAction) implementsGraphQLInterfaceActionDetails() {} +func (v *ActionDetailsWebhookAction) implementsGraphQLInterfaceActionDetails() {} + +func __unmarshalActionDetails(b []byte, v *ActionDetails) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(ActionDetailsEmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(ActionDetailsHumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(ActionDetailsOpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(ActionDetailsPagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(ActionDetailsSlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(ActionDetailsSlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(ActionDetailsUploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(ActionDetailsVictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(ActionDetailsWebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ActionDetails: "%v"`, tn.TypeName) + } +} + +func __marshalActionDetails(v *ActionDetails) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ActionDetailsEmailAction: + typename = "EmailAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsEmailAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsHumioRepoAction: + typename = "HumioRepoAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsHumioRepoAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsOpsGenieAction: + typename = "OpsGenieAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsOpsGenieAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsPagerDutyAction: + typename = "PagerDutyAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsPagerDutyAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsSlackAction: + typename = "SlackAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsSlackAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsSlackPostMessageAction: + typename = "SlackPostMessageAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsSlackPostMessageAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsUploadFileAction: + typename = "UploadFileAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsUploadFileAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsVictorOpsAction: + typename = "VictorOpsAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsVictorOpsAction + }{typename, v} + return json.Marshal(result) + case *ActionDetailsWebhookAction: + typename = "WebhookAction" + + result := struct { + TypeName string `json:"__typename"` + *ActionDetailsWebhookAction + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ActionDetails: "%T"`, v) + } +} + +// ActionDetails includes the GraphQL fields of EmailAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsEmailAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // List of email addresses to send an email to. + Recipients []string `json:"recipients"` + // Subject of the email. Can be templated with values from the result. + SubjectTemplate *string `json:"subjectTemplate"` + // Body of the email. Can be templated with values from the result. + EmailBodyTemplate *string `json:"emailBodyTemplate"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsEmailAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsEmailAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetName() string { return v.Name } + +// GetRecipients returns ActionDetailsEmailAction.Recipients, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetRecipients() []string { return v.Recipients } + +// GetSubjectTemplate returns ActionDetailsEmailAction.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetSubjectTemplate() *string { return v.SubjectTemplate } + +// GetEmailBodyTemplate returns ActionDetailsEmailAction.EmailBodyTemplate, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetEmailBodyTemplate() *string { return v.EmailBodyTemplate } + +// GetUseProxy returns ActionDetailsEmailAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsEmailAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetailsFieldsSlackFieldEntry includes the requested fields of the GraphQL type SlackFieldEntry. +// The GraphQL type's documentation follows. +// +// Field entry in a Slack message +type ActionDetailsFieldsSlackFieldEntry struct { + // Key of a Slack field. + FieldName string `json:"fieldName"` + // Value of a Slack field. + Value string `json:"value"` +} + +// GetFieldName returns ActionDetailsFieldsSlackFieldEntry.FieldName, and is useful for accessing the field via an interface. +func (v *ActionDetailsFieldsSlackFieldEntry) GetFieldName() string { return v.FieldName } + +// GetValue returns ActionDetailsFieldsSlackFieldEntry.Value, and is useful for accessing the field via an interface. +func (v *ActionDetailsFieldsSlackFieldEntry) GetValue() string { return v.Value } + +// ActionDetailsHeadersHttpHeaderEntry includes the requested fields of the GraphQL type HttpHeaderEntry. +// The GraphQL type's documentation follows. +// +// A http request header. +type ActionDetailsHeadersHttpHeaderEntry struct { + // Key of a http(s) header. + Header string `json:"header"` + // Value of a http(s) header. + Value string `json:"value"` +} + +// GetHeader returns ActionDetailsHeadersHttpHeaderEntry.Header, and is useful for accessing the field via an interface. +func (v *ActionDetailsHeadersHttpHeaderEntry) GetHeader() string { return v.Header } + +// GetValue returns ActionDetailsHeadersHttpHeaderEntry.Value, and is useful for accessing the field via an interface. +func (v *ActionDetailsHeadersHttpHeaderEntry) GetValue() string { return v.Value } + +// ActionDetails includes the GraphQL fields of HumioRepoAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsHumioRepoAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Humio ingest token for the dataspace that the action should ingest into. + IngestToken string `json:"ingestToken"` +} + +// GetId returns ActionDetailsHumioRepoAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsHumioRepoAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsHumioRepoAction) GetName() string { return v.Name } + +// GetIngestToken returns ActionDetailsHumioRepoAction.IngestToken, and is useful for accessing the field via an interface. +func (v *ActionDetailsHumioRepoAction) GetIngestToken() string { return v.IngestToken } + +// ActionDetails includes the GraphQL fields of OpsGenieAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsOpsGenieAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // OpsGenie webhook url to send the request to. + ApiUrl string `json:"apiUrl"` + // Key to authenticate with OpsGenie. + GenieKey string `json:"genieKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsOpsGenieAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsOpsGenieAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsOpsGenieAction) GetName() string { return v.Name } + +// GetApiUrl returns ActionDetailsOpsGenieAction.ApiUrl, and is useful for accessing the field via an interface. +func (v *ActionDetailsOpsGenieAction) GetApiUrl() string { return v.ApiUrl } + +// GetGenieKey returns ActionDetailsOpsGenieAction.GenieKey, and is useful for accessing the field via an interface. +func (v *ActionDetailsOpsGenieAction) GetGenieKey() string { return v.GenieKey } + +// GetUseProxy returns ActionDetailsOpsGenieAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsOpsGenieAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetails includes the GraphQL fields of PagerDutyAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsPagerDutyAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Severity level to give to the message. + Severity string `json:"severity"` + // Routing key to authenticate with PagerDuty. + RoutingKey string `json:"routingKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsPagerDutyAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsPagerDutyAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsPagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsPagerDutyAction) GetName() string { return v.Name } + +// GetSeverity returns ActionDetailsPagerDutyAction.Severity, and is useful for accessing the field via an interface. +func (v *ActionDetailsPagerDutyAction) GetSeverity() string { return v.Severity } + +// GetRoutingKey returns ActionDetailsPagerDutyAction.RoutingKey, and is useful for accessing the field via an interface. +func (v *ActionDetailsPagerDutyAction) GetRoutingKey() string { return v.RoutingKey } + +// GetUseProxy returns ActionDetailsPagerDutyAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsPagerDutyAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetails includes the GraphQL fields of SlackAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsSlackAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Slack webhook url to send the request to. + Url string `json:"url"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsSlackAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsSlackAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackAction) GetName() string { return v.Name } + +// GetUrl returns ActionDetailsSlackAction.Url, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackAction) GetUrl() string { return v.Url } + +// GetFields returns ActionDetailsSlackAction.Fields, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { return v.Fields } + +// GetUseProxy returns ActionDetailsSlackAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetails includes the GraphQL fields of SlackPostMessageAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsSlackPostMessageAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Api token to authenticate with Slack. + ApiToken string `json:"apiToken"` + // List of Slack channels to message. + Channels []string `json:"channels"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsSlackPostMessageAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetName() string { return v.Name } + +// GetApiToken returns ActionDetailsSlackPostMessageAction.ApiToken, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetApiToken() string { return v.ApiToken } + +// GetChannels returns ActionDetailsSlackPostMessageAction.Channels, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetChannels() []string { return v.Channels } + +// GetFields returns ActionDetailsSlackPostMessageAction.Fields, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { + return v.Fields +} + +// GetUseProxy returns ActionDetailsSlackPostMessageAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsSlackPostMessageAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetails includes the GraphQL fields of UploadFileAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsUploadFileAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // File name for the uploaded file. + FileName string `json:"fileName"` +} + +// GetId returns ActionDetailsUploadFileAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsUploadFileAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsUploadFileAction) GetName() string { return v.Name } + +// GetFileName returns ActionDetailsUploadFileAction.FileName, and is useful for accessing the field via an interface. +func (v *ActionDetailsUploadFileAction) GetFileName() string { return v.FileName } + +// ActionDetails includes the GraphQL fields of VictorOpsAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsVictorOpsAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Type of the VictorOps message to make. + MessageType string `json:"messageType"` + // VictorOps webhook url to send the request to. + NotifyUrl string `json:"notifyUrl"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsVictorOpsAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsVictorOpsAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsVictorOpsAction) GetName() string { return v.Name } + +// GetMessageType returns ActionDetailsVictorOpsAction.MessageType, and is useful for accessing the field via an interface. +func (v *ActionDetailsVictorOpsAction) GetMessageType() string { return v.MessageType } + +// GetNotifyUrl returns ActionDetailsVictorOpsAction.NotifyUrl, and is useful for accessing the field via an interface. +func (v *ActionDetailsVictorOpsAction) GetNotifyUrl() string { return v.NotifyUrl } + +// GetUseProxy returns ActionDetailsVictorOpsAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsVictorOpsAction) GetUseProxy() bool { return v.UseProxy } + +// ActionDetails includes the GraphQL fields of WebhookAction requested by the fragment ActionDetails. +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ActionDetailsWebhookAction struct { + // An action that can be invoked from a trigger. + Id string `json:"id"` + // An action that can be invoked from a trigger. + Name string `json:"name"` + // Method to use for the request. + Method string `json:"method"` + // Url to send the http(s) request to. + Url string `json:"url"` + // Headers of the http(s) request. + Headers []ActionDetailsHeadersHttpHeaderEntry `json:"headers"` + // Body of the http(s) request. Can be templated with values from the result. + WebhookBodyTemplate string `json:"WebhookBodyTemplate"` + // Flag indicating whether SSL should be ignored for the request. + IgnoreSSL bool `json:"ignoreSSL"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns ActionDetailsWebhookAction.Id, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetId() string { return v.Id } + +// GetName returns ActionDetailsWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetName() string { return v.Name } + +// GetMethod returns ActionDetailsWebhookAction.Method, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetMethod() string { return v.Method } + +// GetUrl returns ActionDetailsWebhookAction.Url, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetUrl() string { return v.Url } + +// GetHeaders returns ActionDetailsWebhookAction.Headers, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetHeaders() []ActionDetailsHeadersHttpHeaderEntry { + return v.Headers +} + +// GetWebhookBodyTemplate returns ActionDetailsWebhookAction.WebhookBodyTemplate, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetWebhookBodyTemplate() string { return v.WebhookBodyTemplate } + +// GetIgnoreSSL returns ActionDetailsWebhookAction.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetIgnoreSSL() bool { return v.IgnoreSSL } + +// GetUseProxy returns ActionDetailsWebhookAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ActionDetailsWebhookAction) GetUseProxy() bool { return v.UseProxy } + +// AddIngestTokenAddIngestTokenV3IngestToken includes the requested fields of the GraphQL type IngestToken. +// The GraphQL type's documentation follows. +// +// An API ingest token used for sending data to LogScale. +type AddIngestTokenAddIngestTokenV3IngestToken struct { + IngestTokenDetails `json:"-"` +} + +// GetName returns AddIngestTokenAddIngestTokenV3IngestToken.Name, and is useful for accessing the field via an interface. +func (v *AddIngestTokenAddIngestTokenV3IngestToken) GetName() string { + return v.IngestTokenDetails.Name +} + +// GetToken returns AddIngestTokenAddIngestTokenV3IngestToken.Token, and is useful for accessing the field via an interface. +func (v *AddIngestTokenAddIngestTokenV3IngestToken) GetToken() string { + return v.IngestTokenDetails.Token +} + +// GetParser returns AddIngestTokenAddIngestTokenV3IngestToken.Parser, and is useful for accessing the field via an interface. +func (v *AddIngestTokenAddIngestTokenV3IngestToken) GetParser() *IngestTokenDetailsParser { + return v.IngestTokenDetails.Parser +} + +func (v *AddIngestTokenAddIngestTokenV3IngestToken) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AddIngestTokenAddIngestTokenV3IngestToken + graphql.NoUnmarshalJSON + } + firstPass.AddIngestTokenAddIngestTokenV3IngestToken = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.IngestTokenDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalAddIngestTokenAddIngestTokenV3IngestToken struct { + Name string `json:"name"` + + Token string `json:"token"` + + Parser *IngestTokenDetailsParser `json:"parser"` +} + +func (v *AddIngestTokenAddIngestTokenV3IngestToken) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *AddIngestTokenAddIngestTokenV3IngestToken) __premarshalJSON() (*__premarshalAddIngestTokenAddIngestTokenV3IngestToken, error) { + var retval __premarshalAddIngestTokenAddIngestTokenV3IngestToken + + retval.Name = v.IngestTokenDetails.Name + retval.Token = v.IngestTokenDetails.Token + retval.Parser = v.IngestTokenDetails.Parser + return &retval, nil +} + +// AddIngestTokenResponse is returned by AddIngestToken on success. +type AddIngestTokenResponse struct { + // Create a new Ingest API Token. + AddIngestTokenV3 AddIngestTokenAddIngestTokenV3IngestToken `json:"addIngestTokenV3"` +} + +// GetAddIngestTokenV3 returns AddIngestTokenResponse.AddIngestTokenV3, and is useful for accessing the field via an interface. +func (v *AddIngestTokenResponse) GetAddIngestTokenV3() AddIngestTokenAddIngestTokenV3IngestToken { + return v.AddIngestTokenV3 +} + +// AddUserAddUserV2PendingUser includes the requested fields of the GraphQL type PendingUser. +// The GraphQL type's documentation follows. +// +// A pending user. I.e. a user that was invited to join an organization. +type AddUserAddUserV2PendingUser struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns AddUserAddUserV2PendingUser.Typename, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2PendingUser) GetTypename() *string { return v.Typename } + +// AddUserAddUserV2User includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user profile. +type AddUserAddUserV2User struct { + Typename *string `json:"__typename"` + UserDetails `json:"-"` +} + +// GetTypename returns AddUserAddUserV2User.Typename, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetTypename() *string { return v.Typename } + +// GetId returns AddUserAddUserV2User.Id, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetId() string { return v.UserDetails.Id } + +// GetUsername returns AddUserAddUserV2User.Username, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetUsername() string { return v.UserDetails.Username } + +// GetFullName returns AddUserAddUserV2User.FullName, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetFullName() *string { return v.UserDetails.FullName } + +// GetEmail returns AddUserAddUserV2User.Email, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetEmail() *string { return v.UserDetails.Email } + +// GetCompany returns AddUserAddUserV2User.Company, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetCompany() *string { return v.UserDetails.Company } + +// GetCountryCode returns AddUserAddUserV2User.CountryCode, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetCountryCode() *string { return v.UserDetails.CountryCode } + +// GetPicture returns AddUserAddUserV2User.Picture, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetPicture() *string { return v.UserDetails.Picture } + +// GetIsRoot returns AddUserAddUserV2User.IsRoot, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetIsRoot() bool { return v.UserDetails.IsRoot } + +// GetCreatedAt returns AddUserAddUserV2User.CreatedAt, and is useful for accessing the field via an interface. +func (v *AddUserAddUserV2User) GetCreatedAt() time.Time { return v.UserDetails.CreatedAt } + +func (v *AddUserAddUserV2User) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AddUserAddUserV2User + graphql.NoUnmarshalJSON + } + firstPass.AddUserAddUserV2User = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalAddUserAddUserV2User struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Username string `json:"username"` + + FullName *string `json:"fullName"` + + Email *string `json:"email"` + + Company *string `json:"company"` + + CountryCode *string `json:"countryCode"` + + Picture *string `json:"picture"` + + IsRoot bool `json:"isRoot"` + + CreatedAt time.Time `json:"createdAt"` +} + +func (v *AddUserAddUserV2User) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *AddUserAddUserV2User) __premarshalJSON() (*__premarshalAddUserAddUserV2User, error) { + var retval __premarshalAddUserAddUserV2User + + retval.Typename = v.Typename + retval.Id = v.UserDetails.Id + retval.Username = v.UserDetails.Username + retval.FullName = v.UserDetails.FullName + retval.Email = v.UserDetails.Email + retval.Company = v.UserDetails.Company + retval.CountryCode = v.UserDetails.CountryCode + retval.Picture = v.UserDetails.Picture + retval.IsRoot = v.UserDetails.IsRoot + retval.CreatedAt = v.UserDetails.CreatedAt + return &retval, nil +} + +// AddUserAddUserV2UserOrPendingUser includes the requested fields of the GraphQL interface userOrPendingUser. +// +// AddUserAddUserV2UserOrPendingUser is implemented by the following types: +// AddUserAddUserV2PendingUser +// AddUserAddUserV2User +// The GraphQL type's documentation follows. +// +// A user or pending user, depending on whether an invitation was sent +type AddUserAddUserV2UserOrPendingUser interface { + implementsGraphQLInterfaceAddUserAddUserV2UserOrPendingUser() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string +} + +func (v *AddUserAddUserV2PendingUser) implementsGraphQLInterfaceAddUserAddUserV2UserOrPendingUser() {} +func (v *AddUserAddUserV2User) implementsGraphQLInterfaceAddUserAddUserV2UserOrPendingUser() {} + +func __unmarshalAddUserAddUserV2UserOrPendingUser(b []byte, v *AddUserAddUserV2UserOrPendingUser) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "PendingUser": + *v = new(AddUserAddUserV2PendingUser) + return json.Unmarshal(b, *v) + case "User": + *v = new(AddUserAddUserV2User) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing userOrPendingUser.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AddUserAddUserV2UserOrPendingUser: "%v"`, tn.TypeName) + } +} + +func __marshalAddUserAddUserV2UserOrPendingUser(v *AddUserAddUserV2UserOrPendingUser) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *AddUserAddUserV2PendingUser: + typename = "PendingUser" + + result := struct { + TypeName string `json:"__typename"` + *AddUserAddUserV2PendingUser + }{typename, v} + return json.Marshal(result) + case *AddUserAddUserV2User: + typename = "User" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAddUserAddUserV2User + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AddUserAddUserV2UserOrPendingUser: "%T"`, v) + } +} + +// AddUserResponse is returned by AddUser on success. +type AddUserResponse struct { + // Add or invite a user. Calling this with an invitation token, will activate the account. By activating the account the client accepts LogScale's Terms and Conditions: https://www.humio.com/terms-and-conditions + AddUserV2 AddUserAddUserV2UserOrPendingUser `json:"-"` +} + +// GetAddUserV2 returns AddUserResponse.AddUserV2, and is useful for accessing the field via an interface. +func (v *AddUserResponse) GetAddUserV2() AddUserAddUserV2UserOrPendingUser { return v.AddUserV2 } + +func (v *AddUserResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AddUserResponse + AddUserV2 json.RawMessage `json:"addUserV2"` + graphql.NoUnmarshalJSON + } + firstPass.AddUserResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.AddUserV2 + src := firstPass.AddUserV2 + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAddUserAddUserV2UserOrPendingUser( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AddUserResponse.AddUserV2: %w", err) + } + } + } + return nil +} + +type __premarshalAddUserResponse struct { + AddUserV2 json.RawMessage `json:"addUserV2"` +} + +func (v *AddUserResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *AddUserResponse) __premarshalJSON() (*__premarshalAddUserResponse, error) { + var retval __premarshalAddUserResponse + + { + + dst := &retval.AddUserV2 + src := v.AddUserV2 + var err error + *dst, err = __marshalAddUserAddUserV2UserOrPendingUser( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AddUserResponse.AddUserV2: %w", err) + } + } + return &retval, nil +} + +// AddUserToGroupAddUsersToGroupAddUsersToGroupMutation includes the requested fields of the GraphQL type AddUsersToGroupMutation. +type AddUserToGroupAddUsersToGroupAddUsersToGroupMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns AddUserToGroupAddUsersToGroupAddUsersToGroupMutation.Typename, and is useful for accessing the field via an interface. +func (v *AddUserToGroupAddUsersToGroupAddUsersToGroupMutation) GetTypename() *string { + return v.Typename +} + +// AddUserToGroupResponse is returned by AddUserToGroup on success. +type AddUserToGroupResponse struct { + // Adds users to an existing group. + AddUsersToGroup AddUserToGroupAddUsersToGroupAddUsersToGroupMutation `json:"addUsersToGroup"` +} + +// GetAddUsersToGroup returns AddUserToGroupResponse.AddUsersToGroup, and is useful for accessing the field via an interface. +func (v *AddUserToGroupResponse) GetAddUsersToGroup() AddUserToGroupAddUsersToGroupAddUsersToGroupMutation { + return v.AddUsersToGroup +} + +// AggregateAlertDetails includes the GraphQL fields of AggregateAlert requested by the fragment AggregateAlertDetails. +// The GraphQL type's documentation follows. +// +// An aggregate alert. +type AggregateAlertDetails struct { + // Id of the aggregate alert. + Id string `json:"id"` + // Name of the aggregate alert. + Name string `json:"name"` + // Description of the aggregate alert. + Description *string `json:"description"` + // LogScale query to execute. + QueryString string `json:"queryString"` + // Search interval in seconds. + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + // Throttle time in seconds. + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + // A field to throttle on. Can only be set if throttleTimeSeconds is set. + ThrottleField *string `json:"throttleField"` + // List of actions to fire on query result. + Actions []AggregateAlertDetailsActionsAction `json:"-"` + // Labels attached to the aggregate alert. + Labels []string `json:"labels"` + // Flag indicating whether the aggregate alert is enabled. + Enabled bool `json:"enabled"` + // Trigger mode used for triggering the alert. + TriggerMode TriggerMode `json:"triggerMode"` + // Timestamp type to use for a query. + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + // Ownership of the query run by this alert + QueryOwnership SharedQueryOwnershipType `json:"-"` +} + +// GetId returns AggregateAlertDetails.Id, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetId() string { return v.Id } + +// GetName returns AggregateAlertDetails.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetName() string { return v.Name } + +// GetDescription returns AggregateAlertDetails.Description, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetDescription() *string { return v.Description } + +// GetQueryString returns AggregateAlertDetails.QueryString, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetQueryString() string { return v.QueryString } + +// GetSearchIntervalSeconds returns AggregateAlertDetails.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetSearchIntervalSeconds() int64 { return v.SearchIntervalSeconds } + +// GetThrottleTimeSeconds returns AggregateAlertDetails.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetThrottleTimeSeconds() int64 { return v.ThrottleTimeSeconds } + +// GetThrottleField returns AggregateAlertDetails.ThrottleField, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetThrottleField() *string { return v.ThrottleField } + +// GetActions returns AggregateAlertDetails.Actions, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetActions() []AggregateAlertDetailsActionsAction { return v.Actions } + +// GetLabels returns AggregateAlertDetails.Labels, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetLabels() []string { return v.Labels } + +// GetEnabled returns AggregateAlertDetails.Enabled, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetEnabled() bool { return v.Enabled } + +// GetTriggerMode returns AggregateAlertDetails.TriggerMode, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetTriggerMode() TriggerMode { return v.TriggerMode } + +// GetQueryTimestampType returns AggregateAlertDetails.QueryTimestampType, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetQueryTimestampType() QueryTimestampType { + return v.QueryTimestampType +} + +// GetQueryOwnership returns AggregateAlertDetails.QueryOwnership, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetails) GetQueryOwnership() SharedQueryOwnershipType { return v.QueryOwnership } + +func (v *AggregateAlertDetails) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AggregateAlertDetails + Actions []json.RawMessage `json:"actions"` + QueryOwnership json.RawMessage `json:"queryOwnership"` + graphql.NoUnmarshalJSON + } + firstPass.AggregateAlertDetails = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Actions + src := firstPass.Actions + *dst = make( + []AggregateAlertDetailsActionsAction, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAggregateAlertDetailsActionsAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AggregateAlertDetails.Actions: %w", err) + } + } + } + } + + { + dst := &v.QueryOwnership + src := firstPass.QueryOwnership + if len(src) != 0 && string(src) != "null" { + err = __unmarshalSharedQueryOwnershipType( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AggregateAlertDetails.QueryOwnership: %w", err) + } + } + } + return nil +} + +type __premarshalAggregateAlertDetails struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + TriggerMode TriggerMode `json:"triggerMode"` + + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *AggregateAlertDetails) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *AggregateAlertDetails) __premarshalJSON() (*__premarshalAggregateAlertDetails, error) { + var retval __premarshalAggregateAlertDetails + + retval.Id = v.Id + retval.Name = v.Name + retval.Description = v.Description + retval.QueryString = v.QueryString + retval.SearchIntervalSeconds = v.SearchIntervalSeconds + retval.ThrottleTimeSeconds = v.ThrottleTimeSeconds + retval.ThrottleField = v.ThrottleField + { + + dst := &retval.Actions + src := v.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalAggregateAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AggregateAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.Labels + retval.Enabled = v.Enabled + retval.TriggerMode = v.TriggerMode + retval.QueryTimestampType = v.QueryTimestampType + { + + dst := &retval.QueryOwnership + src := v.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AggregateAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// AggregateAlertDetailsActionsAction includes the requested fields of the GraphQL interface Action. +// +// AggregateAlertDetailsActionsAction is implemented by the following types: +// AggregateAlertDetailsActionsEmailAction +// AggregateAlertDetailsActionsHumioRepoAction +// AggregateAlertDetailsActionsOpsGenieAction +// AggregateAlertDetailsActionsPagerDutyAction +// AggregateAlertDetailsActionsSlackAction +// AggregateAlertDetailsActionsSlackPostMessageAction +// AggregateAlertDetailsActionsUploadFileAction +// AggregateAlertDetailsActionsVictorOpsAction +// AggregateAlertDetailsActionsWebhookAction +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type AggregateAlertDetailsActionsAction interface { + implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // An action that can be invoked from a trigger. + GetName() string +} + +func (v *AggregateAlertDetailsActionsEmailAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsHumioRepoAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsOpsGenieAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsPagerDutyAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsSlackAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsSlackPostMessageAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsUploadFileAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsVictorOpsAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} +func (v *AggregateAlertDetailsActionsWebhookAction) implementsGraphQLInterfaceAggregateAlertDetailsActionsAction() { +} + +func __unmarshalAggregateAlertDetailsActionsAction(b []byte, v *AggregateAlertDetailsActionsAction) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(AggregateAlertDetailsActionsEmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(AggregateAlertDetailsActionsHumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(AggregateAlertDetailsActionsOpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(AggregateAlertDetailsActionsPagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(AggregateAlertDetailsActionsSlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(AggregateAlertDetailsActionsSlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(AggregateAlertDetailsActionsUploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(AggregateAlertDetailsActionsVictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(AggregateAlertDetailsActionsWebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AggregateAlertDetailsActionsAction: "%v"`, tn.TypeName) + } +} + +func __marshalAggregateAlertDetailsActionsAction(v *AggregateAlertDetailsActionsAction) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *AggregateAlertDetailsActionsEmailAction: + typename = "EmailAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsEmailAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsHumioRepoAction: + typename = "HumioRepoAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsHumioRepoAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsOpsGenieAction: + typename = "OpsGenieAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsOpsGenieAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsPagerDutyAction: + typename = "PagerDutyAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsPagerDutyAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsSlackAction: + typename = "SlackAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsSlackAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsSlackPostMessageAction: + typename = "SlackPostMessageAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsSlackPostMessageAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsUploadFileAction: + typename = "UploadFileAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsUploadFileAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsVictorOpsAction: + typename = "VictorOpsAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsVictorOpsAction + }{typename, v} + return json.Marshal(result) + case *AggregateAlertDetailsActionsWebhookAction: + typename = "WebhookAction" + + result := struct { + TypeName string `json:"__typename"` + *AggregateAlertDetailsActionsWebhookAction + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AggregateAlertDetailsActionsAction: "%T"`, v) + } +} + +// AggregateAlertDetailsActionsEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type AggregateAlertDetailsActionsEmailAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsEmailAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsEmailAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsEmailAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsEmailAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type AggregateAlertDetailsActionsHumioRepoAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsHumioRepoAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsHumioRepoAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsHumioRepoAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type AggregateAlertDetailsActionsOpsGenieAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsOpsGenieAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsOpsGenieAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsOpsGenieAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsPagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type AggregateAlertDetailsActionsPagerDutyAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsPagerDutyAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsPagerDutyAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsPagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsPagerDutyAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type AggregateAlertDetailsActionsSlackAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsSlackAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsSlackAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsSlackAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsSlackAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type AggregateAlertDetailsActionsSlackPostMessageAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsSlackPostMessageAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsSlackPostMessageAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsSlackPostMessageAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type AggregateAlertDetailsActionsUploadFileAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsUploadFileAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsUploadFileAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsUploadFileAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type AggregateAlertDetailsActionsVictorOpsAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsVictorOpsAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsVictorOpsAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsVictorOpsAction) GetName() string { return v.Name } + +// AggregateAlertDetailsActionsWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type AggregateAlertDetailsActionsWebhookAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns AggregateAlertDetailsActionsWebhookAction.Typename, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsWebhookAction) GetTypename() *string { return v.Typename } + +// GetName returns AggregateAlertDetailsActionsWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *AggregateAlertDetailsActionsWebhookAction) GetName() string { return v.Name } + +// AlertDetails includes the GraphQL fields of Alert requested by the fragment AlertDetails. +// The GraphQL type's documentation follows. +// +// An alert. +type AlertDetails struct { + // Id of the alert. + Id string `json:"id"` + // Name of the alert. + Name string `json:"name"` + // LogScale query to execute. + QueryString string `json:"queryString"` + // Start of the relative time interval for the query. + QueryStart string `json:"queryStart"` + // Field to throttle on. + ThrottleField *string `json:"throttleField"` + // Unix timestamp for when the alert was last triggered. + TimeOfLastTrigger *int64 `json:"timeOfLastTrigger"` + // Flag indicating whether the calling user has 'starred' the alert. + IsStarred bool `json:"isStarred"` + // Name of the alert. + Description *string `json:"description"` + // Throttle time in milliseconds. + ThrottleTimeMillis int64 `json:"throttleTimeMillis"` + // Flag indicating whether the alert is enabled. + Enabled bool `json:"enabled"` + // List of ids for actions to fire on query result. + Actions []string `json:"actions"` + // Labels attached to the alert. + Labels []string `json:"labels"` + // Last error encountered while running the alert. + LastError *string `json:"lastError"` + // Ownership of the query run by this alert + QueryOwnership SharedQueryOwnershipType `json:"-"` +} + +// GetId returns AlertDetails.Id, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetId() string { return v.Id } + +// GetName returns AlertDetails.Name, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetName() string { return v.Name } + +// GetQueryString returns AlertDetails.QueryString, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetQueryString() string { return v.QueryString } + +// GetQueryStart returns AlertDetails.QueryStart, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetQueryStart() string { return v.QueryStart } + +// GetThrottleField returns AlertDetails.ThrottleField, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetThrottleField() *string { return v.ThrottleField } + +// GetTimeOfLastTrigger returns AlertDetails.TimeOfLastTrigger, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetTimeOfLastTrigger() *int64 { return v.TimeOfLastTrigger } + +// GetIsStarred returns AlertDetails.IsStarred, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetIsStarred() bool { return v.IsStarred } + +// GetDescription returns AlertDetails.Description, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetDescription() *string { return v.Description } + +// GetThrottleTimeMillis returns AlertDetails.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetThrottleTimeMillis() int64 { return v.ThrottleTimeMillis } + +// GetEnabled returns AlertDetails.Enabled, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetEnabled() bool { return v.Enabled } + +// GetActions returns AlertDetails.Actions, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetActions() []string { return v.Actions } + +// GetLabels returns AlertDetails.Labels, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetLabels() []string { return v.Labels } + +// GetLastError returns AlertDetails.LastError, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetLastError() *string { return v.LastError } + +// GetQueryOwnership returns AlertDetails.QueryOwnership, and is useful for accessing the field via an interface. +func (v *AlertDetails) GetQueryOwnership() SharedQueryOwnershipType { return v.QueryOwnership } + +func (v *AlertDetails) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AlertDetails + QueryOwnership json.RawMessage `json:"queryOwnership"` + graphql.NoUnmarshalJSON + } + firstPass.AlertDetails = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.QueryOwnership + src := firstPass.QueryOwnership + if len(src) != 0 && string(src) != "null" { + err = __unmarshalSharedQueryOwnershipType( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AlertDetails.QueryOwnership: %w", err) + } + } + } + return nil +} + +type __premarshalAlertDetails struct { + Id string `json:"id"` + + Name string `json:"name"` + + QueryString string `json:"queryString"` + + QueryStart string `json:"queryStart"` + + ThrottleField *string `json:"throttleField"` + + TimeOfLastTrigger *int64 `json:"timeOfLastTrigger"` + + IsStarred bool `json:"isStarred"` + + Description *string `json:"description"` + + ThrottleTimeMillis int64 `json:"throttleTimeMillis"` + + Enabled bool `json:"enabled"` + + Actions []string `json:"actions"` + + Labels []string `json:"labels"` + + LastError *string `json:"lastError"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *AlertDetails) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *AlertDetails) __premarshalJSON() (*__premarshalAlertDetails, error) { + var retval __premarshalAlertDetails + + retval.Id = v.Id + retval.Name = v.Name + retval.QueryString = v.QueryString + retval.QueryStart = v.QueryStart + retval.ThrottleField = v.ThrottleField + retval.TimeOfLastTrigger = v.TimeOfLastTrigger + retval.IsStarred = v.IsStarred + retval.Description = v.Description + retval.ThrottleTimeMillis = v.ThrottleTimeMillis + retval.Enabled = v.Enabled + retval.Actions = v.Actions + retval.Labels = v.Labels + retval.LastError = v.LastError + { + + dst := &retval.QueryOwnership + src := v.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken includes the requested fields of the GraphQL type IngestToken. +// The GraphQL type's documentation follows. +// +// An API ingest token used for sending data to LogScale. +type AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken.Typename, and is useful for accessing the field via an interface. +func (v *AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken) GetTypename() *string { + return v.Typename +} + +// AssignParserToIngestTokenResponse is returned by AssignParserToIngestToken on success. +type AssignParserToIngestTokenResponse struct { + // Assign an ingest token to be associated with a parser. + AssignParserToIngestTokenV2 AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken `json:"assignParserToIngestTokenV2"` +} + +// GetAssignParserToIngestTokenV2 returns AssignParserToIngestTokenResponse.AssignParserToIngestTokenV2, and is useful for accessing the field via an interface. +func (v *AssignParserToIngestTokenResponse) GetAssignParserToIngestTokenV2() AssignParserToIngestTokenAssignParserToIngestTokenV2IngestToken { + return v.AssignParserToIngestTokenV2 +} + +// ClusterNode includes the GraphQL fields of Cluster requested by the fragment ClusterNode. +// The GraphQL type's documentation follows. +// +// Information about the LogScale cluster. +type ClusterNode struct { + Nodes []ClusterNodeNodesClusterNode `json:"nodes"` +} + +// GetNodes returns ClusterNode.Nodes, and is useful for accessing the field via an interface. +func (v *ClusterNode) GetNodes() []ClusterNodeNodesClusterNode { return v.Nodes } + +// ClusterNodeNodesClusterNode includes the requested fields of the GraphQL type ClusterNode. +// The GraphQL type's documentation follows. +// +// A node in the a LogScale Cluster. +type ClusterNodeNodesClusterNode struct { + Id int `json:"id"` + Name string `json:"name"` + Uri string `json:"uri"` + Uuid string `json:"uuid"` + ClusterInfoAgeSeconds float64 `json:"clusterInfoAgeSeconds"` + // The size in GB of data this node needs to receive. + InboundSegmentSize float64 `json:"inboundSegmentSize"` + // The size in GB of data this node has that others need. + OutboundSegmentSize float64 `json:"outboundSegmentSize"` + CanBeSafelyUnregistered bool `json:"canBeSafelyUnregistered"` + // The size in GB of data currently on this node. + CurrentSize float64 `json:"currentSize"` + // The size in GB of the data currently on this node that are in the primary storage location. + PrimarySize float64 `json:"primarySize"` + // The size in GB of the data currently on this node that are in the secondary storage location. Zero if no secondary is configured. + SecondarySize float64 `json:"secondarySize"` + // The total size in GB of the primary storage location on this node. + TotalSizeOfPrimary float64 `json:"totalSizeOfPrimary"` + // The total size in GB of the secondary storage location on this node. Zero if no secondary is configured. + TotalSizeOfSecondary float64 `json:"totalSizeOfSecondary"` + // The size in GB of the free space on this node of the primary storage location. + FreeOnPrimary float64 `json:"freeOnPrimary"` + // The size in GB of the free space on this node of the secondary storage location. Zero if no secondary is configured. + FreeOnSecondary float64 `json:"freeOnSecondary"` + // The size in GB of work-in-progress data files. + WipSize float64 `json:"wipSize"` + // The size in GB of data once the node has received the data allocated to it. + TargetSize float64 `json:"targetSize"` + // The size in GB of data that only exists on this node - i.e. only one replica exists in the cluster. + SolitarySegmentSize float64 `json:"solitarySegmentSize"` + // A flag indicating whether the node is considered up or down by the cluster coordinated. This is based on the `lastHeartbeat` field. + IsAvailable bool `json:"isAvailable"` + // The last time a heartbeat was received from the node. + LastHeartbeat time.Time `json:"lastHeartbeat"` + Zone *string `json:"zone"` +} + +// GetId returns ClusterNodeNodesClusterNode.Id, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetId() int { return v.Id } + +// GetName returns ClusterNodeNodesClusterNode.Name, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetName() string { return v.Name } + +// GetUri returns ClusterNodeNodesClusterNode.Uri, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetUri() string { return v.Uri } + +// GetUuid returns ClusterNodeNodesClusterNode.Uuid, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetUuid() string { return v.Uuid } + +// GetClusterInfoAgeSeconds returns ClusterNodeNodesClusterNode.ClusterInfoAgeSeconds, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetClusterInfoAgeSeconds() float64 { + return v.ClusterInfoAgeSeconds +} + +// GetInboundSegmentSize returns ClusterNodeNodesClusterNode.InboundSegmentSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetInboundSegmentSize() float64 { return v.InboundSegmentSize } + +// GetOutboundSegmentSize returns ClusterNodeNodesClusterNode.OutboundSegmentSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetOutboundSegmentSize() float64 { return v.OutboundSegmentSize } + +// GetCanBeSafelyUnregistered returns ClusterNodeNodesClusterNode.CanBeSafelyUnregistered, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetCanBeSafelyUnregistered() bool { + return v.CanBeSafelyUnregistered +} + +// GetCurrentSize returns ClusterNodeNodesClusterNode.CurrentSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetCurrentSize() float64 { return v.CurrentSize } + +// GetPrimarySize returns ClusterNodeNodesClusterNode.PrimarySize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetPrimarySize() float64 { return v.PrimarySize } + +// GetSecondarySize returns ClusterNodeNodesClusterNode.SecondarySize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetSecondarySize() float64 { return v.SecondarySize } + +// GetTotalSizeOfPrimary returns ClusterNodeNodesClusterNode.TotalSizeOfPrimary, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetTotalSizeOfPrimary() float64 { return v.TotalSizeOfPrimary } + +// GetTotalSizeOfSecondary returns ClusterNodeNodesClusterNode.TotalSizeOfSecondary, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetTotalSizeOfSecondary() float64 { + return v.TotalSizeOfSecondary +} + +// GetFreeOnPrimary returns ClusterNodeNodesClusterNode.FreeOnPrimary, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetFreeOnPrimary() float64 { return v.FreeOnPrimary } + +// GetFreeOnSecondary returns ClusterNodeNodesClusterNode.FreeOnSecondary, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetFreeOnSecondary() float64 { return v.FreeOnSecondary } + +// GetWipSize returns ClusterNodeNodesClusterNode.WipSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetWipSize() float64 { return v.WipSize } + +// GetTargetSize returns ClusterNodeNodesClusterNode.TargetSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetTargetSize() float64 { return v.TargetSize } + +// GetSolitarySegmentSize returns ClusterNodeNodesClusterNode.SolitarySegmentSize, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetSolitarySegmentSize() float64 { return v.SolitarySegmentSize } + +// GetIsAvailable returns ClusterNodeNodesClusterNode.IsAvailable, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetIsAvailable() bool { return v.IsAvailable } + +// GetLastHeartbeat returns ClusterNodeNodesClusterNode.LastHeartbeat, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetLastHeartbeat() time.Time { return v.LastHeartbeat } + +// GetZone returns ClusterNodeNodesClusterNode.Zone, and is useful for accessing the field via an interface. +func (v *ClusterNodeNodesClusterNode) GetZone() *string { return v.Zone } + +// CreateAggregateAlertCreateAggregateAlert includes the requested fields of the GraphQL type AggregateAlert. +// The GraphQL type's documentation follows. +// +// An aggregate alert. +type CreateAggregateAlertCreateAggregateAlert struct { + AggregateAlertDetails `json:"-"` +} + +// GetId returns CreateAggregateAlertCreateAggregateAlert.Id, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetId() string { return v.AggregateAlertDetails.Id } + +// GetName returns CreateAggregateAlertCreateAggregateAlert.Name, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetName() string { + return v.AggregateAlertDetails.Name +} + +// GetDescription returns CreateAggregateAlertCreateAggregateAlert.Description, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetDescription() *string { + return v.AggregateAlertDetails.Description +} + +// GetQueryString returns CreateAggregateAlertCreateAggregateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetQueryString() string { + return v.AggregateAlertDetails.QueryString +} + +// GetSearchIntervalSeconds returns CreateAggregateAlertCreateAggregateAlert.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetSearchIntervalSeconds() int64 { + return v.AggregateAlertDetails.SearchIntervalSeconds +} + +// GetThrottleTimeSeconds returns CreateAggregateAlertCreateAggregateAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetThrottleTimeSeconds() int64 { + return v.AggregateAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns CreateAggregateAlertCreateAggregateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetThrottleField() *string { + return v.AggregateAlertDetails.ThrottleField +} + +// GetActions returns CreateAggregateAlertCreateAggregateAlert.Actions, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetActions() []AggregateAlertDetailsActionsAction { + return v.AggregateAlertDetails.Actions +} + +// GetLabels returns CreateAggregateAlertCreateAggregateAlert.Labels, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetLabels() []string { + return v.AggregateAlertDetails.Labels +} + +// GetEnabled returns CreateAggregateAlertCreateAggregateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetEnabled() bool { + return v.AggregateAlertDetails.Enabled +} + +// GetTriggerMode returns CreateAggregateAlertCreateAggregateAlert.TriggerMode, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetTriggerMode() TriggerMode { + return v.AggregateAlertDetails.TriggerMode +} + +// GetQueryTimestampType returns CreateAggregateAlertCreateAggregateAlert.QueryTimestampType, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetQueryTimestampType() QueryTimestampType { + return v.AggregateAlertDetails.QueryTimestampType +} + +// GetQueryOwnership returns CreateAggregateAlertCreateAggregateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertCreateAggregateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AggregateAlertDetails.QueryOwnership +} + +func (v *CreateAggregateAlertCreateAggregateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateAggregateAlertCreateAggregateAlert + graphql.NoUnmarshalJSON + } + firstPass.CreateAggregateAlertCreateAggregateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AggregateAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateAggregateAlertCreateAggregateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + TriggerMode TriggerMode `json:"triggerMode"` + + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *CreateAggregateAlertCreateAggregateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateAggregateAlertCreateAggregateAlert) __premarshalJSON() (*__premarshalCreateAggregateAlertCreateAggregateAlert, error) { + var retval __premarshalCreateAggregateAlertCreateAggregateAlert + + retval.Id = v.AggregateAlertDetails.Id + retval.Name = v.AggregateAlertDetails.Name + retval.Description = v.AggregateAlertDetails.Description + retval.QueryString = v.AggregateAlertDetails.QueryString + retval.SearchIntervalSeconds = v.AggregateAlertDetails.SearchIntervalSeconds + retval.ThrottleTimeSeconds = v.AggregateAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.AggregateAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.AggregateAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalAggregateAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateAggregateAlertCreateAggregateAlert.AggregateAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.AggregateAlertDetails.Labels + retval.Enabled = v.AggregateAlertDetails.Enabled + retval.TriggerMode = v.AggregateAlertDetails.TriggerMode + retval.QueryTimestampType = v.AggregateAlertDetails.QueryTimestampType + { + + dst := &retval.QueryOwnership + src := v.AggregateAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateAggregateAlertCreateAggregateAlert.AggregateAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// CreateAggregateAlertResponse is returned by CreateAggregateAlert on success. +type CreateAggregateAlertResponse struct { + // Create an aggregate alert. + CreateAggregateAlert CreateAggregateAlertCreateAggregateAlert `json:"createAggregateAlert"` +} + +// GetCreateAggregateAlert returns CreateAggregateAlertResponse.CreateAggregateAlert, and is useful for accessing the field via an interface. +func (v *CreateAggregateAlertResponse) GetCreateAggregateAlert() CreateAggregateAlertCreateAggregateAlert { + return v.CreateAggregateAlert +} + +// CreateAlertCreateAlert includes the requested fields of the GraphQL type Alert. +// The GraphQL type's documentation follows. +// +// An alert. +type CreateAlertCreateAlert struct { + AlertDetails `json:"-"` +} + +// GetId returns CreateAlertCreateAlert.Id, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetId() string { return v.AlertDetails.Id } + +// GetName returns CreateAlertCreateAlert.Name, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetName() string { return v.AlertDetails.Name } + +// GetQueryString returns CreateAlertCreateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetQueryString() string { return v.AlertDetails.QueryString } + +// GetQueryStart returns CreateAlertCreateAlert.QueryStart, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetQueryStart() string { return v.AlertDetails.QueryStart } + +// GetThrottleField returns CreateAlertCreateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetThrottleField() *string { return v.AlertDetails.ThrottleField } + +// GetTimeOfLastTrigger returns CreateAlertCreateAlert.TimeOfLastTrigger, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetTimeOfLastTrigger() *int64 { + return v.AlertDetails.TimeOfLastTrigger +} + +// GetIsStarred returns CreateAlertCreateAlert.IsStarred, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetIsStarred() bool { return v.AlertDetails.IsStarred } + +// GetDescription returns CreateAlertCreateAlert.Description, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetDescription() *string { return v.AlertDetails.Description } + +// GetThrottleTimeMillis returns CreateAlertCreateAlert.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetThrottleTimeMillis() int64 { + return v.AlertDetails.ThrottleTimeMillis +} + +// GetEnabled returns CreateAlertCreateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetEnabled() bool { return v.AlertDetails.Enabled } + +// GetActions returns CreateAlertCreateAlert.Actions, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetActions() []string { return v.AlertDetails.Actions } + +// GetLabels returns CreateAlertCreateAlert.Labels, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetLabels() []string { return v.AlertDetails.Labels } + +// GetLastError returns CreateAlertCreateAlert.LastError, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetLastError() *string { return v.AlertDetails.LastError } + +// GetQueryOwnership returns CreateAlertCreateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *CreateAlertCreateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AlertDetails.QueryOwnership +} + +func (v *CreateAlertCreateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateAlertCreateAlert + graphql.NoUnmarshalJSON + } + firstPass.CreateAlertCreateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateAlertCreateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + QueryString string `json:"queryString"` + + QueryStart string `json:"queryStart"` + + ThrottleField *string `json:"throttleField"` + + TimeOfLastTrigger *int64 `json:"timeOfLastTrigger"` + + IsStarred bool `json:"isStarred"` + + Description *string `json:"description"` + + ThrottleTimeMillis int64 `json:"throttleTimeMillis"` + + Enabled bool `json:"enabled"` + + Actions []string `json:"actions"` + + Labels []string `json:"labels"` + + LastError *string `json:"lastError"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *CreateAlertCreateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateAlertCreateAlert) __premarshalJSON() (*__premarshalCreateAlertCreateAlert, error) { + var retval __premarshalCreateAlertCreateAlert + + retval.Id = v.AlertDetails.Id + retval.Name = v.AlertDetails.Name + retval.QueryString = v.AlertDetails.QueryString + retval.QueryStart = v.AlertDetails.QueryStart + retval.ThrottleField = v.AlertDetails.ThrottleField + retval.TimeOfLastTrigger = v.AlertDetails.TimeOfLastTrigger + retval.IsStarred = v.AlertDetails.IsStarred + retval.Description = v.AlertDetails.Description + retval.ThrottleTimeMillis = v.AlertDetails.ThrottleTimeMillis + retval.Enabled = v.AlertDetails.Enabled + retval.Actions = v.AlertDetails.Actions + retval.Labels = v.AlertDetails.Labels + retval.LastError = v.AlertDetails.LastError + { + + dst := &retval.QueryOwnership + src := v.AlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateAlertCreateAlert.AlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// CreateAlertResponse is returned by CreateAlert on success. +type CreateAlertResponse struct { + // Create an alert. + CreateAlert CreateAlertCreateAlert `json:"createAlert"` +} + +// GetCreateAlert returns CreateAlertResponse.CreateAlert, and is useful for accessing the field via an interface. +func (v *CreateAlertResponse) GetCreateAlert() CreateAlertCreateAlert { return v.CreateAlert } + +// CreateEmailActionCreateEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type CreateEmailActionCreateEmailAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // List of email addresses to send an email to. + Recipients []string `json:"recipients"` + // Subject of the email. Can be templated with values from the result. + SubjectTemplate *string `json:"subjectTemplate"` + // Body of the email. Can be templated with values from the result. + BodyTemplate *string `json:"bodyTemplate"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateEmailActionCreateEmailAction.Id, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetId() string { return v.Id } + +// GetName returns CreateEmailActionCreateEmailAction.Name, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetName() string { return v.Name } + +// GetRecipients returns CreateEmailActionCreateEmailAction.Recipients, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetRecipients() []string { return v.Recipients } + +// GetSubjectTemplate returns CreateEmailActionCreateEmailAction.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetSubjectTemplate() *string { return v.SubjectTemplate } + +// GetBodyTemplate returns CreateEmailActionCreateEmailAction.BodyTemplate, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetBodyTemplate() *string { return v.BodyTemplate } + +// GetUseProxy returns CreateEmailActionCreateEmailAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateEmailActionCreateEmailAction) GetUseProxy() bool { return v.UseProxy } + +// CreateEmailActionResponse is returned by CreateEmailAction on success. +type CreateEmailActionResponse struct { + // Create an email action. + CreateEmailAction CreateEmailActionCreateEmailAction `json:"createEmailAction"` +} + +// GetCreateEmailAction returns CreateEmailActionResponse.CreateEmailAction, and is useful for accessing the field via an interface. +func (v *CreateEmailActionResponse) GetCreateEmailAction() CreateEmailActionCreateEmailAction { + return v.CreateEmailAction +} + +// CreateFilterAlertCreateFilterAlert includes the requested fields of the GraphQL type FilterAlert. +// The GraphQL type's documentation follows. +// +// A filter alert. +type CreateFilterAlertCreateFilterAlert struct { + FilterAlertDetails `json:"-"` +} + +// GetId returns CreateFilterAlertCreateFilterAlert.Id, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetId() string { return v.FilterAlertDetails.Id } + +// GetName returns CreateFilterAlertCreateFilterAlert.Name, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetName() string { return v.FilterAlertDetails.Name } + +// GetDescription returns CreateFilterAlertCreateFilterAlert.Description, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetDescription() *string { + return v.FilterAlertDetails.Description +} + +// GetQueryString returns CreateFilterAlertCreateFilterAlert.QueryString, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetQueryString() string { + return v.FilterAlertDetails.QueryString +} + +// GetThrottleTimeSeconds returns CreateFilterAlertCreateFilterAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetThrottleTimeSeconds() *int64 { + return v.FilterAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns CreateFilterAlertCreateFilterAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetThrottleField() *string { + return v.FilterAlertDetails.ThrottleField +} + +// GetActions returns CreateFilterAlertCreateFilterAlert.Actions, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetActions() []FilterAlertDetailsActionsAction { + return v.FilterAlertDetails.Actions +} + +// GetLabels returns CreateFilterAlertCreateFilterAlert.Labels, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetLabels() []string { return v.FilterAlertDetails.Labels } + +// GetEnabled returns CreateFilterAlertCreateFilterAlert.Enabled, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetEnabled() bool { return v.FilterAlertDetails.Enabled } + +// GetQueryOwnership returns CreateFilterAlertCreateFilterAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertCreateFilterAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.FilterAlertDetails.QueryOwnership +} + +func (v *CreateFilterAlertCreateFilterAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateFilterAlertCreateFilterAlert + graphql.NoUnmarshalJSON + } + firstPass.CreateFilterAlertCreateFilterAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FilterAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateFilterAlertCreateFilterAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *CreateFilterAlertCreateFilterAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateFilterAlertCreateFilterAlert) __premarshalJSON() (*__premarshalCreateFilterAlertCreateFilterAlert, error) { + var retval __premarshalCreateFilterAlertCreateFilterAlert + + retval.Id = v.FilterAlertDetails.Id + retval.Name = v.FilterAlertDetails.Name + retval.Description = v.FilterAlertDetails.Description + retval.QueryString = v.FilterAlertDetails.QueryString + retval.ThrottleTimeSeconds = v.FilterAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.FilterAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.FilterAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFilterAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateFilterAlertCreateFilterAlert.FilterAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.FilterAlertDetails.Labels + retval.Enabled = v.FilterAlertDetails.Enabled + { + + dst := &retval.QueryOwnership + src := v.FilterAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateFilterAlertCreateFilterAlert.FilterAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// CreateFilterAlertResponse is returned by CreateFilterAlert on success. +type CreateFilterAlertResponse struct { + // Create a filter alert. + CreateFilterAlert CreateFilterAlertCreateFilterAlert `json:"createFilterAlert"` +} + +// GetCreateFilterAlert returns CreateFilterAlertResponse.CreateFilterAlert, and is useful for accessing the field via an interface. +func (v *CreateFilterAlertResponse) GetCreateFilterAlert() CreateFilterAlertCreateFilterAlert { + return v.CreateFilterAlert +} + +// CreateHumioRepoActionCreateHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type CreateHumioRepoActionCreateHumioRepoAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Humio ingest token for the dataspace that the action should ingest into. + IngestToken string `json:"ingestToken"` +} + +// GetId returns CreateHumioRepoActionCreateHumioRepoAction.Id, and is useful for accessing the field via an interface. +func (v *CreateHumioRepoActionCreateHumioRepoAction) GetId() string { return v.Id } + +// GetName returns CreateHumioRepoActionCreateHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *CreateHumioRepoActionCreateHumioRepoAction) GetName() string { return v.Name } + +// GetIngestToken returns CreateHumioRepoActionCreateHumioRepoAction.IngestToken, and is useful for accessing the field via an interface. +func (v *CreateHumioRepoActionCreateHumioRepoAction) GetIngestToken() string { return v.IngestToken } + +// CreateHumioRepoActionResponse is returned by CreateHumioRepoAction on success. +type CreateHumioRepoActionResponse struct { + // Create a LogScale repository action. + CreateHumioRepoAction CreateHumioRepoActionCreateHumioRepoAction `json:"createHumioRepoAction"` +} + +// GetCreateHumioRepoAction returns CreateHumioRepoActionResponse.CreateHumioRepoAction, and is useful for accessing the field via an interface. +func (v *CreateHumioRepoActionResponse) GetCreateHumioRepoAction() CreateHumioRepoActionCreateHumioRepoAction { + return v.CreateHumioRepoAction +} + +// CreateOpsGenieActionCreateOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type CreateOpsGenieActionCreateOpsGenieAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // OpsGenie webhook url to send the request to. + ApiUrl string `json:"apiUrl"` + // Key to authenticate with OpsGenie. + GenieKey string `json:"genieKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateOpsGenieActionCreateOpsGenieAction.Id, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionCreateOpsGenieAction) GetId() string { return v.Id } + +// GetName returns CreateOpsGenieActionCreateOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionCreateOpsGenieAction) GetName() string { return v.Name } + +// GetApiUrl returns CreateOpsGenieActionCreateOpsGenieAction.ApiUrl, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionCreateOpsGenieAction) GetApiUrl() string { return v.ApiUrl } + +// GetGenieKey returns CreateOpsGenieActionCreateOpsGenieAction.GenieKey, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionCreateOpsGenieAction) GetGenieKey() string { return v.GenieKey } + +// GetUseProxy returns CreateOpsGenieActionCreateOpsGenieAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionCreateOpsGenieAction) GetUseProxy() bool { return v.UseProxy } + +// CreateOpsGenieActionResponse is returned by CreateOpsGenieAction on success. +type CreateOpsGenieActionResponse struct { + // Create an OpsGenie action. + CreateOpsGenieAction CreateOpsGenieActionCreateOpsGenieAction `json:"createOpsGenieAction"` +} + +// GetCreateOpsGenieAction returns CreateOpsGenieActionResponse.CreateOpsGenieAction, and is useful for accessing the field via an interface. +func (v *CreateOpsGenieActionResponse) GetCreateOpsGenieAction() CreateOpsGenieActionCreateOpsGenieAction { + return v.CreateOpsGenieAction +} + +// CreatePagerDutyActionCreatePagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type CreatePagerDutyActionCreatePagerDutyAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Severity level to give to the message. + Severity string `json:"severity"` + // Routing key to authenticate with PagerDuty. + RoutingKey string `json:"routingKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreatePagerDutyActionCreatePagerDutyAction.Id, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionCreatePagerDutyAction) GetId() string { return v.Id } + +// GetName returns CreatePagerDutyActionCreatePagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionCreatePagerDutyAction) GetName() string { return v.Name } + +// GetSeverity returns CreatePagerDutyActionCreatePagerDutyAction.Severity, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionCreatePagerDutyAction) GetSeverity() string { return v.Severity } + +// GetRoutingKey returns CreatePagerDutyActionCreatePagerDutyAction.RoutingKey, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionCreatePagerDutyAction) GetRoutingKey() string { return v.RoutingKey } + +// GetUseProxy returns CreatePagerDutyActionCreatePagerDutyAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionCreatePagerDutyAction) GetUseProxy() bool { return v.UseProxy } + +// CreatePagerDutyActionResponse is returned by CreatePagerDutyAction on success. +type CreatePagerDutyActionResponse struct { + // Create a PagerDuty action. + CreatePagerDutyAction CreatePagerDutyActionCreatePagerDutyAction `json:"createPagerDutyAction"` +} + +// GetCreatePagerDutyAction returns CreatePagerDutyActionResponse.CreatePagerDutyAction, and is useful for accessing the field via an interface. +func (v *CreatePagerDutyActionResponse) GetCreatePagerDutyAction() CreatePagerDutyActionCreatePagerDutyAction { + return v.CreatePagerDutyAction +} + +// CreateParserCreateParserV2Parser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type CreateParserCreateParserV2Parser struct { + ParserDetails `json:"-"` +} + +// GetId returns CreateParserCreateParserV2Parser.Id, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetId() string { return v.ParserDetails.Id } + +// GetName returns CreateParserCreateParserV2Parser.Name, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetName() string { return v.ParserDetails.Name } + +// GetDisplayName returns CreateParserCreateParserV2Parser.DisplayName, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetDisplayName() string { + return v.ParserDetails.DisplayName +} + +// GetDescription returns CreateParserCreateParserV2Parser.Description, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetDescription() *string { + return v.ParserDetails.Description +} + +// GetIsBuiltIn returns CreateParserCreateParserV2Parser.IsBuiltIn, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetIsBuiltIn() bool { return v.ParserDetails.IsBuiltIn } + +// GetScript returns CreateParserCreateParserV2Parser.Script, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetScript() string { return v.ParserDetails.Script } + +// GetFieldsToTag returns CreateParserCreateParserV2Parser.FieldsToTag, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetFieldsToTag() []string { + return v.ParserDetails.FieldsToTag +} + +// GetFieldsToBeRemovedBeforeParsing returns CreateParserCreateParserV2Parser.FieldsToBeRemovedBeforeParsing, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetFieldsToBeRemovedBeforeParsing() []string { + return v.ParserDetails.FieldsToBeRemovedBeforeParsing +} + +// GetTestCases returns CreateParserCreateParserV2Parser.TestCases, and is useful for accessing the field via an interface. +func (v *CreateParserCreateParserV2Parser) GetTestCases() []ParserDetailsTestCasesParserTestCase { + return v.ParserDetails.TestCases +} + +func (v *CreateParserCreateParserV2Parser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateParserCreateParserV2Parser + graphql.NoUnmarshalJSON + } + firstPass.CreateParserCreateParserV2Parser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ParserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateParserCreateParserV2Parser struct { + Id string `json:"id"` + + Name string `json:"name"` + + DisplayName string `json:"displayName"` + + Description *string `json:"description"` + + IsBuiltIn bool `json:"isBuiltIn"` + + Script string `json:"script"` + + FieldsToTag []string `json:"fieldsToTag"` + + FieldsToBeRemovedBeforeParsing []string `json:"fieldsToBeRemovedBeforeParsing"` + + TestCases []ParserDetailsTestCasesParserTestCase `json:"testCases"` +} + +func (v *CreateParserCreateParserV2Parser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateParserCreateParserV2Parser) __premarshalJSON() (*__premarshalCreateParserCreateParserV2Parser, error) { + var retval __premarshalCreateParserCreateParserV2Parser + + retval.Id = v.ParserDetails.Id + retval.Name = v.ParserDetails.Name + retval.DisplayName = v.ParserDetails.DisplayName + retval.Description = v.ParserDetails.Description + retval.IsBuiltIn = v.ParserDetails.IsBuiltIn + retval.Script = v.ParserDetails.Script + retval.FieldsToTag = v.ParserDetails.FieldsToTag + retval.FieldsToBeRemovedBeforeParsing = v.ParserDetails.FieldsToBeRemovedBeforeParsing + retval.TestCases = v.ParserDetails.TestCases + return &retval, nil +} + +// CreateParserResponse is returned by CreateParser on success. +type CreateParserResponse struct { + // Create a parser. + CreateParserV2 CreateParserCreateParserV2Parser `json:"createParserV2"` +} + +// GetCreateParserV2 returns CreateParserResponse.CreateParserV2, and is useful for accessing the field via an interface. +func (v *CreateParserResponse) GetCreateParserV2() CreateParserCreateParserV2Parser { + return v.CreateParserV2 +} + +// CreateRepositoryCreateRepositoryCreateRepositoryMutation includes the requested fields of the GraphQL type CreateRepositoryMutation. +type CreateRepositoryCreateRepositoryCreateRepositoryMutation struct { + Repository CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository `json:"repository"` +} + +// GetRepository returns CreateRepositoryCreateRepositoryCreateRepositoryMutation.Repository, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutation) GetRepository() CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository { + return v.Repository +} + +// CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository struct { + RepositoryDetails `json:"-"` +} + +// GetId returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.Id, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetId() string { + return v.RepositoryDetails.Id +} + +// GetName returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.Name, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetName() string { + return v.RepositoryDetails.Name +} + +// GetDescription returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.Description, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetDescription() *string { + return v.RepositoryDetails.Description +} + +// GetTimeBasedRetention returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.TimeBasedRetention, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetTimeBasedRetention() *float64 { + return v.RepositoryDetails.TimeBasedRetention +} + +// GetIngestSizeBasedRetention returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.IngestSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetIngestSizeBasedRetention() *float64 { + return v.RepositoryDetails.IngestSizeBasedRetention +} + +// GetStorageSizeBasedRetention returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.StorageSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetStorageSizeBasedRetention() *float64 { + return v.RepositoryDetails.StorageSizeBasedRetention +} + +// GetCompressedByteSize returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.CompressedByteSize, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetCompressedByteSize() int64 { + return v.RepositoryDetails.CompressedByteSize +} + +// GetAutomaticSearch returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetAutomaticSearch() bool { + return v.RepositoryDetails.AutomaticSearch +} + +// GetS3ArchivingConfiguration returns CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository.S3ArchivingConfiguration, and is useful for accessing the field via an interface. +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) GetS3ArchivingConfiguration() *RepositoryDetailsS3ArchivingConfigurationS3Configuration { + return v.RepositoryDetails.S3ArchivingConfiguration +} + +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository + graphql.NoUnmarshalJSON + } + firstPass.CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RepositoryDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateRepositoryCreateRepositoryCreateRepositoryMutationRepository struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + TimeBasedRetention *float64 `json:"timeBasedRetention"` + + IngestSizeBasedRetention *float64 `json:"ingestSizeBasedRetention"` + + StorageSizeBasedRetention *float64 `json:"storageSizeBasedRetention"` + + CompressedByteSize int64 `json:"compressedByteSize"` + + AutomaticSearch bool `json:"automaticSearch"` + + S3ArchivingConfiguration *RepositoryDetailsS3ArchivingConfigurationS3Configuration `json:"s3ArchivingConfiguration"` +} + +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateRepositoryCreateRepositoryCreateRepositoryMutationRepository) __premarshalJSON() (*__premarshalCreateRepositoryCreateRepositoryCreateRepositoryMutationRepository, error) { + var retval __premarshalCreateRepositoryCreateRepositoryCreateRepositoryMutationRepository + + retval.Id = v.RepositoryDetails.Id + retval.Name = v.RepositoryDetails.Name + retval.Description = v.RepositoryDetails.Description + retval.TimeBasedRetention = v.RepositoryDetails.TimeBasedRetention + retval.IngestSizeBasedRetention = v.RepositoryDetails.IngestSizeBasedRetention + retval.StorageSizeBasedRetention = v.RepositoryDetails.StorageSizeBasedRetention + retval.CompressedByteSize = v.RepositoryDetails.CompressedByteSize + retval.AutomaticSearch = v.RepositoryDetails.AutomaticSearch + retval.S3ArchivingConfiguration = v.RepositoryDetails.S3ArchivingConfiguration + return &retval, nil +} + +// CreateRepositoryResponse is returned by CreateRepository on success. +type CreateRepositoryResponse struct { + // Create a new repository. + CreateRepository CreateRepositoryCreateRepositoryCreateRepositoryMutation `json:"createRepository"` +} + +// GetCreateRepository returns CreateRepositoryResponse.CreateRepository, and is useful for accessing the field via an interface. +func (v *CreateRepositoryResponse) GetCreateRepository() CreateRepositoryCreateRepositoryCreateRepositoryMutation { + return v.CreateRepository +} + +// CreateRoleCreateRoleAddRoleMutation includes the requested fields of the GraphQL type AddRoleMutation. +type CreateRoleCreateRoleAddRoleMutation struct { + Role CreateRoleCreateRoleAddRoleMutationRole `json:"role"` +} + +// GetRole returns CreateRoleCreateRoleAddRoleMutation.Role, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutation) GetRole() CreateRoleCreateRoleAddRoleMutationRole { + return v.Role +} + +// CreateRoleCreateRoleAddRoleMutationRole includes the requested fields of the GraphQL type Role. +type CreateRoleCreateRoleAddRoleMutationRole struct { + RoleDetails `json:"-"` +} + +// GetId returns CreateRoleCreateRoleAddRoleMutationRole.Id, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutationRole) GetId() string { return v.RoleDetails.Id } + +// GetDisplayName returns CreateRoleCreateRoleAddRoleMutationRole.DisplayName, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutationRole) GetDisplayName() string { + return v.RoleDetails.DisplayName +} + +// GetViewPermissions returns CreateRoleCreateRoleAddRoleMutationRole.ViewPermissions, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutationRole) GetViewPermissions() []Permission { + return v.RoleDetails.ViewPermissions +} + +// GetOrganizationPermissions returns CreateRoleCreateRoleAddRoleMutationRole.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutationRole) GetOrganizationPermissions() []OrganizationPermission { + return v.RoleDetails.OrganizationPermissions +} + +// GetSystemPermissions returns CreateRoleCreateRoleAddRoleMutationRole.SystemPermissions, and is useful for accessing the field via an interface. +func (v *CreateRoleCreateRoleAddRoleMutationRole) GetSystemPermissions() []SystemPermission { + return v.RoleDetails.SystemPermissions +} + +func (v *CreateRoleCreateRoleAddRoleMutationRole) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateRoleCreateRoleAddRoleMutationRole + graphql.NoUnmarshalJSON + } + firstPass.CreateRoleCreateRoleAddRoleMutationRole = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RoleDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateRoleCreateRoleAddRoleMutationRole struct { + Id string `json:"id"` + + DisplayName string `json:"displayName"` + + ViewPermissions []Permission `json:"viewPermissions"` + + OrganizationPermissions []OrganizationPermission `json:"organizationPermissions"` + + SystemPermissions []SystemPermission `json:"systemPermissions"` +} + +func (v *CreateRoleCreateRoleAddRoleMutationRole) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateRoleCreateRoleAddRoleMutationRole) __premarshalJSON() (*__premarshalCreateRoleCreateRoleAddRoleMutationRole, error) { + var retval __premarshalCreateRoleCreateRoleAddRoleMutationRole + + retval.Id = v.RoleDetails.Id + retval.DisplayName = v.RoleDetails.DisplayName + retval.ViewPermissions = v.RoleDetails.ViewPermissions + retval.OrganizationPermissions = v.RoleDetails.OrganizationPermissions + retval.SystemPermissions = v.RoleDetails.SystemPermissions + return &retval, nil +} + +// CreateRoleResponse is returned by CreateRole on success. +type CreateRoleResponse struct { + // Adds a role. Only usable if roles are not managed externally, e.g. in LDAP. + CreateRole CreateRoleCreateRoleAddRoleMutation `json:"createRole"` +} + +// GetCreateRole returns CreateRoleResponse.CreateRole, and is useful for accessing the field via an interface. +func (v *CreateRoleResponse) GetCreateRole() CreateRoleCreateRoleAddRoleMutation { return v.CreateRole } + +// CreateScheduledSearchCreateScheduledSearch includes the requested fields of the GraphQL type ScheduledSearch. +// The GraphQL type's documentation follows. +// +// Information about a scheduled search +type CreateScheduledSearchCreateScheduledSearch struct { + ScheduledSearchDetails `json:"-"` +} + +// GetId returns CreateScheduledSearchCreateScheduledSearch.Id, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetId() string { + return v.ScheduledSearchDetails.Id +} + +// GetName returns CreateScheduledSearchCreateScheduledSearch.Name, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetName() string { + return v.ScheduledSearchDetails.Name +} + +// GetDescription returns CreateScheduledSearchCreateScheduledSearch.Description, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetDescription() *string { + return v.ScheduledSearchDetails.Description +} + +// GetQueryString returns CreateScheduledSearchCreateScheduledSearch.QueryString, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetQueryString() string { + return v.ScheduledSearchDetails.QueryString +} + +// GetStart returns CreateScheduledSearchCreateScheduledSearch.Start, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetStart() string { + return v.ScheduledSearchDetails.Start +} + +// GetEnd returns CreateScheduledSearchCreateScheduledSearch.End, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetEnd() string { + return v.ScheduledSearchDetails.End +} + +// GetTimeZone returns CreateScheduledSearchCreateScheduledSearch.TimeZone, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetTimeZone() string { + return v.ScheduledSearchDetails.TimeZone +} + +// GetSchedule returns CreateScheduledSearchCreateScheduledSearch.Schedule, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetSchedule() string { + return v.ScheduledSearchDetails.Schedule +} + +// GetBackfillLimit returns CreateScheduledSearchCreateScheduledSearch.BackfillLimit, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetBackfillLimit() int { + return v.ScheduledSearchDetails.BackfillLimit +} + +// GetEnabled returns CreateScheduledSearchCreateScheduledSearch.Enabled, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetEnabled() bool { + return v.ScheduledSearchDetails.Enabled +} + +// GetActionsV2 returns CreateScheduledSearchCreateScheduledSearch.ActionsV2, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetActionsV2() []ScheduledSearchDetailsActionsV2Action { + return v.ScheduledSearchDetails.ActionsV2 +} + +// GetLabels returns CreateScheduledSearchCreateScheduledSearch.Labels, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetLabels() []string { + return v.ScheduledSearchDetails.Labels +} + +// GetQueryOwnership returns CreateScheduledSearchCreateScheduledSearch.QueryOwnership, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchCreateScheduledSearch) GetQueryOwnership() SharedQueryOwnershipType { + return v.ScheduledSearchDetails.QueryOwnership +} + +func (v *CreateScheduledSearchCreateScheduledSearch) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *CreateScheduledSearchCreateScheduledSearch + graphql.NoUnmarshalJSON + } + firstPass.CreateScheduledSearchCreateScheduledSearch = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ScheduledSearchDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalCreateScheduledSearchCreateScheduledSearch struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + Start string `json:"start"` + + End string `json:"end"` + + TimeZone string `json:"timeZone"` + + Schedule string `json:"schedule"` + + BackfillLimit int `json:"backfillLimit"` + + Enabled bool `json:"enabled"` + + ActionsV2 []json.RawMessage `json:"actionsV2"` + + Labels []string `json:"labels"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *CreateScheduledSearchCreateScheduledSearch) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *CreateScheduledSearchCreateScheduledSearch) __premarshalJSON() (*__premarshalCreateScheduledSearchCreateScheduledSearch, error) { + var retval __premarshalCreateScheduledSearchCreateScheduledSearch + + retval.Id = v.ScheduledSearchDetails.Id + retval.Name = v.ScheduledSearchDetails.Name + retval.Description = v.ScheduledSearchDetails.Description + retval.QueryString = v.ScheduledSearchDetails.QueryString + retval.Start = v.ScheduledSearchDetails.Start + retval.End = v.ScheduledSearchDetails.End + retval.TimeZone = v.ScheduledSearchDetails.TimeZone + retval.Schedule = v.ScheduledSearchDetails.Schedule + retval.BackfillLimit = v.ScheduledSearchDetails.BackfillLimit + retval.Enabled = v.ScheduledSearchDetails.Enabled + { + + dst := &retval.ActionsV2 + src := v.ScheduledSearchDetails.ActionsV2 + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalScheduledSearchDetailsActionsV2Action( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateScheduledSearchCreateScheduledSearch.ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + retval.Labels = v.ScheduledSearchDetails.Labels + { + + dst := &retval.QueryOwnership + src := v.ScheduledSearchDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CreateScheduledSearchCreateScheduledSearch.ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// CreateScheduledSearchResponse is returned by CreateScheduledSearch on success. +type CreateScheduledSearchResponse struct { + // Create a scheduled search. + CreateScheduledSearch CreateScheduledSearchCreateScheduledSearch `json:"createScheduledSearch"` +} + +// GetCreateScheduledSearch returns CreateScheduledSearchResponse.CreateScheduledSearch, and is useful for accessing the field via an interface. +func (v *CreateScheduledSearchResponse) GetCreateScheduledSearch() CreateScheduledSearchCreateScheduledSearch { + return v.CreateScheduledSearch +} + +// CreateSlackActionCreateSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type CreateSlackActionCreateSlackAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []CreateSlackActionCreateSlackActionFieldsSlackFieldEntry `json:"fields"` + // Slack webhook url to send the request to. + Url string `json:"url"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateSlackActionCreateSlackAction.Id, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackAction) GetId() string { return v.Id } + +// GetName returns CreateSlackActionCreateSlackAction.Name, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackAction) GetName() string { return v.Name } + +// GetFields returns CreateSlackActionCreateSlackAction.Fields, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackAction) GetFields() []CreateSlackActionCreateSlackActionFieldsSlackFieldEntry { + return v.Fields +} + +// GetUrl returns CreateSlackActionCreateSlackAction.Url, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackAction) GetUrl() string { return v.Url } + +// GetUseProxy returns CreateSlackActionCreateSlackAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackAction) GetUseProxy() bool { return v.UseProxy } + +// CreateSlackActionCreateSlackActionFieldsSlackFieldEntry includes the requested fields of the GraphQL type SlackFieldEntry. +// The GraphQL type's documentation follows. +// +// Field entry in a Slack message +type CreateSlackActionCreateSlackActionFieldsSlackFieldEntry struct { + // Value of a Slack field. + Value string `json:"value"` + // Key of a Slack field. + FieldName string `json:"fieldName"` +} + +// GetValue returns CreateSlackActionCreateSlackActionFieldsSlackFieldEntry.Value, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackActionFieldsSlackFieldEntry) GetValue() string { return v.Value } + +// GetFieldName returns CreateSlackActionCreateSlackActionFieldsSlackFieldEntry.FieldName, and is useful for accessing the field via an interface. +func (v *CreateSlackActionCreateSlackActionFieldsSlackFieldEntry) GetFieldName() string { + return v.FieldName +} + +// CreateSlackActionResponse is returned by CreateSlackAction on success. +type CreateSlackActionResponse struct { + // Create a Slack action. + CreateSlackAction CreateSlackActionCreateSlackAction `json:"createSlackAction"` +} + +// GetCreateSlackAction returns CreateSlackActionResponse.CreateSlackAction, and is useful for accessing the field via an interface. +func (v *CreateSlackActionResponse) GetCreateSlackAction() CreateSlackActionCreateSlackAction { + return v.CreateSlackAction +} + +// CreateSlackPostMessageActionCreateSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type CreateSlackPostMessageActionCreateSlackPostMessageAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Api token to authenticate with Slack. + ApiToken string `json:"apiToken"` + // List of Slack channels to message. + Channels []string `json:"channels"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry `json:"fields"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateSlackPostMessageActionCreateSlackPostMessageAction.Id, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetId() string { return v.Id } + +// GetName returns CreateSlackPostMessageActionCreateSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetName() string { return v.Name } + +// GetApiToken returns CreateSlackPostMessageActionCreateSlackPostMessageAction.ApiToken, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetApiToken() string { + return v.ApiToken +} + +// GetChannels returns CreateSlackPostMessageActionCreateSlackPostMessageAction.Channels, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetChannels() []string { + return v.Channels +} + +// GetFields returns CreateSlackPostMessageActionCreateSlackPostMessageAction.Fields, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetFields() []CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry { + return v.Fields +} + +// GetUseProxy returns CreateSlackPostMessageActionCreateSlackPostMessageAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageAction) GetUseProxy() bool { + return v.UseProxy +} + +// CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry includes the requested fields of the GraphQL type SlackFieldEntry. +// The GraphQL type's documentation follows. +// +// Field entry in a Slack message +type CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry struct { + // Value of a Slack field. + Value string `json:"value"` + // Key of a Slack field. + FieldName string `json:"fieldName"` +} + +// GetValue returns CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry.Value, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry) GetValue() string { + return v.Value +} + +// GetFieldName returns CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry.FieldName, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionCreateSlackPostMessageActionFieldsSlackFieldEntry) GetFieldName() string { + return v.FieldName +} + +// CreateSlackPostMessageActionResponse is returned by CreateSlackPostMessageAction on success. +type CreateSlackPostMessageActionResponse struct { + // Create a post message Slack action. + CreateSlackPostMessageAction CreateSlackPostMessageActionCreateSlackPostMessageAction `json:"createSlackPostMessageAction"` +} + +// GetCreateSlackPostMessageAction returns CreateSlackPostMessageActionResponse.CreateSlackPostMessageAction, and is useful for accessing the field via an interface. +func (v *CreateSlackPostMessageActionResponse) GetCreateSlackPostMessageAction() CreateSlackPostMessageActionCreateSlackPostMessageAction { + return v.CreateSlackPostMessageAction +} + +// CreateUploadFileActionCreateUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type CreateUploadFileActionCreateUploadFileAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // File name for the uploaded file. + FileName string `json:"fileName"` +} + +// GetId returns CreateUploadFileActionCreateUploadFileAction.Id, and is useful for accessing the field via an interface. +func (v *CreateUploadFileActionCreateUploadFileAction) GetId() string { return v.Id } + +// GetName returns CreateUploadFileActionCreateUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *CreateUploadFileActionCreateUploadFileAction) GetName() string { return v.Name } + +// GetFileName returns CreateUploadFileActionCreateUploadFileAction.FileName, and is useful for accessing the field via an interface. +func (v *CreateUploadFileActionCreateUploadFileAction) GetFileName() string { return v.FileName } + +// CreateUploadFileActionResponse is returned by CreateUploadFileAction on success. +type CreateUploadFileActionResponse struct { + // Create an upload file action. + CreateUploadFileAction CreateUploadFileActionCreateUploadFileAction `json:"createUploadFileAction"` +} + +// GetCreateUploadFileAction returns CreateUploadFileActionResponse.CreateUploadFileAction, and is useful for accessing the field via an interface. +func (v *CreateUploadFileActionResponse) GetCreateUploadFileAction() CreateUploadFileActionCreateUploadFileAction { + return v.CreateUploadFileAction +} + +// CreateVictorOpsActionCreateVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type CreateVictorOpsActionCreateVictorOpsAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Type of the VictorOps message to make. + MessageType string `json:"messageType"` + // VictorOps webhook url to send the request to. + NotifyUrl string `json:"notifyUrl"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateVictorOpsActionCreateVictorOpsAction.Id, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionCreateVictorOpsAction) GetId() string { return v.Id } + +// GetName returns CreateVictorOpsActionCreateVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionCreateVictorOpsAction) GetName() string { return v.Name } + +// GetMessageType returns CreateVictorOpsActionCreateVictorOpsAction.MessageType, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionCreateVictorOpsAction) GetMessageType() string { return v.MessageType } + +// GetNotifyUrl returns CreateVictorOpsActionCreateVictorOpsAction.NotifyUrl, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionCreateVictorOpsAction) GetNotifyUrl() string { return v.NotifyUrl } + +// GetUseProxy returns CreateVictorOpsActionCreateVictorOpsAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionCreateVictorOpsAction) GetUseProxy() bool { return v.UseProxy } + +// CreateVictorOpsActionResponse is returned by CreateVictorOpsAction on success. +type CreateVictorOpsActionResponse struct { + // Create a VictorOps action. + CreateVictorOpsAction CreateVictorOpsActionCreateVictorOpsAction `json:"createVictorOpsAction"` +} + +// GetCreateVictorOpsAction returns CreateVictorOpsActionResponse.CreateVictorOpsAction, and is useful for accessing the field via an interface. +func (v *CreateVictorOpsActionResponse) GetCreateVictorOpsAction() CreateVictorOpsActionCreateVictorOpsAction { + return v.CreateVictorOpsAction +} + +// CreateViewCreateView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type CreateViewCreateView struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns CreateViewCreateView.Typename, and is useful for accessing the field via an interface. +func (v *CreateViewCreateView) GetTypename() *string { return v.Typename } + +// CreateViewResponse is returned by CreateView on success. +type CreateViewResponse struct { + // Create a new view. + CreateView CreateViewCreateView `json:"createView"` +} + +// GetCreateView returns CreateViewResponse.CreateView, and is useful for accessing the field via an interface. +func (v *CreateViewResponse) GetCreateView() CreateViewCreateView { return v.CreateView } + +// CreateWebhookActionCreateWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type CreateWebhookActionCreateWebhookAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Url to send the http(s) request to. + Url string `json:"url"` + // Method to use for the request. + Method string `json:"method"` + // Headers of the http(s) request. + Headers []CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry `json:"headers"` + // Body of the http(s) request. Can be templated with values from the result. + BodyTemplate string `json:"bodyTemplate"` + // Flag indicating whether SSL should be ignored for the request. + IgnoreSSL bool `json:"ignoreSSL"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns CreateWebhookActionCreateWebhookAction.Id, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetId() string { return v.Id } + +// GetName returns CreateWebhookActionCreateWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetName() string { return v.Name } + +// GetUrl returns CreateWebhookActionCreateWebhookAction.Url, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetUrl() string { return v.Url } + +// GetMethod returns CreateWebhookActionCreateWebhookAction.Method, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetMethod() string { return v.Method } + +// GetHeaders returns CreateWebhookActionCreateWebhookAction.Headers, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetHeaders() []CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry { + return v.Headers +} + +// GetBodyTemplate returns CreateWebhookActionCreateWebhookAction.BodyTemplate, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetBodyTemplate() string { return v.BodyTemplate } + +// GetIgnoreSSL returns CreateWebhookActionCreateWebhookAction.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetIgnoreSSL() bool { return v.IgnoreSSL } + +// GetUseProxy returns CreateWebhookActionCreateWebhookAction.UseProxy, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookAction) GetUseProxy() bool { return v.UseProxy } + +// CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry includes the requested fields of the GraphQL type HttpHeaderEntry. +// The GraphQL type's documentation follows. +// +// A http request header. +type CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry struct { + // Value of a http(s) header. + Value string `json:"value"` + // Key of a http(s) header. + Header string `json:"header"` +} + +// GetValue returns CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry.Value, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry) GetValue() string { + return v.Value +} + +// GetHeader returns CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry.Header, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionCreateWebhookActionHeadersHttpHeaderEntry) GetHeader() string { + return v.Header +} + +// CreateWebhookActionResponse is returned by CreateWebhookAction on success. +type CreateWebhookActionResponse struct { + // Create a webhook action. + CreateWebhookAction CreateWebhookActionCreateWebhookAction `json:"createWebhookAction"` +} + +// GetCreateWebhookAction returns CreateWebhookActionResponse.CreateWebhookAction, and is useful for accessing the field via an interface. +func (v *CreateWebhookActionResponse) GetCreateWebhookAction() CreateWebhookActionCreateWebhookAction { + return v.CreateWebhookAction +} + +// DeleteActionByIDResponse is returned by DeleteActionByID on success. +type DeleteActionByIDResponse struct { + // Delete an action. + DeleteAction bool `json:"deleteAction"` +} + +// GetDeleteAction returns DeleteActionByIDResponse.DeleteAction, and is useful for accessing the field via an interface. +func (v *DeleteActionByIDResponse) GetDeleteAction() bool { return v.DeleteAction } + +// DeleteAggregateAlertResponse is returned by DeleteAggregateAlert on success. +type DeleteAggregateAlertResponse struct { + // Delete an aggregate alert. + DeleteAggregateAlert bool `json:"deleteAggregateAlert"` +} + +// GetDeleteAggregateAlert returns DeleteAggregateAlertResponse.DeleteAggregateAlert, and is useful for accessing the field via an interface. +func (v *DeleteAggregateAlertResponse) GetDeleteAggregateAlert() bool { return v.DeleteAggregateAlert } + +// DeleteAlertResponse is returned by DeleteAlert on success. +type DeleteAlertResponse struct { + // Delete an alert. + DeleteAlert bool `json:"deleteAlert"` +} + +// GetDeleteAlert returns DeleteAlertResponse.DeleteAlert, and is useful for accessing the field via an interface. +func (v *DeleteAlertResponse) GetDeleteAlert() bool { return v.DeleteAlert } + +// DeleteFilterAlertResponse is returned by DeleteFilterAlert on success. +type DeleteFilterAlertResponse struct { + // Delete a filter alert. + DeleteFilterAlert bool `json:"deleteFilterAlert"` +} + +// GetDeleteFilterAlert returns DeleteFilterAlertResponse.DeleteFilterAlert, and is useful for accessing the field via an interface. +func (v *DeleteFilterAlertResponse) GetDeleteFilterAlert() bool { return v.DeleteFilterAlert } + +// DeleteParserByIDDeleteParserBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type DeleteParserByIDDeleteParserBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns DeleteParserByIDDeleteParserBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *DeleteParserByIDDeleteParserBooleanResultType) GetTypename() *string { return v.Typename } + +// DeleteParserByIDResponse is returned by DeleteParserByID on success. +type DeleteParserByIDResponse struct { + // Delete a parser. + DeleteParser DeleteParserByIDDeleteParserBooleanResultType `json:"deleteParser"` +} + +// GetDeleteParser returns DeleteParserByIDResponse.DeleteParser, and is useful for accessing the field via an interface. +func (v *DeleteParserByIDResponse) GetDeleteParser() DeleteParserByIDDeleteParserBooleanResultType { + return v.DeleteParser +} + +// DeleteScheduledSearchByIDResponse is returned by DeleteScheduledSearchByID on success. +type DeleteScheduledSearchByIDResponse struct { + // Delete a scheduled search. + DeleteScheduledSearch bool `json:"deleteScheduledSearch"` +} + +// GetDeleteScheduledSearch returns DeleteScheduledSearchByIDResponse.DeleteScheduledSearch, and is useful for accessing the field via an interface. +func (v *DeleteScheduledSearchByIDResponse) GetDeleteScheduledSearch() bool { + return v.DeleteScheduledSearch +} + +// DeleteSearchDomainDeleteSearchDomainBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type DeleteSearchDomainDeleteSearchDomainBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns DeleteSearchDomainDeleteSearchDomainBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *DeleteSearchDomainDeleteSearchDomainBooleanResultType) GetTypename() *string { + return v.Typename +} + +// DeleteSearchDomainResponse is returned by DeleteSearchDomain on success. +type DeleteSearchDomainResponse struct { + // Delete a repository or view. + DeleteSearchDomain DeleteSearchDomainDeleteSearchDomainBooleanResultType `json:"deleteSearchDomain"` +} + +// GetDeleteSearchDomain returns DeleteSearchDomainResponse.DeleteSearchDomain, and is useful for accessing the field via an interface. +func (v *DeleteSearchDomainResponse) GetDeleteSearchDomain() DeleteSearchDomainDeleteSearchDomainBooleanResultType { + return v.DeleteSearchDomain +} + +// DisableFeatureFlagForOrganizationResponse is returned by DisableFeatureFlagForOrganization on success. +type DisableFeatureFlagForOrganizationResponse struct { + // Disable a feature for a specific organization. + DisableFeatureForOrg bool `json:"disableFeatureForOrg"` +} + +// GetDisableFeatureForOrg returns DisableFeatureFlagForOrganizationResponse.DisableFeatureForOrg, and is useful for accessing the field via an interface. +func (v *DisableFeatureFlagForOrganizationResponse) GetDisableFeatureForOrg() bool { + return v.DisableFeatureForOrg +} + +// DisableFeatureFlagForUserResponse is returned by DisableFeatureFlagForUser on success. +type DisableFeatureFlagForUserResponse struct { + // Disable a feature for a specific user. + DisableFeatureForUser bool `json:"disableFeatureForUser"` +} + +// GetDisableFeatureForUser returns DisableFeatureFlagForUserResponse.DisableFeatureForUser, and is useful for accessing the field via an interface. +func (v *DisableFeatureFlagForUserResponse) GetDisableFeatureForUser() bool { + return v.DisableFeatureForUser +} + +// DisableFeatureFlagGloballyResponse is returned by DisableFeatureFlagGlobally on success. +type DisableFeatureFlagGloballyResponse struct { + // Disable a feature. + DisableFeature bool `json:"disableFeature"` +} + +// GetDisableFeature returns DisableFeatureFlagGloballyResponse.DisableFeature, and is useful for accessing the field via an interface. +func (v *DisableFeatureFlagGloballyResponse) GetDisableFeature() bool { return v.DisableFeature } + +// DisableS3ArchivingResponse is returned by DisableS3Archiving on success. +type DisableS3ArchivingResponse struct { + // Disables the archiving job for the repository. + S3DisableArchiving DisableS3ArchivingS3DisableArchivingBooleanResultType `json:"s3DisableArchiving"` +} + +// GetS3DisableArchiving returns DisableS3ArchivingResponse.S3DisableArchiving, and is useful for accessing the field via an interface. +func (v *DisableS3ArchivingResponse) GetS3DisableArchiving() DisableS3ArchivingS3DisableArchivingBooleanResultType { + return v.S3DisableArchiving +} + +// DisableS3ArchivingS3DisableArchivingBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type DisableS3ArchivingS3DisableArchivingBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns DisableS3ArchivingS3DisableArchivingBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *DisableS3ArchivingS3DisableArchivingBooleanResultType) GetTypename() *string { + return v.Typename +} + +// EnableFeatureFlagForOrganizationResponse is returned by EnableFeatureFlagForOrganization on success. +type EnableFeatureFlagForOrganizationResponse struct { + // Enable a feature for a specific organization. + EnableFeatureForOrg bool `json:"enableFeatureForOrg"` +} + +// GetEnableFeatureForOrg returns EnableFeatureFlagForOrganizationResponse.EnableFeatureForOrg, and is useful for accessing the field via an interface. +func (v *EnableFeatureFlagForOrganizationResponse) GetEnableFeatureForOrg() bool { + return v.EnableFeatureForOrg +} + +// EnableFeatureFlagForUserResponse is returned by EnableFeatureFlagForUser on success. +type EnableFeatureFlagForUserResponse struct { + // Enable a feature for a specific user. + EnableFeatureForUser bool `json:"enableFeatureForUser"` +} + +// GetEnableFeatureForUser returns EnableFeatureFlagForUserResponse.EnableFeatureForUser, and is useful for accessing the field via an interface. +func (v *EnableFeatureFlagForUserResponse) GetEnableFeatureForUser() bool { + return v.EnableFeatureForUser +} + +// EnableFeatureFlagGloballyResponse is returned by EnableFeatureFlagGlobally on success. +type EnableFeatureFlagGloballyResponse struct { + // Enable a feature. + EnableFeature bool `json:"enableFeature"` +} + +// GetEnableFeature returns EnableFeatureFlagGloballyResponse.EnableFeature, and is useful for accessing the field via an interface. +func (v *EnableFeatureFlagGloballyResponse) GetEnableFeature() bool { return v.EnableFeature } + +// EnableS3ArchivingResponse is returned by EnableS3Archiving on success. +type EnableS3ArchivingResponse struct { + // Enables the archiving job for the repository. + S3EnableArchiving EnableS3ArchivingS3EnableArchivingBooleanResultType `json:"s3EnableArchiving"` +} + +// GetS3EnableArchiving returns EnableS3ArchivingResponse.S3EnableArchiving, and is useful for accessing the field via an interface. +func (v *EnableS3ArchivingResponse) GetS3EnableArchiving() EnableS3ArchivingS3EnableArchivingBooleanResultType { + return v.S3EnableArchiving +} + +// EnableS3ArchivingS3EnableArchivingBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type EnableS3ArchivingS3EnableArchivingBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns EnableS3ArchivingS3EnableArchivingBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *EnableS3ArchivingS3EnableArchivingBooleanResultType) GetTypename() *string { + return v.Typename +} + +// Represents a feature flag. +type FeatureFlag string + +const ( + // [PREVIEW: This functionality is still under development and can change without warning.] Export data to bucket storage. + FeatureFlagExporttobucket FeatureFlag = "ExportToBucket" + // [PREVIEW: This functionality is still under development and can change without warning.] Enable repeating queries. Can be used instead of live queries for functions having limitations around live queries. + FeatureFlagRepeatingqueries FeatureFlag = "RepeatingQueries" + // [PREVIEW: This functionality is still under development and can change without warning.] Enable custom ingest tokens not generated by LogScale. + FeatureFlagCustomingesttokens FeatureFlag = "CustomIngestTokens" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable permission tokens. + FeatureFlagPermissiontokens FeatureFlag = "PermissionTokens" + // [PREVIEW: This functionality is still under development and can change without warning.] Assign default roles for groups. + FeatureFlagDefaultrolesforgroups FeatureFlag = "DefaultRolesForGroups" + // [PREVIEW: This functionality is still under development and can change without warning.] Use new organization limits. + FeatureFlagNeworganizationlimits FeatureFlag = "NewOrganizationLimits" + // [PREVIEW: This functionality is still under development and can change without warning.] Authenticate cookies server-side. + FeatureFlagCookieauthserverside FeatureFlag = "CookieAuthServerSide" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable ArrayFunctions in query language. + FeatureFlagArrayfunctions FeatureFlag = "ArrayFunctions" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable geography functions in query language. + FeatureFlagGeographyfunctions FeatureFlag = "GeographyFunctions" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Prioritize newer over older segments. + FeatureFlagCachepolicies FeatureFlag = "CachePolicies" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable searching across LogScale clusters. + FeatureFlagMulticlustersearch FeatureFlag = "MultiClusterSearch" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable subdomains for current cluster. + FeatureFlagSubdomainfororganizations FeatureFlag = "SubdomainForOrganizations" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable Humio Managed repositories. The customer is not permitted to change certain configurations in a LogScale Managed repository. + FeatureFlagManagedrepositories FeatureFlag = "ManagedRepositories" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Allow users to configure FDR feeds for managed repositories + FeatureFlagManagedrepositoriesallowfdrconfig FeatureFlag = "ManagedRepositoriesAllowFDRConfig" + // [PREVIEW: This functionality is still under development and can change without warning.] The UsagePage shows data from ingestAfterFieldRemovalSize instead of segmentWriteBytes + FeatureFlagUsagepageusingingestafterfieldremovalsize FeatureFlag = "UsagePageUsingIngestAfterFieldRemovalSize" + // [PREVIEW: This functionality is still under development and can change without warning.] Enable falcon data connector + FeatureFlagFalcondataconnector FeatureFlag = "FalconDataConnector" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Flag for testing, does nothing + FeatureFlagSleepfunction FeatureFlag = "SleepFunction" + // [PREVIEW: This functionality is still under development and can change without warning.] Enable login bridge + FeatureFlagLoginbridge FeatureFlag = "LoginBridge" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables download of macos installer for logcollector through fleet management + FeatureFlagMacosinstallerforlogcollector FeatureFlag = "MacosInstallerForLogCollector" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables UsageJob to log average usage as part of usage log + FeatureFlagLogaverageusage FeatureFlag = "LogAverageUsage" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables ephemeral hosts support for fleet management + FeatureFlagFleetephemeralhosts FeatureFlag = "FleetEphemeralHosts" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables fleet management collector metrics + FeatureFlagFleetcollectormetrics FeatureFlag = "FleetCollectorMetrics" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] No currentHosts writes for segments in buckets + FeatureFlagNocurrentsforbucketsegments FeatureFlag = "NoCurrentsForBucketSegments" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Pre-merge mini-segments + FeatureFlagPremergeminisegments FeatureFlag = "PreMergeMiniSegments" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Use a new segment file format on write - not readable by older versions + FeatureFlagWritenewsegmentfileformat FeatureFlag = "WriteNewSegmentFileFormat" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables fleet management collector debug logging + FeatureFlagFleetcollectordebuglogging FeatureFlag = "FleetCollectorDebugLogging" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables LogScale Collector remote updates + FeatureFlagFleetremoteupdates FeatureFlag = "FleetRemoteUpdates" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables alternate query merge target handling + FeatureFlagAlternatequerymergetargethandling FeatureFlag = "AlternateQueryMergeTargetHandling" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables query optimizations for fleet management + FeatureFlagFleetusestaticqueries FeatureFlag = "FleetUseStaticQueries" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables labels for fleet management + FeatureFlagFleetlabels FeatureFlag = "FleetLabels" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables Field Aliasing + FeatureFlagFieldaliasing FeatureFlag = "FieldAliasing" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] External Functions + FeatureFlagExternalfunctions FeatureFlag = "ExternalFunctions" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable the LogScale Query Assistant + FeatureFlagQueryassistant FeatureFlag = "QueryAssistant" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable Flight Control support in cluster + FeatureFlagFlightcontrol FeatureFlag = "FlightControl" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable organization level security policies. For instance the ability to only enable certain action types. + FeatureFlagOrganizationsecuritypolicies FeatureFlag = "OrganizationSecurityPolicies" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables a limit on query backtracking + FeatureFlagQuerybacktrackinglimit FeatureFlag = "QueryBacktrackingLimit" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Adds a derived #repo.cid tag when searching in views or dataspaces within an organization with an associated CID + FeatureFlagDerivedcidtag FeatureFlag = "DerivedCidTag" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Live tables + FeatureFlagLivetables FeatureFlag = "LiveTables" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables the MITRE Detection Annotation function + FeatureFlagMitredetectionannotation FeatureFlag = "MitreDetectionAnnotation" + // [PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables having multiple role bindings for a single view in the same group. This feature flag does nothing until min version is at least 1.150.0 + FeatureFlagMultipleviewrolebindings FeatureFlag = "MultipleViewRoleBindings" +) + +// Asserts that a given field has an expected value after having been parsed. +type FieldHasValueInput struct { + // Asserts that a given field has an expected value after having been parsed. + FieldName string `json:"fieldName"` + // Asserts that a given field has an expected value after having been parsed. + ExpectedValue string `json:"expectedValue"` +} + +// GetFieldName returns FieldHasValueInput.FieldName, and is useful for accessing the field via an interface. +func (v *FieldHasValueInput) GetFieldName() string { return v.FieldName } + +// GetExpectedValue returns FieldHasValueInput.ExpectedValue, and is useful for accessing the field via an interface. +func (v *FieldHasValueInput) GetExpectedValue() string { return v.ExpectedValue } + +// FilterAlertDetails includes the GraphQL fields of FilterAlert requested by the fragment FilterAlertDetails. +// The GraphQL type's documentation follows. +// +// A filter alert. +type FilterAlertDetails struct { + // Id of the filter alert. + Id string `json:"id"` + // Name of the filter alert. + Name string `json:"name"` + // Description of the filter alert. + Description *string `json:"description"` + // LogScale query to execute. + QueryString string `json:"queryString"` + // Throttle time in seconds. + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + // A field to throttle on. Can only be set if throttleTimeSeconds is set. + ThrottleField *string `json:"throttleField"` + // List of ids for actions to fire on query result. + Actions []FilterAlertDetailsActionsAction `json:"-"` + // Labels attached to the filter alert. + Labels []string `json:"labels"` + // Flag indicating whether the filter alert is enabled. + Enabled bool `json:"enabled"` + // Ownership of the query run by this alert + QueryOwnership SharedQueryOwnershipType `json:"-"` +} + +// GetId returns FilterAlertDetails.Id, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetId() string { return v.Id } + +// GetName returns FilterAlertDetails.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetName() string { return v.Name } + +// GetDescription returns FilterAlertDetails.Description, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetDescription() *string { return v.Description } + +// GetQueryString returns FilterAlertDetails.QueryString, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetQueryString() string { return v.QueryString } + +// GetThrottleTimeSeconds returns FilterAlertDetails.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetThrottleTimeSeconds() *int64 { return v.ThrottleTimeSeconds } + +// GetThrottleField returns FilterAlertDetails.ThrottleField, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetThrottleField() *string { return v.ThrottleField } + +// GetActions returns FilterAlertDetails.Actions, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetActions() []FilterAlertDetailsActionsAction { return v.Actions } + +// GetLabels returns FilterAlertDetails.Labels, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetLabels() []string { return v.Labels } + +// GetEnabled returns FilterAlertDetails.Enabled, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetEnabled() bool { return v.Enabled } + +// GetQueryOwnership returns FilterAlertDetails.QueryOwnership, and is useful for accessing the field via an interface. +func (v *FilterAlertDetails) GetQueryOwnership() SharedQueryOwnershipType { return v.QueryOwnership } + +func (v *FilterAlertDetails) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *FilterAlertDetails + Actions []json.RawMessage `json:"actions"` + QueryOwnership json.RawMessage `json:"queryOwnership"` + graphql.NoUnmarshalJSON + } + firstPass.FilterAlertDetails = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Actions + src := firstPass.Actions + *dst = make( + []FilterAlertDetailsActionsAction, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalFilterAlertDetailsActionsAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal FilterAlertDetails.Actions: %w", err) + } + } + } + } + + { + dst := &v.QueryOwnership + src := firstPass.QueryOwnership + if len(src) != 0 && string(src) != "null" { + err = __unmarshalSharedQueryOwnershipType( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal FilterAlertDetails.QueryOwnership: %w", err) + } + } + } + return nil +} + +type __premarshalFilterAlertDetails struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *FilterAlertDetails) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *FilterAlertDetails) __premarshalJSON() (*__premarshalFilterAlertDetails, error) { + var retval __premarshalFilterAlertDetails + + retval.Id = v.Id + retval.Name = v.Name + retval.Description = v.Description + retval.QueryString = v.QueryString + retval.ThrottleTimeSeconds = v.ThrottleTimeSeconds + retval.ThrottleField = v.ThrottleField + { + + dst := &retval.Actions + src := v.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFilterAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal FilterAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.Labels + retval.Enabled = v.Enabled + { + + dst := &retval.QueryOwnership + src := v.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal FilterAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// FilterAlertDetailsActionsAction includes the requested fields of the GraphQL interface Action. +// +// FilterAlertDetailsActionsAction is implemented by the following types: +// FilterAlertDetailsActionsEmailAction +// FilterAlertDetailsActionsHumioRepoAction +// FilterAlertDetailsActionsOpsGenieAction +// FilterAlertDetailsActionsPagerDutyAction +// FilterAlertDetailsActionsSlackAction +// FilterAlertDetailsActionsSlackPostMessageAction +// FilterAlertDetailsActionsUploadFileAction +// FilterAlertDetailsActionsVictorOpsAction +// FilterAlertDetailsActionsWebhookAction +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type FilterAlertDetailsActionsAction interface { + implementsGraphQLInterfaceFilterAlertDetailsActionsAction() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // An action that can be invoked from a trigger. + GetName() string +} + +func (v *FilterAlertDetailsActionsEmailAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsHumioRepoAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsOpsGenieAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsPagerDutyAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsSlackAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsSlackPostMessageAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsUploadFileAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsVictorOpsAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} +func (v *FilterAlertDetailsActionsWebhookAction) implementsGraphQLInterfaceFilterAlertDetailsActionsAction() { +} + +func __unmarshalFilterAlertDetailsActionsAction(b []byte, v *FilterAlertDetailsActionsAction) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(FilterAlertDetailsActionsEmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(FilterAlertDetailsActionsHumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(FilterAlertDetailsActionsOpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(FilterAlertDetailsActionsPagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(FilterAlertDetailsActionsSlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(FilterAlertDetailsActionsSlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(FilterAlertDetailsActionsUploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(FilterAlertDetailsActionsVictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(FilterAlertDetailsActionsWebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for FilterAlertDetailsActionsAction: "%v"`, tn.TypeName) + } +} + +func __marshalFilterAlertDetailsActionsAction(v *FilterAlertDetailsActionsAction) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *FilterAlertDetailsActionsEmailAction: + typename = "EmailAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsEmailAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsHumioRepoAction: + typename = "HumioRepoAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsHumioRepoAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsOpsGenieAction: + typename = "OpsGenieAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsOpsGenieAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsPagerDutyAction: + typename = "PagerDutyAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsPagerDutyAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsSlackAction: + typename = "SlackAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsSlackAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsSlackPostMessageAction: + typename = "SlackPostMessageAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsSlackPostMessageAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsUploadFileAction: + typename = "UploadFileAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsUploadFileAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsVictorOpsAction: + typename = "VictorOpsAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsVictorOpsAction + }{typename, v} + return json.Marshal(result) + case *FilterAlertDetailsActionsWebhookAction: + typename = "WebhookAction" + + result := struct { + TypeName string `json:"__typename"` + *FilterAlertDetailsActionsWebhookAction + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for FilterAlertDetailsActionsAction: "%T"`, v) + } +} + +// FilterAlertDetailsActionsEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type FilterAlertDetailsActionsEmailAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsEmailAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsEmailAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsEmailAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsEmailAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type FilterAlertDetailsActionsHumioRepoAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsHumioRepoAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsHumioRepoAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsHumioRepoAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type FilterAlertDetailsActionsOpsGenieAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsOpsGenieAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsOpsGenieAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsOpsGenieAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsPagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type FilterAlertDetailsActionsPagerDutyAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsPagerDutyAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsPagerDutyAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsPagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsPagerDutyAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type FilterAlertDetailsActionsSlackAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsSlackAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsSlackAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsSlackAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsSlackAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type FilterAlertDetailsActionsSlackPostMessageAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsSlackPostMessageAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsSlackPostMessageAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsSlackPostMessageAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type FilterAlertDetailsActionsUploadFileAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsUploadFileAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsUploadFileAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsUploadFileAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type FilterAlertDetailsActionsVictorOpsAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsVictorOpsAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsVictorOpsAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsVictorOpsAction) GetName() string { return v.Name } + +// FilterAlertDetailsActionsWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type FilterAlertDetailsActionsWebhookAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns FilterAlertDetailsActionsWebhookAction.Typename, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsWebhookAction) GetTypename() *string { return v.Typename } + +// GetName returns FilterAlertDetailsActionsWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *FilterAlertDetailsActionsWebhookAction) GetName() string { return v.Name } + +// GetActionByIDResponse is returned by GetActionByID on success. +type GetActionByIDResponse struct { + SearchDomain GetActionByIDSearchDomain `json:"-"` +} + +// GetSearchDomain returns GetActionByIDResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *GetActionByIDResponse) GetSearchDomain() GetActionByIDSearchDomain { return v.SearchDomain } + +func (v *GetActionByIDResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetActionByIDSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetActionByIDResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalGetActionByIDResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *GetActionByIDResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDResponse) __premarshalJSON() (*__premarshalGetActionByIDResponse, error) { + var retval __premarshalGetActionByIDResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalGetActionByIDSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetActionByIDResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// GetActionByIDSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// GetActionByIDSearchDomain is implemented by the following types: +// GetActionByIDSearchDomainRepository +// GetActionByIDSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type GetActionByIDSearchDomain interface { + implementsGraphQLInterfaceGetActionByIDSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetAction returns the interface-field "action" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAction() GetActionByIDSearchDomainAction +} + +func (v *GetActionByIDSearchDomainRepository) implementsGraphQLInterfaceGetActionByIDSearchDomain() {} +func (v *GetActionByIDSearchDomainView) implementsGraphQLInterfaceGetActionByIDSearchDomain() {} + +func __unmarshalGetActionByIDSearchDomain(b []byte, v *GetActionByIDSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(GetActionByIDSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(GetActionByIDSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetActionByIDSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalGetActionByIDSearchDomain(v *GetActionByIDSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetActionByIDSearchDomainRepository: + typename = "Repository" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainRepository + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainView: + typename = "View" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainView + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetActionByIDSearchDomain: "%T"`, v) + } +} + +// GetActionByIDSearchDomainAction includes the requested fields of the GraphQL interface Action. +// +// GetActionByIDSearchDomainAction is implemented by the following types: +// GetActionByIDSearchDomainActionEmailAction +// GetActionByIDSearchDomainActionHumioRepoAction +// GetActionByIDSearchDomainActionOpsGenieAction +// GetActionByIDSearchDomainActionPagerDutyAction +// GetActionByIDSearchDomainActionSlackAction +// GetActionByIDSearchDomainActionSlackPostMessageAction +// GetActionByIDSearchDomainActionUploadFileAction +// GetActionByIDSearchDomainActionVictorOpsAction +// GetActionByIDSearchDomainActionWebhookAction +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type GetActionByIDSearchDomainAction interface { + implementsGraphQLInterfaceGetActionByIDSearchDomainAction() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + ActionDetails +} + +func (v *GetActionByIDSearchDomainActionEmailAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionHumioRepoAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionOpsGenieAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionPagerDutyAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionSlackAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionUploadFileAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionVictorOpsAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} +func (v *GetActionByIDSearchDomainActionWebhookAction) implementsGraphQLInterfaceGetActionByIDSearchDomainAction() { +} + +func __unmarshalGetActionByIDSearchDomainAction(b []byte, v *GetActionByIDSearchDomainAction) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(GetActionByIDSearchDomainActionEmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(GetActionByIDSearchDomainActionHumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(GetActionByIDSearchDomainActionOpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(GetActionByIDSearchDomainActionPagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(GetActionByIDSearchDomainActionSlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(GetActionByIDSearchDomainActionSlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(GetActionByIDSearchDomainActionUploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(GetActionByIDSearchDomainActionVictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(GetActionByIDSearchDomainActionWebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetActionByIDSearchDomainAction: "%v"`, tn.TypeName) + } +} + +func __marshalGetActionByIDSearchDomainAction(v *GetActionByIDSearchDomainAction) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetActionByIDSearchDomainActionEmailAction: + typename = "EmailAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionEmailAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionHumioRepoAction: + typename = "HumioRepoAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionHumioRepoAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionOpsGenieAction: + typename = "OpsGenieAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionOpsGenieAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionPagerDutyAction: + typename = "PagerDutyAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionPagerDutyAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionSlackAction: + typename = "SlackAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionSlackAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionSlackPostMessageAction: + typename = "SlackPostMessageAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionSlackPostMessageAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionUploadFileAction: + typename = "UploadFileAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionUploadFileAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionVictorOpsAction: + typename = "VictorOpsAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionVictorOpsAction + }{typename, premarshaled} + return json.Marshal(result) + case *GetActionByIDSearchDomainActionWebhookAction: + typename = "WebhookAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActionByIDSearchDomainActionWebhookAction + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetActionByIDSearchDomainAction: "%T"`, v) + } +} + +// GetActionByIDSearchDomainActionEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type GetActionByIDSearchDomainActionEmailAction struct { + Typename *string `json:"__typename"` + ActionDetailsEmailAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionEmailAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionEmailAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetId() string { + return v.ActionDetailsEmailAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionEmailAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetName() string { + return v.ActionDetailsEmailAction.Name +} + +// GetRecipients returns GetActionByIDSearchDomainActionEmailAction.Recipients, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetRecipients() []string { + return v.ActionDetailsEmailAction.Recipients +} + +// GetSubjectTemplate returns GetActionByIDSearchDomainActionEmailAction.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetSubjectTemplate() *string { + return v.ActionDetailsEmailAction.SubjectTemplate +} + +// GetEmailBodyTemplate returns GetActionByIDSearchDomainActionEmailAction.EmailBodyTemplate, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetEmailBodyTemplate() *string { + return v.ActionDetailsEmailAction.EmailBodyTemplate +} + +// GetUseProxy returns GetActionByIDSearchDomainActionEmailAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionEmailAction) GetUseProxy() bool { + return v.ActionDetailsEmailAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionEmailAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionEmailAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionEmailAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsEmailAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionEmailAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Recipients []string `json:"recipients"` + + SubjectTemplate *string `json:"subjectTemplate"` + + EmailBodyTemplate *string `json:"emailBodyTemplate"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionEmailAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionEmailAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionEmailAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionEmailAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsEmailAction.Id + retval.Name = v.ActionDetailsEmailAction.Name + retval.Recipients = v.ActionDetailsEmailAction.Recipients + retval.SubjectTemplate = v.ActionDetailsEmailAction.SubjectTemplate + retval.EmailBodyTemplate = v.ActionDetailsEmailAction.EmailBodyTemplate + retval.UseProxy = v.ActionDetailsEmailAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type GetActionByIDSearchDomainActionHumioRepoAction struct { + Typename *string `json:"__typename"` + ActionDetailsHumioRepoAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionHumioRepoAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionHumioRepoAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionHumioRepoAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionHumioRepoAction) GetId() string { + return v.ActionDetailsHumioRepoAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionHumioRepoAction) GetName() string { + return v.ActionDetailsHumioRepoAction.Name +} + +// GetIngestToken returns GetActionByIDSearchDomainActionHumioRepoAction.IngestToken, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionHumioRepoAction) GetIngestToken() string { + return v.ActionDetailsHumioRepoAction.IngestToken +} + +func (v *GetActionByIDSearchDomainActionHumioRepoAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionHumioRepoAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionHumioRepoAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsHumioRepoAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionHumioRepoAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + IngestToken string `json:"ingestToken"` +} + +func (v *GetActionByIDSearchDomainActionHumioRepoAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionHumioRepoAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionHumioRepoAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionHumioRepoAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsHumioRepoAction.Id + retval.Name = v.ActionDetailsHumioRepoAction.Name + retval.IngestToken = v.ActionDetailsHumioRepoAction.IngestToken + return &retval, nil +} + +// GetActionByIDSearchDomainActionOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type GetActionByIDSearchDomainActionOpsGenieAction struct { + Typename *string `json:"__typename"` + ActionDetailsOpsGenieAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionOpsGenieAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionOpsGenieAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetId() string { + return v.ActionDetailsOpsGenieAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetName() string { + return v.ActionDetailsOpsGenieAction.Name +} + +// GetApiUrl returns GetActionByIDSearchDomainActionOpsGenieAction.ApiUrl, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetApiUrl() string { + return v.ActionDetailsOpsGenieAction.ApiUrl +} + +// GetGenieKey returns GetActionByIDSearchDomainActionOpsGenieAction.GenieKey, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetGenieKey() string { + return v.ActionDetailsOpsGenieAction.GenieKey +} + +// GetUseProxy returns GetActionByIDSearchDomainActionOpsGenieAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionOpsGenieAction) GetUseProxy() bool { + return v.ActionDetailsOpsGenieAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionOpsGenieAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionOpsGenieAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionOpsGenieAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsOpsGenieAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionOpsGenieAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + ApiUrl string `json:"apiUrl"` + + GenieKey string `json:"genieKey"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionOpsGenieAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionOpsGenieAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionOpsGenieAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionOpsGenieAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsOpsGenieAction.Id + retval.Name = v.ActionDetailsOpsGenieAction.Name + retval.ApiUrl = v.ActionDetailsOpsGenieAction.ApiUrl + retval.GenieKey = v.ActionDetailsOpsGenieAction.GenieKey + retval.UseProxy = v.ActionDetailsOpsGenieAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionPagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type GetActionByIDSearchDomainActionPagerDutyAction struct { + Typename *string `json:"__typename"` + ActionDetailsPagerDutyAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionPagerDutyAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionPagerDutyAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetId() string { + return v.ActionDetailsPagerDutyAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionPagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetName() string { + return v.ActionDetailsPagerDutyAction.Name +} + +// GetSeverity returns GetActionByIDSearchDomainActionPagerDutyAction.Severity, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetSeverity() string { + return v.ActionDetailsPagerDutyAction.Severity +} + +// GetRoutingKey returns GetActionByIDSearchDomainActionPagerDutyAction.RoutingKey, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetRoutingKey() string { + return v.ActionDetailsPagerDutyAction.RoutingKey +} + +// GetUseProxy returns GetActionByIDSearchDomainActionPagerDutyAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionPagerDutyAction) GetUseProxy() bool { + return v.ActionDetailsPagerDutyAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionPagerDutyAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionPagerDutyAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionPagerDutyAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsPagerDutyAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionPagerDutyAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Severity string `json:"severity"` + + RoutingKey string `json:"routingKey"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionPagerDutyAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionPagerDutyAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionPagerDutyAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionPagerDutyAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsPagerDutyAction.Id + retval.Name = v.ActionDetailsPagerDutyAction.Name + retval.Severity = v.ActionDetailsPagerDutyAction.Severity + retval.RoutingKey = v.ActionDetailsPagerDutyAction.RoutingKey + retval.UseProxy = v.ActionDetailsPagerDutyAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type GetActionByIDSearchDomainActionSlackAction struct { + Typename *string `json:"__typename"` + ActionDetailsSlackAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionSlackAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionSlackAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetId() string { + return v.ActionDetailsSlackAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionSlackAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetName() string { + return v.ActionDetailsSlackAction.Name +} + +// GetUrl returns GetActionByIDSearchDomainActionSlackAction.Url, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetUrl() string { + return v.ActionDetailsSlackAction.Url +} + +// GetFields returns GetActionByIDSearchDomainActionSlackAction.Fields, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { + return v.ActionDetailsSlackAction.Fields +} + +// GetUseProxy returns GetActionByIDSearchDomainActionSlackAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackAction) GetUseProxy() bool { + return v.ActionDetailsSlackAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionSlackAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionSlackAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionSlackAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsSlackAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionSlackAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Url string `json:"url"` + + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionSlackAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionSlackAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionSlackAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionSlackAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsSlackAction.Id + retval.Name = v.ActionDetailsSlackAction.Name + retval.Url = v.ActionDetailsSlackAction.Url + retval.Fields = v.ActionDetailsSlackAction.Fields + retval.UseProxy = v.ActionDetailsSlackAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type GetActionByIDSearchDomainActionSlackPostMessageAction struct { + Typename *string `json:"__typename"` + ActionDetailsSlackPostMessageAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionSlackPostMessageAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetTypename() *string { + return v.Typename +} + +// GetId returns GetActionByIDSearchDomainActionSlackPostMessageAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetId() string { + return v.ActionDetailsSlackPostMessageAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetName() string { + return v.ActionDetailsSlackPostMessageAction.Name +} + +// GetApiToken returns GetActionByIDSearchDomainActionSlackPostMessageAction.ApiToken, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetApiToken() string { + return v.ActionDetailsSlackPostMessageAction.ApiToken +} + +// GetChannels returns GetActionByIDSearchDomainActionSlackPostMessageAction.Channels, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetChannels() []string { + return v.ActionDetailsSlackPostMessageAction.Channels +} + +// GetFields returns GetActionByIDSearchDomainActionSlackPostMessageAction.Fields, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { + return v.ActionDetailsSlackPostMessageAction.Fields +} + +// GetUseProxy returns GetActionByIDSearchDomainActionSlackPostMessageAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) GetUseProxy() bool { + return v.ActionDetailsSlackPostMessageAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionSlackPostMessageAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionSlackPostMessageAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsSlackPostMessageAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionSlackPostMessageAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + ApiToken string `json:"apiToken"` + + Channels []string `json:"channels"` + + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionSlackPostMessageAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionSlackPostMessageAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionSlackPostMessageAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsSlackPostMessageAction.Id + retval.Name = v.ActionDetailsSlackPostMessageAction.Name + retval.ApiToken = v.ActionDetailsSlackPostMessageAction.ApiToken + retval.Channels = v.ActionDetailsSlackPostMessageAction.Channels + retval.Fields = v.ActionDetailsSlackPostMessageAction.Fields + retval.UseProxy = v.ActionDetailsSlackPostMessageAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type GetActionByIDSearchDomainActionUploadFileAction struct { + Typename *string `json:"__typename"` + ActionDetailsUploadFileAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionUploadFileAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionUploadFileAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionUploadFileAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionUploadFileAction) GetId() string { + return v.ActionDetailsUploadFileAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionUploadFileAction) GetName() string { + return v.ActionDetailsUploadFileAction.Name +} + +// GetFileName returns GetActionByIDSearchDomainActionUploadFileAction.FileName, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionUploadFileAction) GetFileName() string { + return v.ActionDetailsUploadFileAction.FileName +} + +func (v *GetActionByIDSearchDomainActionUploadFileAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionUploadFileAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionUploadFileAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsUploadFileAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionUploadFileAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + FileName string `json:"fileName"` +} + +func (v *GetActionByIDSearchDomainActionUploadFileAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionUploadFileAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionUploadFileAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionUploadFileAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsUploadFileAction.Id + retval.Name = v.ActionDetailsUploadFileAction.Name + retval.FileName = v.ActionDetailsUploadFileAction.FileName + return &retval, nil +} + +// GetActionByIDSearchDomainActionVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type GetActionByIDSearchDomainActionVictorOpsAction struct { + Typename *string `json:"__typename"` + ActionDetailsVictorOpsAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionVictorOpsAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionVictorOpsAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetId() string { + return v.ActionDetailsVictorOpsAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetName() string { + return v.ActionDetailsVictorOpsAction.Name +} + +// GetMessageType returns GetActionByIDSearchDomainActionVictorOpsAction.MessageType, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetMessageType() string { + return v.ActionDetailsVictorOpsAction.MessageType +} + +// GetNotifyUrl returns GetActionByIDSearchDomainActionVictorOpsAction.NotifyUrl, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetNotifyUrl() string { + return v.ActionDetailsVictorOpsAction.NotifyUrl +} + +// GetUseProxy returns GetActionByIDSearchDomainActionVictorOpsAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionVictorOpsAction) GetUseProxy() bool { + return v.ActionDetailsVictorOpsAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionVictorOpsAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionVictorOpsAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionVictorOpsAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsVictorOpsAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionVictorOpsAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + MessageType string `json:"messageType"` + + NotifyUrl string `json:"notifyUrl"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionVictorOpsAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionVictorOpsAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionVictorOpsAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionVictorOpsAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsVictorOpsAction.Id + retval.Name = v.ActionDetailsVictorOpsAction.Name + retval.MessageType = v.ActionDetailsVictorOpsAction.MessageType + retval.NotifyUrl = v.ActionDetailsVictorOpsAction.NotifyUrl + retval.UseProxy = v.ActionDetailsVictorOpsAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainActionWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type GetActionByIDSearchDomainActionWebhookAction struct { + Typename *string `json:"__typename"` + ActionDetailsWebhookAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainActionWebhookAction.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetTypename() *string { return v.Typename } + +// GetId returns GetActionByIDSearchDomainActionWebhookAction.Id, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetId() string { + return v.ActionDetailsWebhookAction.Id +} + +// GetName returns GetActionByIDSearchDomainActionWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetName() string { + return v.ActionDetailsWebhookAction.Name +} + +// GetMethod returns GetActionByIDSearchDomainActionWebhookAction.Method, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetMethod() string { + return v.ActionDetailsWebhookAction.Method +} + +// GetUrl returns GetActionByIDSearchDomainActionWebhookAction.Url, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetUrl() string { + return v.ActionDetailsWebhookAction.Url +} + +// GetHeaders returns GetActionByIDSearchDomainActionWebhookAction.Headers, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetHeaders() []ActionDetailsHeadersHttpHeaderEntry { + return v.ActionDetailsWebhookAction.Headers +} + +// GetWebhookBodyTemplate returns GetActionByIDSearchDomainActionWebhookAction.WebhookBodyTemplate, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetWebhookBodyTemplate() string { + return v.ActionDetailsWebhookAction.WebhookBodyTemplate +} + +// GetIgnoreSSL returns GetActionByIDSearchDomainActionWebhookAction.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetIgnoreSSL() bool { + return v.ActionDetailsWebhookAction.IgnoreSSL +} + +// GetUseProxy returns GetActionByIDSearchDomainActionWebhookAction.UseProxy, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainActionWebhookAction) GetUseProxy() bool { + return v.ActionDetailsWebhookAction.UseProxy +} + +func (v *GetActionByIDSearchDomainActionWebhookAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainActionWebhookAction + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainActionWebhookAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsWebhookAction) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActionByIDSearchDomainActionWebhookAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Method string `json:"method"` + + Url string `json:"url"` + + Headers []ActionDetailsHeadersHttpHeaderEntry `json:"headers"` + + WebhookBodyTemplate string `json:"WebhookBodyTemplate"` + + IgnoreSSL bool `json:"ignoreSSL"` + + UseProxy bool `json:"useProxy"` +} + +func (v *GetActionByIDSearchDomainActionWebhookAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainActionWebhookAction) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainActionWebhookAction, error) { + var retval __premarshalGetActionByIDSearchDomainActionWebhookAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsWebhookAction.Id + retval.Name = v.ActionDetailsWebhookAction.Name + retval.Method = v.ActionDetailsWebhookAction.Method + retval.Url = v.ActionDetailsWebhookAction.Url + retval.Headers = v.ActionDetailsWebhookAction.Headers + retval.WebhookBodyTemplate = v.ActionDetailsWebhookAction.WebhookBodyTemplate + retval.IgnoreSSL = v.ActionDetailsWebhookAction.IgnoreSSL + retval.UseProxy = v.ActionDetailsWebhookAction.UseProxy + return &retval, nil +} + +// GetActionByIDSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetActionByIDSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Action GetActionByIDSearchDomainAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetAction returns GetActionByIDSearchDomainRepository.Action, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainRepository) GetAction() GetActionByIDSearchDomainAction { + return v.Action +} + +func (v *GetActionByIDSearchDomainRepository) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainRepository + Action json.RawMessage `json:"action"` + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainRepository = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Action + src := firstPass.Action + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetActionByIDSearchDomainAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetActionByIDSearchDomainRepository.Action: %w", err) + } + } + } + return nil +} + +type __premarshalGetActionByIDSearchDomainRepository struct { + Typename *string `json:"__typename"` + + Action json.RawMessage `json:"action"` +} + +func (v *GetActionByIDSearchDomainRepository) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainRepository) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainRepository, error) { + var retval __premarshalGetActionByIDSearchDomainRepository + + retval.Typename = v.Typename + { + + dst := &retval.Action + src := v.Action + var err error + *dst, err = __marshalGetActionByIDSearchDomainAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetActionByIDSearchDomainRepository.Action: %w", err) + } + } + return &retval, nil +} + +// GetActionByIDSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type GetActionByIDSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Action GetActionByIDSearchDomainAction `json:"-"` +} + +// GetTypename returns GetActionByIDSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainView) GetTypename() *string { return v.Typename } + +// GetAction returns GetActionByIDSearchDomainView.Action, and is useful for accessing the field via an interface. +func (v *GetActionByIDSearchDomainView) GetAction() GetActionByIDSearchDomainAction { return v.Action } + +func (v *GetActionByIDSearchDomainView) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActionByIDSearchDomainView + Action json.RawMessage `json:"action"` + graphql.NoUnmarshalJSON + } + firstPass.GetActionByIDSearchDomainView = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Action + src := firstPass.Action + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetActionByIDSearchDomainAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetActionByIDSearchDomainView.Action: %w", err) + } + } + } + return nil +} + +type __premarshalGetActionByIDSearchDomainView struct { + Typename *string `json:"__typename"` + + Action json.RawMessage `json:"action"` +} + +func (v *GetActionByIDSearchDomainView) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActionByIDSearchDomainView) __premarshalJSON() (*__premarshalGetActionByIDSearchDomainView, error) { + var retval __premarshalGetActionByIDSearchDomainView + + retval.Typename = v.Typename + { + + dst := &retval.Action + src := v.Action + var err error + *dst, err = __marshalGetActionByIDSearchDomainAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetActionByIDSearchDomainView.Action: %w", err) + } + } + return &retval, nil +} + +// GetAggregateAlertByIDResponse is returned by GetAggregateAlertByID on success. +type GetAggregateAlertByIDResponse struct { + SearchDomain GetAggregateAlertByIDSearchDomain `json:"-"` +} + +// GetSearchDomain returns GetAggregateAlertByIDResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDResponse) GetSearchDomain() GetAggregateAlertByIDSearchDomain { + return v.SearchDomain +} + +func (v *GetAggregateAlertByIDResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetAggregateAlertByIDResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.GetAggregateAlertByIDResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetAggregateAlertByIDSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetAggregateAlertByIDResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalGetAggregateAlertByIDResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *GetAggregateAlertByIDResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetAggregateAlertByIDResponse) __premarshalJSON() (*__premarshalGetAggregateAlertByIDResponse, error) { + var retval __premarshalGetAggregateAlertByIDResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalGetAggregateAlertByIDSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetAggregateAlertByIDResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// GetAggregateAlertByIDSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// GetAggregateAlertByIDSearchDomain is implemented by the following types: +// GetAggregateAlertByIDSearchDomainRepository +// GetAggregateAlertByIDSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type GetAggregateAlertByIDSearchDomain interface { + implementsGraphQLInterfaceGetAggregateAlertByIDSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetAggregateAlert returns the interface-field "aggregateAlert" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAggregateAlert() GetAggregateAlertByIDSearchDomainAggregateAlert +} + +func (v *GetAggregateAlertByIDSearchDomainRepository) implementsGraphQLInterfaceGetAggregateAlertByIDSearchDomain() { +} +func (v *GetAggregateAlertByIDSearchDomainView) implementsGraphQLInterfaceGetAggregateAlertByIDSearchDomain() { +} + +func __unmarshalGetAggregateAlertByIDSearchDomain(b []byte, v *GetAggregateAlertByIDSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(GetAggregateAlertByIDSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(GetAggregateAlertByIDSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetAggregateAlertByIDSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalGetAggregateAlertByIDSearchDomain(v *GetAggregateAlertByIDSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetAggregateAlertByIDSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *GetAggregateAlertByIDSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *GetAggregateAlertByIDSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *GetAggregateAlertByIDSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetAggregateAlertByIDSearchDomain: "%T"`, v) + } +} + +// GetAggregateAlertByIDSearchDomainAggregateAlert includes the requested fields of the GraphQL type AggregateAlert. +// The GraphQL type's documentation follows. +// +// An aggregate alert. +type GetAggregateAlertByIDSearchDomainAggregateAlert struct { + AggregateAlertDetails `json:"-"` +} + +// GetId returns GetAggregateAlertByIDSearchDomainAggregateAlert.Id, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetId() string { + return v.AggregateAlertDetails.Id +} + +// GetName returns GetAggregateAlertByIDSearchDomainAggregateAlert.Name, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetName() string { + return v.AggregateAlertDetails.Name +} + +// GetDescription returns GetAggregateAlertByIDSearchDomainAggregateAlert.Description, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetDescription() *string { + return v.AggregateAlertDetails.Description +} + +// GetQueryString returns GetAggregateAlertByIDSearchDomainAggregateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetQueryString() string { + return v.AggregateAlertDetails.QueryString +} + +// GetSearchIntervalSeconds returns GetAggregateAlertByIDSearchDomainAggregateAlert.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetSearchIntervalSeconds() int64 { + return v.AggregateAlertDetails.SearchIntervalSeconds +} + +// GetThrottleTimeSeconds returns GetAggregateAlertByIDSearchDomainAggregateAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetThrottleTimeSeconds() int64 { + return v.AggregateAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns GetAggregateAlertByIDSearchDomainAggregateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetThrottleField() *string { + return v.AggregateAlertDetails.ThrottleField +} + +// GetActions returns GetAggregateAlertByIDSearchDomainAggregateAlert.Actions, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetActions() []AggregateAlertDetailsActionsAction { + return v.AggregateAlertDetails.Actions +} + +// GetLabels returns GetAggregateAlertByIDSearchDomainAggregateAlert.Labels, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetLabels() []string { + return v.AggregateAlertDetails.Labels +} + +// GetEnabled returns GetAggregateAlertByIDSearchDomainAggregateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetEnabled() bool { + return v.AggregateAlertDetails.Enabled +} + +// GetTriggerMode returns GetAggregateAlertByIDSearchDomainAggregateAlert.TriggerMode, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetTriggerMode() TriggerMode { + return v.AggregateAlertDetails.TriggerMode +} + +// GetQueryTimestampType returns GetAggregateAlertByIDSearchDomainAggregateAlert.QueryTimestampType, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetQueryTimestampType() QueryTimestampType { + return v.AggregateAlertDetails.QueryTimestampType +} + +// GetQueryOwnership returns GetAggregateAlertByIDSearchDomainAggregateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AggregateAlertDetails.QueryOwnership +} + +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetAggregateAlertByIDSearchDomainAggregateAlert + graphql.NoUnmarshalJSON + } + firstPass.GetAggregateAlertByIDSearchDomainAggregateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AggregateAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetAggregateAlertByIDSearchDomainAggregateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + TriggerMode TriggerMode `json:"triggerMode"` + + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetAggregateAlertByIDSearchDomainAggregateAlert) __premarshalJSON() (*__premarshalGetAggregateAlertByIDSearchDomainAggregateAlert, error) { + var retval __premarshalGetAggregateAlertByIDSearchDomainAggregateAlert + + retval.Id = v.AggregateAlertDetails.Id + retval.Name = v.AggregateAlertDetails.Name + retval.Description = v.AggregateAlertDetails.Description + retval.QueryString = v.AggregateAlertDetails.QueryString + retval.SearchIntervalSeconds = v.AggregateAlertDetails.SearchIntervalSeconds + retval.ThrottleTimeSeconds = v.AggregateAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.AggregateAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.AggregateAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalAggregateAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetAggregateAlertByIDSearchDomainAggregateAlert.AggregateAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.AggregateAlertDetails.Labels + retval.Enabled = v.AggregateAlertDetails.Enabled + retval.TriggerMode = v.AggregateAlertDetails.TriggerMode + retval.QueryTimestampType = v.AggregateAlertDetails.QueryTimestampType + { + + dst := &retval.QueryOwnership + src := v.AggregateAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetAggregateAlertByIDSearchDomainAggregateAlert.AggregateAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// GetAggregateAlertByIDSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetAggregateAlertByIDSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + AggregateAlert GetAggregateAlertByIDSearchDomainAggregateAlert `json:"aggregateAlert"` +} + +// GetTypename returns GetAggregateAlertByIDSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetAggregateAlert returns GetAggregateAlertByIDSearchDomainRepository.AggregateAlert, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainRepository) GetAggregateAlert() GetAggregateAlertByIDSearchDomainAggregateAlert { + return v.AggregateAlert +} + +// GetAggregateAlertByIDSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type GetAggregateAlertByIDSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + AggregateAlert GetAggregateAlertByIDSearchDomainAggregateAlert `json:"aggregateAlert"` +} + +// GetTypename returns GetAggregateAlertByIDSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainView) GetTypename() *string { return v.Typename } + +// GetAggregateAlert returns GetAggregateAlertByIDSearchDomainView.AggregateAlert, and is useful for accessing the field via an interface. +func (v *GetAggregateAlertByIDSearchDomainView) GetAggregateAlert() GetAggregateAlertByIDSearchDomainAggregateAlert { + return v.AggregateAlert +} + +// GetClusterCluster includes the requested fields of the GraphQL type Cluster. +// The GraphQL type's documentation follows. +// +// Information about the LogScale cluster. +type GetClusterCluster struct { + ClusterNode `json:"-"` + ClusterInfoAgeSeconds float64 `json:"clusterInfoAgeSeconds"` + UnderReplicatedSegmentSize float64 `json:"underReplicatedSegmentSize"` + OverReplicatedSegmentSize float64 `json:"overReplicatedSegmentSize"` + MissingSegmentSize float64 `json:"missingSegmentSize"` + ProperlyReplicatedSegmentSize float64 `json:"properlyReplicatedSegmentSize"` + TargetUnderReplicatedSegmentSize float64 `json:"targetUnderReplicatedSegmentSize"` + TargetOverReplicatedSegmentSize float64 `json:"targetOverReplicatedSegmentSize"` + TargetMissingSegmentSize float64 `json:"targetMissingSegmentSize"` + TargetProperlyReplicatedSegmentSize float64 `json:"targetProperlyReplicatedSegmentSize"` + IngestPartitions []GetClusterClusterIngestPartitionsIngestPartition `json:"ingestPartitions"` +} + +// GetClusterInfoAgeSeconds returns GetClusterCluster.ClusterInfoAgeSeconds, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetClusterInfoAgeSeconds() float64 { return v.ClusterInfoAgeSeconds } + +// GetUnderReplicatedSegmentSize returns GetClusterCluster.UnderReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetUnderReplicatedSegmentSize() float64 { + return v.UnderReplicatedSegmentSize +} + +// GetOverReplicatedSegmentSize returns GetClusterCluster.OverReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetOverReplicatedSegmentSize() float64 { + return v.OverReplicatedSegmentSize +} + +// GetMissingSegmentSize returns GetClusterCluster.MissingSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetMissingSegmentSize() float64 { return v.MissingSegmentSize } + +// GetProperlyReplicatedSegmentSize returns GetClusterCluster.ProperlyReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetProperlyReplicatedSegmentSize() float64 { + return v.ProperlyReplicatedSegmentSize +} + +// GetTargetUnderReplicatedSegmentSize returns GetClusterCluster.TargetUnderReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetTargetUnderReplicatedSegmentSize() float64 { + return v.TargetUnderReplicatedSegmentSize +} + +// GetTargetOverReplicatedSegmentSize returns GetClusterCluster.TargetOverReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetTargetOverReplicatedSegmentSize() float64 { + return v.TargetOverReplicatedSegmentSize +} + +// GetTargetMissingSegmentSize returns GetClusterCluster.TargetMissingSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetTargetMissingSegmentSize() float64 { return v.TargetMissingSegmentSize } + +// GetTargetProperlyReplicatedSegmentSize returns GetClusterCluster.TargetProperlyReplicatedSegmentSize, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetTargetProperlyReplicatedSegmentSize() float64 { + return v.TargetProperlyReplicatedSegmentSize +} + +// GetIngestPartitions returns GetClusterCluster.IngestPartitions, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetIngestPartitions() []GetClusterClusterIngestPartitionsIngestPartition { + return v.IngestPartitions +} + +// GetNodes returns GetClusterCluster.Nodes, and is useful for accessing the field via an interface. +func (v *GetClusterCluster) GetNodes() []ClusterNodeNodesClusterNode { return v.ClusterNode.Nodes } + +func (v *GetClusterCluster) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetClusterCluster + graphql.NoUnmarshalJSON + } + firstPass.GetClusterCluster = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ClusterNode) + if err != nil { + return err + } + return nil +} + +type __premarshalGetClusterCluster struct { + ClusterInfoAgeSeconds float64 `json:"clusterInfoAgeSeconds"` + + UnderReplicatedSegmentSize float64 `json:"underReplicatedSegmentSize"` + + OverReplicatedSegmentSize float64 `json:"overReplicatedSegmentSize"` + + MissingSegmentSize float64 `json:"missingSegmentSize"` + + ProperlyReplicatedSegmentSize float64 `json:"properlyReplicatedSegmentSize"` + + TargetUnderReplicatedSegmentSize float64 `json:"targetUnderReplicatedSegmentSize"` + + TargetOverReplicatedSegmentSize float64 `json:"targetOverReplicatedSegmentSize"` + + TargetMissingSegmentSize float64 `json:"targetMissingSegmentSize"` + + TargetProperlyReplicatedSegmentSize float64 `json:"targetProperlyReplicatedSegmentSize"` + + IngestPartitions []GetClusterClusterIngestPartitionsIngestPartition `json:"ingestPartitions"` + + Nodes []ClusterNodeNodesClusterNode `json:"nodes"` +} + +func (v *GetClusterCluster) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetClusterCluster) __premarshalJSON() (*__premarshalGetClusterCluster, error) { + var retval __premarshalGetClusterCluster + + retval.ClusterInfoAgeSeconds = v.ClusterInfoAgeSeconds + retval.UnderReplicatedSegmentSize = v.UnderReplicatedSegmentSize + retval.OverReplicatedSegmentSize = v.OverReplicatedSegmentSize + retval.MissingSegmentSize = v.MissingSegmentSize + retval.ProperlyReplicatedSegmentSize = v.ProperlyReplicatedSegmentSize + retval.TargetUnderReplicatedSegmentSize = v.TargetUnderReplicatedSegmentSize + retval.TargetOverReplicatedSegmentSize = v.TargetOverReplicatedSegmentSize + retval.TargetMissingSegmentSize = v.TargetMissingSegmentSize + retval.TargetProperlyReplicatedSegmentSize = v.TargetProperlyReplicatedSegmentSize + retval.IngestPartitions = v.IngestPartitions + retval.Nodes = v.ClusterNode.Nodes + return &retval, nil +} + +// GetClusterClusterIngestPartitionsIngestPartition includes the requested fields of the GraphQL type IngestPartition. +// The GraphQL type's documentation follows. +// +// A cluster ingest partition. It assigns cluster nodes with the responsibility of ingesting data. +type GetClusterClusterIngestPartitionsIngestPartition struct { + Id int `json:"id"` + // The ids of the node responsible executing real-time queries for the partition and writing events to time series. The list is ordered so that the first node is the primary node and the rest are followers ready to take over if the primary fails. + NodeIds []int `json:"nodeIds"` +} + +// GetId returns GetClusterClusterIngestPartitionsIngestPartition.Id, and is useful for accessing the field via an interface. +func (v *GetClusterClusterIngestPartitionsIngestPartition) GetId() int { return v.Id } + +// GetNodeIds returns GetClusterClusterIngestPartitionsIngestPartition.NodeIds, and is useful for accessing the field via an interface. +func (v *GetClusterClusterIngestPartitionsIngestPartition) GetNodeIds() []int { return v.NodeIds } + +// GetClusterResponse is returned by GetCluster on success. +type GetClusterResponse struct { + // This is used to retrieve information about a cluster. + Cluster GetClusterCluster `json:"cluster"` +} + +// GetCluster returns GetClusterResponse.Cluster, and is useful for accessing the field via an interface. +func (v *GetClusterResponse) GetCluster() GetClusterCluster { return v.Cluster } + +// GetFilterAlertByIDResponse is returned by GetFilterAlertByID on success. +type GetFilterAlertByIDResponse struct { + SearchDomain GetFilterAlertByIDSearchDomain `json:"-"` +} + +// GetSearchDomain returns GetFilterAlertByIDResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDResponse) GetSearchDomain() GetFilterAlertByIDSearchDomain { + return v.SearchDomain +} + +func (v *GetFilterAlertByIDResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetFilterAlertByIDResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.GetFilterAlertByIDResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetFilterAlertByIDSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetFilterAlertByIDResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalGetFilterAlertByIDResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *GetFilterAlertByIDResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetFilterAlertByIDResponse) __premarshalJSON() (*__premarshalGetFilterAlertByIDResponse, error) { + var retval __premarshalGetFilterAlertByIDResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalGetFilterAlertByIDSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetFilterAlertByIDResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// GetFilterAlertByIDSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// GetFilterAlertByIDSearchDomain is implemented by the following types: +// GetFilterAlertByIDSearchDomainRepository +// GetFilterAlertByIDSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type GetFilterAlertByIDSearchDomain interface { + implementsGraphQLInterfaceGetFilterAlertByIDSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetFilterAlert returns the interface-field "filterAlert" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetFilterAlert() GetFilterAlertByIDSearchDomainFilterAlert +} + +func (v *GetFilterAlertByIDSearchDomainRepository) implementsGraphQLInterfaceGetFilterAlertByIDSearchDomain() { +} +func (v *GetFilterAlertByIDSearchDomainView) implementsGraphQLInterfaceGetFilterAlertByIDSearchDomain() { +} + +func __unmarshalGetFilterAlertByIDSearchDomain(b []byte, v *GetFilterAlertByIDSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(GetFilterAlertByIDSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(GetFilterAlertByIDSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetFilterAlertByIDSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalGetFilterAlertByIDSearchDomain(v *GetFilterAlertByIDSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetFilterAlertByIDSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *GetFilterAlertByIDSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *GetFilterAlertByIDSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *GetFilterAlertByIDSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetFilterAlertByIDSearchDomain: "%T"`, v) + } +} + +// GetFilterAlertByIDSearchDomainFilterAlert includes the requested fields of the GraphQL type FilterAlert. +// The GraphQL type's documentation follows. +// +// A filter alert. +type GetFilterAlertByIDSearchDomainFilterAlert struct { + FilterAlertDetails `json:"-"` +} + +// GetId returns GetFilterAlertByIDSearchDomainFilterAlert.Id, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetId() string { return v.FilterAlertDetails.Id } + +// GetName returns GetFilterAlertByIDSearchDomainFilterAlert.Name, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetName() string { + return v.FilterAlertDetails.Name +} + +// GetDescription returns GetFilterAlertByIDSearchDomainFilterAlert.Description, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetDescription() *string { + return v.FilterAlertDetails.Description +} + +// GetQueryString returns GetFilterAlertByIDSearchDomainFilterAlert.QueryString, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetQueryString() string { + return v.FilterAlertDetails.QueryString +} + +// GetThrottleTimeSeconds returns GetFilterAlertByIDSearchDomainFilterAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetThrottleTimeSeconds() *int64 { + return v.FilterAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns GetFilterAlertByIDSearchDomainFilterAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetThrottleField() *string { + return v.FilterAlertDetails.ThrottleField +} + +// GetActions returns GetFilterAlertByIDSearchDomainFilterAlert.Actions, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetActions() []FilterAlertDetailsActionsAction { + return v.FilterAlertDetails.Actions +} + +// GetLabels returns GetFilterAlertByIDSearchDomainFilterAlert.Labels, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetLabels() []string { + return v.FilterAlertDetails.Labels +} + +// GetEnabled returns GetFilterAlertByIDSearchDomainFilterAlert.Enabled, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetEnabled() bool { + return v.FilterAlertDetails.Enabled +} + +// GetQueryOwnership returns GetFilterAlertByIDSearchDomainFilterAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainFilterAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.FilterAlertDetails.QueryOwnership +} + +func (v *GetFilterAlertByIDSearchDomainFilterAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetFilterAlertByIDSearchDomainFilterAlert + graphql.NoUnmarshalJSON + } + firstPass.GetFilterAlertByIDSearchDomainFilterAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FilterAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetFilterAlertByIDSearchDomainFilterAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *GetFilterAlertByIDSearchDomainFilterAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetFilterAlertByIDSearchDomainFilterAlert) __premarshalJSON() (*__premarshalGetFilterAlertByIDSearchDomainFilterAlert, error) { + var retval __premarshalGetFilterAlertByIDSearchDomainFilterAlert + + retval.Id = v.FilterAlertDetails.Id + retval.Name = v.FilterAlertDetails.Name + retval.Description = v.FilterAlertDetails.Description + retval.QueryString = v.FilterAlertDetails.QueryString + retval.ThrottleTimeSeconds = v.FilterAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.FilterAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.FilterAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFilterAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetFilterAlertByIDSearchDomainFilterAlert.FilterAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.FilterAlertDetails.Labels + retval.Enabled = v.FilterAlertDetails.Enabled + { + + dst := &retval.QueryOwnership + src := v.FilterAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetFilterAlertByIDSearchDomainFilterAlert.FilterAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// GetFilterAlertByIDSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetFilterAlertByIDSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + FilterAlert GetFilterAlertByIDSearchDomainFilterAlert `json:"filterAlert"` +} + +// GetTypename returns GetFilterAlertByIDSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetFilterAlert returns GetFilterAlertByIDSearchDomainRepository.FilterAlert, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainRepository) GetFilterAlert() GetFilterAlertByIDSearchDomainFilterAlert { + return v.FilterAlert +} + +// GetFilterAlertByIDSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type GetFilterAlertByIDSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + FilterAlert GetFilterAlertByIDSearchDomainFilterAlert `json:"filterAlert"` +} + +// GetTypename returns GetFilterAlertByIDSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainView) GetTypename() *string { return v.Typename } + +// GetFilterAlert returns GetFilterAlertByIDSearchDomainView.FilterAlert, and is useful for accessing the field via an interface. +func (v *GetFilterAlertByIDSearchDomainView) GetFilterAlert() GetFilterAlertByIDSearchDomainFilterAlert { + return v.FilterAlert +} + +// GetLicenseInstalledLicense includes the requested fields of the GraphQL interface License. +// +// GetLicenseInstalledLicense is implemented by the following types: +// GetLicenseInstalledLicenseOnPremLicense +// GetLicenseInstalledLicenseTrialLicense +// The GraphQL type's documentation follows. +// +// Represents information about the LogScale instance. +type GetLicenseInstalledLicense interface { + implementsGraphQLInterfaceGetLicenseInstalledLicense() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetExpiresAt returns the interface-field "expiresAt" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Represents information about the LogScale instance. + GetExpiresAt() time.Time + // GetIssuedAt returns the interface-field "issuedAt" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Represents information about the LogScale instance. + GetIssuedAt() time.Time +} + +func (v *GetLicenseInstalledLicenseOnPremLicense) implementsGraphQLInterfaceGetLicenseInstalledLicense() { +} +func (v *GetLicenseInstalledLicenseTrialLicense) implementsGraphQLInterfaceGetLicenseInstalledLicense() { +} + +func __unmarshalGetLicenseInstalledLicense(b []byte, v *GetLicenseInstalledLicense) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "OnPremLicense": + *v = new(GetLicenseInstalledLicenseOnPremLicense) + return json.Unmarshal(b, *v) + case "TrialLicense": + *v = new(GetLicenseInstalledLicenseTrialLicense) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing License.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetLicenseInstalledLicense: "%v"`, tn.TypeName) + } +} + +func __marshalGetLicenseInstalledLicense(v *GetLicenseInstalledLicense) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetLicenseInstalledLicenseOnPremLicense: + typename = "OnPremLicense" + + result := struct { + TypeName string `json:"__typename"` + *GetLicenseInstalledLicenseOnPremLicense + }{typename, v} + return json.Marshal(result) + case *GetLicenseInstalledLicenseTrialLicense: + typename = "TrialLicense" + + result := struct { + TypeName string `json:"__typename"` + *GetLicenseInstalledLicenseTrialLicense + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetLicenseInstalledLicense: "%T"`, v) + } +} + +// GetLicenseInstalledLicenseOnPremLicense includes the requested fields of the GraphQL type OnPremLicense. +// The GraphQL type's documentation follows. +// +// Represents information about a LogScale License. +type GetLicenseInstalledLicenseOnPremLicense struct { + Typename *string `json:"__typename"` + // Represents information about the LogScale instance. + ExpiresAt time.Time `json:"expiresAt"` + // Represents information about the LogScale instance. + IssuedAt time.Time `json:"issuedAt"` + // license id. + Uid string `json:"uid"` + // The name of the entity the license was issued to. + Owner string `json:"owner"` + // The maximum number of user accounts allowed in LogScale. Unlimited if undefined. + MaxUsers *int `json:"maxUsers"` +} + +// GetTypename returns GetLicenseInstalledLicenseOnPremLicense.Typename, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetTypename() *string { return v.Typename } + +// GetExpiresAt returns GetLicenseInstalledLicenseOnPremLicense.ExpiresAt, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetExpiresAt() time.Time { return v.ExpiresAt } + +// GetIssuedAt returns GetLicenseInstalledLicenseOnPremLicense.IssuedAt, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetIssuedAt() time.Time { return v.IssuedAt } + +// GetUid returns GetLicenseInstalledLicenseOnPremLicense.Uid, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetUid() string { return v.Uid } + +// GetOwner returns GetLicenseInstalledLicenseOnPremLicense.Owner, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetOwner() string { return v.Owner } + +// GetMaxUsers returns GetLicenseInstalledLicenseOnPremLicense.MaxUsers, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseOnPremLicense) GetMaxUsers() *int { return v.MaxUsers } + +// GetLicenseInstalledLicenseTrialLicense includes the requested fields of the GraphQL type TrialLicense. +// The GraphQL type's documentation follows. +// +// Represents information about an on-going trial of LogScale. +type GetLicenseInstalledLicenseTrialLicense struct { + Typename *string `json:"__typename"` + // Represents information about the LogScale instance. + ExpiresAt time.Time `json:"expiresAt"` + // Represents information about the LogScale instance. + IssuedAt time.Time `json:"issuedAt"` +} + +// GetTypename returns GetLicenseInstalledLicenseTrialLicense.Typename, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseTrialLicense) GetTypename() *string { return v.Typename } + +// GetExpiresAt returns GetLicenseInstalledLicenseTrialLicense.ExpiresAt, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseTrialLicense) GetExpiresAt() time.Time { return v.ExpiresAt } + +// GetIssuedAt returns GetLicenseInstalledLicenseTrialLicense.IssuedAt, and is useful for accessing the field via an interface. +func (v *GetLicenseInstalledLicenseTrialLicense) GetIssuedAt() time.Time { return v.IssuedAt } + +// GetLicenseResponse is returned by GetLicense on success. +type GetLicenseResponse struct { + // This returns information about the license for the LogScale instance, if any license installed. + InstalledLicense *GetLicenseInstalledLicense `json:"-"` +} + +// GetInstalledLicense returns GetLicenseResponse.InstalledLicense, and is useful for accessing the field via an interface. +func (v *GetLicenseResponse) GetInstalledLicense() *GetLicenseInstalledLicense { + return v.InstalledLicense +} + +func (v *GetLicenseResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetLicenseResponse + InstalledLicense json.RawMessage `json:"installedLicense"` + graphql.NoUnmarshalJSON + } + firstPass.GetLicenseResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.InstalledLicense + src := firstPass.InstalledLicense + if len(src) != 0 && string(src) != "null" { + *dst = new(GetLicenseInstalledLicense) + err = __unmarshalGetLicenseInstalledLicense( + src, *dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetLicenseResponse.InstalledLicense: %w", err) + } + } + } + return nil +} + +type __premarshalGetLicenseResponse struct { + InstalledLicense json.RawMessage `json:"installedLicense"` +} + +func (v *GetLicenseResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetLicenseResponse) __premarshalJSON() (*__premarshalGetLicenseResponse, error) { + var retval __premarshalGetLicenseResponse + + { + + dst := &retval.InstalledLicense + src := v.InstalledLicense + if src != nil { + var err error + *dst, err = __marshalGetLicenseInstalledLicense( + src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetLicenseResponse.InstalledLicense: %w", err) + } + } + } + return &retval, nil +} + +// GetParserByIDRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetParserByIDRepository struct { + // A parser on the repository. + Parser *GetParserByIDRepositoryParser `json:"parser"` +} + +// GetParser returns GetParserByIDRepository.Parser, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepository) GetParser() *GetParserByIDRepositoryParser { return v.Parser } + +// GetParserByIDRepositoryParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type GetParserByIDRepositoryParser struct { + ParserDetails `json:"-"` +} + +// GetId returns GetParserByIDRepositoryParser.Id, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetId() string { return v.ParserDetails.Id } + +// GetName returns GetParserByIDRepositoryParser.Name, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetName() string { return v.ParserDetails.Name } + +// GetDisplayName returns GetParserByIDRepositoryParser.DisplayName, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetDisplayName() string { return v.ParserDetails.DisplayName } + +// GetDescription returns GetParserByIDRepositoryParser.Description, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetDescription() *string { return v.ParserDetails.Description } + +// GetIsBuiltIn returns GetParserByIDRepositoryParser.IsBuiltIn, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetIsBuiltIn() bool { return v.ParserDetails.IsBuiltIn } + +// GetScript returns GetParserByIDRepositoryParser.Script, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetScript() string { return v.ParserDetails.Script } + +// GetFieldsToTag returns GetParserByIDRepositoryParser.FieldsToTag, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetFieldsToTag() []string { return v.ParserDetails.FieldsToTag } + +// GetFieldsToBeRemovedBeforeParsing returns GetParserByIDRepositoryParser.FieldsToBeRemovedBeforeParsing, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetFieldsToBeRemovedBeforeParsing() []string { + return v.ParserDetails.FieldsToBeRemovedBeforeParsing +} + +// GetTestCases returns GetParserByIDRepositoryParser.TestCases, and is useful for accessing the field via an interface. +func (v *GetParserByIDRepositoryParser) GetTestCases() []ParserDetailsTestCasesParserTestCase { + return v.ParserDetails.TestCases +} + +func (v *GetParserByIDRepositoryParser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetParserByIDRepositoryParser + graphql.NoUnmarshalJSON + } + firstPass.GetParserByIDRepositoryParser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ParserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetParserByIDRepositoryParser struct { + Id string `json:"id"` + + Name string `json:"name"` + + DisplayName string `json:"displayName"` + + Description *string `json:"description"` + + IsBuiltIn bool `json:"isBuiltIn"` + + Script string `json:"script"` + + FieldsToTag []string `json:"fieldsToTag"` + + FieldsToBeRemovedBeforeParsing []string `json:"fieldsToBeRemovedBeforeParsing"` + + TestCases []ParserDetailsTestCasesParserTestCase `json:"testCases"` +} + +func (v *GetParserByIDRepositoryParser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetParserByIDRepositoryParser) __premarshalJSON() (*__premarshalGetParserByIDRepositoryParser, error) { + var retval __premarshalGetParserByIDRepositoryParser + + retval.Id = v.ParserDetails.Id + retval.Name = v.ParserDetails.Name + retval.DisplayName = v.ParserDetails.DisplayName + retval.Description = v.ParserDetails.Description + retval.IsBuiltIn = v.ParserDetails.IsBuiltIn + retval.Script = v.ParserDetails.Script + retval.FieldsToTag = v.ParserDetails.FieldsToTag + retval.FieldsToBeRemovedBeforeParsing = v.ParserDetails.FieldsToBeRemovedBeforeParsing + retval.TestCases = v.ParserDetails.TestCases + return &retval, nil +} + +// GetParserByIDResponse is returned by GetParserByID on success. +type GetParserByIDResponse struct { + // Lookup a given repository by name. + Repository GetParserByIDRepository `json:"repository"` +} + +// GetRepository returns GetParserByIDResponse.Repository, and is useful for accessing the field via an interface. +func (v *GetParserByIDResponse) GetRepository() GetParserByIDRepository { return v.Repository } + +// GetParserYAMLByNameRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetParserYAMLByNameRepository struct { + // A parser on the repository. + Parser *GetParserYAMLByNameRepositoryParser `json:"parser"` +} + +// GetParser returns GetParserYAMLByNameRepository.Parser, and is useful for accessing the field via an interface. +func (v *GetParserYAMLByNameRepository) GetParser() *GetParserYAMLByNameRepositoryParser { + return v.Parser +} + +// GetParserYAMLByNameRepositoryParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type GetParserYAMLByNameRepositoryParser struct { + // Name of the parser. + Name string `json:"name"` + // A template that can be used to recreate the parser. + YamlTemplate string `json:"yamlTemplate"` +} + +// GetName returns GetParserYAMLByNameRepositoryParser.Name, and is useful for accessing the field via an interface. +func (v *GetParserYAMLByNameRepositoryParser) GetName() string { return v.Name } + +// GetYamlTemplate returns GetParserYAMLByNameRepositoryParser.YamlTemplate, and is useful for accessing the field via an interface. +func (v *GetParserYAMLByNameRepositoryParser) GetYamlTemplate() string { return v.YamlTemplate } + +// GetParserYAMLByNameResponse is returned by GetParserYAMLByName on success. +type GetParserYAMLByNameResponse struct { + // Lookup a given repository by name. + Repository GetParserYAMLByNameRepository `json:"repository"` +} + +// GetRepository returns GetParserYAMLByNameResponse.Repository, and is useful for accessing the field via an interface. +func (v *GetParserYAMLByNameResponse) GetRepository() GetParserYAMLByNameRepository { + return v.Repository +} + +// GetRepositoryRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetRepositoryRepository struct { + RepositoryDetails `json:"-"` +} + +// GetId returns GetRepositoryRepository.Id, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetId() string { return v.RepositoryDetails.Id } + +// GetName returns GetRepositoryRepository.Name, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetName() string { return v.RepositoryDetails.Name } + +// GetDescription returns GetRepositoryRepository.Description, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetDescription() *string { return v.RepositoryDetails.Description } + +// GetTimeBasedRetention returns GetRepositoryRepository.TimeBasedRetention, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetTimeBasedRetention() *float64 { + return v.RepositoryDetails.TimeBasedRetention +} + +// GetIngestSizeBasedRetention returns GetRepositoryRepository.IngestSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetIngestSizeBasedRetention() *float64 { + return v.RepositoryDetails.IngestSizeBasedRetention +} + +// GetStorageSizeBasedRetention returns GetRepositoryRepository.StorageSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetStorageSizeBasedRetention() *float64 { + return v.RepositoryDetails.StorageSizeBasedRetention +} + +// GetCompressedByteSize returns GetRepositoryRepository.CompressedByteSize, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetCompressedByteSize() int64 { + return v.RepositoryDetails.CompressedByteSize +} + +// GetAutomaticSearch returns GetRepositoryRepository.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetAutomaticSearch() bool { + return v.RepositoryDetails.AutomaticSearch +} + +// GetS3ArchivingConfiguration returns GetRepositoryRepository.S3ArchivingConfiguration, and is useful for accessing the field via an interface. +func (v *GetRepositoryRepository) GetS3ArchivingConfiguration() *RepositoryDetailsS3ArchivingConfigurationS3Configuration { + return v.RepositoryDetails.S3ArchivingConfiguration +} + +func (v *GetRepositoryRepository) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetRepositoryRepository + graphql.NoUnmarshalJSON + } + firstPass.GetRepositoryRepository = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RepositoryDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetRepositoryRepository struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + TimeBasedRetention *float64 `json:"timeBasedRetention"` + + IngestSizeBasedRetention *float64 `json:"ingestSizeBasedRetention"` + + StorageSizeBasedRetention *float64 `json:"storageSizeBasedRetention"` + + CompressedByteSize int64 `json:"compressedByteSize"` + + AutomaticSearch bool `json:"automaticSearch"` + + S3ArchivingConfiguration *RepositoryDetailsS3ArchivingConfigurationS3Configuration `json:"s3ArchivingConfiguration"` +} + +func (v *GetRepositoryRepository) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetRepositoryRepository) __premarshalJSON() (*__premarshalGetRepositoryRepository, error) { + var retval __premarshalGetRepositoryRepository + + retval.Id = v.RepositoryDetails.Id + retval.Name = v.RepositoryDetails.Name + retval.Description = v.RepositoryDetails.Description + retval.TimeBasedRetention = v.RepositoryDetails.TimeBasedRetention + retval.IngestSizeBasedRetention = v.RepositoryDetails.IngestSizeBasedRetention + retval.StorageSizeBasedRetention = v.RepositoryDetails.StorageSizeBasedRetention + retval.CompressedByteSize = v.RepositoryDetails.CompressedByteSize + retval.AutomaticSearch = v.RepositoryDetails.AutomaticSearch + retval.S3ArchivingConfiguration = v.RepositoryDetails.S3ArchivingConfiguration + return &retval, nil +} + +// GetRepositoryResponse is returned by GetRepository on success. +type GetRepositoryResponse struct { + // Lookup a given repository by name. + Repository GetRepositoryRepository `json:"repository"` +} + +// GetRepository returns GetRepositoryResponse.Repository, and is useful for accessing the field via an interface. +func (v *GetRepositoryResponse) GetRepository() GetRepositoryRepository { return v.Repository } + +// GetRoleByIDResponse is returned by GetRoleByID on success. +type GetRoleByIDResponse struct { + // A given role. + Role GetRoleByIDRole `json:"role"` +} + +// GetRole returns GetRoleByIDResponse.Role, and is useful for accessing the field via an interface. +func (v *GetRoleByIDResponse) GetRole() GetRoleByIDRole { return v.Role } + +// GetRoleByIDRole includes the requested fields of the GraphQL type Role. +type GetRoleByIDRole struct { + RoleDetails `json:"-"` +} + +// GetId returns GetRoleByIDRole.Id, and is useful for accessing the field via an interface. +func (v *GetRoleByIDRole) GetId() string { return v.RoleDetails.Id } + +// GetDisplayName returns GetRoleByIDRole.DisplayName, and is useful for accessing the field via an interface. +func (v *GetRoleByIDRole) GetDisplayName() string { return v.RoleDetails.DisplayName } + +// GetViewPermissions returns GetRoleByIDRole.ViewPermissions, and is useful for accessing the field via an interface. +func (v *GetRoleByIDRole) GetViewPermissions() []Permission { return v.RoleDetails.ViewPermissions } + +// GetOrganizationPermissions returns GetRoleByIDRole.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *GetRoleByIDRole) GetOrganizationPermissions() []OrganizationPermission { + return v.RoleDetails.OrganizationPermissions +} + +// GetSystemPermissions returns GetRoleByIDRole.SystemPermissions, and is useful for accessing the field via an interface. +func (v *GetRoleByIDRole) GetSystemPermissions() []SystemPermission { + return v.RoleDetails.SystemPermissions +} + +func (v *GetRoleByIDRole) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetRoleByIDRole + graphql.NoUnmarshalJSON + } + firstPass.GetRoleByIDRole = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RoleDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetRoleByIDRole struct { + Id string `json:"id"` + + DisplayName string `json:"displayName"` + + ViewPermissions []Permission `json:"viewPermissions"` + + OrganizationPermissions []OrganizationPermission `json:"organizationPermissions"` + + SystemPermissions []SystemPermission `json:"systemPermissions"` +} + +func (v *GetRoleByIDRole) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetRoleByIDRole) __premarshalJSON() (*__premarshalGetRoleByIDRole, error) { + var retval __premarshalGetRoleByIDRole + + retval.Id = v.RoleDetails.Id + retval.DisplayName = v.RoleDetails.DisplayName + retval.ViewPermissions = v.RoleDetails.ViewPermissions + retval.OrganizationPermissions = v.RoleDetails.OrganizationPermissions + retval.SystemPermissions = v.RoleDetails.SystemPermissions + return &retval, nil +} + +// GetScheduledSearchByIDResponse is returned by GetScheduledSearchByID on success. +type GetScheduledSearchByIDResponse struct { + SearchDomain GetScheduledSearchByIDSearchDomain `json:"-"` +} + +// GetSearchDomain returns GetScheduledSearchByIDResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDResponse) GetSearchDomain() GetScheduledSearchByIDSearchDomain { + return v.SearchDomain +} + +func (v *GetScheduledSearchByIDResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetScheduledSearchByIDResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.GetScheduledSearchByIDResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetScheduledSearchByIDSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetScheduledSearchByIDResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalGetScheduledSearchByIDResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *GetScheduledSearchByIDResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetScheduledSearchByIDResponse) __premarshalJSON() (*__premarshalGetScheduledSearchByIDResponse, error) { + var retval __premarshalGetScheduledSearchByIDResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalGetScheduledSearchByIDSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetScheduledSearchByIDResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// GetScheduledSearchByIDSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// GetScheduledSearchByIDSearchDomain is implemented by the following types: +// GetScheduledSearchByIDSearchDomainRepository +// GetScheduledSearchByIDSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type GetScheduledSearchByIDSearchDomain interface { + implementsGraphQLInterfaceGetScheduledSearchByIDSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetScheduledSearch returns the interface-field "scheduledSearch" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetScheduledSearch() GetScheduledSearchByIDSearchDomainScheduledSearch +} + +func (v *GetScheduledSearchByIDSearchDomainRepository) implementsGraphQLInterfaceGetScheduledSearchByIDSearchDomain() { +} +func (v *GetScheduledSearchByIDSearchDomainView) implementsGraphQLInterfaceGetScheduledSearchByIDSearchDomain() { +} + +func __unmarshalGetScheduledSearchByIDSearchDomain(b []byte, v *GetScheduledSearchByIDSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(GetScheduledSearchByIDSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(GetScheduledSearchByIDSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetScheduledSearchByIDSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalGetScheduledSearchByIDSearchDomain(v *GetScheduledSearchByIDSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetScheduledSearchByIDSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *GetScheduledSearchByIDSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *GetScheduledSearchByIDSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *GetScheduledSearchByIDSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetScheduledSearchByIDSearchDomain: "%T"`, v) + } +} + +// GetScheduledSearchByIDSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetScheduledSearchByIDSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + ScheduledSearch GetScheduledSearchByIDSearchDomainScheduledSearch `json:"scheduledSearch"` +} + +// GetTypename returns GetScheduledSearchByIDSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetScheduledSearch returns GetScheduledSearchByIDSearchDomainRepository.ScheduledSearch, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainRepository) GetScheduledSearch() GetScheduledSearchByIDSearchDomainScheduledSearch { + return v.ScheduledSearch +} + +// GetScheduledSearchByIDSearchDomainScheduledSearch includes the requested fields of the GraphQL type ScheduledSearch. +// The GraphQL type's documentation follows. +// +// Information about a scheduled search +type GetScheduledSearchByIDSearchDomainScheduledSearch struct { + ScheduledSearchDetails `json:"-"` +} + +// GetId returns GetScheduledSearchByIDSearchDomainScheduledSearch.Id, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetId() string { + return v.ScheduledSearchDetails.Id +} + +// GetName returns GetScheduledSearchByIDSearchDomainScheduledSearch.Name, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetName() string { + return v.ScheduledSearchDetails.Name +} + +// GetDescription returns GetScheduledSearchByIDSearchDomainScheduledSearch.Description, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetDescription() *string { + return v.ScheduledSearchDetails.Description +} + +// GetQueryString returns GetScheduledSearchByIDSearchDomainScheduledSearch.QueryString, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetQueryString() string { + return v.ScheduledSearchDetails.QueryString +} + +// GetStart returns GetScheduledSearchByIDSearchDomainScheduledSearch.Start, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetStart() string { + return v.ScheduledSearchDetails.Start +} + +// GetEnd returns GetScheduledSearchByIDSearchDomainScheduledSearch.End, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetEnd() string { + return v.ScheduledSearchDetails.End +} + +// GetTimeZone returns GetScheduledSearchByIDSearchDomainScheduledSearch.TimeZone, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetTimeZone() string { + return v.ScheduledSearchDetails.TimeZone +} + +// GetSchedule returns GetScheduledSearchByIDSearchDomainScheduledSearch.Schedule, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetSchedule() string { + return v.ScheduledSearchDetails.Schedule +} + +// GetBackfillLimit returns GetScheduledSearchByIDSearchDomainScheduledSearch.BackfillLimit, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetBackfillLimit() int { + return v.ScheduledSearchDetails.BackfillLimit +} + +// GetEnabled returns GetScheduledSearchByIDSearchDomainScheduledSearch.Enabled, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetEnabled() bool { + return v.ScheduledSearchDetails.Enabled +} + +// GetActionsV2 returns GetScheduledSearchByIDSearchDomainScheduledSearch.ActionsV2, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetActionsV2() []ScheduledSearchDetailsActionsV2Action { + return v.ScheduledSearchDetails.ActionsV2 +} + +// GetLabels returns GetScheduledSearchByIDSearchDomainScheduledSearch.Labels, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetLabels() []string { + return v.ScheduledSearchDetails.Labels +} + +// GetQueryOwnership returns GetScheduledSearchByIDSearchDomainScheduledSearch.QueryOwnership, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) GetQueryOwnership() SharedQueryOwnershipType { + return v.ScheduledSearchDetails.QueryOwnership +} + +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetScheduledSearchByIDSearchDomainScheduledSearch + graphql.NoUnmarshalJSON + } + firstPass.GetScheduledSearchByIDSearchDomainScheduledSearch = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ScheduledSearchDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetScheduledSearchByIDSearchDomainScheduledSearch struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + Start string `json:"start"` + + End string `json:"end"` + + TimeZone string `json:"timeZone"` + + Schedule string `json:"schedule"` + + BackfillLimit int `json:"backfillLimit"` + + Enabled bool `json:"enabled"` + + ActionsV2 []json.RawMessage `json:"actionsV2"` + + Labels []string `json:"labels"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetScheduledSearchByIDSearchDomainScheduledSearch) __premarshalJSON() (*__premarshalGetScheduledSearchByIDSearchDomainScheduledSearch, error) { + var retval __premarshalGetScheduledSearchByIDSearchDomainScheduledSearch + + retval.Id = v.ScheduledSearchDetails.Id + retval.Name = v.ScheduledSearchDetails.Name + retval.Description = v.ScheduledSearchDetails.Description + retval.QueryString = v.ScheduledSearchDetails.QueryString + retval.Start = v.ScheduledSearchDetails.Start + retval.End = v.ScheduledSearchDetails.End + retval.TimeZone = v.ScheduledSearchDetails.TimeZone + retval.Schedule = v.ScheduledSearchDetails.Schedule + retval.BackfillLimit = v.ScheduledSearchDetails.BackfillLimit + retval.Enabled = v.ScheduledSearchDetails.Enabled + { + + dst := &retval.ActionsV2 + src := v.ScheduledSearchDetails.ActionsV2 + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalScheduledSearchDetailsActionsV2Action( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetScheduledSearchByIDSearchDomainScheduledSearch.ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + retval.Labels = v.ScheduledSearchDetails.Labels + { + + dst := &retval.QueryOwnership + src := v.ScheduledSearchDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetScheduledSearchByIDSearchDomainScheduledSearch.ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// GetScheduledSearchByIDSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type GetScheduledSearchByIDSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + ScheduledSearch GetScheduledSearchByIDSearchDomainScheduledSearch `json:"scheduledSearch"` +} + +// GetTypename returns GetScheduledSearchByIDSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainView) GetTypename() *string { return v.Typename } + +// GetScheduledSearch returns GetScheduledSearchByIDSearchDomainView.ScheduledSearch, and is useful for accessing the field via an interface. +func (v *GetScheduledSearchByIDSearchDomainView) GetScheduledSearch() GetScheduledSearchByIDSearchDomainScheduledSearch { + return v.ScheduledSearch +} + +// GetSearchDomainResponse is returned by GetSearchDomain on success. +type GetSearchDomainResponse struct { + SearchDomain GetSearchDomainSearchDomain `json:"-"` +} + +// GetSearchDomain returns GetSearchDomainResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *GetSearchDomainResponse) GetSearchDomain() GetSearchDomainSearchDomain { + return v.SearchDomain +} + +func (v *GetSearchDomainResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetSearchDomainResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.GetSearchDomainResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetSearchDomainSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetSearchDomainResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalGetSearchDomainResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *GetSearchDomainResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetSearchDomainResponse) __premarshalJSON() (*__premarshalGetSearchDomainResponse, error) { + var retval __premarshalGetSearchDomainResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalGetSearchDomainSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetSearchDomainResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// GetSearchDomainSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// GetSearchDomainSearchDomain is implemented by the following types: +// GetSearchDomainSearchDomainRepository +// GetSearchDomainSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type GetSearchDomainSearchDomain interface { + implementsGraphQLInterfaceGetSearchDomainSearchDomain() + // GetId returns the interface-field "id" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetId() string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetName() string + // GetDescription returns the interface-field "description" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetDescription() *string + // GetAutomaticSearch returns the interface-field "automaticSearch" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAutomaticSearch() bool + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string +} + +func (v *GetSearchDomainSearchDomainRepository) implementsGraphQLInterfaceGetSearchDomainSearchDomain() { +} +func (v *GetSearchDomainSearchDomainView) implementsGraphQLInterfaceGetSearchDomainSearchDomain() {} + +func __unmarshalGetSearchDomainSearchDomain(b []byte, v *GetSearchDomainSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(GetSearchDomainSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(GetSearchDomainSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetSearchDomainSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalGetSearchDomainSearchDomain(v *GetSearchDomainSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetSearchDomainSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *GetSearchDomainSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *GetSearchDomainSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *GetSearchDomainSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetSearchDomainSearchDomain: "%T"`, v) + } +} + +// GetSearchDomainSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetSearchDomainSearchDomainRepository struct { + // Common interface for Repositories and Views. + Id string `json:"id"` + // Common interface for Repositories and Views. + Name string `json:"name"` + // Common interface for Repositories and Views. + Description *string `json:"description"` + // Common interface for Repositories and Views. + AutomaticSearch bool `json:"automaticSearch"` + Typename *string `json:"__typename"` +} + +// GetId returns GetSearchDomainSearchDomainRepository.Id, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainRepository) GetId() string { return v.Id } + +// GetName returns GetSearchDomainSearchDomainRepository.Name, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainRepository) GetName() string { return v.Name } + +// GetDescription returns GetSearchDomainSearchDomainRepository.Description, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainRepository) GetDescription() *string { return v.Description } + +// GetAutomaticSearch returns GetSearchDomainSearchDomainRepository.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainRepository) GetAutomaticSearch() bool { return v.AutomaticSearch } + +// GetTypename returns GetSearchDomainSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetSearchDomainSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type GetSearchDomainSearchDomainView struct { + // Common interface for Repositories and Views. + Id string `json:"id"` + // Common interface for Repositories and Views. + Name string `json:"name"` + // Common interface for Repositories and Views. + Description *string `json:"description"` + // Common interface for Repositories and Views. + AutomaticSearch bool `json:"automaticSearch"` + Connections []GetSearchDomainSearchDomainViewConnectionsViewConnection `json:"connections"` + Typename *string `json:"__typename"` +} + +// GetId returns GetSearchDomainSearchDomainView.Id, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetId() string { return v.Id } + +// GetName returns GetSearchDomainSearchDomainView.Name, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetName() string { return v.Name } + +// GetDescription returns GetSearchDomainSearchDomainView.Description, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetDescription() *string { return v.Description } + +// GetAutomaticSearch returns GetSearchDomainSearchDomainView.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetAutomaticSearch() bool { return v.AutomaticSearch } + +// GetConnections returns GetSearchDomainSearchDomainView.Connections, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetConnections() []GetSearchDomainSearchDomainViewConnectionsViewConnection { + return v.Connections +} + +// GetTypename returns GetSearchDomainSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainView) GetTypename() *string { return v.Typename } + +// GetSearchDomainSearchDomainViewConnectionsViewConnection includes the requested fields of the GraphQL type ViewConnection. +// The GraphQL type's documentation follows. +// +// Represents the connection between a view and an underlying repository. +type GetSearchDomainSearchDomainViewConnectionsViewConnection struct { + // The underlying repository + Repository GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository `json:"repository"` + // The filter applied to all results from the repository. + Filter string `json:"filter"` +} + +// GetRepository returns GetSearchDomainSearchDomainViewConnectionsViewConnection.Repository, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainViewConnectionsViewConnection) GetRepository() GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository { + return v.Repository +} + +// GetFilter returns GetSearchDomainSearchDomainViewConnectionsViewConnection.Filter, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainViewConnectionsViewConnection) GetFilter() string { + return v.Filter +} + +// GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository struct { + Name string `json:"name"` +} + +// GetName returns GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository.Name, and is useful for accessing the field via an interface. +func (v *GetSearchDomainSearchDomainViewConnectionsViewConnectionRepository) GetName() string { + return v.Name +} + +// GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2 includes the requested fields of the GraphQL type FeatureFlagV2. +// The GraphQL type's documentation follows. +// +// Feature flags with details +type GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2 struct { + Flag FeatureFlag `json:"flag"` + Experimental bool `json:"experimental"` + Description string `json:"description"` +} + +// GetFlag returns GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2.Flag, and is useful for accessing the field via an interface. +func (v *GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2) GetFlag() FeatureFlag { return v.Flag } + +// GetExperimental returns GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2.Experimental, and is useful for accessing the field via an interface. +func (v *GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2) GetExperimental() bool { + return v.Experimental +} + +// GetDescription returns GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2.Description, and is useful for accessing the field via an interface. +func (v *GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2) GetDescription() string { + return v.Description +} + +// GetSupportedFeatureFlagsResponse is returned by GetSupportedFeatureFlags on success. +type GetSupportedFeatureFlagsResponse struct { + // [PREVIEW: All flags should be considered as beta features. Enabling features that are marked as experimental is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] List feature flags depending on filters and context + FeatureFlags []GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2 `json:"featureFlags"` +} + +// GetFeatureFlags returns GetSupportedFeatureFlagsResponse.FeatureFlags, and is useful for accessing the field via an interface. +func (v *GetSupportedFeatureFlagsResponse) GetFeatureFlags() []GetSupportedFeatureFlagsFeatureFlagsFeatureFlagV2 { + return v.FeatureFlags +} + +// GetUsernameResponse is returned by GetUsername on success. +type GetUsernameResponse struct { + // The currently authenticated user's account. + Viewer GetUsernameViewerAccount `json:"viewer"` +} + +// GetViewer returns GetUsernameResponse.Viewer, and is useful for accessing the field via an interface. +func (v *GetUsernameResponse) GetViewer() GetUsernameViewerAccount { return v.Viewer } + +// GetUsernameViewerAccount includes the requested fields of the GraphQL type Account. +// The GraphQL type's documentation follows. +// +// A user account. +type GetUsernameViewerAccount struct { + Username string `json:"username"` +} + +// GetUsername returns GetUsernameViewerAccount.Username, and is useful for accessing the field via an interface. +func (v *GetUsernameViewerAccount) GetUsername() string { return v.Username } + +// GetUsersByUsernameResponse is returned by GetUsersByUsername on success. +type GetUsersByUsernameResponse struct { + // Requires manage cluster permission; Returns all users in the system. + Users []GetUsersByUsernameUsersUser `json:"users"` +} + +// GetUsers returns GetUsersByUsernameResponse.Users, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameResponse) GetUsers() []GetUsersByUsernameUsersUser { return v.Users } + +// GetUsersByUsernameUsersUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user profile. +type GetUsersByUsernameUsersUser struct { + UserDetails `json:"-"` +} + +// GetId returns GetUsersByUsernameUsersUser.Id, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetId() string { return v.UserDetails.Id } + +// GetUsername returns GetUsersByUsernameUsersUser.Username, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetUsername() string { return v.UserDetails.Username } + +// GetFullName returns GetUsersByUsernameUsersUser.FullName, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetFullName() *string { return v.UserDetails.FullName } + +// GetEmail returns GetUsersByUsernameUsersUser.Email, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetEmail() *string { return v.UserDetails.Email } + +// GetCompany returns GetUsersByUsernameUsersUser.Company, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetCompany() *string { return v.UserDetails.Company } + +// GetCountryCode returns GetUsersByUsernameUsersUser.CountryCode, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetCountryCode() *string { return v.UserDetails.CountryCode } + +// GetPicture returns GetUsersByUsernameUsersUser.Picture, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetPicture() *string { return v.UserDetails.Picture } + +// GetIsRoot returns GetUsersByUsernameUsersUser.IsRoot, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetIsRoot() bool { return v.UserDetails.IsRoot } + +// GetCreatedAt returns GetUsersByUsernameUsersUser.CreatedAt, and is useful for accessing the field via an interface. +func (v *GetUsersByUsernameUsersUser) GetCreatedAt() time.Time { return v.UserDetails.CreatedAt } + +func (v *GetUsersByUsernameUsersUser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetUsersByUsernameUsersUser + graphql.NoUnmarshalJSON + } + firstPass.GetUsersByUsernameUsersUser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalGetUsersByUsernameUsersUser struct { + Id string `json:"id"` + + Username string `json:"username"` + + FullName *string `json:"fullName"` + + Email *string `json:"email"` + + Company *string `json:"company"` + + CountryCode *string `json:"countryCode"` + + Picture *string `json:"picture"` + + IsRoot bool `json:"isRoot"` + + CreatedAt time.Time `json:"createdAt"` +} + +func (v *GetUsersByUsernameUsersUser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetUsersByUsernameUsersUser) __premarshalJSON() (*__premarshalGetUsersByUsernameUsersUser, error) { + var retval __premarshalGetUsersByUsernameUsersUser + + retval.Id = v.UserDetails.Id + retval.Username = v.UserDetails.Username + retval.FullName = v.UserDetails.FullName + retval.Email = v.UserDetails.Email + retval.Company = v.UserDetails.Company + retval.CountryCode = v.UserDetails.CountryCode + retval.Picture = v.UserDetails.Picture + retval.IsRoot = v.UserDetails.IsRoot + retval.CreatedAt = v.UserDetails.CreatedAt + return &retval, nil +} + +// Http(s) Header entry. +type HttpHeaderEntryInput struct { + // Http(s) Header entry. + Header string `json:"header"` + // Http(s) Header entry. + Value string `json:"value"` +} + +// GetHeader returns HttpHeaderEntryInput.Header, and is useful for accessing the field via an interface. +func (v *HttpHeaderEntryInput) GetHeader() string { return v.Header } + +// GetValue returns HttpHeaderEntryInput.Value, and is useful for accessing the field via an interface. +func (v *HttpHeaderEntryInput) GetValue() string { return v.Value } + +// IngestTokenDetails includes the GraphQL fields of IngestToken requested by the fragment IngestTokenDetails. +// The GraphQL type's documentation follows. +// +// An API ingest token used for sending data to LogScale. +type IngestTokenDetails struct { + Name string `json:"name"` + Token string `json:"token"` + Parser *IngestTokenDetailsParser `json:"parser"` +} + +// GetName returns IngestTokenDetails.Name, and is useful for accessing the field via an interface. +func (v *IngestTokenDetails) GetName() string { return v.Name } + +// GetToken returns IngestTokenDetails.Token, and is useful for accessing the field via an interface. +func (v *IngestTokenDetails) GetToken() string { return v.Token } + +// GetParser returns IngestTokenDetails.Parser, and is useful for accessing the field via an interface. +func (v *IngestTokenDetails) GetParser() *IngestTokenDetailsParser { return v.Parser } + +// IngestTokenDetailsParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type IngestTokenDetailsParser struct { + // Name of the parser. + Name string `json:"name"` +} + +// GetName returns IngestTokenDetailsParser.Name, and is useful for accessing the field via an interface. +func (v *IngestTokenDetailsParser) GetName() string { return v.Name } + +// The version of the LogScale query language to use. +type LanguageVersionEnum string + +const ( + LanguageVersionEnumLegacy LanguageVersionEnum = "legacy" + LanguageVersionEnumXdr1 LanguageVersionEnum = "xdr1" + LanguageVersionEnumXdrdetects1 LanguageVersionEnum = "xdrdetects1" + LanguageVersionEnumFilteralert LanguageVersionEnum = "filteralert" + LanguageVersionEnumFederated1 LanguageVersionEnum = "federated1" +) + +// LegacyCreateParserCreateParserCreateParserMutation includes the requested fields of the GraphQL type CreateParserMutation. +type LegacyCreateParserCreateParserCreateParserMutation struct { + Parser LegacyCreateParserCreateParserCreateParserMutationParser `json:"parser"` +} + +// GetParser returns LegacyCreateParserCreateParserCreateParserMutation.Parser, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutation) GetParser() LegacyCreateParserCreateParserCreateParserMutationParser { + return v.Parser +} + +// LegacyCreateParserCreateParserCreateParserMutationParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type LegacyCreateParserCreateParserCreateParserMutationParser struct { + ParserDetails `json:"-"` +} + +// GetId returns LegacyCreateParserCreateParserCreateParserMutationParser.Id, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetId() string { + return v.ParserDetails.Id +} + +// GetName returns LegacyCreateParserCreateParserCreateParserMutationParser.Name, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetName() string { + return v.ParserDetails.Name +} + +// GetDisplayName returns LegacyCreateParserCreateParserCreateParserMutationParser.DisplayName, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetDisplayName() string { + return v.ParserDetails.DisplayName +} + +// GetDescription returns LegacyCreateParserCreateParserCreateParserMutationParser.Description, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetDescription() *string { + return v.ParserDetails.Description +} + +// GetIsBuiltIn returns LegacyCreateParserCreateParserCreateParserMutationParser.IsBuiltIn, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetIsBuiltIn() bool { + return v.ParserDetails.IsBuiltIn +} + +// GetScript returns LegacyCreateParserCreateParserCreateParserMutationParser.Script, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetScript() string { + return v.ParserDetails.Script +} + +// GetFieldsToTag returns LegacyCreateParserCreateParserCreateParserMutationParser.FieldsToTag, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetFieldsToTag() []string { + return v.ParserDetails.FieldsToTag +} + +// GetFieldsToBeRemovedBeforeParsing returns LegacyCreateParserCreateParserCreateParserMutationParser.FieldsToBeRemovedBeforeParsing, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetFieldsToBeRemovedBeforeParsing() []string { + return v.ParserDetails.FieldsToBeRemovedBeforeParsing +} + +// GetTestCases returns LegacyCreateParserCreateParserCreateParserMutationParser.TestCases, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) GetTestCases() []ParserDetailsTestCasesParserTestCase { + return v.ParserDetails.TestCases +} + +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LegacyCreateParserCreateParserCreateParserMutationParser + graphql.NoUnmarshalJSON + } + firstPass.LegacyCreateParserCreateParserCreateParserMutationParser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ParserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalLegacyCreateParserCreateParserCreateParserMutationParser struct { + Id string `json:"id"` + + Name string `json:"name"` + + DisplayName string `json:"displayName"` + + Description *string `json:"description"` + + IsBuiltIn bool `json:"isBuiltIn"` + + Script string `json:"script"` + + FieldsToTag []string `json:"fieldsToTag"` + + FieldsToBeRemovedBeforeParsing []string `json:"fieldsToBeRemovedBeforeParsing"` + + TestCases []ParserDetailsTestCasesParserTestCase `json:"testCases"` +} + +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LegacyCreateParserCreateParserCreateParserMutationParser) __premarshalJSON() (*__premarshalLegacyCreateParserCreateParserCreateParserMutationParser, error) { + var retval __premarshalLegacyCreateParserCreateParserCreateParserMutationParser + + retval.Id = v.ParserDetails.Id + retval.Name = v.ParserDetails.Name + retval.DisplayName = v.ParserDetails.DisplayName + retval.Description = v.ParserDetails.Description + retval.IsBuiltIn = v.ParserDetails.IsBuiltIn + retval.Script = v.ParserDetails.Script + retval.FieldsToTag = v.ParserDetails.FieldsToTag + retval.FieldsToBeRemovedBeforeParsing = v.ParserDetails.FieldsToBeRemovedBeforeParsing + retval.TestCases = v.ParserDetails.TestCases + return &retval, nil +} + +// LegacyCreateParserResponse is returned by LegacyCreateParser on success. +type LegacyCreateParserResponse struct { + // Create a parser. + CreateParser LegacyCreateParserCreateParserCreateParserMutation `json:"createParser"` +} + +// GetCreateParser returns LegacyCreateParserResponse.CreateParser, and is useful for accessing the field via an interface. +func (v *LegacyCreateParserResponse) GetCreateParser() LegacyCreateParserCreateParserCreateParserMutation { + return v.CreateParser +} + +// LegacyDeleteParserByIDRemoveParserRemoveParserMutation includes the requested fields of the GraphQL type RemoveParserMutation. +type LegacyDeleteParserByIDRemoveParserRemoveParserMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns LegacyDeleteParserByIDRemoveParserRemoveParserMutation.Typename, and is useful for accessing the field via an interface. +func (v *LegacyDeleteParserByIDRemoveParserRemoveParserMutation) GetTypename() *string { + return v.Typename +} + +// LegacyDeleteParserByIDResponse is returned by LegacyDeleteParserByID on success. +type LegacyDeleteParserByIDResponse struct { + // Remove a parser. + RemoveParser LegacyDeleteParserByIDRemoveParserRemoveParserMutation `json:"removeParser"` +} + +// GetRemoveParser returns LegacyDeleteParserByIDResponse.RemoveParser, and is useful for accessing the field via an interface. +func (v *LegacyDeleteParserByIDResponse) GetRemoveParser() LegacyDeleteParserByIDRemoveParserRemoveParserMutation { + return v.RemoveParser +} + +// LegacyGetParserRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type LegacyGetParserRepository struct { + // A parser on the repository. + Parser *LegacyGetParserRepositoryParser `json:"parser"` +} + +// GetParser returns LegacyGetParserRepository.Parser, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepository) GetParser() *LegacyGetParserRepositoryParser { return v.Parser } + +// LegacyGetParserRepositoryParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type LegacyGetParserRepositoryParser struct { + // The id of the parser. + Id string `json:"id"` + // Name of the parser. + Name string `json:"name"` + // The source code of the parser. + SourceCode string `json:"sourceCode"` + // Saved test data (e.g. log lines) that you can use to test the parser. + TestData []string `json:"testData"` + // The fields to use as tags. + TagFields []string `json:"tagFields"` +} + +// GetId returns LegacyGetParserRepositoryParser.Id, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepositoryParser) GetId() string { return v.Id } + +// GetName returns LegacyGetParserRepositoryParser.Name, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepositoryParser) GetName() string { return v.Name } + +// GetSourceCode returns LegacyGetParserRepositoryParser.SourceCode, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepositoryParser) GetSourceCode() string { return v.SourceCode } + +// GetTestData returns LegacyGetParserRepositoryParser.TestData, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepositoryParser) GetTestData() []string { return v.TestData } + +// GetTagFields returns LegacyGetParserRepositoryParser.TagFields, and is useful for accessing the field via an interface. +func (v *LegacyGetParserRepositoryParser) GetTagFields() []string { return v.TagFields } + +// LegacyGetParserResponse is returned by LegacyGetParser on success. +type LegacyGetParserResponse struct { + // Lookup a given repository by name. + Repository LegacyGetParserRepository `json:"repository"` +} + +// GetRepository returns LegacyGetParserResponse.Repository, and is useful for accessing the field via an interface. +func (v *LegacyGetParserResponse) GetRepository() LegacyGetParserRepository { return v.Repository } + +// ListActionsResponse is returned by ListActions on success. +type ListActionsResponse struct { + SearchDomain ListActionsSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListActionsResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListActionsResponse) GetSearchDomain() ListActionsSearchDomain { return v.SearchDomain } + +func (v *ListActionsResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListActionsResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListActionsSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListActionsResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListActionsResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListActionsResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsResponse) __premarshalJSON() (*__premarshalListActionsResponse, error) { + var retval __premarshalListActionsResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListActionsSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListActionsResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListActionsSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListActionsSearchDomain is implemented by the following types: +// ListActionsSearchDomainRepository +// ListActionsSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListActionsSearchDomain interface { + implementsGraphQLInterfaceListActionsSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetActions returns the interface-field "actions" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetActions() []ListActionsSearchDomainActionsAction +} + +func (v *ListActionsSearchDomainRepository) implementsGraphQLInterfaceListActionsSearchDomain() {} +func (v *ListActionsSearchDomainView) implementsGraphQLInterfaceListActionsSearchDomain() {} + +func __unmarshalListActionsSearchDomain(b []byte, v *ListActionsSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListActionsSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListActionsSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListActionsSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListActionsSearchDomain(v *ListActionsSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListActionsSearchDomainRepository: + typename = "Repository" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainRepository + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainView: + typename = "View" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainView + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListActionsSearchDomain: "%T"`, v) + } +} + +// ListActionsSearchDomainActionsAction includes the requested fields of the GraphQL interface Action. +// +// ListActionsSearchDomainActionsAction is implemented by the following types: +// ListActionsSearchDomainActionsEmailAction +// ListActionsSearchDomainActionsHumioRepoAction +// ListActionsSearchDomainActionsOpsGenieAction +// ListActionsSearchDomainActionsPagerDutyAction +// ListActionsSearchDomainActionsSlackAction +// ListActionsSearchDomainActionsSlackPostMessageAction +// ListActionsSearchDomainActionsUploadFileAction +// ListActionsSearchDomainActionsVictorOpsAction +// ListActionsSearchDomainActionsWebhookAction +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ListActionsSearchDomainActionsAction interface { + implementsGraphQLInterfaceListActionsSearchDomainActionsAction() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + ActionDetails +} + +func (v *ListActionsSearchDomainActionsEmailAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsHumioRepoAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsOpsGenieAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsPagerDutyAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsSlackAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsUploadFileAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsVictorOpsAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} +func (v *ListActionsSearchDomainActionsWebhookAction) implementsGraphQLInterfaceListActionsSearchDomainActionsAction() { +} + +func __unmarshalListActionsSearchDomainActionsAction(b []byte, v *ListActionsSearchDomainActionsAction) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(ListActionsSearchDomainActionsEmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(ListActionsSearchDomainActionsHumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(ListActionsSearchDomainActionsOpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(ListActionsSearchDomainActionsPagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(ListActionsSearchDomainActionsSlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(ListActionsSearchDomainActionsSlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(ListActionsSearchDomainActionsUploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(ListActionsSearchDomainActionsVictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(ListActionsSearchDomainActionsWebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListActionsSearchDomainActionsAction: "%v"`, tn.TypeName) + } +} + +func __marshalListActionsSearchDomainActionsAction(v *ListActionsSearchDomainActionsAction) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListActionsSearchDomainActionsEmailAction: + typename = "EmailAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsEmailAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsHumioRepoAction: + typename = "HumioRepoAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsHumioRepoAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsOpsGenieAction: + typename = "OpsGenieAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsOpsGenieAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsPagerDutyAction: + typename = "PagerDutyAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsPagerDutyAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsSlackAction: + typename = "SlackAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsSlackAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsSlackPostMessageAction: + typename = "SlackPostMessageAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsSlackPostMessageAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsUploadFileAction: + typename = "UploadFileAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsUploadFileAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsVictorOpsAction: + typename = "VictorOpsAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsVictorOpsAction + }{typename, premarshaled} + return json.Marshal(result) + case *ListActionsSearchDomainActionsWebhookAction: + typename = "WebhookAction" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalListActionsSearchDomainActionsWebhookAction + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListActionsSearchDomainActionsAction: "%T"`, v) + } +} + +// ListActionsSearchDomainActionsEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type ListActionsSearchDomainActionsEmailAction struct { + Typename *string `json:"__typename"` + ActionDetailsEmailAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsEmailAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsEmailAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetId() string { + return v.ActionDetailsEmailAction.Id +} + +// GetName returns ListActionsSearchDomainActionsEmailAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetName() string { + return v.ActionDetailsEmailAction.Name +} + +// GetRecipients returns ListActionsSearchDomainActionsEmailAction.Recipients, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetRecipients() []string { + return v.ActionDetailsEmailAction.Recipients +} + +// GetSubjectTemplate returns ListActionsSearchDomainActionsEmailAction.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetSubjectTemplate() *string { + return v.ActionDetailsEmailAction.SubjectTemplate +} + +// GetEmailBodyTemplate returns ListActionsSearchDomainActionsEmailAction.EmailBodyTemplate, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetEmailBodyTemplate() *string { + return v.ActionDetailsEmailAction.EmailBodyTemplate +} + +// GetUseProxy returns ListActionsSearchDomainActionsEmailAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsEmailAction) GetUseProxy() bool { + return v.ActionDetailsEmailAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsEmailAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsEmailAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsEmailAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsEmailAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsEmailAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Recipients []string `json:"recipients"` + + SubjectTemplate *string `json:"subjectTemplate"` + + EmailBodyTemplate *string `json:"emailBodyTemplate"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsEmailAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsEmailAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsEmailAction, error) { + var retval __premarshalListActionsSearchDomainActionsEmailAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsEmailAction.Id + retval.Name = v.ActionDetailsEmailAction.Name + retval.Recipients = v.ActionDetailsEmailAction.Recipients + retval.SubjectTemplate = v.ActionDetailsEmailAction.SubjectTemplate + retval.EmailBodyTemplate = v.ActionDetailsEmailAction.EmailBodyTemplate + retval.UseProxy = v.ActionDetailsEmailAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type ListActionsSearchDomainActionsHumioRepoAction struct { + Typename *string `json:"__typename"` + ActionDetailsHumioRepoAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsHumioRepoAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsHumioRepoAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsHumioRepoAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsHumioRepoAction) GetId() string { + return v.ActionDetailsHumioRepoAction.Id +} + +// GetName returns ListActionsSearchDomainActionsHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsHumioRepoAction) GetName() string { + return v.ActionDetailsHumioRepoAction.Name +} + +// GetIngestToken returns ListActionsSearchDomainActionsHumioRepoAction.IngestToken, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsHumioRepoAction) GetIngestToken() string { + return v.ActionDetailsHumioRepoAction.IngestToken +} + +func (v *ListActionsSearchDomainActionsHumioRepoAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsHumioRepoAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsHumioRepoAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsHumioRepoAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsHumioRepoAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + IngestToken string `json:"ingestToken"` +} + +func (v *ListActionsSearchDomainActionsHumioRepoAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsHumioRepoAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsHumioRepoAction, error) { + var retval __premarshalListActionsSearchDomainActionsHumioRepoAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsHumioRepoAction.Id + retval.Name = v.ActionDetailsHumioRepoAction.Name + retval.IngestToken = v.ActionDetailsHumioRepoAction.IngestToken + return &retval, nil +} + +// ListActionsSearchDomainActionsOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type ListActionsSearchDomainActionsOpsGenieAction struct { + Typename *string `json:"__typename"` + ActionDetailsOpsGenieAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsOpsGenieAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsOpsGenieAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetId() string { + return v.ActionDetailsOpsGenieAction.Id +} + +// GetName returns ListActionsSearchDomainActionsOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetName() string { + return v.ActionDetailsOpsGenieAction.Name +} + +// GetApiUrl returns ListActionsSearchDomainActionsOpsGenieAction.ApiUrl, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetApiUrl() string { + return v.ActionDetailsOpsGenieAction.ApiUrl +} + +// GetGenieKey returns ListActionsSearchDomainActionsOpsGenieAction.GenieKey, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetGenieKey() string { + return v.ActionDetailsOpsGenieAction.GenieKey +} + +// GetUseProxy returns ListActionsSearchDomainActionsOpsGenieAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsOpsGenieAction) GetUseProxy() bool { + return v.ActionDetailsOpsGenieAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsOpsGenieAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsOpsGenieAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsOpsGenieAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsOpsGenieAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsOpsGenieAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + ApiUrl string `json:"apiUrl"` + + GenieKey string `json:"genieKey"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsOpsGenieAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsOpsGenieAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsOpsGenieAction, error) { + var retval __premarshalListActionsSearchDomainActionsOpsGenieAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsOpsGenieAction.Id + retval.Name = v.ActionDetailsOpsGenieAction.Name + retval.ApiUrl = v.ActionDetailsOpsGenieAction.ApiUrl + retval.GenieKey = v.ActionDetailsOpsGenieAction.GenieKey + retval.UseProxy = v.ActionDetailsOpsGenieAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsPagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type ListActionsSearchDomainActionsPagerDutyAction struct { + Typename *string `json:"__typename"` + ActionDetailsPagerDutyAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsPagerDutyAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsPagerDutyAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetId() string { + return v.ActionDetailsPagerDutyAction.Id +} + +// GetName returns ListActionsSearchDomainActionsPagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetName() string { + return v.ActionDetailsPagerDutyAction.Name +} + +// GetSeverity returns ListActionsSearchDomainActionsPagerDutyAction.Severity, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetSeverity() string { + return v.ActionDetailsPagerDutyAction.Severity +} + +// GetRoutingKey returns ListActionsSearchDomainActionsPagerDutyAction.RoutingKey, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetRoutingKey() string { + return v.ActionDetailsPagerDutyAction.RoutingKey +} + +// GetUseProxy returns ListActionsSearchDomainActionsPagerDutyAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsPagerDutyAction) GetUseProxy() bool { + return v.ActionDetailsPagerDutyAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsPagerDutyAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsPagerDutyAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsPagerDutyAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsPagerDutyAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsPagerDutyAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Severity string `json:"severity"` + + RoutingKey string `json:"routingKey"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsPagerDutyAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsPagerDutyAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsPagerDutyAction, error) { + var retval __premarshalListActionsSearchDomainActionsPagerDutyAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsPagerDutyAction.Id + retval.Name = v.ActionDetailsPagerDutyAction.Name + retval.Severity = v.ActionDetailsPagerDutyAction.Severity + retval.RoutingKey = v.ActionDetailsPagerDutyAction.RoutingKey + retval.UseProxy = v.ActionDetailsPagerDutyAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type ListActionsSearchDomainActionsSlackAction struct { + Typename *string `json:"__typename"` + ActionDetailsSlackAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsSlackAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsSlackAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetId() string { + return v.ActionDetailsSlackAction.Id +} + +// GetName returns ListActionsSearchDomainActionsSlackAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetName() string { + return v.ActionDetailsSlackAction.Name +} + +// GetUrl returns ListActionsSearchDomainActionsSlackAction.Url, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetUrl() string { + return v.ActionDetailsSlackAction.Url +} + +// GetFields returns ListActionsSearchDomainActionsSlackAction.Fields, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { + return v.ActionDetailsSlackAction.Fields +} + +// GetUseProxy returns ListActionsSearchDomainActionsSlackAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackAction) GetUseProxy() bool { + return v.ActionDetailsSlackAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsSlackAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsSlackAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsSlackAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsSlackAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsSlackAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Url string `json:"url"` + + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsSlackAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsSlackAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsSlackAction, error) { + var retval __premarshalListActionsSearchDomainActionsSlackAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsSlackAction.Id + retval.Name = v.ActionDetailsSlackAction.Name + retval.Url = v.ActionDetailsSlackAction.Url + retval.Fields = v.ActionDetailsSlackAction.Fields + retval.UseProxy = v.ActionDetailsSlackAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type ListActionsSearchDomainActionsSlackPostMessageAction struct { + Typename *string `json:"__typename"` + ActionDetailsSlackPostMessageAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsSlackPostMessageAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetTypename() *string { + return v.Typename +} + +// GetId returns ListActionsSearchDomainActionsSlackPostMessageAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetId() string { + return v.ActionDetailsSlackPostMessageAction.Id +} + +// GetName returns ListActionsSearchDomainActionsSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetName() string { + return v.ActionDetailsSlackPostMessageAction.Name +} + +// GetApiToken returns ListActionsSearchDomainActionsSlackPostMessageAction.ApiToken, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetApiToken() string { + return v.ActionDetailsSlackPostMessageAction.ApiToken +} + +// GetChannels returns ListActionsSearchDomainActionsSlackPostMessageAction.Channels, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetChannels() []string { + return v.ActionDetailsSlackPostMessageAction.Channels +} + +// GetFields returns ListActionsSearchDomainActionsSlackPostMessageAction.Fields, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetFields() []ActionDetailsFieldsSlackFieldEntry { + return v.ActionDetailsSlackPostMessageAction.Fields +} + +// GetUseProxy returns ListActionsSearchDomainActionsSlackPostMessageAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) GetUseProxy() bool { + return v.ActionDetailsSlackPostMessageAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsSlackPostMessageAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsSlackPostMessageAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsSlackPostMessageAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsSlackPostMessageAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + ApiToken string `json:"apiToken"` + + Channels []string `json:"channels"` + + Fields []ActionDetailsFieldsSlackFieldEntry `json:"fields"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsSlackPostMessageAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsSlackPostMessageAction, error) { + var retval __premarshalListActionsSearchDomainActionsSlackPostMessageAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsSlackPostMessageAction.Id + retval.Name = v.ActionDetailsSlackPostMessageAction.Name + retval.ApiToken = v.ActionDetailsSlackPostMessageAction.ApiToken + retval.Channels = v.ActionDetailsSlackPostMessageAction.Channels + retval.Fields = v.ActionDetailsSlackPostMessageAction.Fields + retval.UseProxy = v.ActionDetailsSlackPostMessageAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type ListActionsSearchDomainActionsUploadFileAction struct { + Typename *string `json:"__typename"` + ActionDetailsUploadFileAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsUploadFileAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsUploadFileAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsUploadFileAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsUploadFileAction) GetId() string { + return v.ActionDetailsUploadFileAction.Id +} + +// GetName returns ListActionsSearchDomainActionsUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsUploadFileAction) GetName() string { + return v.ActionDetailsUploadFileAction.Name +} + +// GetFileName returns ListActionsSearchDomainActionsUploadFileAction.FileName, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsUploadFileAction) GetFileName() string { + return v.ActionDetailsUploadFileAction.FileName +} + +func (v *ListActionsSearchDomainActionsUploadFileAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsUploadFileAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsUploadFileAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsUploadFileAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsUploadFileAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + FileName string `json:"fileName"` +} + +func (v *ListActionsSearchDomainActionsUploadFileAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsUploadFileAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsUploadFileAction, error) { + var retval __premarshalListActionsSearchDomainActionsUploadFileAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsUploadFileAction.Id + retval.Name = v.ActionDetailsUploadFileAction.Name + retval.FileName = v.ActionDetailsUploadFileAction.FileName + return &retval, nil +} + +// ListActionsSearchDomainActionsVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type ListActionsSearchDomainActionsVictorOpsAction struct { + Typename *string `json:"__typename"` + ActionDetailsVictorOpsAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsVictorOpsAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsVictorOpsAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetId() string { + return v.ActionDetailsVictorOpsAction.Id +} + +// GetName returns ListActionsSearchDomainActionsVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetName() string { + return v.ActionDetailsVictorOpsAction.Name +} + +// GetMessageType returns ListActionsSearchDomainActionsVictorOpsAction.MessageType, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetMessageType() string { + return v.ActionDetailsVictorOpsAction.MessageType +} + +// GetNotifyUrl returns ListActionsSearchDomainActionsVictorOpsAction.NotifyUrl, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetNotifyUrl() string { + return v.ActionDetailsVictorOpsAction.NotifyUrl +} + +// GetUseProxy returns ListActionsSearchDomainActionsVictorOpsAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsVictorOpsAction) GetUseProxy() bool { + return v.ActionDetailsVictorOpsAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsVictorOpsAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsVictorOpsAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsVictorOpsAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsVictorOpsAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsVictorOpsAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + MessageType string `json:"messageType"` + + NotifyUrl string `json:"notifyUrl"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsVictorOpsAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsVictorOpsAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsVictorOpsAction, error) { + var retval __premarshalListActionsSearchDomainActionsVictorOpsAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsVictorOpsAction.Id + retval.Name = v.ActionDetailsVictorOpsAction.Name + retval.MessageType = v.ActionDetailsVictorOpsAction.MessageType + retval.NotifyUrl = v.ActionDetailsVictorOpsAction.NotifyUrl + retval.UseProxy = v.ActionDetailsVictorOpsAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainActionsWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type ListActionsSearchDomainActionsWebhookAction struct { + Typename *string `json:"__typename"` + ActionDetailsWebhookAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainActionsWebhookAction.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetTypename() *string { return v.Typename } + +// GetId returns ListActionsSearchDomainActionsWebhookAction.Id, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetId() string { + return v.ActionDetailsWebhookAction.Id +} + +// GetName returns ListActionsSearchDomainActionsWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetName() string { + return v.ActionDetailsWebhookAction.Name +} + +// GetMethod returns ListActionsSearchDomainActionsWebhookAction.Method, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetMethod() string { + return v.ActionDetailsWebhookAction.Method +} + +// GetUrl returns ListActionsSearchDomainActionsWebhookAction.Url, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetUrl() string { + return v.ActionDetailsWebhookAction.Url +} + +// GetHeaders returns ListActionsSearchDomainActionsWebhookAction.Headers, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetHeaders() []ActionDetailsHeadersHttpHeaderEntry { + return v.ActionDetailsWebhookAction.Headers +} + +// GetWebhookBodyTemplate returns ListActionsSearchDomainActionsWebhookAction.WebhookBodyTemplate, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetWebhookBodyTemplate() string { + return v.ActionDetailsWebhookAction.WebhookBodyTemplate +} + +// GetIgnoreSSL returns ListActionsSearchDomainActionsWebhookAction.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetIgnoreSSL() bool { + return v.ActionDetailsWebhookAction.IgnoreSSL +} + +// GetUseProxy returns ListActionsSearchDomainActionsWebhookAction.UseProxy, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainActionsWebhookAction) GetUseProxy() bool { + return v.ActionDetailsWebhookAction.UseProxy +} + +func (v *ListActionsSearchDomainActionsWebhookAction) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainActionsWebhookAction + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainActionsWebhookAction = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ActionDetailsWebhookAction) + if err != nil { + return err + } + return nil +} + +type __premarshalListActionsSearchDomainActionsWebhookAction struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Name string `json:"name"` + + Method string `json:"method"` + + Url string `json:"url"` + + Headers []ActionDetailsHeadersHttpHeaderEntry `json:"headers"` + + WebhookBodyTemplate string `json:"WebhookBodyTemplate"` + + IgnoreSSL bool `json:"ignoreSSL"` + + UseProxy bool `json:"useProxy"` +} + +func (v *ListActionsSearchDomainActionsWebhookAction) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainActionsWebhookAction) __premarshalJSON() (*__premarshalListActionsSearchDomainActionsWebhookAction, error) { + var retval __premarshalListActionsSearchDomainActionsWebhookAction + + retval.Typename = v.Typename + retval.Id = v.ActionDetailsWebhookAction.Id + retval.Name = v.ActionDetailsWebhookAction.Name + retval.Method = v.ActionDetailsWebhookAction.Method + retval.Url = v.ActionDetailsWebhookAction.Url + retval.Headers = v.ActionDetailsWebhookAction.Headers + retval.WebhookBodyTemplate = v.ActionDetailsWebhookAction.WebhookBodyTemplate + retval.IgnoreSSL = v.ActionDetailsWebhookAction.IgnoreSSL + retval.UseProxy = v.ActionDetailsWebhookAction.UseProxy + return &retval, nil +} + +// ListActionsSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListActionsSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Actions []ListActionsSearchDomainActionsAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetActions returns ListActionsSearchDomainRepository.Actions, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainRepository) GetActions() []ListActionsSearchDomainActionsAction { + return v.Actions +} + +func (v *ListActionsSearchDomainRepository) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainRepository + Actions []json.RawMessage `json:"actions"` + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainRepository = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Actions + src := firstPass.Actions + *dst = make( + []ListActionsSearchDomainActionsAction, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListActionsSearchDomainActionsAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListActionsSearchDomainRepository.Actions: %w", err) + } + } + } + } + return nil +} + +type __premarshalListActionsSearchDomainRepository struct { + Typename *string `json:"__typename"` + + Actions []json.RawMessage `json:"actions"` +} + +func (v *ListActionsSearchDomainRepository) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainRepository) __premarshalJSON() (*__premarshalListActionsSearchDomainRepository, error) { + var retval __premarshalListActionsSearchDomainRepository + + retval.Typename = v.Typename + { + + dst := &retval.Actions + src := v.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalListActionsSearchDomainActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListActionsSearchDomainRepository.Actions: %w", err) + } + } + } + return &retval, nil +} + +// ListActionsSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListActionsSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Actions []ListActionsSearchDomainActionsAction `json:"-"` +} + +// GetTypename returns ListActionsSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainView) GetTypename() *string { return v.Typename } + +// GetActions returns ListActionsSearchDomainView.Actions, and is useful for accessing the field via an interface. +func (v *ListActionsSearchDomainView) GetActions() []ListActionsSearchDomainActionsAction { + return v.Actions +} + +func (v *ListActionsSearchDomainView) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListActionsSearchDomainView + Actions []json.RawMessage `json:"actions"` + graphql.NoUnmarshalJSON + } + firstPass.ListActionsSearchDomainView = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Actions + src := firstPass.Actions + *dst = make( + []ListActionsSearchDomainActionsAction, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListActionsSearchDomainActionsAction( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListActionsSearchDomainView.Actions: %w", err) + } + } + } + } + return nil +} + +type __premarshalListActionsSearchDomainView struct { + Typename *string `json:"__typename"` + + Actions []json.RawMessage `json:"actions"` +} + +func (v *ListActionsSearchDomainView) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListActionsSearchDomainView) __premarshalJSON() (*__premarshalListActionsSearchDomainView, error) { + var retval __premarshalListActionsSearchDomainView + + retval.Typename = v.Typename + { + + dst := &retval.Actions + src := v.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalListActionsSearchDomainActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListActionsSearchDomainView.Actions: %w", err) + } + } + } + return &retval, nil +} + +// ListAggregateAlertsResponse is returned by ListAggregateAlerts on success. +type ListAggregateAlertsResponse struct { + SearchDomain ListAggregateAlertsSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListAggregateAlertsResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsResponse) GetSearchDomain() ListAggregateAlertsSearchDomain { + return v.SearchDomain +} + +func (v *ListAggregateAlertsResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListAggregateAlertsResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListAggregateAlertsResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListAggregateAlertsSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListAggregateAlertsResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListAggregateAlertsResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListAggregateAlertsResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListAggregateAlertsResponse) __premarshalJSON() (*__premarshalListAggregateAlertsResponse, error) { + var retval __premarshalListAggregateAlertsResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListAggregateAlertsSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListAggregateAlertsResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListAggregateAlertsSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListAggregateAlertsSearchDomain is implemented by the following types: +// ListAggregateAlertsSearchDomainRepository +// ListAggregateAlertsSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListAggregateAlertsSearchDomain interface { + implementsGraphQLInterfaceListAggregateAlertsSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetAggregateAlerts returns the interface-field "aggregateAlerts" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAggregateAlerts() []ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert +} + +func (v *ListAggregateAlertsSearchDomainRepository) implementsGraphQLInterfaceListAggregateAlertsSearchDomain() { +} +func (v *ListAggregateAlertsSearchDomainView) implementsGraphQLInterfaceListAggregateAlertsSearchDomain() { +} + +func __unmarshalListAggregateAlertsSearchDomain(b []byte, v *ListAggregateAlertsSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListAggregateAlertsSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListAggregateAlertsSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListAggregateAlertsSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListAggregateAlertsSearchDomain(v *ListAggregateAlertsSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListAggregateAlertsSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListAggregateAlertsSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListAggregateAlertsSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListAggregateAlertsSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListAggregateAlertsSearchDomain: "%T"`, v) + } +} + +// ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert includes the requested fields of the GraphQL type AggregateAlert. +// The GraphQL type's documentation follows. +// +// An aggregate alert. +type ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert struct { + AggregateAlertDetails `json:"-"` +} + +// GetId returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Id, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetId() string { + return v.AggregateAlertDetails.Id +} + +// GetName returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Name, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetName() string { + return v.AggregateAlertDetails.Name +} + +// GetDescription returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Description, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetDescription() *string { + return v.AggregateAlertDetails.Description +} + +// GetQueryString returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetQueryString() string { + return v.AggregateAlertDetails.QueryString +} + +// GetSearchIntervalSeconds returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetSearchIntervalSeconds() int64 { + return v.AggregateAlertDetails.SearchIntervalSeconds +} + +// GetThrottleTimeSeconds returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetThrottleTimeSeconds() int64 { + return v.AggregateAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetThrottleField() *string { + return v.AggregateAlertDetails.ThrottleField +} + +// GetActions returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Actions, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetActions() []AggregateAlertDetailsActionsAction { + return v.AggregateAlertDetails.Actions +} + +// GetLabels returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Labels, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetLabels() []string { + return v.AggregateAlertDetails.Labels +} + +// GetEnabled returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetEnabled() bool { + return v.AggregateAlertDetails.Enabled +} + +// GetTriggerMode returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.TriggerMode, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetTriggerMode() TriggerMode { + return v.AggregateAlertDetails.TriggerMode +} + +// GetQueryTimestampType returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.QueryTimestampType, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetQueryTimestampType() QueryTimestampType { + return v.AggregateAlertDetails.QueryTimestampType +} + +// GetQueryOwnership returns ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AggregateAlertDetails.QueryOwnership +} + +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert + graphql.NoUnmarshalJSON + } + firstPass.ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AggregateAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + TriggerMode TriggerMode `json:"triggerMode"` + + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert) __premarshalJSON() (*__premarshalListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert, error) { + var retval __premarshalListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert + + retval.Id = v.AggregateAlertDetails.Id + retval.Name = v.AggregateAlertDetails.Name + retval.Description = v.AggregateAlertDetails.Description + retval.QueryString = v.AggregateAlertDetails.QueryString + retval.SearchIntervalSeconds = v.AggregateAlertDetails.SearchIntervalSeconds + retval.ThrottleTimeSeconds = v.AggregateAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.AggregateAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.AggregateAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalAggregateAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.AggregateAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.AggregateAlertDetails.Labels + retval.Enabled = v.AggregateAlertDetails.Enabled + retval.TriggerMode = v.AggregateAlertDetails.TriggerMode + retval.QueryTimestampType = v.AggregateAlertDetails.QueryTimestampType + { + + dst := &retval.QueryOwnership + src := v.AggregateAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert.AggregateAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// ListAggregateAlertsSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListAggregateAlertsSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + AggregateAlerts []ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert `json:"aggregateAlerts"` +} + +// GetTypename returns ListAggregateAlertsSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetAggregateAlerts returns ListAggregateAlertsSearchDomainRepository.AggregateAlerts, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainRepository) GetAggregateAlerts() []ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert { + return v.AggregateAlerts +} + +// ListAggregateAlertsSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListAggregateAlertsSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + AggregateAlerts []ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert `json:"aggregateAlerts"` +} + +// GetTypename returns ListAggregateAlertsSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainView) GetTypename() *string { return v.Typename } + +// GetAggregateAlerts returns ListAggregateAlertsSearchDomainView.AggregateAlerts, and is useful for accessing the field via an interface. +func (v *ListAggregateAlertsSearchDomainView) GetAggregateAlerts() []ListAggregateAlertsSearchDomainAggregateAlertsAggregateAlert { + return v.AggregateAlerts +} + +// ListAlertsResponse is returned by ListAlerts on success. +type ListAlertsResponse struct { + SearchDomain ListAlertsSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListAlertsResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListAlertsResponse) GetSearchDomain() ListAlertsSearchDomain { return v.SearchDomain } + +func (v *ListAlertsResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListAlertsResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListAlertsResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListAlertsSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListAlertsResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListAlertsResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListAlertsResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListAlertsResponse) __premarshalJSON() (*__premarshalListAlertsResponse, error) { + var retval __premarshalListAlertsResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListAlertsSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListAlertsResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListAlertsSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListAlertsSearchDomain is implemented by the following types: +// ListAlertsSearchDomainRepository +// ListAlertsSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListAlertsSearchDomain interface { + implementsGraphQLInterfaceListAlertsSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetAlerts returns the interface-field "alerts" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAlerts() []ListAlertsSearchDomainAlertsAlert +} + +func (v *ListAlertsSearchDomainRepository) implementsGraphQLInterfaceListAlertsSearchDomain() {} +func (v *ListAlertsSearchDomainView) implementsGraphQLInterfaceListAlertsSearchDomain() {} + +func __unmarshalListAlertsSearchDomain(b []byte, v *ListAlertsSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListAlertsSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListAlertsSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListAlertsSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListAlertsSearchDomain(v *ListAlertsSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListAlertsSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListAlertsSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListAlertsSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListAlertsSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListAlertsSearchDomain: "%T"`, v) + } +} + +// ListAlertsSearchDomainAlertsAlert includes the requested fields of the GraphQL type Alert. +// The GraphQL type's documentation follows. +// +// An alert. +type ListAlertsSearchDomainAlertsAlert struct { + AlertDetails `json:"-"` +} + +// GetId returns ListAlertsSearchDomainAlertsAlert.Id, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetId() string { return v.AlertDetails.Id } + +// GetName returns ListAlertsSearchDomainAlertsAlert.Name, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetName() string { return v.AlertDetails.Name } + +// GetQueryString returns ListAlertsSearchDomainAlertsAlert.QueryString, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetQueryString() string { + return v.AlertDetails.QueryString +} + +// GetQueryStart returns ListAlertsSearchDomainAlertsAlert.QueryStart, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetQueryStart() string { return v.AlertDetails.QueryStart } + +// GetThrottleField returns ListAlertsSearchDomainAlertsAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetThrottleField() *string { + return v.AlertDetails.ThrottleField +} + +// GetTimeOfLastTrigger returns ListAlertsSearchDomainAlertsAlert.TimeOfLastTrigger, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetTimeOfLastTrigger() *int64 { + return v.AlertDetails.TimeOfLastTrigger +} + +// GetIsStarred returns ListAlertsSearchDomainAlertsAlert.IsStarred, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetIsStarred() bool { return v.AlertDetails.IsStarred } + +// GetDescription returns ListAlertsSearchDomainAlertsAlert.Description, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetDescription() *string { + return v.AlertDetails.Description +} + +// GetThrottleTimeMillis returns ListAlertsSearchDomainAlertsAlert.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetThrottleTimeMillis() int64 { + return v.AlertDetails.ThrottleTimeMillis +} + +// GetEnabled returns ListAlertsSearchDomainAlertsAlert.Enabled, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetEnabled() bool { return v.AlertDetails.Enabled } + +// GetActions returns ListAlertsSearchDomainAlertsAlert.Actions, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetActions() []string { return v.AlertDetails.Actions } + +// GetLabels returns ListAlertsSearchDomainAlertsAlert.Labels, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetLabels() []string { return v.AlertDetails.Labels } + +// GetLastError returns ListAlertsSearchDomainAlertsAlert.LastError, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetLastError() *string { return v.AlertDetails.LastError } + +// GetQueryOwnership returns ListAlertsSearchDomainAlertsAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainAlertsAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AlertDetails.QueryOwnership +} + +func (v *ListAlertsSearchDomainAlertsAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListAlertsSearchDomainAlertsAlert + graphql.NoUnmarshalJSON + } + firstPass.ListAlertsSearchDomainAlertsAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListAlertsSearchDomainAlertsAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + QueryString string `json:"queryString"` + + QueryStart string `json:"queryStart"` + + ThrottleField *string `json:"throttleField"` + + TimeOfLastTrigger *int64 `json:"timeOfLastTrigger"` + + IsStarred bool `json:"isStarred"` + + Description *string `json:"description"` + + ThrottleTimeMillis int64 `json:"throttleTimeMillis"` + + Enabled bool `json:"enabled"` + + Actions []string `json:"actions"` + + Labels []string `json:"labels"` + + LastError *string `json:"lastError"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *ListAlertsSearchDomainAlertsAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListAlertsSearchDomainAlertsAlert) __premarshalJSON() (*__premarshalListAlertsSearchDomainAlertsAlert, error) { + var retval __premarshalListAlertsSearchDomainAlertsAlert + + retval.Id = v.AlertDetails.Id + retval.Name = v.AlertDetails.Name + retval.QueryString = v.AlertDetails.QueryString + retval.QueryStart = v.AlertDetails.QueryStart + retval.ThrottleField = v.AlertDetails.ThrottleField + retval.TimeOfLastTrigger = v.AlertDetails.TimeOfLastTrigger + retval.IsStarred = v.AlertDetails.IsStarred + retval.Description = v.AlertDetails.Description + retval.ThrottleTimeMillis = v.AlertDetails.ThrottleTimeMillis + retval.Enabled = v.AlertDetails.Enabled + retval.Actions = v.AlertDetails.Actions + retval.Labels = v.AlertDetails.Labels + retval.LastError = v.AlertDetails.LastError + { + + dst := &retval.QueryOwnership + src := v.AlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListAlertsSearchDomainAlertsAlert.AlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// ListAlertsSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListAlertsSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Alerts []ListAlertsSearchDomainAlertsAlert `json:"alerts"` +} + +// GetTypename returns ListAlertsSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetAlerts returns ListAlertsSearchDomainRepository.Alerts, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainRepository) GetAlerts() []ListAlertsSearchDomainAlertsAlert { + return v.Alerts +} + +// ListAlertsSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListAlertsSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Alerts []ListAlertsSearchDomainAlertsAlert `json:"alerts"` +} + +// GetTypename returns ListAlertsSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainView) GetTypename() *string { return v.Typename } + +// GetAlerts returns ListAlertsSearchDomainView.Alerts, and is useful for accessing the field via an interface. +func (v *ListAlertsSearchDomainView) GetAlerts() []ListAlertsSearchDomainAlertsAlert { return v.Alerts } + +// ListClusterNodesCluster includes the requested fields of the GraphQL type Cluster. +// The GraphQL type's documentation follows. +// +// Information about the LogScale cluster. +type ListClusterNodesCluster struct { + ClusterNode `json:"-"` +} + +// GetNodes returns ListClusterNodesCluster.Nodes, and is useful for accessing the field via an interface. +func (v *ListClusterNodesCluster) GetNodes() []ClusterNodeNodesClusterNode { + return v.ClusterNode.Nodes +} + +func (v *ListClusterNodesCluster) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListClusterNodesCluster + graphql.NoUnmarshalJSON + } + firstPass.ListClusterNodesCluster = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ClusterNode) + if err != nil { + return err + } + return nil +} + +type __premarshalListClusterNodesCluster struct { + Nodes []ClusterNodeNodesClusterNode `json:"nodes"` +} + +func (v *ListClusterNodesCluster) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListClusterNodesCluster) __premarshalJSON() (*__premarshalListClusterNodesCluster, error) { + var retval __premarshalListClusterNodesCluster + + retval.Nodes = v.ClusterNode.Nodes + return &retval, nil +} + +// ListClusterNodesResponse is returned by ListClusterNodes on success. +type ListClusterNodesResponse struct { + // This is used to retrieve information about a cluster. + Cluster ListClusterNodesCluster `json:"cluster"` +} + +// GetCluster returns ListClusterNodesResponse.Cluster, and is useful for accessing the field via an interface. +func (v *ListClusterNodesResponse) GetCluster() ListClusterNodesCluster { return v.Cluster } + +// ListFilesResponse is returned by ListFiles on success. +type ListFilesResponse struct { + SearchDomain ListFilesSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListFilesResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListFilesResponse) GetSearchDomain() ListFilesSearchDomain { return v.SearchDomain } + +func (v *ListFilesResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListFilesResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListFilesResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListFilesSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListFilesResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListFilesResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListFilesResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListFilesResponse) __premarshalJSON() (*__premarshalListFilesResponse, error) { + var retval __premarshalListFilesResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListFilesSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListFilesResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListFilesSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListFilesSearchDomain is implemented by the following types: +// ListFilesSearchDomainRepository +// ListFilesSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListFilesSearchDomain interface { + implementsGraphQLInterfaceListFilesSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetFiles returns the interface-field "files" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetFiles() []ListFilesSearchDomainFilesFile +} + +func (v *ListFilesSearchDomainRepository) implementsGraphQLInterfaceListFilesSearchDomain() {} +func (v *ListFilesSearchDomainView) implementsGraphQLInterfaceListFilesSearchDomain() {} + +func __unmarshalListFilesSearchDomain(b []byte, v *ListFilesSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListFilesSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListFilesSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListFilesSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListFilesSearchDomain(v *ListFilesSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListFilesSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListFilesSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListFilesSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListFilesSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListFilesSearchDomain: "%T"`, v) + } +} + +// ListFilesSearchDomainFilesFile includes the requested fields of the GraphQL type File. +// The GraphQL type's documentation follows. +// +// A file upload to LogScale for use with the `match` query function. You can see them under the Files page in the UI. +type ListFilesSearchDomainFilesFile struct { + ContentHash string `json:"contentHash"` + NameAndPath ListFilesSearchDomainFilesFileNameAndPath `json:"nameAndPath"` +} + +// GetContentHash returns ListFilesSearchDomainFilesFile.ContentHash, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainFilesFile) GetContentHash() string { return v.ContentHash } + +// GetNameAndPath returns ListFilesSearchDomainFilesFile.NameAndPath, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainFilesFile) GetNameAndPath() ListFilesSearchDomainFilesFileNameAndPath { + return v.NameAndPath +} + +// ListFilesSearchDomainFilesFileNameAndPath includes the requested fields of the GraphQL type FileNameAndPath. +type ListFilesSearchDomainFilesFileNameAndPath struct { + Name string `json:"name"` +} + +// GetName returns ListFilesSearchDomainFilesFileNameAndPath.Name, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainFilesFileNameAndPath) GetName() string { return v.Name } + +// ListFilesSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListFilesSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Files []ListFilesSearchDomainFilesFile `json:"files"` +} + +// GetTypename returns ListFilesSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetFiles returns ListFilesSearchDomainRepository.Files, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainRepository) GetFiles() []ListFilesSearchDomainFilesFile { return v.Files } + +// ListFilesSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListFilesSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Files []ListFilesSearchDomainFilesFile `json:"files"` +} + +// GetTypename returns ListFilesSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainView) GetTypename() *string { return v.Typename } + +// GetFiles returns ListFilesSearchDomainView.Files, and is useful for accessing the field via an interface. +func (v *ListFilesSearchDomainView) GetFiles() []ListFilesSearchDomainFilesFile { return v.Files } + +// ListFilterAlertsResponse is returned by ListFilterAlerts on success. +type ListFilterAlertsResponse struct { + SearchDomain ListFilterAlertsSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListFilterAlertsResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsResponse) GetSearchDomain() ListFilterAlertsSearchDomain { + return v.SearchDomain +} + +func (v *ListFilterAlertsResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListFilterAlertsResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListFilterAlertsResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListFilterAlertsSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListFilterAlertsResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListFilterAlertsResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListFilterAlertsResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListFilterAlertsResponse) __premarshalJSON() (*__premarshalListFilterAlertsResponse, error) { + var retval __premarshalListFilterAlertsResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListFilterAlertsSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListFilterAlertsResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListFilterAlertsSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListFilterAlertsSearchDomain is implemented by the following types: +// ListFilterAlertsSearchDomainRepository +// ListFilterAlertsSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListFilterAlertsSearchDomain interface { + implementsGraphQLInterfaceListFilterAlertsSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetFilterAlerts returns the interface-field "filterAlerts" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetFilterAlerts() []ListFilterAlertsSearchDomainFilterAlertsFilterAlert +} + +func (v *ListFilterAlertsSearchDomainRepository) implementsGraphQLInterfaceListFilterAlertsSearchDomain() { +} +func (v *ListFilterAlertsSearchDomainView) implementsGraphQLInterfaceListFilterAlertsSearchDomain() {} + +func __unmarshalListFilterAlertsSearchDomain(b []byte, v *ListFilterAlertsSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListFilterAlertsSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListFilterAlertsSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListFilterAlertsSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListFilterAlertsSearchDomain(v *ListFilterAlertsSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListFilterAlertsSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListFilterAlertsSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListFilterAlertsSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListFilterAlertsSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListFilterAlertsSearchDomain: "%T"`, v) + } +} + +// ListFilterAlertsSearchDomainFilterAlertsFilterAlert includes the requested fields of the GraphQL type FilterAlert. +// The GraphQL type's documentation follows. +// +// A filter alert. +type ListFilterAlertsSearchDomainFilterAlertsFilterAlert struct { + FilterAlertDetails `json:"-"` +} + +// GetId returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Id, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetId() string { + return v.FilterAlertDetails.Id +} + +// GetName returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Name, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetName() string { + return v.FilterAlertDetails.Name +} + +// GetDescription returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Description, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetDescription() *string { + return v.FilterAlertDetails.Description +} + +// GetQueryString returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.QueryString, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetQueryString() string { + return v.FilterAlertDetails.QueryString +} + +// GetThrottleTimeSeconds returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetThrottleTimeSeconds() *int64 { + return v.FilterAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetThrottleField() *string { + return v.FilterAlertDetails.ThrottleField +} + +// GetActions returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Actions, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetActions() []FilterAlertDetailsActionsAction { + return v.FilterAlertDetails.Actions +} + +// GetLabels returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Labels, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetLabels() []string { + return v.FilterAlertDetails.Labels +} + +// GetEnabled returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.Enabled, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetEnabled() bool { + return v.FilterAlertDetails.Enabled +} + +// GetQueryOwnership returns ListFilterAlertsSearchDomainFilterAlertsFilterAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.FilterAlertDetails.QueryOwnership +} + +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListFilterAlertsSearchDomainFilterAlertsFilterAlert + graphql.NoUnmarshalJSON + } + firstPass.ListFilterAlertsSearchDomainFilterAlertsFilterAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FilterAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListFilterAlertsSearchDomainFilterAlertsFilterAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListFilterAlertsSearchDomainFilterAlertsFilterAlert) __premarshalJSON() (*__premarshalListFilterAlertsSearchDomainFilterAlertsFilterAlert, error) { + var retval __premarshalListFilterAlertsSearchDomainFilterAlertsFilterAlert + + retval.Id = v.FilterAlertDetails.Id + retval.Name = v.FilterAlertDetails.Name + retval.Description = v.FilterAlertDetails.Description + retval.QueryString = v.FilterAlertDetails.QueryString + retval.ThrottleTimeSeconds = v.FilterAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.FilterAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.FilterAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFilterAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListFilterAlertsSearchDomainFilterAlertsFilterAlert.FilterAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.FilterAlertDetails.Labels + retval.Enabled = v.FilterAlertDetails.Enabled + { + + dst := &retval.QueryOwnership + src := v.FilterAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListFilterAlertsSearchDomainFilterAlertsFilterAlert.FilterAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// ListFilterAlertsSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListFilterAlertsSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + FilterAlerts []ListFilterAlertsSearchDomainFilterAlertsFilterAlert `json:"filterAlerts"` +} + +// GetTypename returns ListFilterAlertsSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetFilterAlerts returns ListFilterAlertsSearchDomainRepository.FilterAlerts, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainRepository) GetFilterAlerts() []ListFilterAlertsSearchDomainFilterAlertsFilterAlert { + return v.FilterAlerts +} + +// ListFilterAlertsSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListFilterAlertsSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + FilterAlerts []ListFilterAlertsSearchDomainFilterAlertsFilterAlert `json:"filterAlerts"` +} + +// GetTypename returns ListFilterAlertsSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainView) GetTypename() *string { return v.Typename } + +// GetFilterAlerts returns ListFilterAlertsSearchDomainView.FilterAlerts, and is useful for accessing the field via an interface. +func (v *ListFilterAlertsSearchDomainView) GetFilterAlerts() []ListFilterAlertsSearchDomainFilterAlertsFilterAlert { + return v.FilterAlerts +} + +// ListGroupsGroupsPageGroupPage includes the requested fields of the GraphQL type GroupPage. +// The GraphQL type's documentation follows. +// +// A page of groups in an organization. +type ListGroupsGroupsPageGroupPage struct { + Page []ListGroupsGroupsPageGroupPagePageGroup `json:"page"` +} + +// GetPage returns ListGroupsGroupsPageGroupPage.Page, and is useful for accessing the field via an interface. +func (v *ListGroupsGroupsPageGroupPage) GetPage() []ListGroupsGroupsPageGroupPagePageGroup { + return v.Page +} + +// ListGroupsGroupsPageGroupPagePageGroup includes the requested fields of the GraphQL type Group. +// The GraphQL type's documentation follows. +// +// A group. +type ListGroupsGroupsPageGroupPagePageGroup struct { + Id string `json:"id"` + DisplayName string `json:"displayName"` +} + +// GetId returns ListGroupsGroupsPageGroupPagePageGroup.Id, and is useful for accessing the field via an interface. +func (v *ListGroupsGroupsPageGroupPagePageGroup) GetId() string { return v.Id } + +// GetDisplayName returns ListGroupsGroupsPageGroupPagePageGroup.DisplayName, and is useful for accessing the field via an interface. +func (v *ListGroupsGroupsPageGroupPagePageGroup) GetDisplayName() string { return v.DisplayName } + +// ListGroupsResponse is returned by ListGroups on success. +type ListGroupsResponse struct { + // All defined groups in an organization. + GroupsPage ListGroupsGroupsPageGroupPage `json:"groupsPage"` +} + +// GetGroupsPage returns ListGroupsResponse.GroupsPage, and is useful for accessing the field via an interface. +func (v *ListGroupsResponse) GetGroupsPage() ListGroupsGroupsPageGroupPage { return v.GroupsPage } + +// ListIngestTokensRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListIngestTokensRepository struct { + IngestTokens []ListIngestTokensRepositoryIngestTokensIngestToken `json:"ingestTokens"` +} + +// GetIngestTokens returns ListIngestTokensRepository.IngestTokens, and is useful for accessing the field via an interface. +func (v *ListIngestTokensRepository) GetIngestTokens() []ListIngestTokensRepositoryIngestTokensIngestToken { + return v.IngestTokens +} + +// ListIngestTokensRepositoryIngestTokensIngestToken includes the requested fields of the GraphQL type IngestToken. +// The GraphQL type's documentation follows. +// +// An API ingest token used for sending data to LogScale. +type ListIngestTokensRepositoryIngestTokensIngestToken struct { + IngestTokenDetails `json:"-"` +} + +// GetName returns ListIngestTokensRepositoryIngestTokensIngestToken.Name, and is useful for accessing the field via an interface. +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) GetName() string { + return v.IngestTokenDetails.Name +} + +// GetToken returns ListIngestTokensRepositoryIngestTokensIngestToken.Token, and is useful for accessing the field via an interface. +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) GetToken() string { + return v.IngestTokenDetails.Token +} + +// GetParser returns ListIngestTokensRepositoryIngestTokensIngestToken.Parser, and is useful for accessing the field via an interface. +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) GetParser() *IngestTokenDetailsParser { + return v.IngestTokenDetails.Parser +} + +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListIngestTokensRepositoryIngestTokensIngestToken + graphql.NoUnmarshalJSON + } + firstPass.ListIngestTokensRepositoryIngestTokensIngestToken = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.IngestTokenDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListIngestTokensRepositoryIngestTokensIngestToken struct { + Name string `json:"name"` + + Token string `json:"token"` + + Parser *IngestTokenDetailsParser `json:"parser"` +} + +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListIngestTokensRepositoryIngestTokensIngestToken) __premarshalJSON() (*__premarshalListIngestTokensRepositoryIngestTokensIngestToken, error) { + var retval __premarshalListIngestTokensRepositoryIngestTokensIngestToken + + retval.Name = v.IngestTokenDetails.Name + retval.Token = v.IngestTokenDetails.Token + retval.Parser = v.IngestTokenDetails.Parser + return &retval, nil +} + +// ListIngestTokensResponse is returned by ListIngestTokens on success. +type ListIngestTokensResponse struct { + // Lookup a given repository by name. + Repository ListIngestTokensRepository `json:"repository"` +} + +// GetRepository returns ListIngestTokensResponse.Repository, and is useful for accessing the field via an interface. +func (v *ListIngestTokensResponse) GetRepository() ListIngestTokensRepository { return v.Repository } + +// ListInstalledPackagesResponse is returned by ListInstalledPackages on success. +type ListInstalledPackagesResponse struct { + SearchDomain ListInstalledPackagesSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListInstalledPackagesResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesResponse) GetSearchDomain() ListInstalledPackagesSearchDomain { + return v.SearchDomain +} + +func (v *ListInstalledPackagesResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListInstalledPackagesResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListInstalledPackagesResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListInstalledPackagesSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListInstalledPackagesResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListInstalledPackagesResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListInstalledPackagesResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListInstalledPackagesResponse) __premarshalJSON() (*__premarshalListInstalledPackagesResponse, error) { + var retval __premarshalListInstalledPackagesResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListInstalledPackagesSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListInstalledPackagesResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListInstalledPackagesSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListInstalledPackagesSearchDomain is implemented by the following types: +// ListInstalledPackagesSearchDomainRepository +// ListInstalledPackagesSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListInstalledPackagesSearchDomain interface { + implementsGraphQLInterfaceListInstalledPackagesSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetInstalledPackages returns the interface-field "installedPackages" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetInstalledPackages() []ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation +} + +func (v *ListInstalledPackagesSearchDomainRepository) implementsGraphQLInterfaceListInstalledPackagesSearchDomain() { +} +func (v *ListInstalledPackagesSearchDomainView) implementsGraphQLInterfaceListInstalledPackagesSearchDomain() { +} + +func __unmarshalListInstalledPackagesSearchDomain(b []byte, v *ListInstalledPackagesSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListInstalledPackagesSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListInstalledPackagesSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListInstalledPackagesSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListInstalledPackagesSearchDomain(v *ListInstalledPackagesSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListInstalledPackagesSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListInstalledPackagesSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListInstalledPackagesSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListInstalledPackagesSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListInstalledPackagesSearchDomain: "%T"`, v) + } +} + +// ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation includes the requested fields of the GraphQL type PackageInstallation. +// The GraphQL type's documentation follows. +// +// A package installation. +type ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation struct { + Id string `json:"id"` + InstalledBy ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp `json:"installedBy"` + UpdatedBy ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp `json:"updatedBy"` + Source PackageInstallationSourceType `json:"source"` + // Finds updates on a package. It also looks for updates on packages that were installed manually, in case e.g. test versions of a package have been distributed prior to the full release. + AvailableUpdate *string `json:"availableUpdate"` +} + +// GetId returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation.Id, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation) GetId() string { + return v.Id +} + +// GetInstalledBy returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation.InstalledBy, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation) GetInstalledBy() ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp { + return v.InstalledBy +} + +// GetUpdatedBy returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation.UpdatedBy, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation) GetUpdatedBy() ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp { + return v.UpdatedBy +} + +// GetSource returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation.Source, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation) GetSource() PackageInstallationSourceType { + return v.Source +} + +// GetAvailableUpdate returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation.AvailableUpdate, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation) GetAvailableUpdate() *string { + return v.AvailableUpdate +} + +// ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp includes the requested fields of the GraphQL type UserAndTimestamp. +type ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp struct { + Username string `json:"username"` + Timestamp time.Time `json:"timestamp"` +} + +// GetUsername returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp.Username, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp) GetUsername() string { + return v.Username +} + +// GetTimestamp returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp.Timestamp, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationInstalledByUserAndTimestamp) GetTimestamp() time.Time { + return v.Timestamp +} + +// ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp includes the requested fields of the GraphQL type UserAndTimestamp. +type ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp struct { + Username string `json:"username"` + Timestamp time.Time `json:"timestamp"` +} + +// GetUsername returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp.Username, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp) GetUsername() string { + return v.Username +} + +// GetTimestamp returns ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp.Timestamp, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallationUpdatedByUserAndTimestamp) GetTimestamp() time.Time { + return v.Timestamp +} + +// ListInstalledPackagesSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListInstalledPackagesSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + InstalledPackages []ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation `json:"installedPackages"` +} + +// GetTypename returns ListInstalledPackagesSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetInstalledPackages returns ListInstalledPackagesSearchDomainRepository.InstalledPackages, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainRepository) GetInstalledPackages() []ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation { + return v.InstalledPackages +} + +// ListInstalledPackagesSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListInstalledPackagesSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + InstalledPackages []ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation `json:"installedPackages"` +} + +// GetTypename returns ListInstalledPackagesSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainView) GetTypename() *string { return v.Typename } + +// GetInstalledPackages returns ListInstalledPackagesSearchDomainView.InstalledPackages, and is useful for accessing the field via an interface. +func (v *ListInstalledPackagesSearchDomainView) GetInstalledPackages() []ListInstalledPackagesSearchDomainInstalledPackagesPackageInstallation { + return v.InstalledPackages +} + +// ListParsersRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListParsersRepository struct { + // Saved parsers. + Parsers []ListParsersRepositoryParsersParser `json:"parsers"` +} + +// GetParsers returns ListParsersRepository.Parsers, and is useful for accessing the field via an interface. +func (v *ListParsersRepository) GetParsers() []ListParsersRepositoryParsersParser { return v.Parsers } + +// ListParsersRepositoryParsersParser includes the requested fields of the GraphQL type Parser. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type ListParsersRepositoryParsersParser struct { + // The id of the parser. + Id string `json:"id"` + // Name of the parser. + Name string `json:"name"` + // True if the parser is one of LogScale's built-in parsers. + IsBuiltIn bool `json:"isBuiltIn"` +} + +// GetId returns ListParsersRepositoryParsersParser.Id, and is useful for accessing the field via an interface. +func (v *ListParsersRepositoryParsersParser) GetId() string { return v.Id } + +// GetName returns ListParsersRepositoryParsersParser.Name, and is useful for accessing the field via an interface. +func (v *ListParsersRepositoryParsersParser) GetName() string { return v.Name } + +// GetIsBuiltIn returns ListParsersRepositoryParsersParser.IsBuiltIn, and is useful for accessing the field via an interface. +func (v *ListParsersRepositoryParsersParser) GetIsBuiltIn() bool { return v.IsBuiltIn } + +// ListParsersResponse is returned by ListParsers on success. +type ListParsersResponse struct { + // Lookup a given repository by name. + Repository ListParsersRepository `json:"repository"` +} + +// GetRepository returns ListParsersResponse.Repository, and is useful for accessing the field via an interface. +func (v *ListParsersResponse) GetRepository() ListParsersRepository { return v.Repository } + +// ListRepositoriesRepositoriesRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListRepositoriesRepositoriesRepository struct { + Id string `json:"id"` + Name string `json:"name"` + // Total size of data. Size is measured as the size after compression. + CompressedByteSize int64 `json:"compressedByteSize"` +} + +// GetId returns ListRepositoriesRepositoriesRepository.Id, and is useful for accessing the field via an interface. +func (v *ListRepositoriesRepositoriesRepository) GetId() string { return v.Id } + +// GetName returns ListRepositoriesRepositoriesRepository.Name, and is useful for accessing the field via an interface. +func (v *ListRepositoriesRepositoriesRepository) GetName() string { return v.Name } + +// GetCompressedByteSize returns ListRepositoriesRepositoriesRepository.CompressedByteSize, and is useful for accessing the field via an interface. +func (v *ListRepositoriesRepositoriesRepository) GetCompressedByteSize() int64 { + return v.CompressedByteSize +} + +// ListRepositoriesResponse is returned by ListRepositories on success. +type ListRepositoriesResponse struct { + Repositories []ListRepositoriesRepositoriesRepository `json:"repositories"` +} + +// GetRepositories returns ListRepositoriesResponse.Repositories, and is useful for accessing the field via an interface. +func (v *ListRepositoriesResponse) GetRepositories() []ListRepositoriesRepositoriesRepository { + return v.Repositories +} + +// ListRolesResponse is returned by ListRoles on success. +type ListRolesResponse struct { + // All defined roles. + Roles []ListRolesRolesRole `json:"roles"` +} + +// GetRoles returns ListRolesResponse.Roles, and is useful for accessing the field via an interface. +func (v *ListRolesResponse) GetRoles() []ListRolesRolesRole { return v.Roles } + +// ListRolesRolesRole includes the requested fields of the GraphQL type Role. +type ListRolesRolesRole struct { + RoleDetails `json:"-"` +} + +// GetId returns ListRolesRolesRole.Id, and is useful for accessing the field via an interface. +func (v *ListRolesRolesRole) GetId() string { return v.RoleDetails.Id } + +// GetDisplayName returns ListRolesRolesRole.DisplayName, and is useful for accessing the field via an interface. +func (v *ListRolesRolesRole) GetDisplayName() string { return v.RoleDetails.DisplayName } + +// GetViewPermissions returns ListRolesRolesRole.ViewPermissions, and is useful for accessing the field via an interface. +func (v *ListRolesRolesRole) GetViewPermissions() []Permission { return v.RoleDetails.ViewPermissions } + +// GetOrganizationPermissions returns ListRolesRolesRole.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *ListRolesRolesRole) GetOrganizationPermissions() []OrganizationPermission { + return v.RoleDetails.OrganizationPermissions +} + +// GetSystemPermissions returns ListRolesRolesRole.SystemPermissions, and is useful for accessing the field via an interface. +func (v *ListRolesRolesRole) GetSystemPermissions() []SystemPermission { + return v.RoleDetails.SystemPermissions +} + +func (v *ListRolesRolesRole) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListRolesRolesRole + graphql.NoUnmarshalJSON + } + firstPass.ListRolesRolesRole = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RoleDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListRolesRolesRole struct { + Id string `json:"id"` + + DisplayName string `json:"displayName"` + + ViewPermissions []Permission `json:"viewPermissions"` + + OrganizationPermissions []OrganizationPermission `json:"organizationPermissions"` + + SystemPermissions []SystemPermission `json:"systemPermissions"` +} + +func (v *ListRolesRolesRole) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListRolesRolesRole) __premarshalJSON() (*__premarshalListRolesRolesRole, error) { + var retval __premarshalListRolesRolesRole + + retval.Id = v.RoleDetails.Id + retval.DisplayName = v.RoleDetails.DisplayName + retval.ViewPermissions = v.RoleDetails.ViewPermissions + retval.OrganizationPermissions = v.RoleDetails.OrganizationPermissions + retval.SystemPermissions = v.RoleDetails.SystemPermissions + return &retval, nil +} + +// ListScheduledSearchesResponse is returned by ListScheduledSearches on success. +type ListScheduledSearchesResponse struct { + SearchDomain ListScheduledSearchesSearchDomain `json:"-"` +} + +// GetSearchDomain returns ListScheduledSearchesResponse.SearchDomain, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesResponse) GetSearchDomain() ListScheduledSearchesSearchDomain { + return v.SearchDomain +} + +func (v *ListScheduledSearchesResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListScheduledSearchesResponse + SearchDomain json.RawMessage `json:"searchDomain"` + graphql.NoUnmarshalJSON + } + firstPass.ListScheduledSearchesResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomain + src := firstPass.SearchDomain + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListScheduledSearchesSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListScheduledSearchesResponse.SearchDomain: %w", err) + } + } + } + return nil +} + +type __premarshalListScheduledSearchesResponse struct { + SearchDomain json.RawMessage `json:"searchDomain"` +} + +func (v *ListScheduledSearchesResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListScheduledSearchesResponse) __premarshalJSON() (*__premarshalListScheduledSearchesResponse, error) { + var retval __premarshalListScheduledSearchesResponse + + { + + dst := &retval.SearchDomain + src := v.SearchDomain + var err error + *dst, err = __marshalListScheduledSearchesSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListScheduledSearchesResponse.SearchDomain: %w", err) + } + } + return &retval, nil +} + +// ListScheduledSearchesSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListScheduledSearchesSearchDomain is implemented by the following types: +// ListScheduledSearchesSearchDomainRepository +// ListScheduledSearchesSearchDomainView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListScheduledSearchesSearchDomain interface { + implementsGraphQLInterfaceListScheduledSearchesSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetScheduledSearches returns the interface-field "scheduledSearches" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetScheduledSearches() []ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch +} + +func (v *ListScheduledSearchesSearchDomainRepository) implementsGraphQLInterfaceListScheduledSearchesSearchDomain() { +} +func (v *ListScheduledSearchesSearchDomainView) implementsGraphQLInterfaceListScheduledSearchesSearchDomain() { +} + +func __unmarshalListScheduledSearchesSearchDomain(b []byte, v *ListScheduledSearchesSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListScheduledSearchesSearchDomainRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListScheduledSearchesSearchDomainView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListScheduledSearchesSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListScheduledSearchesSearchDomain(v *ListScheduledSearchesSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListScheduledSearchesSearchDomainRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListScheduledSearchesSearchDomainRepository + }{typename, v} + return json.Marshal(result) + case *ListScheduledSearchesSearchDomainView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListScheduledSearchesSearchDomainView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListScheduledSearchesSearchDomain: "%T"`, v) + } +} + +// ListScheduledSearchesSearchDomainRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListScheduledSearchesSearchDomainRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + ScheduledSearches []ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch `json:"scheduledSearches"` +} + +// GetTypename returns ListScheduledSearchesSearchDomainRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainRepository) GetTypename() *string { return v.Typename } + +// GetScheduledSearches returns ListScheduledSearchesSearchDomainRepository.ScheduledSearches, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainRepository) GetScheduledSearches() []ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch { + return v.ScheduledSearches +} + +// ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch includes the requested fields of the GraphQL type ScheduledSearch. +// The GraphQL type's documentation follows. +// +// Information about a scheduled search +type ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch struct { + ScheduledSearchDetails `json:"-"` +} + +// GetId returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Id, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetId() string { + return v.ScheduledSearchDetails.Id +} + +// GetName returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Name, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetName() string { + return v.ScheduledSearchDetails.Name +} + +// GetDescription returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Description, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetDescription() *string { + return v.ScheduledSearchDetails.Description +} + +// GetQueryString returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.QueryString, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetQueryString() string { + return v.ScheduledSearchDetails.QueryString +} + +// GetStart returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Start, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetStart() string { + return v.ScheduledSearchDetails.Start +} + +// GetEnd returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.End, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetEnd() string { + return v.ScheduledSearchDetails.End +} + +// GetTimeZone returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.TimeZone, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetTimeZone() string { + return v.ScheduledSearchDetails.TimeZone +} + +// GetSchedule returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Schedule, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetSchedule() string { + return v.ScheduledSearchDetails.Schedule +} + +// GetBackfillLimit returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.BackfillLimit, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetBackfillLimit() int { + return v.ScheduledSearchDetails.BackfillLimit +} + +// GetEnabled returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Enabled, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetEnabled() bool { + return v.ScheduledSearchDetails.Enabled +} + +// GetActionsV2 returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.ActionsV2, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetActionsV2() []ScheduledSearchDetailsActionsV2Action { + return v.ScheduledSearchDetails.ActionsV2 +} + +// GetLabels returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.Labels, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetLabels() []string { + return v.ScheduledSearchDetails.Labels +} + +// GetQueryOwnership returns ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.QueryOwnership, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) GetQueryOwnership() SharedQueryOwnershipType { + return v.ScheduledSearchDetails.QueryOwnership +} + +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch + graphql.NoUnmarshalJSON + } + firstPass.ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ScheduledSearchDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + Start string `json:"start"` + + End string `json:"end"` + + TimeZone string `json:"timeZone"` + + Schedule string `json:"schedule"` + + BackfillLimit int `json:"backfillLimit"` + + Enabled bool `json:"enabled"` + + ActionsV2 []json.RawMessage `json:"actionsV2"` + + Labels []string `json:"labels"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch) __premarshalJSON() (*__premarshalListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch, error) { + var retval __premarshalListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch + + retval.Id = v.ScheduledSearchDetails.Id + retval.Name = v.ScheduledSearchDetails.Name + retval.Description = v.ScheduledSearchDetails.Description + retval.QueryString = v.ScheduledSearchDetails.QueryString + retval.Start = v.ScheduledSearchDetails.Start + retval.End = v.ScheduledSearchDetails.End + retval.TimeZone = v.ScheduledSearchDetails.TimeZone + retval.Schedule = v.ScheduledSearchDetails.Schedule + retval.BackfillLimit = v.ScheduledSearchDetails.BackfillLimit + retval.Enabled = v.ScheduledSearchDetails.Enabled + { + + dst := &retval.ActionsV2 + src := v.ScheduledSearchDetails.ActionsV2 + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalScheduledSearchDetailsActionsV2Action( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + retval.Labels = v.ScheduledSearchDetails.Labels + { + + dst := &retval.QueryOwnership + src := v.ScheduledSearchDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch.ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// ListScheduledSearchesSearchDomainView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListScheduledSearchesSearchDomainView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + ScheduledSearches []ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch `json:"scheduledSearches"` +} + +// GetTypename returns ListScheduledSearchesSearchDomainView.Typename, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainView) GetTypename() *string { return v.Typename } + +// GetScheduledSearches returns ListScheduledSearchesSearchDomainView.ScheduledSearches, and is useful for accessing the field via an interface. +func (v *ListScheduledSearchesSearchDomainView) GetScheduledSearches() []ListScheduledSearchesSearchDomainScheduledSearchesScheduledSearch { + return v.ScheduledSearches +} + +// ListSearchDomainsResponse is returned by ListSearchDomains on success. +type ListSearchDomainsResponse struct { + SearchDomains []ListSearchDomainsSearchDomainsSearchDomain `json:"-"` +} + +// GetSearchDomains returns ListSearchDomainsResponse.SearchDomains, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsResponse) GetSearchDomains() []ListSearchDomainsSearchDomainsSearchDomain { + return v.SearchDomains +} + +func (v *ListSearchDomainsResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListSearchDomainsResponse + SearchDomains []json.RawMessage `json:"searchDomains"` + graphql.NoUnmarshalJSON + } + firstPass.ListSearchDomainsResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.SearchDomains + src := firstPass.SearchDomains + *dst = make( + []ListSearchDomainsSearchDomainsSearchDomain, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalListSearchDomainsSearchDomainsSearchDomain( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ListSearchDomainsResponse.SearchDomains: %w", err) + } + } + } + } + return nil +} + +type __premarshalListSearchDomainsResponse struct { + SearchDomains []json.RawMessage `json:"searchDomains"` +} + +func (v *ListSearchDomainsResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListSearchDomainsResponse) __premarshalJSON() (*__premarshalListSearchDomainsResponse, error) { + var retval __premarshalListSearchDomainsResponse + + { + + dst := &retval.SearchDomains + src := v.SearchDomains + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalListSearchDomainsSearchDomainsSearchDomain( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ListSearchDomainsResponse.SearchDomains: %w", err) + } + } + } + return &retval, nil +} + +// ListSearchDomainsSearchDomainsRepository includes the requested fields of the GraphQL type Repository. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type ListSearchDomainsSearchDomainsRepository struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Name string `json:"name"` + // Common interface for Repositories and Views. + AutomaticSearch bool `json:"automaticSearch"` +} + +// GetTypename returns ListSearchDomainsSearchDomainsRepository.Typename, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsRepository) GetTypename() *string { return v.Typename } + +// GetName returns ListSearchDomainsSearchDomainsRepository.Name, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsRepository) GetName() string { return v.Name } + +// GetAutomaticSearch returns ListSearchDomainsSearchDomainsRepository.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsRepository) GetAutomaticSearch() bool { + return v.AutomaticSearch +} + +// ListSearchDomainsSearchDomainsSearchDomain includes the requested fields of the GraphQL interface SearchDomain. +// +// ListSearchDomainsSearchDomainsSearchDomain is implemented by the following types: +// ListSearchDomainsSearchDomainsRepository +// ListSearchDomainsSearchDomainsView +// The GraphQL type's documentation follows. +// +// Common interface for Repositories and Views. +type ListSearchDomainsSearchDomainsSearchDomain interface { + implementsGraphQLInterfaceListSearchDomainsSearchDomainsSearchDomain() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetName() string + // GetAutomaticSearch returns the interface-field "automaticSearch" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Common interface for Repositories and Views. + GetAutomaticSearch() bool +} + +func (v *ListSearchDomainsSearchDomainsRepository) implementsGraphQLInterfaceListSearchDomainsSearchDomainsSearchDomain() { +} +func (v *ListSearchDomainsSearchDomainsView) implementsGraphQLInterfaceListSearchDomainsSearchDomainsSearchDomain() { +} + +func __unmarshalListSearchDomainsSearchDomainsSearchDomain(b []byte, v *ListSearchDomainsSearchDomainsSearchDomain) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Repository": + *v = new(ListSearchDomainsSearchDomainsRepository) + return json.Unmarshal(b, *v) + case "View": + *v = new(ListSearchDomainsSearchDomainsView) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing SearchDomain.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ListSearchDomainsSearchDomainsSearchDomain: "%v"`, tn.TypeName) + } +} + +func __marshalListSearchDomainsSearchDomainsSearchDomain(v *ListSearchDomainsSearchDomainsSearchDomain) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ListSearchDomainsSearchDomainsRepository: + typename = "Repository" + + result := struct { + TypeName string `json:"__typename"` + *ListSearchDomainsSearchDomainsRepository + }{typename, v} + return json.Marshal(result) + case *ListSearchDomainsSearchDomainsView: + typename = "View" + + result := struct { + TypeName string `json:"__typename"` + *ListSearchDomainsSearchDomainsView + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ListSearchDomainsSearchDomainsSearchDomain: "%T"`, v) + } +} + +// ListSearchDomainsSearchDomainsView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type ListSearchDomainsSearchDomainsView struct { + Typename *string `json:"__typename"` + // Common interface for Repositories and Views. + Name string `json:"name"` + // Common interface for Repositories and Views. + AutomaticSearch bool `json:"automaticSearch"` +} + +// GetTypename returns ListSearchDomainsSearchDomainsView.Typename, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsView) GetTypename() *string { return v.Typename } + +// GetName returns ListSearchDomainsSearchDomainsView.Name, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsView) GetName() string { return v.Name } + +// GetAutomaticSearch returns ListSearchDomainsSearchDomainsView.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *ListSearchDomainsSearchDomainsView) GetAutomaticSearch() bool { return v.AutomaticSearch } + +// ListUsersResponse is returned by ListUsers on success. +type ListUsersResponse struct { + // Requires manage cluster permission; Returns all users in the system. + Users []ListUsersUsersUser `json:"users"` +} + +// GetUsers returns ListUsersResponse.Users, and is useful for accessing the field via an interface. +func (v *ListUsersResponse) GetUsers() []ListUsersUsersUser { return v.Users } + +// ListUsersUsersUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user profile. +type ListUsersUsersUser struct { + UserDetails `json:"-"` +} + +// GetId returns ListUsersUsersUser.Id, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetId() string { return v.UserDetails.Id } + +// GetUsername returns ListUsersUsersUser.Username, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetUsername() string { return v.UserDetails.Username } + +// GetFullName returns ListUsersUsersUser.FullName, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetFullName() *string { return v.UserDetails.FullName } + +// GetEmail returns ListUsersUsersUser.Email, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetEmail() *string { return v.UserDetails.Email } + +// GetCompany returns ListUsersUsersUser.Company, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetCompany() *string { return v.UserDetails.Company } + +// GetCountryCode returns ListUsersUsersUser.CountryCode, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetCountryCode() *string { return v.UserDetails.CountryCode } + +// GetPicture returns ListUsersUsersUser.Picture, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetPicture() *string { return v.UserDetails.Picture } + +// GetIsRoot returns ListUsersUsersUser.IsRoot, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetIsRoot() bool { return v.UserDetails.IsRoot } + +// GetCreatedAt returns ListUsersUsersUser.CreatedAt, and is useful for accessing the field via an interface. +func (v *ListUsersUsersUser) GetCreatedAt() time.Time { return v.UserDetails.CreatedAt } + +func (v *ListUsersUsersUser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ListUsersUsersUser + graphql.NoUnmarshalJSON + } + firstPass.ListUsersUsersUser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalListUsersUsersUser struct { + Id string `json:"id"` + + Username string `json:"username"` + + FullName *string `json:"fullName"` + + Email *string `json:"email"` + + Company *string `json:"company"` + + CountryCode *string `json:"countryCode"` + + Picture *string `json:"picture"` + + IsRoot bool `json:"isRoot"` + + CreatedAt time.Time `json:"createdAt"` +} + +func (v *ListUsersUsersUser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ListUsersUsersUser) __premarshalJSON() (*__premarshalListUsersUsersUser, error) { + var retval __premarshalListUsersUsersUser + + retval.Id = v.UserDetails.Id + retval.Username = v.UserDetails.Username + retval.FullName = v.UserDetails.FullName + retval.Email = v.UserDetails.Email + retval.Company = v.UserDetails.Company + retval.CountryCode = v.UserDetails.CountryCode + retval.Picture = v.UserDetails.Picture + retval.IsRoot = v.UserDetails.IsRoot + retval.CreatedAt = v.UserDetails.CreatedAt + return &retval, nil +} + +// Organization permissions +type OrganizationPermission string + +const ( + OrganizationPermissionExportorganization OrganizationPermission = "ExportOrganization" + OrganizationPermissionChangeorganizationpermissions OrganizationPermission = "ChangeOrganizationPermissions" + OrganizationPermissionChangeidentityproviders OrganizationPermission = "ChangeIdentityProviders" + OrganizationPermissionCreaterepository OrganizationPermission = "CreateRepository" + OrganizationPermissionManageusers OrganizationPermission = "ManageUsers" + OrganizationPermissionViewusage OrganizationPermission = "ViewUsage" + OrganizationPermissionChangeorganizationsettings OrganizationPermission = "ChangeOrganizationSettings" + OrganizationPermissionChangeipfilters OrganizationPermission = "ChangeIPFilters" + OrganizationPermissionChangesessions OrganizationPermission = "ChangeSessions" + OrganizationPermissionChangeallvieworrepositorypermissions OrganizationPermission = "ChangeAllViewOrRepositoryPermissions" + OrganizationPermissionIngestacrossallreposwithinorganization OrganizationPermission = "IngestAcrossAllReposWithinOrganization" + OrganizationPermissionDeleteallrepositories OrganizationPermission = "DeleteAllRepositories" + OrganizationPermissionDeleteallviews OrganizationPermission = "DeleteAllViews" + OrganizationPermissionViewallinternalnotifications OrganizationPermission = "ViewAllInternalNotifications" + OrganizationPermissionChangefleetmanagement OrganizationPermission = "ChangeFleetManagement" + OrganizationPermissionViewfleetmanagement OrganizationPermission = "ViewFleetManagement" + OrganizationPermissionChangetriggerstorunasotherusers OrganizationPermission = "ChangeTriggersToRunAsOtherUsers" + OrganizationPermissionMonitorqueries OrganizationPermission = "MonitorQueries" + OrganizationPermissionBlockqueries OrganizationPermission = "BlockQueries" + OrganizationPermissionChangesecuritypolicies OrganizationPermission = "ChangeSecurityPolicies" + OrganizationPermissionChangeexternalfunctions OrganizationPermission = "ChangeExternalFunctions" + OrganizationPermissionChangefieldaliases OrganizationPermission = "ChangeFieldAliases" + OrganizationPermissionManageviewconnections OrganizationPermission = "ManageViewConnections" +) + +type PackageInstallationSourceType string + +const ( + PackageInstallationSourceTypeHumiohub PackageInstallationSourceType = "HumioHub" + PackageInstallationSourceTypeZipfile PackageInstallationSourceType = "ZipFile" +) + +// ParserDetails includes the GraphQL fields of Parser requested by the fragment ParserDetails. +// The GraphQL type's documentation follows. +// +// A configured parser for incoming data. +type ParserDetails struct { + // The id of the parser. + Id string `json:"id"` + // Name of the parser. + Name string `json:"name"` + // The full name of the parser including package information if part of an application. + DisplayName string `json:"displayName"` + // The description of the parser. + Description *string `json:"description"` + // True if the parser is one of LogScale's built-in parsers. + IsBuiltIn bool `json:"isBuiltIn"` + // The parser script that is executed for every incoming event. + Script string `json:"script"` + // Fields that are used as tags. + FieldsToTag []string `json:"fieldsToTag"` + // A list of fields that will be removed from the event before it's parsed. These fields will not be included when calculating usage. + FieldsToBeRemovedBeforeParsing []string `json:"fieldsToBeRemovedBeforeParsing"` + // Test cases that can be used to help verify that the parser works as expected. + TestCases []ParserDetailsTestCasesParserTestCase `json:"testCases"` +} + +// GetId returns ParserDetails.Id, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetId() string { return v.Id } + +// GetName returns ParserDetails.Name, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetName() string { return v.Name } + +// GetDisplayName returns ParserDetails.DisplayName, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetDisplayName() string { return v.DisplayName } + +// GetDescription returns ParserDetails.Description, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetDescription() *string { return v.Description } + +// GetIsBuiltIn returns ParserDetails.IsBuiltIn, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetIsBuiltIn() bool { return v.IsBuiltIn } + +// GetScript returns ParserDetails.Script, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetScript() string { return v.Script } + +// GetFieldsToTag returns ParserDetails.FieldsToTag, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetFieldsToTag() []string { return v.FieldsToTag } + +// GetFieldsToBeRemovedBeforeParsing returns ParserDetails.FieldsToBeRemovedBeforeParsing, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetFieldsToBeRemovedBeforeParsing() []string { + return v.FieldsToBeRemovedBeforeParsing +} + +// GetTestCases returns ParserDetails.TestCases, and is useful for accessing the field via an interface. +func (v *ParserDetails) GetTestCases() []ParserDetailsTestCasesParserTestCase { return v.TestCases } + +// ParserDetailsTestCasesParserTestCase includes the requested fields of the GraphQL type ParserTestCase. +// The GraphQL type's documentation follows. +// +// A test case for a parser. +type ParserDetailsTestCasesParserTestCase struct { + // The event to parse and test on. + Event ParserDetailsTestCasesParserTestCaseEventParserTestEvent `json:"event"` + // Assertions on the shape of the test case output events. The list consists of key-value pairs to be treated as a map-construct, where the index of the output event is the key, and the assertions are the value. + OutputAssertions []ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput `json:"outputAssertions"` +} + +// GetEvent returns ParserDetailsTestCasesParserTestCase.Event, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCase) GetEvent() ParserDetailsTestCasesParserTestCaseEventParserTestEvent { + return v.Event +} + +// GetOutputAssertions returns ParserDetailsTestCasesParserTestCase.OutputAssertions, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCase) GetOutputAssertions() []ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput { + return v.OutputAssertions +} + +// ParserDetailsTestCasesParserTestCaseEventParserTestEvent includes the requested fields of the GraphQL type ParserTestEvent. +// The GraphQL type's documentation follows. +// +// An event for a parser to parse during testing. +type ParserDetailsTestCasesParserTestCaseEventParserTestEvent struct { + // The contents of the `@rawstring` field when the event begins parsing. + RawString string `json:"rawString"` +} + +// GetRawString returns ParserDetailsTestCasesParserTestCaseEventParserTestEvent.RawString, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseEventParserTestEvent) GetRawString() string { + return v.RawString +} + +// ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput includes the requested fields of the GraphQL type ParserTestCaseAssertionsForOutput. +// The GraphQL type's documentation follows. +// +// Assertions on the shape of the given output event. It is a key-value pair, where the index of the output event is the key, and the assertions are the value. +type ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput struct { + // Assertions on the shape of a given test case output event. + Assertions ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions `json:"assertions"` + // The index of the output event which the assertions should apply to. + OutputEventIndex int `json:"outputEventIndex"` +} + +// GetAssertions returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput.Assertions, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput) GetAssertions() ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions { + return v.Assertions +} + +// GetOutputEventIndex returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput.OutputEventIndex, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutput) GetOutputEventIndex() int { + return v.OutputEventIndex +} + +// ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions includes the requested fields of the GraphQL type ParserTestCaseOutputAssertions. +// The GraphQL type's documentation follows. +// +// Assertions on the shape of a given test case output event. +type ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions struct { + // Names of fields and their expected value on the output event. These are key-value pairs, and should be treated as a map-construct. + FieldsHaveValues []ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue `json:"fieldsHaveValues"` + // Names of fields which should not be present on the output event. + FieldsNotPresent []string `json:"fieldsNotPresent"` +} + +// GetFieldsHaveValues returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions.FieldsHaveValues, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions) GetFieldsHaveValues() []ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue { + return v.FieldsHaveValues +} + +// GetFieldsNotPresent returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions.FieldsNotPresent, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertions) GetFieldsNotPresent() []string { + return v.FieldsNotPresent +} + +// ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue includes the requested fields of the GraphQL type FieldHasValue. +// The GraphQL type's documentation follows. +// +// An assertion that an event output from a parser test case has an expected value for a given field. +type ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue struct { + // Field to assert on. + FieldName string `json:"fieldName"` + // Value expected to be contained in the field. + ExpectedValue string `json:"expectedValue"` +} + +// GetFieldName returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue.FieldName, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue) GetFieldName() string { + return v.FieldName +} + +// GetExpectedValue returns ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue.ExpectedValue, and is useful for accessing the field via an interface. +func (v *ParserDetailsTestCasesParserTestCaseOutputAssertionsParserTestCaseAssertionsForOutputAssertionsParserTestCaseOutputAssertionsFieldsHaveValuesFieldHasValue) GetExpectedValue() string { + return v.ExpectedValue +} + +// Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. +type ParserTestCaseAssertionsForOutputInput struct { + // Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. + OutputEventIndex int `json:"outputEventIndex"` + // Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. + Assertions ParserTestCaseOutputAssertionsInput `json:"assertions"` +} + +// GetOutputEventIndex returns ParserTestCaseAssertionsForOutputInput.OutputEventIndex, and is useful for accessing the field via an interface. +func (v *ParserTestCaseAssertionsForOutputInput) GetOutputEventIndex() int { return v.OutputEventIndex } + +// GetAssertions returns ParserTestCaseAssertionsForOutputInput.Assertions, and is useful for accessing the field via an interface. +func (v *ParserTestCaseAssertionsForOutputInput) GetAssertions() ParserTestCaseOutputAssertionsInput { + return v.Assertions +} + +// A test case for a parser. +type ParserTestCaseInput struct { + // A test case for a parser. + Event ParserTestEventInput `json:"event"` + // A test case for a parser. + OutputAssertions []ParserTestCaseAssertionsForOutputInput `json:"outputAssertions"` +} + +// GetEvent returns ParserTestCaseInput.Event, and is useful for accessing the field via an interface. +func (v *ParserTestCaseInput) GetEvent() ParserTestEventInput { return v.Event } + +// GetOutputAssertions returns ParserTestCaseInput.OutputAssertions, and is useful for accessing the field via an interface. +func (v *ParserTestCaseInput) GetOutputAssertions() []ParserTestCaseAssertionsForOutputInput { + return v.OutputAssertions +} + +// Assertions on the shape of a given test case output event. +type ParserTestCaseOutputAssertionsInput struct { + // Assertions on the shape of a given test case output event. + FieldsNotPresent []string `json:"fieldsNotPresent"` + // Assertions on the shape of a given test case output event. + FieldsHaveValues []FieldHasValueInput `json:"fieldsHaveValues"` +} + +// GetFieldsNotPresent returns ParserTestCaseOutputAssertionsInput.FieldsNotPresent, and is useful for accessing the field via an interface. +func (v *ParserTestCaseOutputAssertionsInput) GetFieldsNotPresent() []string { + return v.FieldsNotPresent +} + +// GetFieldsHaveValues returns ParserTestCaseOutputAssertionsInput.FieldsHaveValues, and is useful for accessing the field via an interface. +func (v *ParserTestCaseOutputAssertionsInput) GetFieldsHaveValues() []FieldHasValueInput { + return v.FieldsHaveValues +} + +// An event for a parser to parse during testing. +type ParserTestEventInput struct { + // An event for a parser to parse during testing. + RawString string `json:"rawString"` +} + +// GetRawString returns ParserTestEventInput.RawString, and is useful for accessing the field via an interface. +func (v *ParserTestEventInput) GetRawString() string { return v.RawString } + +// Permissions on a view +type Permission string + +const ( + PermissionChangeuseraccess Permission = "ChangeUserAccess" + // Permission to administer alerts, scheduled searches and actions + PermissionChangetriggersandactions Permission = "ChangeTriggersAndActions" + // Permission to administer alerts and scheduled searches + PermissionChangetriggers Permission = "ChangeTriggers" + // Permission to administer actions + PermissionChangeactions Permission = "ChangeActions" + PermissionChangedashboards Permission = "ChangeDashboards" + PermissionChangedashboardreadonlytoken Permission = "ChangeDashboardReadonlyToken" + PermissionChangefiles Permission = "ChangeFiles" + PermissionChangeinteractions Permission = "ChangeInteractions" + PermissionChangeparsers Permission = "ChangeParsers" + PermissionChangesavedqueries Permission = "ChangeSavedQueries" + PermissionConnectview Permission = "ConnectView" + PermissionChangedatadeletionpermissions Permission = "ChangeDataDeletionPermissions" + PermissionChangeretention Permission = "ChangeRetention" + PermissionChangedefaultsearchsettings Permission = "ChangeDefaultSearchSettings" + PermissionChanges3archivingsettings Permission = "ChangeS3ArchivingSettings" + PermissionDeletedatasources Permission = "DeleteDataSources" + PermissionDeleterepositoryorview Permission = "DeleteRepositoryOrView" + PermissionDeleteevents Permission = "DeleteEvents" + PermissionReadaccess Permission = "ReadAccess" + PermissionChangeingesttokens Permission = "ChangeIngestTokens" + PermissionChangepackages Permission = "ChangePackages" + PermissionChangevieworrepositorydescription Permission = "ChangeViewOrRepositoryDescription" + PermissionChangeconnections Permission = "ChangeConnections" + // Permission to administer event forwarding rules + PermissionEventforwarding Permission = "EventForwarding" + PermissionQuerydashboard Permission = "QueryDashboard" + PermissionChangevieworrepositorypermissions Permission = "ChangeViewOrRepositoryPermissions" + PermissionChangefdrfeeds Permission = "ChangeFdrFeeds" + PermissionOrganizationownedqueries Permission = "OrganizationOwnedQueries" + PermissionReadexternalfunctions Permission = "ReadExternalFunctions" + PermissionChangeingestfeeds Permission = "ChangeIngestFeeds" + PermissionChangescheduledreports Permission = "ChangeScheduledReports" +) + +// QueryOwnership includes the GraphQL fields of QueryOwnership requested by the fragment QueryOwnership. +// The GraphQL type's documentation follows. +// +// # Query ownership +// +// QueryOwnership is implemented by the following types: +// QueryOwnershipOrganizationOwnership +// QueryOwnershipUserOwnership +type QueryOwnership interface { + implementsGraphQLInterfaceQueryOwnership() + // GetId returns the interface-field "id" from its implementation. + // The GraphQL interface field's documentation follows. + // + // Query ownership + GetId() string +} + +func (v *QueryOwnershipOrganizationOwnership) implementsGraphQLInterfaceQueryOwnership() {} +func (v *QueryOwnershipUserOwnership) implementsGraphQLInterfaceQueryOwnership() {} + +func __unmarshalQueryOwnership(b []byte, v *QueryOwnership) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "OrganizationOwnership": + *v = new(QueryOwnershipOrganizationOwnership) + return json.Unmarshal(b, *v) + case "UserOwnership": + *v = new(QueryOwnershipUserOwnership) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing QueryOwnership.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for QueryOwnership: "%v"`, tn.TypeName) + } +} + +func __marshalQueryOwnership(v *QueryOwnership) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *QueryOwnershipOrganizationOwnership: + typename = "OrganizationOwnership" + + result := struct { + TypeName string `json:"__typename"` + *QueryOwnershipOrganizationOwnership + }{typename, v} + return json.Marshal(result) + case *QueryOwnershipUserOwnership: + typename = "UserOwnership" + + result := struct { + TypeName string `json:"__typename"` + *QueryOwnershipUserOwnership + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for QueryOwnership: "%T"`, v) + } +} + +// QueryOwnership includes the GraphQL fields of OrganizationOwnership requested by the fragment QueryOwnership. +// The GraphQL type's documentation follows. +// +// Query ownership +type QueryOwnershipOrganizationOwnership struct { + // Query ownership + Id string `json:"id"` +} + +// GetId returns QueryOwnershipOrganizationOwnership.Id, and is useful for accessing the field via an interface. +func (v *QueryOwnershipOrganizationOwnership) GetId() string { return v.Id } + +// The type of query ownership +type QueryOwnershipType string + +const ( + // Queries run on behalf of user + QueryOwnershipTypeUser QueryOwnershipType = "User" + // Queries run on behalf of the organization + QueryOwnershipTypeOrganization QueryOwnershipType = "Organization" +) + +// QueryOwnership includes the GraphQL fields of UserOwnership requested by the fragment QueryOwnership. +// The GraphQL type's documentation follows. +// +// Query ownership +type QueryOwnershipUserOwnership struct { + // Query ownership + Id string `json:"id"` +} + +// GetId returns QueryOwnershipUserOwnership.Id, and is useful for accessing the field via an interface. +func (v *QueryOwnershipUserOwnership) GetId() string { return v.Id } + +// Timestamp type to use for a query. +type QueryTimestampType string + +const ( + // Use @timestamp for the query. + QueryTimestampTypeEventtimestamp QueryTimestampType = "EventTimestamp" + // Use @ingesttimestamp for the query. + QueryTimestampTypeIngesttimestamp QueryTimestampType = "IngestTimestamp" +) + +// RemoveFileRemoveFileBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type RemoveFileRemoveFileBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns RemoveFileRemoveFileBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *RemoveFileRemoveFileBooleanResultType) GetTypename() *string { return v.Typename } + +// RemoveFileResponse is returned by RemoveFile on success. +type RemoveFileResponse struct { + // Remove file + RemoveFile RemoveFileRemoveFileBooleanResultType `json:"removeFile"` +} + +// GetRemoveFile returns RemoveFileResponse.RemoveFile, and is useful for accessing the field via an interface. +func (v *RemoveFileResponse) GetRemoveFile() RemoveFileRemoveFileBooleanResultType { + return v.RemoveFile +} + +// RemoveIngestTokenRemoveIngestTokenBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type RemoveIngestTokenRemoveIngestTokenBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns RemoveIngestTokenRemoveIngestTokenBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *RemoveIngestTokenRemoveIngestTokenBooleanResultType) GetTypename() *string { + return v.Typename +} + +// RemoveIngestTokenResponse is returned by RemoveIngestToken on success. +type RemoveIngestTokenResponse struct { + // Remove an Ingest Token. + RemoveIngestToken RemoveIngestTokenRemoveIngestTokenBooleanResultType `json:"removeIngestToken"` +} + +// GetRemoveIngestToken returns RemoveIngestTokenResponse.RemoveIngestToken, and is useful for accessing the field via an interface. +func (v *RemoveIngestTokenResponse) GetRemoveIngestToken() RemoveIngestTokenRemoveIngestTokenBooleanResultType { + return v.RemoveIngestToken +} + +// RemoveRoleByIDRemoveRoleBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type RemoveRoleByIDRemoveRoleBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns RemoveRoleByIDRemoveRoleBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *RemoveRoleByIDRemoveRoleBooleanResultType) GetTypename() *string { return v.Typename } + +// RemoveRoleByIDResponse is returned by RemoveRoleByID on success. +type RemoveRoleByIDResponse struct { + // Removes a role. Only usable if roles are not managed externally, e.g. in LDAP. + RemoveRole RemoveRoleByIDRemoveRoleBooleanResultType `json:"removeRole"` +} + +// GetRemoveRole returns RemoveRoleByIDResponse.RemoveRole, and is useful for accessing the field via an interface. +func (v *RemoveRoleByIDResponse) GetRemoveRole() RemoveRoleByIDRemoveRoleBooleanResultType { + return v.RemoveRole +} + +// RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation includes the requested fields of the GraphQL type RemoveUsersFromGroupMutation. +type RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation.Typename, and is useful for accessing the field via an interface. +func (v *RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation) GetTypename() *string { + return v.Typename +} + +// RemoveUserFromGroupResponse is returned by RemoveUserFromGroup on success. +type RemoveUserFromGroupResponse struct { + // Removes users from an existing group. + RemoveUsersFromGroup RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation `json:"removeUsersFromGroup"` +} + +// GetRemoveUsersFromGroup returns RemoveUserFromGroupResponse.RemoveUsersFromGroup, and is useful for accessing the field via an interface. +func (v *RemoveUserFromGroupResponse) GetRemoveUsersFromGroup() RemoveUserFromGroupRemoveUsersFromGroupRemoveUsersFromGroupMutation { + return v.RemoveUsersFromGroup +} + +// RemoveUserRemoveUserRemoveUserMutation includes the requested fields of the GraphQL type RemoveUserMutation. +type RemoveUserRemoveUserRemoveUserMutation struct { + User RemoveUserRemoveUserRemoveUserMutationUser `json:"user"` +} + +// GetUser returns RemoveUserRemoveUserRemoveUserMutation.User, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutation) GetUser() RemoveUserRemoveUserRemoveUserMutationUser { + return v.User +} + +// RemoveUserRemoveUserRemoveUserMutationUser includes the requested fields of the GraphQL type User. +// The GraphQL type's documentation follows. +// +// A user profile. +type RemoveUserRemoveUserRemoveUserMutationUser struct { + UserDetails `json:"-"` +} + +// GetId returns RemoveUserRemoveUserRemoveUserMutationUser.Id, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetId() string { return v.UserDetails.Id } + +// GetUsername returns RemoveUserRemoveUserRemoveUserMutationUser.Username, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetUsername() string { + return v.UserDetails.Username +} + +// GetFullName returns RemoveUserRemoveUserRemoveUserMutationUser.FullName, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetFullName() *string { + return v.UserDetails.FullName +} + +// GetEmail returns RemoveUserRemoveUserRemoveUserMutationUser.Email, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetEmail() *string { return v.UserDetails.Email } + +// GetCompany returns RemoveUserRemoveUserRemoveUserMutationUser.Company, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetCompany() *string { + return v.UserDetails.Company +} + +// GetCountryCode returns RemoveUserRemoveUserRemoveUserMutationUser.CountryCode, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetCountryCode() *string { + return v.UserDetails.CountryCode +} + +// GetPicture returns RemoveUserRemoveUserRemoveUserMutationUser.Picture, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetPicture() *string { + return v.UserDetails.Picture +} + +// GetIsRoot returns RemoveUserRemoveUserRemoveUserMutationUser.IsRoot, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetIsRoot() bool { return v.UserDetails.IsRoot } + +// GetCreatedAt returns RemoveUserRemoveUserRemoveUserMutationUser.CreatedAt, and is useful for accessing the field via an interface. +func (v *RemoveUserRemoveUserRemoveUserMutationUser) GetCreatedAt() time.Time { + return v.UserDetails.CreatedAt +} + +func (v *RemoveUserRemoveUserRemoveUserMutationUser) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *RemoveUserRemoveUserRemoveUserMutationUser + graphql.NoUnmarshalJSON + } + firstPass.RemoveUserRemoveUserRemoveUserMutationUser = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UserDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalRemoveUserRemoveUserRemoveUserMutationUser struct { + Id string `json:"id"` + + Username string `json:"username"` + + FullName *string `json:"fullName"` + + Email *string `json:"email"` + + Company *string `json:"company"` + + CountryCode *string `json:"countryCode"` + + Picture *string `json:"picture"` + + IsRoot bool `json:"isRoot"` + + CreatedAt time.Time `json:"createdAt"` +} + +func (v *RemoveUserRemoveUserRemoveUserMutationUser) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *RemoveUserRemoveUserRemoveUserMutationUser) __premarshalJSON() (*__premarshalRemoveUserRemoveUserRemoveUserMutationUser, error) { + var retval __premarshalRemoveUserRemoveUserRemoveUserMutationUser + + retval.Id = v.UserDetails.Id + retval.Username = v.UserDetails.Username + retval.FullName = v.UserDetails.FullName + retval.Email = v.UserDetails.Email + retval.Company = v.UserDetails.Company + retval.CountryCode = v.UserDetails.CountryCode + retval.Picture = v.UserDetails.Picture + retval.IsRoot = v.UserDetails.IsRoot + retval.CreatedAt = v.UserDetails.CreatedAt + return &retval, nil +} + +// RemoveUserResponse is returned by RemoveUser on success. +type RemoveUserResponse struct { + // Remove a user. + RemoveUser RemoveUserRemoveUserRemoveUserMutation `json:"removeUser"` +} + +// GetRemoveUser returns RemoveUserResponse.RemoveUser, and is useful for accessing the field via an interface. +func (v *RemoveUserResponse) GetRemoveUser() RemoveUserRemoveUserRemoveUserMutation { + return v.RemoveUser +} + +// RepositoryDetails includes the GraphQL fields of Repository requested by the fragment RepositoryDetails. +// The GraphQL type's documentation follows. +// +// A repository stores ingested data, configures parsers and data retention policies. +type RepositoryDetails struct { + Id string `json:"id"` + Name string `json:"name"` + Description *string `json:"description"` + // The maximum time (in days) to keep data. Data old than this will be deleted. + TimeBasedRetention *float64 `json:"timeBasedRetention"` + // Retention (in Gigabytes) based on the size of data when it arrives to LogScale, that is before parsing and compression. LogScale will keep `at most` this amount of data. + IngestSizeBasedRetention *float64 `json:"ingestSizeBasedRetention"` + // Retention (in Gigabytes) based on the size of data when in storage, that is, after parsing and compression. LogScale will keep `at least` this amount of data, but as close to this number as possible. + StorageSizeBasedRetention *float64 `json:"storageSizeBasedRetention"` + // Total size of data. Size is measured as the size after compression. + CompressedByteSize int64 `json:"compressedByteSize"` + AutomaticSearch bool `json:"automaticSearch"` + // Configuration for S3 archiving. E.g. bucket name and region. + S3ArchivingConfiguration *RepositoryDetailsS3ArchivingConfigurationS3Configuration `json:"s3ArchivingConfiguration"` +} + +// GetId returns RepositoryDetails.Id, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetId() string { return v.Id } + +// GetName returns RepositoryDetails.Name, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetName() string { return v.Name } + +// GetDescription returns RepositoryDetails.Description, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetDescription() *string { return v.Description } + +// GetTimeBasedRetention returns RepositoryDetails.TimeBasedRetention, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetTimeBasedRetention() *float64 { return v.TimeBasedRetention } + +// GetIngestSizeBasedRetention returns RepositoryDetails.IngestSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetIngestSizeBasedRetention() *float64 { return v.IngestSizeBasedRetention } + +// GetStorageSizeBasedRetention returns RepositoryDetails.StorageSizeBasedRetention, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetStorageSizeBasedRetention() *float64 { + return v.StorageSizeBasedRetention +} + +// GetCompressedByteSize returns RepositoryDetails.CompressedByteSize, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetCompressedByteSize() int64 { return v.CompressedByteSize } + +// GetAutomaticSearch returns RepositoryDetails.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetAutomaticSearch() bool { return v.AutomaticSearch } + +// GetS3ArchivingConfiguration returns RepositoryDetails.S3ArchivingConfiguration, and is useful for accessing the field via an interface. +func (v *RepositoryDetails) GetS3ArchivingConfiguration() *RepositoryDetailsS3ArchivingConfigurationS3Configuration { + return v.S3ArchivingConfiguration +} + +// RepositoryDetailsS3ArchivingConfigurationS3Configuration includes the requested fields of the GraphQL type S3Configuration. +// The GraphQL type's documentation follows. +// +// Configuration for S3 archiving. E.g. bucket name and region. +type RepositoryDetailsS3ArchivingConfigurationS3Configuration struct { + // S3 bucket name for storing archived data. Example: acme-bucket. + Bucket string `json:"bucket"` + // The region the S3 bucket belongs to. Example: eu-central-1. + Region string `json:"region"` + // Whether the archiving has been disabled. + Disabled *bool `json:"disabled"` + // The format to store the archived data in on S3. + Format *S3ArchivingFormat `json:"format"` +} + +// GetBucket returns RepositoryDetailsS3ArchivingConfigurationS3Configuration.Bucket, and is useful for accessing the field via an interface. +func (v *RepositoryDetailsS3ArchivingConfigurationS3Configuration) GetBucket() string { + return v.Bucket +} + +// GetRegion returns RepositoryDetailsS3ArchivingConfigurationS3Configuration.Region, and is useful for accessing the field via an interface. +func (v *RepositoryDetailsS3ArchivingConfigurationS3Configuration) GetRegion() string { + return v.Region +} + +// GetDisabled returns RepositoryDetailsS3ArchivingConfigurationS3Configuration.Disabled, and is useful for accessing the field via an interface. +func (v *RepositoryDetailsS3ArchivingConfigurationS3Configuration) GetDisabled() *bool { + return v.Disabled +} + +// GetFormat returns RepositoryDetailsS3ArchivingConfigurationS3Configuration.Format, and is useful for accessing the field via an interface. +func (v *RepositoryDetailsS3ArchivingConfigurationS3Configuration) GetFormat() *S3ArchivingFormat { + return v.Format +} + +// RoleDetails includes the GraphQL fields of Role requested by the fragment RoleDetails. +type RoleDetails struct { + Id string `json:"id"` + DisplayName string `json:"displayName"` + ViewPermissions []Permission `json:"viewPermissions"` + OrganizationPermissions []OrganizationPermission `json:"organizationPermissions"` + SystemPermissions []SystemPermission `json:"systemPermissions"` +} + +// GetId returns RoleDetails.Id, and is useful for accessing the field via an interface. +func (v *RoleDetails) GetId() string { return v.Id } + +// GetDisplayName returns RoleDetails.DisplayName, and is useful for accessing the field via an interface. +func (v *RoleDetails) GetDisplayName() string { return v.DisplayName } + +// GetViewPermissions returns RoleDetails.ViewPermissions, and is useful for accessing the field via an interface. +func (v *RoleDetails) GetViewPermissions() []Permission { return v.ViewPermissions } + +// GetOrganizationPermissions returns RoleDetails.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *RoleDetails) GetOrganizationPermissions() []OrganizationPermission { + return v.OrganizationPermissions +} + +// GetSystemPermissions returns RoleDetails.SystemPermissions, and is useful for accessing the field via an interface. +func (v *RoleDetails) GetSystemPermissions() []SystemPermission { return v.SystemPermissions } + +// RotateTokenByIDResponse is returned by RotateTokenByID on success. +type RotateTokenByIDResponse struct { + // Rotate a token + RotateToken string `json:"rotateToken"` +} + +// GetRotateToken returns RotateTokenByIDResponse.RotateToken, and is useful for accessing the field via an interface. +func (v *RotateTokenByIDResponse) GetRotateToken() string { return v.RotateToken } + +// The format to store archived segments in on AWS S3. +type S3ArchivingFormat string + +const ( + S3ArchivingFormatRaw S3ArchivingFormat = "RAW" + S3ArchivingFormatNdjson S3ArchivingFormat = "NDJSON" +) + +// ScheduledSearchDetails includes the GraphQL fields of ScheduledSearch requested by the fragment ScheduledSearchDetails. +// The GraphQL type's documentation follows. +// +// Information about a scheduled search +type ScheduledSearchDetails struct { + // Id of the scheduled search. + Id string `json:"id"` + // Name of the scheduled search. + Name string `json:"name"` + // Description of the scheduled search. + Description *string `json:"description"` + // LogScale query to execute. + QueryString string `json:"queryString"` + // Start of the relative time interval for the query. + Start string `json:"start"` + // End of the relative time interval for the query. + End string `json:"end"` + // Time zone of the schedule. Currently this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'. + TimeZone string `json:"timeZone"` + // Cron pattern describing the schedule to execute the query on. + Schedule string `json:"schedule"` + // User-defined limit, which caps the number of missed searches to backfill, e.g. in the event of a shutdown. + BackfillLimit int `json:"backfillLimit"` + // Flag indicating whether the scheduled search is enabled. + Enabled bool `json:"enabled"` + // List of actions to fire on query result. + ActionsV2 []ScheduledSearchDetailsActionsV2Action `json:"-"` + // Labels added to the scheduled search. + Labels []string `json:"labels"` + // Ownership of the query run by this scheduled search + QueryOwnership SharedQueryOwnershipType `json:"-"` +} + +// GetId returns ScheduledSearchDetails.Id, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetId() string { return v.Id } + +// GetName returns ScheduledSearchDetails.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetName() string { return v.Name } + +// GetDescription returns ScheduledSearchDetails.Description, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetDescription() *string { return v.Description } + +// GetQueryString returns ScheduledSearchDetails.QueryString, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetQueryString() string { return v.QueryString } + +// GetStart returns ScheduledSearchDetails.Start, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetStart() string { return v.Start } + +// GetEnd returns ScheduledSearchDetails.End, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetEnd() string { return v.End } + +// GetTimeZone returns ScheduledSearchDetails.TimeZone, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetTimeZone() string { return v.TimeZone } + +// GetSchedule returns ScheduledSearchDetails.Schedule, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetSchedule() string { return v.Schedule } + +// GetBackfillLimit returns ScheduledSearchDetails.BackfillLimit, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetBackfillLimit() int { return v.BackfillLimit } + +// GetEnabled returns ScheduledSearchDetails.Enabled, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetEnabled() bool { return v.Enabled } + +// GetActionsV2 returns ScheduledSearchDetails.ActionsV2, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetActionsV2() []ScheduledSearchDetailsActionsV2Action { + return v.ActionsV2 +} + +// GetLabels returns ScheduledSearchDetails.Labels, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetLabels() []string { return v.Labels } + +// GetQueryOwnership returns ScheduledSearchDetails.QueryOwnership, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetails) GetQueryOwnership() SharedQueryOwnershipType { + return v.QueryOwnership +} + +func (v *ScheduledSearchDetails) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *ScheduledSearchDetails + ActionsV2 []json.RawMessage `json:"actionsV2"` + QueryOwnership json.RawMessage `json:"queryOwnership"` + graphql.NoUnmarshalJSON + } + firstPass.ScheduledSearchDetails = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.ActionsV2 + src := firstPass.ActionsV2 + *dst = make( + []ScheduledSearchDetailsActionsV2Action, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalScheduledSearchDetailsActionsV2Action( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + } + + { + dst := &v.QueryOwnership + src := firstPass.QueryOwnership + if len(src) != 0 && string(src) != "null" { + err = __unmarshalSharedQueryOwnershipType( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + } + return nil +} + +type __premarshalScheduledSearchDetails struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + Start string `json:"start"` + + End string `json:"end"` + + TimeZone string `json:"timeZone"` + + Schedule string `json:"schedule"` + + BackfillLimit int `json:"backfillLimit"` + + Enabled bool `json:"enabled"` + + ActionsV2 []json.RawMessage `json:"actionsV2"` + + Labels []string `json:"labels"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *ScheduledSearchDetails) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *ScheduledSearchDetails) __premarshalJSON() (*__premarshalScheduledSearchDetails, error) { + var retval __premarshalScheduledSearchDetails + + retval.Id = v.Id + retval.Name = v.Name + retval.Description = v.Description + retval.QueryString = v.QueryString + retval.Start = v.Start + retval.End = v.End + retval.TimeZone = v.TimeZone + retval.Schedule = v.Schedule + retval.BackfillLimit = v.BackfillLimit + retval.Enabled = v.Enabled + { + + dst := &retval.ActionsV2 + src := v.ActionsV2 + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalScheduledSearchDetailsActionsV2Action( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + retval.Labels = v.Labels + { + + dst := &retval.QueryOwnership + src := v.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// ScheduledSearchDetailsActionsV2Action includes the requested fields of the GraphQL interface Action. +// +// ScheduledSearchDetailsActionsV2Action is implemented by the following types: +// ScheduledSearchDetailsActionsV2EmailAction +// ScheduledSearchDetailsActionsV2HumioRepoAction +// ScheduledSearchDetailsActionsV2OpsGenieAction +// ScheduledSearchDetailsActionsV2PagerDutyAction +// ScheduledSearchDetailsActionsV2SlackAction +// ScheduledSearchDetailsActionsV2SlackPostMessageAction +// ScheduledSearchDetailsActionsV2UploadFileAction +// ScheduledSearchDetailsActionsV2VictorOpsAction +// ScheduledSearchDetailsActionsV2WebhookAction +// The GraphQL type's documentation follows. +// +// An action that can be invoked from a trigger. +type ScheduledSearchDetailsActionsV2Action interface { + implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + // GetName returns the interface-field "name" from its implementation. + // The GraphQL interface field's documentation follows. + // + // An action that can be invoked from a trigger. + GetName() string +} + +func (v *ScheduledSearchDetailsActionsV2EmailAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2HumioRepoAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2OpsGenieAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2PagerDutyAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2SlackAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2SlackPostMessageAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2UploadFileAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2VictorOpsAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} +func (v *ScheduledSearchDetailsActionsV2WebhookAction) implementsGraphQLInterfaceScheduledSearchDetailsActionsV2Action() { +} + +func __unmarshalScheduledSearchDetailsActionsV2Action(b []byte, v *ScheduledSearchDetailsActionsV2Action) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "EmailAction": + *v = new(ScheduledSearchDetailsActionsV2EmailAction) + return json.Unmarshal(b, *v) + case "HumioRepoAction": + *v = new(ScheduledSearchDetailsActionsV2HumioRepoAction) + return json.Unmarshal(b, *v) + case "OpsGenieAction": + *v = new(ScheduledSearchDetailsActionsV2OpsGenieAction) + return json.Unmarshal(b, *v) + case "PagerDutyAction": + *v = new(ScheduledSearchDetailsActionsV2PagerDutyAction) + return json.Unmarshal(b, *v) + case "SlackAction": + *v = new(ScheduledSearchDetailsActionsV2SlackAction) + return json.Unmarshal(b, *v) + case "SlackPostMessageAction": + *v = new(ScheduledSearchDetailsActionsV2SlackPostMessageAction) + return json.Unmarshal(b, *v) + case "UploadFileAction": + *v = new(ScheduledSearchDetailsActionsV2UploadFileAction) + return json.Unmarshal(b, *v) + case "VictorOpsAction": + *v = new(ScheduledSearchDetailsActionsV2VictorOpsAction) + return json.Unmarshal(b, *v) + case "WebhookAction": + *v = new(ScheduledSearchDetailsActionsV2WebhookAction) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Action.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for ScheduledSearchDetailsActionsV2Action: "%v"`, tn.TypeName) + } +} + +func __marshalScheduledSearchDetailsActionsV2Action(v *ScheduledSearchDetailsActionsV2Action) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *ScheduledSearchDetailsActionsV2EmailAction: + typename = "EmailAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2EmailAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2HumioRepoAction: + typename = "HumioRepoAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2HumioRepoAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2OpsGenieAction: + typename = "OpsGenieAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2OpsGenieAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2PagerDutyAction: + typename = "PagerDutyAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2PagerDutyAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2SlackAction: + typename = "SlackAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2SlackAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2SlackPostMessageAction: + typename = "SlackPostMessageAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2SlackPostMessageAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2UploadFileAction: + typename = "UploadFileAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2UploadFileAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2VictorOpsAction: + typename = "VictorOpsAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2VictorOpsAction + }{typename, v} + return json.Marshal(result) + case *ScheduledSearchDetailsActionsV2WebhookAction: + typename = "WebhookAction" + + result := struct { + TypeName string `json:"__typename"` + *ScheduledSearchDetailsActionsV2WebhookAction + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for ScheduledSearchDetailsActionsV2Action: "%T"`, v) + } +} + +// ScheduledSearchDetailsActionsV2EmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type ScheduledSearchDetailsActionsV2EmailAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2EmailAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2EmailAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2EmailAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2EmailAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2HumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type ScheduledSearchDetailsActionsV2HumioRepoAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2HumioRepoAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2HumioRepoAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2HumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2HumioRepoAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2OpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type ScheduledSearchDetailsActionsV2OpsGenieAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2OpsGenieAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2OpsGenieAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2OpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2OpsGenieAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2PagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type ScheduledSearchDetailsActionsV2PagerDutyAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2PagerDutyAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2PagerDutyAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2PagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2PagerDutyAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2SlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type ScheduledSearchDetailsActionsV2SlackAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2SlackAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2SlackAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2SlackAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2SlackAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2SlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type ScheduledSearchDetailsActionsV2SlackPostMessageAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2SlackPostMessageAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2SlackPostMessageAction) GetTypename() *string { + return v.Typename +} + +// GetName returns ScheduledSearchDetailsActionsV2SlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2SlackPostMessageAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2UploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type ScheduledSearchDetailsActionsV2UploadFileAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2UploadFileAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2UploadFileAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2UploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2UploadFileAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2VictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type ScheduledSearchDetailsActionsV2VictorOpsAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2VictorOpsAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2VictorOpsAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2VictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2VictorOpsAction) GetName() string { return v.Name } + +// ScheduledSearchDetailsActionsV2WebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type ScheduledSearchDetailsActionsV2WebhookAction struct { + Typename *string `json:"__typename"` + // An action that can be invoked from a trigger. + Name string `json:"name"` +} + +// GetTypename returns ScheduledSearchDetailsActionsV2WebhookAction.Typename, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2WebhookAction) GetTypename() *string { return v.Typename } + +// GetName returns ScheduledSearchDetailsActionsV2WebhookAction.Name, and is useful for accessing the field via an interface. +func (v *ScheduledSearchDetailsActionsV2WebhookAction) GetName() string { return v.Name } + +// SetAutomaticSearchingResponse is returned by SetAutomaticSearching on success. +type SetAutomaticSearchingResponse struct { + // Automatically search when arriving at the search page + SetAutomaticSearching SetAutomaticSearchingSetAutomaticSearching `json:"setAutomaticSearching"` +} + +// GetSetAutomaticSearching returns SetAutomaticSearchingResponse.SetAutomaticSearching, and is useful for accessing the field via an interface. +func (v *SetAutomaticSearchingResponse) GetSetAutomaticSearching() SetAutomaticSearchingSetAutomaticSearching { + return v.SetAutomaticSearching +} + +// SetAutomaticSearchingSetAutomaticSearching includes the requested fields of the GraphQL type setAutomaticSearching. +type SetAutomaticSearchingSetAutomaticSearching struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns SetAutomaticSearchingSetAutomaticSearching.Typename, and is useful for accessing the field via an interface. +func (v *SetAutomaticSearchingSetAutomaticSearching) GetTypename() *string { return v.Typename } + +// SharedQueryOwnershipType includes the requested fields of the GraphQL interface QueryOwnership. +// +// SharedQueryOwnershipType is implemented by the following types: +// SharedQueryOwnershipTypeOrganizationOwnership +// SharedQueryOwnershipTypeUserOwnership +// The GraphQL type's documentation follows. +// +// Query ownership +type SharedQueryOwnershipType interface { + implementsGraphQLInterfaceSharedQueryOwnershipType() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string + QueryOwnership +} + +func (v *SharedQueryOwnershipTypeOrganizationOwnership) implementsGraphQLInterfaceSharedQueryOwnershipType() { +} +func (v *SharedQueryOwnershipTypeUserOwnership) implementsGraphQLInterfaceSharedQueryOwnershipType() { +} + +func __unmarshalSharedQueryOwnershipType(b []byte, v *SharedQueryOwnershipType) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "OrganizationOwnership": + *v = new(SharedQueryOwnershipTypeOrganizationOwnership) + return json.Unmarshal(b, *v) + case "UserOwnership": + *v = new(SharedQueryOwnershipTypeUserOwnership) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing QueryOwnership.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for SharedQueryOwnershipType: "%v"`, tn.TypeName) + } +} + +func __marshalSharedQueryOwnershipType(v *SharedQueryOwnershipType) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *SharedQueryOwnershipTypeOrganizationOwnership: + typename = "OrganizationOwnership" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalSharedQueryOwnershipTypeOrganizationOwnership + }{typename, premarshaled} + return json.Marshal(result) + case *SharedQueryOwnershipTypeUserOwnership: + typename = "UserOwnership" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalSharedQueryOwnershipTypeUserOwnership + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for SharedQueryOwnershipType: "%T"`, v) + } +} + +// SharedQueryOwnershipTypeOrganizationOwnership includes the requested fields of the GraphQL type OrganizationOwnership. +// The GraphQL type's documentation follows. +// +// Query running with organization based ownership +type SharedQueryOwnershipTypeOrganizationOwnership struct { + Typename *string `json:"__typename"` + QueryOwnershipOrganizationOwnership `json:"-"` +} + +// GetTypename returns SharedQueryOwnershipTypeOrganizationOwnership.Typename, and is useful for accessing the field via an interface. +func (v *SharedQueryOwnershipTypeOrganizationOwnership) GetTypename() *string { return v.Typename } + +// GetId returns SharedQueryOwnershipTypeOrganizationOwnership.Id, and is useful for accessing the field via an interface. +func (v *SharedQueryOwnershipTypeOrganizationOwnership) GetId() string { + return v.QueryOwnershipOrganizationOwnership.Id +} + +func (v *SharedQueryOwnershipTypeOrganizationOwnership) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *SharedQueryOwnershipTypeOrganizationOwnership + graphql.NoUnmarshalJSON + } + firstPass.SharedQueryOwnershipTypeOrganizationOwnership = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.QueryOwnershipOrganizationOwnership) + if err != nil { + return err + } + return nil +} + +type __premarshalSharedQueryOwnershipTypeOrganizationOwnership struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` +} + +func (v *SharedQueryOwnershipTypeOrganizationOwnership) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *SharedQueryOwnershipTypeOrganizationOwnership) __premarshalJSON() (*__premarshalSharedQueryOwnershipTypeOrganizationOwnership, error) { + var retval __premarshalSharedQueryOwnershipTypeOrganizationOwnership + + retval.Typename = v.Typename + retval.Id = v.QueryOwnershipOrganizationOwnership.Id + return &retval, nil +} + +// SharedQueryOwnershipTypeUserOwnership includes the requested fields of the GraphQL type UserOwnership. +// The GraphQL type's documentation follows. +// +// Query running with user based ownership +type SharedQueryOwnershipTypeUserOwnership struct { + Typename *string `json:"__typename"` + QueryOwnershipUserOwnership `json:"-"` +} + +// GetTypename returns SharedQueryOwnershipTypeUserOwnership.Typename, and is useful for accessing the field via an interface. +func (v *SharedQueryOwnershipTypeUserOwnership) GetTypename() *string { return v.Typename } + +// GetId returns SharedQueryOwnershipTypeUserOwnership.Id, and is useful for accessing the field via an interface. +func (v *SharedQueryOwnershipTypeUserOwnership) GetId() string { + return v.QueryOwnershipUserOwnership.Id +} + +func (v *SharedQueryOwnershipTypeUserOwnership) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *SharedQueryOwnershipTypeUserOwnership + graphql.NoUnmarshalJSON + } + firstPass.SharedQueryOwnershipTypeUserOwnership = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.QueryOwnershipUserOwnership) + if err != nil { + return err + } + return nil +} + +type __premarshalSharedQueryOwnershipTypeUserOwnership struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` +} + +func (v *SharedQueryOwnershipTypeUserOwnership) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *SharedQueryOwnershipTypeUserOwnership) __premarshalJSON() (*__premarshalSharedQueryOwnershipTypeUserOwnership, error) { + var retval __premarshalSharedQueryOwnershipTypeUserOwnership + + retval.Typename = v.Typename + retval.Id = v.QueryOwnershipUserOwnership.Id + return &retval, nil +} + +// Slack message field entry. +type SlackFieldEntryInput struct { + // Slack message field entry. + FieldName string `json:"fieldName"` + // Slack message field entry. + Value string `json:"value"` +} + +// GetFieldName returns SlackFieldEntryInput.FieldName, and is useful for accessing the field via an interface. +func (v *SlackFieldEntryInput) GetFieldName() string { return v.FieldName } + +// GetValue returns SlackFieldEntryInput.Value, and is useful for accessing the field via an interface. +func (v *SlackFieldEntryInput) GetValue() string { return v.Value } + +// System permissions +type SystemPermission string + +const ( + SystemPermissionReadhealthcheck SystemPermission = "ReadHealthCheck" + SystemPermissionVieworganizations SystemPermission = "ViewOrganizations" + SystemPermissionManageorganizations SystemPermission = "ManageOrganizations" + SystemPermissionImportorganization SystemPermission = "ImportOrganization" + SystemPermissionDeleteorganizations SystemPermission = "DeleteOrganizations" + SystemPermissionChangesystempermissions SystemPermission = "ChangeSystemPermissions" + SystemPermissionManagecluster SystemPermission = "ManageCluster" + SystemPermissionIngestacrossallreposwithincluster SystemPermission = "IngestAcrossAllReposWithinCluster" + SystemPermissionDeletehumioownedrepositoryorview SystemPermission = "DeleteHumioOwnedRepositoryOrView" + SystemPermissionChangeusername SystemPermission = "ChangeUsername" + SystemPermissionChangefeatureflags SystemPermission = "ChangeFeatureFlags" + SystemPermissionChangesubdomains SystemPermission = "ChangeSubdomains" + SystemPermissionListsubdomains SystemPermission = "ListSubdomains" + SystemPermissionPatchglobal SystemPermission = "PatchGlobal" + SystemPermissionChangebucketstorage SystemPermission = "ChangeBucketStorage" + SystemPermissionManageorganizationlinks SystemPermission = "ManageOrganizationLinks" +) + +// Trigger mode for an aggregate alert. +type TriggerMode string + +const ( + // Wait for up to 20 minutes for a complete result before triggering. + TriggerModeCompletemode TriggerMode = "CompleteMode" + // Trigger immediately, even on incomplete results. If nothing to trigger on, wait for up to 20 minutes for there to be a result to trigger on. + TriggerModeImmediatemode TriggerMode = "ImmediateMode" +) + +// UnassignParserToIngestTokenResponse is returned by UnassignParserToIngestToken on success. +type UnassignParserToIngestTokenResponse struct { + // Un-associates a token with its currently assigned parser. + UnassignIngestToken UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation `json:"unassignIngestToken"` +} + +// GetUnassignIngestToken returns UnassignParserToIngestTokenResponse.UnassignIngestToken, and is useful for accessing the field via an interface. +func (v *UnassignParserToIngestTokenResponse) GetUnassignIngestToken() UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation { + return v.UnassignIngestToken +} + +// UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation includes the requested fields of the GraphQL type UnassignIngestTokenMutation. +type UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation.Typename, and is useful for accessing the field via an interface. +func (v *UnassignParserToIngestTokenUnassignIngestTokenUnassignIngestTokenMutation) GetTypename() *string { + return v.Typename +} + +// UninstallPackageResponse is returned by UninstallPackage on success. +type UninstallPackageResponse struct { + // Uninstalls a package from a specific view. + UninstallPackage UninstallPackageUninstallPackageBooleanResultType `json:"uninstallPackage"` +} + +// GetUninstallPackage returns UninstallPackageResponse.UninstallPackage, and is useful for accessing the field via an interface. +func (v *UninstallPackageResponse) GetUninstallPackage() UninstallPackageUninstallPackageBooleanResultType { + return v.UninstallPackage +} + +// UninstallPackageUninstallPackageBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type UninstallPackageUninstallPackageBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UninstallPackageUninstallPackageBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *UninstallPackageUninstallPackageBooleanResultType) GetTypename() *string { return v.Typename } + +// UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation includes the requested fields of the GraphQL type UnregisterNodeMutation. +type UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation.Typename, and is useful for accessing the field via an interface. +func (v *UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation) GetTypename() *string { + return v.Typename +} + +// UnregisterClusterNodeResponse is returned by UnregisterClusterNode on success. +type UnregisterClusterNodeResponse struct { + // Unregisters a node from the cluster. + ClusterUnregisterNode UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation `json:"clusterUnregisterNode"` +} + +// GetClusterUnregisterNode returns UnregisterClusterNodeResponse.ClusterUnregisterNode, and is useful for accessing the field via an interface. +func (v *UnregisterClusterNodeResponse) GetClusterUnregisterNode() UnregisterClusterNodeClusterUnregisterNodeUnregisterNodeMutation { + return v.ClusterUnregisterNode +} + +// UpdateAggregateAlertResponse is returned by UpdateAggregateAlert on success. +type UpdateAggregateAlertResponse struct { + // Update an aggregate alert. + UpdateAggregateAlert UpdateAggregateAlertUpdateAggregateAlert `json:"updateAggregateAlert"` +} + +// GetUpdateAggregateAlert returns UpdateAggregateAlertResponse.UpdateAggregateAlert, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertResponse) GetUpdateAggregateAlert() UpdateAggregateAlertUpdateAggregateAlert { + return v.UpdateAggregateAlert +} + +// UpdateAggregateAlertUpdateAggregateAlert includes the requested fields of the GraphQL type AggregateAlert. +// The GraphQL type's documentation follows. +// +// An aggregate alert. +type UpdateAggregateAlertUpdateAggregateAlert struct { + AggregateAlertDetails `json:"-"` +} + +// GetId returns UpdateAggregateAlertUpdateAggregateAlert.Id, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetId() string { return v.AggregateAlertDetails.Id } + +// GetName returns UpdateAggregateAlertUpdateAggregateAlert.Name, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetName() string { + return v.AggregateAlertDetails.Name +} + +// GetDescription returns UpdateAggregateAlertUpdateAggregateAlert.Description, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetDescription() *string { + return v.AggregateAlertDetails.Description +} + +// GetQueryString returns UpdateAggregateAlertUpdateAggregateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetQueryString() string { + return v.AggregateAlertDetails.QueryString +} + +// GetSearchIntervalSeconds returns UpdateAggregateAlertUpdateAggregateAlert.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetSearchIntervalSeconds() int64 { + return v.AggregateAlertDetails.SearchIntervalSeconds +} + +// GetThrottleTimeSeconds returns UpdateAggregateAlertUpdateAggregateAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetThrottleTimeSeconds() int64 { + return v.AggregateAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns UpdateAggregateAlertUpdateAggregateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetThrottleField() *string { + return v.AggregateAlertDetails.ThrottleField +} + +// GetActions returns UpdateAggregateAlertUpdateAggregateAlert.Actions, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetActions() []AggregateAlertDetailsActionsAction { + return v.AggregateAlertDetails.Actions +} + +// GetLabels returns UpdateAggregateAlertUpdateAggregateAlert.Labels, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetLabels() []string { + return v.AggregateAlertDetails.Labels +} + +// GetEnabled returns UpdateAggregateAlertUpdateAggregateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetEnabled() bool { + return v.AggregateAlertDetails.Enabled +} + +// GetTriggerMode returns UpdateAggregateAlertUpdateAggregateAlert.TriggerMode, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetTriggerMode() TriggerMode { + return v.AggregateAlertDetails.TriggerMode +} + +// GetQueryTimestampType returns UpdateAggregateAlertUpdateAggregateAlert.QueryTimestampType, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetQueryTimestampType() QueryTimestampType { + return v.AggregateAlertDetails.QueryTimestampType +} + +// GetQueryOwnership returns UpdateAggregateAlertUpdateAggregateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *UpdateAggregateAlertUpdateAggregateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AggregateAlertDetails.QueryOwnership +} + +func (v *UpdateAggregateAlertUpdateAggregateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateAggregateAlertUpdateAggregateAlert + graphql.NoUnmarshalJSON + } + firstPass.UpdateAggregateAlertUpdateAggregateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AggregateAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateAggregateAlertUpdateAggregateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + SearchIntervalSeconds int64 `json:"searchIntervalSeconds"` + + ThrottleTimeSeconds int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + TriggerMode TriggerMode `json:"triggerMode"` + + QueryTimestampType QueryTimestampType `json:"queryTimestampType"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *UpdateAggregateAlertUpdateAggregateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateAggregateAlertUpdateAggregateAlert) __premarshalJSON() (*__premarshalUpdateAggregateAlertUpdateAggregateAlert, error) { + var retval __premarshalUpdateAggregateAlertUpdateAggregateAlert + + retval.Id = v.AggregateAlertDetails.Id + retval.Name = v.AggregateAlertDetails.Name + retval.Description = v.AggregateAlertDetails.Description + retval.QueryString = v.AggregateAlertDetails.QueryString + retval.SearchIntervalSeconds = v.AggregateAlertDetails.SearchIntervalSeconds + retval.ThrottleTimeSeconds = v.AggregateAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.AggregateAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.AggregateAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalAggregateAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateAggregateAlertUpdateAggregateAlert.AggregateAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.AggregateAlertDetails.Labels + retval.Enabled = v.AggregateAlertDetails.Enabled + retval.TriggerMode = v.AggregateAlertDetails.TriggerMode + retval.QueryTimestampType = v.AggregateAlertDetails.QueryTimestampType + { + + dst := &retval.QueryOwnership + src := v.AggregateAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateAggregateAlertUpdateAggregateAlert.AggregateAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// UpdateAlertResponse is returned by UpdateAlert on success. +type UpdateAlertResponse struct { + // Update an alert. + UpdateAlert UpdateAlertUpdateAlert `json:"updateAlert"` +} + +// GetUpdateAlert returns UpdateAlertResponse.UpdateAlert, and is useful for accessing the field via an interface. +func (v *UpdateAlertResponse) GetUpdateAlert() UpdateAlertUpdateAlert { return v.UpdateAlert } + +// UpdateAlertUpdateAlert includes the requested fields of the GraphQL type Alert. +// The GraphQL type's documentation follows. +// +// An alert. +type UpdateAlertUpdateAlert struct { + AlertDetails `json:"-"` +} + +// GetId returns UpdateAlertUpdateAlert.Id, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetId() string { return v.AlertDetails.Id } + +// GetName returns UpdateAlertUpdateAlert.Name, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetName() string { return v.AlertDetails.Name } + +// GetQueryString returns UpdateAlertUpdateAlert.QueryString, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetQueryString() string { return v.AlertDetails.QueryString } + +// GetQueryStart returns UpdateAlertUpdateAlert.QueryStart, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetQueryStart() string { return v.AlertDetails.QueryStart } + +// GetThrottleField returns UpdateAlertUpdateAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetThrottleField() *string { return v.AlertDetails.ThrottleField } + +// GetTimeOfLastTrigger returns UpdateAlertUpdateAlert.TimeOfLastTrigger, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetTimeOfLastTrigger() *int64 { + return v.AlertDetails.TimeOfLastTrigger +} + +// GetIsStarred returns UpdateAlertUpdateAlert.IsStarred, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetIsStarred() bool { return v.AlertDetails.IsStarred } + +// GetDescription returns UpdateAlertUpdateAlert.Description, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetDescription() *string { return v.AlertDetails.Description } + +// GetThrottleTimeMillis returns UpdateAlertUpdateAlert.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetThrottleTimeMillis() int64 { + return v.AlertDetails.ThrottleTimeMillis +} + +// GetEnabled returns UpdateAlertUpdateAlert.Enabled, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetEnabled() bool { return v.AlertDetails.Enabled } + +// GetActions returns UpdateAlertUpdateAlert.Actions, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetActions() []string { return v.AlertDetails.Actions } + +// GetLabels returns UpdateAlertUpdateAlert.Labels, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetLabels() []string { return v.AlertDetails.Labels } + +// GetLastError returns UpdateAlertUpdateAlert.LastError, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetLastError() *string { return v.AlertDetails.LastError } + +// GetQueryOwnership returns UpdateAlertUpdateAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *UpdateAlertUpdateAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.AlertDetails.QueryOwnership +} + +func (v *UpdateAlertUpdateAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateAlertUpdateAlert + graphql.NoUnmarshalJSON + } + firstPass.UpdateAlertUpdateAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateAlertUpdateAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + QueryString string `json:"queryString"` + + QueryStart string `json:"queryStart"` + + ThrottleField *string `json:"throttleField"` + + TimeOfLastTrigger *int64 `json:"timeOfLastTrigger"` + + IsStarred bool `json:"isStarred"` + + Description *string `json:"description"` + + ThrottleTimeMillis int64 `json:"throttleTimeMillis"` + + Enabled bool `json:"enabled"` + + Actions []string `json:"actions"` + + Labels []string `json:"labels"` + + LastError *string `json:"lastError"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *UpdateAlertUpdateAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateAlertUpdateAlert) __premarshalJSON() (*__premarshalUpdateAlertUpdateAlert, error) { + var retval __premarshalUpdateAlertUpdateAlert + + retval.Id = v.AlertDetails.Id + retval.Name = v.AlertDetails.Name + retval.QueryString = v.AlertDetails.QueryString + retval.QueryStart = v.AlertDetails.QueryStart + retval.ThrottleField = v.AlertDetails.ThrottleField + retval.TimeOfLastTrigger = v.AlertDetails.TimeOfLastTrigger + retval.IsStarred = v.AlertDetails.IsStarred + retval.Description = v.AlertDetails.Description + retval.ThrottleTimeMillis = v.AlertDetails.ThrottleTimeMillis + retval.Enabled = v.AlertDetails.Enabled + retval.Actions = v.AlertDetails.Actions + retval.Labels = v.AlertDetails.Labels + retval.LastError = v.AlertDetails.LastError + { + + dst := &retval.QueryOwnership + src := v.AlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateAlertUpdateAlert.AlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// UpdateDescriptionForSearchDomainResponse is returned by UpdateDescriptionForSearchDomain on success. +type UpdateDescriptionForSearchDomainResponse struct { + UpdateDescriptionForSearchDomain UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation `json:"updateDescriptionForSearchDomain"` +} + +// GetUpdateDescriptionForSearchDomain returns UpdateDescriptionForSearchDomainResponse.UpdateDescriptionForSearchDomain, and is useful for accessing the field via an interface. +func (v *UpdateDescriptionForSearchDomainResponse) GetUpdateDescriptionForSearchDomain() UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation { + return v.UpdateDescriptionForSearchDomain +} + +// UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation includes the requested fields of the GraphQL type UpdateDescriptionMutation. +type UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation.Typename, and is useful for accessing the field via an interface. +func (v *UpdateDescriptionForSearchDomainUpdateDescriptionForSearchDomainUpdateDescriptionMutation) GetTypename() *string { + return v.Typename +} + +// UpdateEmailActionResponse is returned by UpdateEmailAction on success. +type UpdateEmailActionResponse struct { + // Update an email action. + UpdateEmailAction UpdateEmailActionUpdateEmailAction `json:"updateEmailAction"` +} + +// GetUpdateEmailAction returns UpdateEmailActionResponse.UpdateEmailAction, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionResponse) GetUpdateEmailAction() UpdateEmailActionUpdateEmailAction { + return v.UpdateEmailAction +} + +// UpdateEmailActionUpdateEmailAction includes the requested fields of the GraphQL type EmailAction. +// The GraphQL type's documentation follows. +// +// An email action. +type UpdateEmailActionUpdateEmailAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // List of email addresses to send an email to. + Recipients []string `json:"recipients"` + // Subject of the email. Can be templated with values from the result. + SubjectTemplate *string `json:"subjectTemplate"` + // Body of the email. Can be templated with values from the result. + BodyTemplate *string `json:"bodyTemplate"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateEmailActionUpdateEmailAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetId() string { return v.Id } + +// GetName returns UpdateEmailActionUpdateEmailAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetName() string { return v.Name } + +// GetRecipients returns UpdateEmailActionUpdateEmailAction.Recipients, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetRecipients() []string { return v.Recipients } + +// GetSubjectTemplate returns UpdateEmailActionUpdateEmailAction.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetSubjectTemplate() *string { return v.SubjectTemplate } + +// GetBodyTemplate returns UpdateEmailActionUpdateEmailAction.BodyTemplate, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetBodyTemplate() *string { return v.BodyTemplate } + +// GetUseProxy returns UpdateEmailActionUpdateEmailAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateEmailActionUpdateEmailAction) GetUseProxy() bool { return v.UseProxy } + +// UpdateFilterAlertResponse is returned by UpdateFilterAlert on success. +type UpdateFilterAlertResponse struct { + // Update a filter alert. + UpdateFilterAlert UpdateFilterAlertUpdateFilterAlert `json:"updateFilterAlert"` +} + +// GetUpdateFilterAlert returns UpdateFilterAlertResponse.UpdateFilterAlert, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertResponse) GetUpdateFilterAlert() UpdateFilterAlertUpdateFilterAlert { + return v.UpdateFilterAlert +} + +// UpdateFilterAlertUpdateFilterAlert includes the requested fields of the GraphQL type FilterAlert. +// The GraphQL type's documentation follows. +// +// A filter alert. +type UpdateFilterAlertUpdateFilterAlert struct { + FilterAlertDetails `json:"-"` +} + +// GetId returns UpdateFilterAlertUpdateFilterAlert.Id, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetId() string { return v.FilterAlertDetails.Id } + +// GetName returns UpdateFilterAlertUpdateFilterAlert.Name, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetName() string { return v.FilterAlertDetails.Name } + +// GetDescription returns UpdateFilterAlertUpdateFilterAlert.Description, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetDescription() *string { + return v.FilterAlertDetails.Description +} + +// GetQueryString returns UpdateFilterAlertUpdateFilterAlert.QueryString, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetQueryString() string { + return v.FilterAlertDetails.QueryString +} + +// GetThrottleTimeSeconds returns UpdateFilterAlertUpdateFilterAlert.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetThrottleTimeSeconds() *int64 { + return v.FilterAlertDetails.ThrottleTimeSeconds +} + +// GetThrottleField returns UpdateFilterAlertUpdateFilterAlert.ThrottleField, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetThrottleField() *string { + return v.FilterAlertDetails.ThrottleField +} + +// GetActions returns UpdateFilterAlertUpdateFilterAlert.Actions, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetActions() []FilterAlertDetailsActionsAction { + return v.FilterAlertDetails.Actions +} + +// GetLabels returns UpdateFilterAlertUpdateFilterAlert.Labels, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetLabels() []string { return v.FilterAlertDetails.Labels } + +// GetEnabled returns UpdateFilterAlertUpdateFilterAlert.Enabled, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetEnabled() bool { return v.FilterAlertDetails.Enabled } + +// GetQueryOwnership returns UpdateFilterAlertUpdateFilterAlert.QueryOwnership, and is useful for accessing the field via an interface. +func (v *UpdateFilterAlertUpdateFilterAlert) GetQueryOwnership() SharedQueryOwnershipType { + return v.FilterAlertDetails.QueryOwnership +} + +func (v *UpdateFilterAlertUpdateFilterAlert) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateFilterAlertUpdateFilterAlert + graphql.NoUnmarshalJSON + } + firstPass.UpdateFilterAlertUpdateFilterAlert = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.FilterAlertDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateFilterAlertUpdateFilterAlert struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + ThrottleTimeSeconds *int64 `json:"throttleTimeSeconds"` + + ThrottleField *string `json:"throttleField"` + + Actions []json.RawMessage `json:"actions"` + + Labels []string `json:"labels"` + + Enabled bool `json:"enabled"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *UpdateFilterAlertUpdateFilterAlert) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateFilterAlertUpdateFilterAlert) __premarshalJSON() (*__premarshalUpdateFilterAlertUpdateFilterAlert, error) { + var retval __premarshalUpdateFilterAlertUpdateFilterAlert + + retval.Id = v.FilterAlertDetails.Id + retval.Name = v.FilterAlertDetails.Name + retval.Description = v.FilterAlertDetails.Description + retval.QueryString = v.FilterAlertDetails.QueryString + retval.ThrottleTimeSeconds = v.FilterAlertDetails.ThrottleTimeSeconds + retval.ThrottleField = v.FilterAlertDetails.ThrottleField + { + + dst := &retval.Actions + src := v.FilterAlertDetails.Actions + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFilterAlertDetailsActionsAction( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateFilterAlertUpdateFilterAlert.FilterAlertDetails.Actions: %w", err) + } + } + } + retval.Labels = v.FilterAlertDetails.Labels + retval.Enabled = v.FilterAlertDetails.Enabled + { + + dst := &retval.QueryOwnership + src := v.FilterAlertDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateFilterAlertUpdateFilterAlert.FilterAlertDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// UpdateHumioRepoActionResponse is returned by UpdateHumioRepoAction on success. +type UpdateHumioRepoActionResponse struct { + // Update a LogScale repository action. + UpdateHumioRepoAction UpdateHumioRepoActionUpdateHumioRepoAction `json:"updateHumioRepoAction"` +} + +// GetUpdateHumioRepoAction returns UpdateHumioRepoActionResponse.UpdateHumioRepoAction, and is useful for accessing the field via an interface. +func (v *UpdateHumioRepoActionResponse) GetUpdateHumioRepoAction() UpdateHumioRepoActionUpdateHumioRepoAction { + return v.UpdateHumioRepoAction +} + +// UpdateHumioRepoActionUpdateHumioRepoAction includes the requested fields of the GraphQL type HumioRepoAction. +// The GraphQL type's documentation follows. +// +// A LogScale repository action. +type UpdateHumioRepoActionUpdateHumioRepoAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Humio ingest token for the dataspace that the action should ingest into. + IngestToken string `json:"ingestToken"` +} + +// GetId returns UpdateHumioRepoActionUpdateHumioRepoAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateHumioRepoActionUpdateHumioRepoAction) GetId() string { return v.Id } + +// GetName returns UpdateHumioRepoActionUpdateHumioRepoAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateHumioRepoActionUpdateHumioRepoAction) GetName() string { return v.Name } + +// GetIngestToken returns UpdateHumioRepoActionUpdateHumioRepoAction.IngestToken, and is useful for accessing the field via an interface. +func (v *UpdateHumioRepoActionUpdateHumioRepoAction) GetIngestToken() string { return v.IngestToken } + +// UpdateIngestBasedRetentionResponse is returned by UpdateIngestBasedRetention on success. +type UpdateIngestBasedRetentionResponse struct { + // Update the retention policy of a repository. + UpdateRetention UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation `json:"updateRetention"` +} + +// GetUpdateRetention returns UpdateIngestBasedRetentionResponse.UpdateRetention, and is useful for accessing the field via an interface. +func (v *UpdateIngestBasedRetentionResponse) GetUpdateRetention() UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation { + return v.UpdateRetention +} + +// UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation includes the requested fields of the GraphQL type UpdateRetentionMutation. +type UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation.Typename, and is useful for accessing the field via an interface. +func (v *UpdateIngestBasedRetentionUpdateRetentionUpdateRetentionMutation) GetTypename() *string { + return v.Typename +} + +// UpdateLicenseKeyResponse is returned by UpdateLicenseKey on success. +type UpdateLicenseKeyResponse struct { + // Update the license key for the LogScale cluster. If there is an existing license on this cluster this operation requires permission to manage cluster. + UpdateLicenseKey UpdateLicenseKeyUpdateLicenseKeyLicense `json:"-"` +} + +// GetUpdateLicenseKey returns UpdateLicenseKeyResponse.UpdateLicenseKey, and is useful for accessing the field via an interface. +func (v *UpdateLicenseKeyResponse) GetUpdateLicenseKey() UpdateLicenseKeyUpdateLicenseKeyLicense { + return v.UpdateLicenseKey +} + +func (v *UpdateLicenseKeyResponse) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateLicenseKeyResponse + UpdateLicenseKey json.RawMessage `json:"updateLicenseKey"` + graphql.NoUnmarshalJSON + } + firstPass.UpdateLicenseKeyResponse = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.UpdateLicenseKey + src := firstPass.UpdateLicenseKey + if len(src) != 0 && string(src) != "null" { + err = __unmarshalUpdateLicenseKeyUpdateLicenseKeyLicense( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal UpdateLicenseKeyResponse.UpdateLicenseKey: %w", err) + } + } + } + return nil +} + +type __premarshalUpdateLicenseKeyResponse struct { + UpdateLicenseKey json.RawMessage `json:"updateLicenseKey"` +} + +func (v *UpdateLicenseKeyResponse) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateLicenseKeyResponse) __premarshalJSON() (*__premarshalUpdateLicenseKeyResponse, error) { + var retval __premarshalUpdateLicenseKeyResponse + + { + + dst := &retval.UpdateLicenseKey + src := v.UpdateLicenseKey + var err error + *dst, err = __marshalUpdateLicenseKeyUpdateLicenseKeyLicense( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateLicenseKeyResponse.UpdateLicenseKey: %w", err) + } + } + return &retval, nil +} + +// UpdateLicenseKeyUpdateLicenseKeyLicense includes the requested fields of the GraphQL interface License. +// +// UpdateLicenseKeyUpdateLicenseKeyLicense is implemented by the following types: +// UpdateLicenseKeyUpdateLicenseKeyOnPremLicense +// UpdateLicenseKeyUpdateLicenseKeyTrialLicense +// The GraphQL type's documentation follows. +// +// Represents information about the LogScale instance. +type UpdateLicenseKeyUpdateLicenseKeyLicense interface { + implementsGraphQLInterfaceUpdateLicenseKeyUpdateLicenseKeyLicense() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string +} + +func (v *UpdateLicenseKeyUpdateLicenseKeyOnPremLicense) implementsGraphQLInterfaceUpdateLicenseKeyUpdateLicenseKeyLicense() { +} +func (v *UpdateLicenseKeyUpdateLicenseKeyTrialLicense) implementsGraphQLInterfaceUpdateLicenseKeyUpdateLicenseKeyLicense() { +} + +func __unmarshalUpdateLicenseKeyUpdateLicenseKeyLicense(b []byte, v *UpdateLicenseKeyUpdateLicenseKeyLicense) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "OnPremLicense": + *v = new(UpdateLicenseKeyUpdateLicenseKeyOnPremLicense) + return json.Unmarshal(b, *v) + case "TrialLicense": + *v = new(UpdateLicenseKeyUpdateLicenseKeyTrialLicense) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing License.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for UpdateLicenseKeyUpdateLicenseKeyLicense: "%v"`, tn.TypeName) + } +} + +func __marshalUpdateLicenseKeyUpdateLicenseKeyLicense(v *UpdateLicenseKeyUpdateLicenseKeyLicense) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *UpdateLicenseKeyUpdateLicenseKeyOnPremLicense: + typename = "OnPremLicense" + + result := struct { + TypeName string `json:"__typename"` + *UpdateLicenseKeyUpdateLicenseKeyOnPremLicense + }{typename, v} + return json.Marshal(result) + case *UpdateLicenseKeyUpdateLicenseKeyTrialLicense: + typename = "TrialLicense" + + result := struct { + TypeName string `json:"__typename"` + *UpdateLicenseKeyUpdateLicenseKeyTrialLicense + }{typename, v} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for UpdateLicenseKeyUpdateLicenseKeyLicense: "%T"`, v) + } +} + +// UpdateLicenseKeyUpdateLicenseKeyOnPremLicense includes the requested fields of the GraphQL type OnPremLicense. +// The GraphQL type's documentation follows. +// +// Represents information about a LogScale License. +type UpdateLicenseKeyUpdateLicenseKeyOnPremLicense struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateLicenseKeyUpdateLicenseKeyOnPremLicense.Typename, and is useful for accessing the field via an interface. +func (v *UpdateLicenseKeyUpdateLicenseKeyOnPremLicense) GetTypename() *string { return v.Typename } + +// UpdateLicenseKeyUpdateLicenseKeyTrialLicense includes the requested fields of the GraphQL type TrialLicense. +// The GraphQL type's documentation follows. +// +// Represents information about an on-going trial of LogScale. +type UpdateLicenseKeyUpdateLicenseKeyTrialLicense struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateLicenseKeyUpdateLicenseKeyTrialLicense.Typename, and is useful for accessing the field via an interface. +func (v *UpdateLicenseKeyUpdateLicenseKeyTrialLicense) GetTypename() *string { return v.Typename } + +// UpdateOpsGenieActionResponse is returned by UpdateOpsGenieAction on success. +type UpdateOpsGenieActionResponse struct { + // Update an OpsGenie action. + UpdateOpsGenieAction UpdateOpsGenieActionUpdateOpsGenieAction `json:"updateOpsGenieAction"` +} + +// GetUpdateOpsGenieAction returns UpdateOpsGenieActionResponse.UpdateOpsGenieAction, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionResponse) GetUpdateOpsGenieAction() UpdateOpsGenieActionUpdateOpsGenieAction { + return v.UpdateOpsGenieAction +} + +// UpdateOpsGenieActionUpdateOpsGenieAction includes the requested fields of the GraphQL type OpsGenieAction. +// The GraphQL type's documentation follows. +// +// An OpsGenie action +type UpdateOpsGenieActionUpdateOpsGenieAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // OpsGenie webhook url to send the request to. + ApiUrl string `json:"apiUrl"` + // Key to authenticate with OpsGenie. + GenieKey string `json:"genieKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateOpsGenieActionUpdateOpsGenieAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionUpdateOpsGenieAction) GetId() string { return v.Id } + +// GetName returns UpdateOpsGenieActionUpdateOpsGenieAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionUpdateOpsGenieAction) GetName() string { return v.Name } + +// GetApiUrl returns UpdateOpsGenieActionUpdateOpsGenieAction.ApiUrl, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionUpdateOpsGenieAction) GetApiUrl() string { return v.ApiUrl } + +// GetGenieKey returns UpdateOpsGenieActionUpdateOpsGenieAction.GenieKey, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionUpdateOpsGenieAction) GetGenieKey() string { return v.GenieKey } + +// GetUseProxy returns UpdateOpsGenieActionUpdateOpsGenieAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateOpsGenieActionUpdateOpsGenieAction) GetUseProxy() bool { return v.UseProxy } + +// UpdatePagerDutyActionResponse is returned by UpdatePagerDutyAction on success. +type UpdatePagerDutyActionResponse struct { + // Update a PagerDuty action. + UpdatePagerDutyAction UpdatePagerDutyActionUpdatePagerDutyAction `json:"updatePagerDutyAction"` +} + +// GetUpdatePagerDutyAction returns UpdatePagerDutyActionResponse.UpdatePagerDutyAction, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionResponse) GetUpdatePagerDutyAction() UpdatePagerDutyActionUpdatePagerDutyAction { + return v.UpdatePagerDutyAction +} + +// UpdatePagerDutyActionUpdatePagerDutyAction includes the requested fields of the GraphQL type PagerDutyAction. +// The GraphQL type's documentation follows. +// +// A PagerDuty action. +type UpdatePagerDutyActionUpdatePagerDutyAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Severity level to give to the message. + Severity string `json:"severity"` + // Routing key to authenticate with PagerDuty. + RoutingKey string `json:"routingKey"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdatePagerDutyActionUpdatePagerDutyAction.Id, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionUpdatePagerDutyAction) GetId() string { return v.Id } + +// GetName returns UpdatePagerDutyActionUpdatePagerDutyAction.Name, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionUpdatePagerDutyAction) GetName() string { return v.Name } + +// GetSeverity returns UpdatePagerDutyActionUpdatePagerDutyAction.Severity, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionUpdatePagerDutyAction) GetSeverity() string { return v.Severity } + +// GetRoutingKey returns UpdatePagerDutyActionUpdatePagerDutyAction.RoutingKey, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionUpdatePagerDutyAction) GetRoutingKey() string { return v.RoutingKey } + +// GetUseProxy returns UpdatePagerDutyActionUpdatePagerDutyAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdatePagerDutyActionUpdatePagerDutyAction) GetUseProxy() bool { return v.UseProxy } + +// UpdateRoleResponse is returned by UpdateRole on success. +type UpdateRoleResponse struct { + UpdateRole UpdateRoleUpdateRoleUpdateRoleMutation `json:"updateRole"` +} + +// GetUpdateRole returns UpdateRoleResponse.UpdateRole, and is useful for accessing the field via an interface. +func (v *UpdateRoleResponse) GetUpdateRole() UpdateRoleUpdateRoleUpdateRoleMutation { + return v.UpdateRole +} + +// UpdateRoleUpdateRoleUpdateRoleMutation includes the requested fields of the GraphQL type UpdateRoleMutation. +type UpdateRoleUpdateRoleUpdateRoleMutation struct { + Role UpdateRoleUpdateRoleUpdateRoleMutationRole `json:"role"` +} + +// GetRole returns UpdateRoleUpdateRoleUpdateRoleMutation.Role, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutation) GetRole() UpdateRoleUpdateRoleUpdateRoleMutationRole { + return v.Role +} + +// UpdateRoleUpdateRoleUpdateRoleMutationRole includes the requested fields of the GraphQL type Role. +type UpdateRoleUpdateRoleUpdateRoleMutationRole struct { + RoleDetails `json:"-"` +} + +// GetId returns UpdateRoleUpdateRoleUpdateRoleMutationRole.Id, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) GetId() string { return v.RoleDetails.Id } + +// GetDisplayName returns UpdateRoleUpdateRoleUpdateRoleMutationRole.DisplayName, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) GetDisplayName() string { + return v.RoleDetails.DisplayName +} + +// GetViewPermissions returns UpdateRoleUpdateRoleUpdateRoleMutationRole.ViewPermissions, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) GetViewPermissions() []Permission { + return v.RoleDetails.ViewPermissions +} + +// GetOrganizationPermissions returns UpdateRoleUpdateRoleUpdateRoleMutationRole.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) GetOrganizationPermissions() []OrganizationPermission { + return v.RoleDetails.OrganizationPermissions +} + +// GetSystemPermissions returns UpdateRoleUpdateRoleUpdateRoleMutationRole.SystemPermissions, and is useful for accessing the field via an interface. +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) GetSystemPermissions() []SystemPermission { + return v.RoleDetails.SystemPermissions +} + +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateRoleUpdateRoleUpdateRoleMutationRole + graphql.NoUnmarshalJSON + } + firstPass.UpdateRoleUpdateRoleUpdateRoleMutationRole = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.RoleDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateRoleUpdateRoleUpdateRoleMutationRole struct { + Id string `json:"id"` + + DisplayName string `json:"displayName"` + + ViewPermissions []Permission `json:"viewPermissions"` + + OrganizationPermissions []OrganizationPermission `json:"organizationPermissions"` + + SystemPermissions []SystemPermission `json:"systemPermissions"` +} + +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateRoleUpdateRoleUpdateRoleMutationRole) __premarshalJSON() (*__premarshalUpdateRoleUpdateRoleUpdateRoleMutationRole, error) { + var retval __premarshalUpdateRoleUpdateRoleUpdateRoleMutationRole + + retval.Id = v.RoleDetails.Id + retval.DisplayName = v.RoleDetails.DisplayName + retval.ViewPermissions = v.RoleDetails.ViewPermissions + retval.OrganizationPermissions = v.RoleDetails.OrganizationPermissions + retval.SystemPermissions = v.RoleDetails.SystemPermissions + return &retval, nil +} + +// UpdateS3ArchivingConfigurationResponse is returned by UpdateS3ArchivingConfiguration on success. +type UpdateS3ArchivingConfigurationResponse struct { + // Configures S3 archiving for a repository. E.g. bucket and region. + S3ConfigureArchiving UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType `json:"s3ConfigureArchiving"` +} + +// GetS3ConfigureArchiving returns UpdateS3ArchivingConfigurationResponse.S3ConfigureArchiving, and is useful for accessing the field via an interface. +func (v *UpdateS3ArchivingConfigurationResponse) GetS3ConfigureArchiving() UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType { + return v.S3ConfigureArchiving +} + +// UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType includes the requested fields of the GraphQL type BooleanResultType. +type UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType.Typename, and is useful for accessing the field via an interface. +func (v *UpdateS3ArchivingConfigurationS3ConfigureArchivingBooleanResultType) GetTypename() *string { + return v.Typename +} + +// UpdateScheduledSearchResponse is returned by UpdateScheduledSearch on success. +type UpdateScheduledSearchResponse struct { + // Update a scheduled search. + UpdateScheduledSearch UpdateScheduledSearchUpdateScheduledSearch `json:"updateScheduledSearch"` +} + +// GetUpdateScheduledSearch returns UpdateScheduledSearchResponse.UpdateScheduledSearch, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchResponse) GetUpdateScheduledSearch() UpdateScheduledSearchUpdateScheduledSearch { + return v.UpdateScheduledSearch +} + +// UpdateScheduledSearchUpdateScheduledSearch includes the requested fields of the GraphQL type ScheduledSearch. +// The GraphQL type's documentation follows. +// +// Information about a scheduled search +type UpdateScheduledSearchUpdateScheduledSearch struct { + ScheduledSearchDetails `json:"-"` +} + +// GetId returns UpdateScheduledSearchUpdateScheduledSearch.Id, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetId() string { + return v.ScheduledSearchDetails.Id +} + +// GetName returns UpdateScheduledSearchUpdateScheduledSearch.Name, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetName() string { + return v.ScheduledSearchDetails.Name +} + +// GetDescription returns UpdateScheduledSearchUpdateScheduledSearch.Description, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetDescription() *string { + return v.ScheduledSearchDetails.Description +} + +// GetQueryString returns UpdateScheduledSearchUpdateScheduledSearch.QueryString, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetQueryString() string { + return v.ScheduledSearchDetails.QueryString +} + +// GetStart returns UpdateScheduledSearchUpdateScheduledSearch.Start, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetStart() string { + return v.ScheduledSearchDetails.Start +} + +// GetEnd returns UpdateScheduledSearchUpdateScheduledSearch.End, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetEnd() string { + return v.ScheduledSearchDetails.End +} + +// GetTimeZone returns UpdateScheduledSearchUpdateScheduledSearch.TimeZone, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetTimeZone() string { + return v.ScheduledSearchDetails.TimeZone +} + +// GetSchedule returns UpdateScheduledSearchUpdateScheduledSearch.Schedule, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetSchedule() string { + return v.ScheduledSearchDetails.Schedule +} + +// GetBackfillLimit returns UpdateScheduledSearchUpdateScheduledSearch.BackfillLimit, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetBackfillLimit() int { + return v.ScheduledSearchDetails.BackfillLimit +} + +// GetEnabled returns UpdateScheduledSearchUpdateScheduledSearch.Enabled, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetEnabled() bool { + return v.ScheduledSearchDetails.Enabled +} + +// GetActionsV2 returns UpdateScheduledSearchUpdateScheduledSearch.ActionsV2, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetActionsV2() []ScheduledSearchDetailsActionsV2Action { + return v.ScheduledSearchDetails.ActionsV2 +} + +// GetLabels returns UpdateScheduledSearchUpdateScheduledSearch.Labels, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetLabels() []string { + return v.ScheduledSearchDetails.Labels +} + +// GetQueryOwnership returns UpdateScheduledSearchUpdateScheduledSearch.QueryOwnership, and is useful for accessing the field via an interface. +func (v *UpdateScheduledSearchUpdateScheduledSearch) GetQueryOwnership() SharedQueryOwnershipType { + return v.ScheduledSearchDetails.QueryOwnership +} + +func (v *UpdateScheduledSearchUpdateScheduledSearch) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *UpdateScheduledSearchUpdateScheduledSearch + graphql.NoUnmarshalJSON + } + firstPass.UpdateScheduledSearchUpdateScheduledSearch = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.ScheduledSearchDetails) + if err != nil { + return err + } + return nil +} + +type __premarshalUpdateScheduledSearchUpdateScheduledSearch struct { + Id string `json:"id"` + + Name string `json:"name"` + + Description *string `json:"description"` + + QueryString string `json:"queryString"` + + Start string `json:"start"` + + End string `json:"end"` + + TimeZone string `json:"timeZone"` + + Schedule string `json:"schedule"` + + BackfillLimit int `json:"backfillLimit"` + + Enabled bool `json:"enabled"` + + ActionsV2 []json.RawMessage `json:"actionsV2"` + + Labels []string `json:"labels"` + + QueryOwnership json.RawMessage `json:"queryOwnership"` +} + +func (v *UpdateScheduledSearchUpdateScheduledSearch) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *UpdateScheduledSearchUpdateScheduledSearch) __premarshalJSON() (*__premarshalUpdateScheduledSearchUpdateScheduledSearch, error) { + var retval __premarshalUpdateScheduledSearchUpdateScheduledSearch + + retval.Id = v.ScheduledSearchDetails.Id + retval.Name = v.ScheduledSearchDetails.Name + retval.Description = v.ScheduledSearchDetails.Description + retval.QueryString = v.ScheduledSearchDetails.QueryString + retval.Start = v.ScheduledSearchDetails.Start + retval.End = v.ScheduledSearchDetails.End + retval.TimeZone = v.ScheduledSearchDetails.TimeZone + retval.Schedule = v.ScheduledSearchDetails.Schedule + retval.BackfillLimit = v.ScheduledSearchDetails.BackfillLimit + retval.Enabled = v.ScheduledSearchDetails.Enabled + { + + dst := &retval.ActionsV2 + src := v.ScheduledSearchDetails.ActionsV2 + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalScheduledSearchDetailsActionsV2Action( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateScheduledSearchUpdateScheduledSearch.ScheduledSearchDetails.ActionsV2: %w", err) + } + } + } + retval.Labels = v.ScheduledSearchDetails.Labels + { + + dst := &retval.QueryOwnership + src := v.ScheduledSearchDetails.QueryOwnership + var err error + *dst, err = __marshalSharedQueryOwnershipType( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal UpdateScheduledSearchUpdateScheduledSearch.ScheduledSearchDetails.QueryOwnership: %w", err) + } + } + return &retval, nil +} + +// UpdateSlackActionResponse is returned by UpdateSlackAction on success. +type UpdateSlackActionResponse struct { + // Update a Slack action. + UpdateSlackAction UpdateSlackActionUpdateSlackAction `json:"updateSlackAction"` +} + +// GetUpdateSlackAction returns UpdateSlackActionResponse.UpdateSlackAction, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionResponse) GetUpdateSlackAction() UpdateSlackActionUpdateSlackAction { + return v.UpdateSlackAction +} + +// UpdateSlackActionUpdateSlackAction includes the requested fields of the GraphQL type SlackAction. +// The GraphQL type's documentation follows. +// +// A Slack action +type UpdateSlackActionUpdateSlackAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry `json:"fields"` + // Slack webhook url to send the request to. + Url string `json:"url"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateSlackActionUpdateSlackAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackAction) GetId() string { return v.Id } + +// GetName returns UpdateSlackActionUpdateSlackAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackAction) GetName() string { return v.Name } + +// GetFields returns UpdateSlackActionUpdateSlackAction.Fields, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackAction) GetFields() []UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry { + return v.Fields +} + +// GetUrl returns UpdateSlackActionUpdateSlackAction.Url, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackAction) GetUrl() string { return v.Url } + +// GetUseProxy returns UpdateSlackActionUpdateSlackAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackAction) GetUseProxy() bool { return v.UseProxy } + +// UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry includes the requested fields of the GraphQL type SlackFieldEntry. +// The GraphQL type's documentation follows. +// +// Field entry in a Slack message +type UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry struct { + // Value of a Slack field. + Value string `json:"value"` + // Key of a Slack field. + FieldName string `json:"fieldName"` +} + +// GetValue returns UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry.Value, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry) GetValue() string { return v.Value } + +// GetFieldName returns UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry.FieldName, and is useful for accessing the field via an interface. +func (v *UpdateSlackActionUpdateSlackActionFieldsSlackFieldEntry) GetFieldName() string { + return v.FieldName +} + +// UpdateSlackPostMessageActionResponse is returned by UpdateSlackPostMessageAction on success. +type UpdateSlackPostMessageActionResponse struct { + // Update a post-message Slack action. + UpdateSlackPostMessageAction UpdateSlackPostMessageActionUpdateSlackPostMessageAction `json:"updateSlackPostMessageAction"` +} + +// GetUpdateSlackPostMessageAction returns UpdateSlackPostMessageActionResponse.UpdateSlackPostMessageAction, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionResponse) GetUpdateSlackPostMessageAction() UpdateSlackPostMessageActionUpdateSlackPostMessageAction { + return v.UpdateSlackPostMessageAction +} + +// UpdateSlackPostMessageActionUpdateSlackPostMessageAction includes the requested fields of the GraphQL type SlackPostMessageAction. +// The GraphQL type's documentation follows. +// +// A slack post-message action. +type UpdateSlackPostMessageActionUpdateSlackPostMessageAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Api token to authenticate with Slack. + ApiToken string `json:"apiToken"` + // List of Slack channels to message. + Channels []string `json:"channels"` + // Fields to include within the Slack message. Can be templated with values from the result. + Fields []UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry `json:"fields"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetId() string { return v.Id } + +// GetName returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetName() string { return v.Name } + +// GetApiToken returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.ApiToken, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetApiToken() string { + return v.ApiToken +} + +// GetChannels returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.Channels, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetChannels() []string { + return v.Channels +} + +// GetFields returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.Fields, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetFields() []UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry { + return v.Fields +} + +// GetUseProxy returns UpdateSlackPostMessageActionUpdateSlackPostMessageAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageAction) GetUseProxy() bool { + return v.UseProxy +} + +// UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry includes the requested fields of the GraphQL type SlackFieldEntry. +// The GraphQL type's documentation follows. +// +// Field entry in a Slack message +type UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry struct { + // Value of a Slack field. + Value string `json:"value"` + // Key of a Slack field. + FieldName string `json:"fieldName"` +} + +// GetValue returns UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry.Value, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry) GetValue() string { + return v.Value +} + +// GetFieldName returns UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry.FieldName, and is useful for accessing the field via an interface. +func (v *UpdateSlackPostMessageActionUpdateSlackPostMessageActionFieldsSlackFieldEntry) GetFieldName() string { + return v.FieldName +} + +// UpdateStorageBasedRetentionResponse is returned by UpdateStorageBasedRetention on success. +type UpdateStorageBasedRetentionResponse struct { + // Update the retention policy of a repository. + UpdateRetention UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation `json:"updateRetention"` +} + +// GetUpdateRetention returns UpdateStorageBasedRetentionResponse.UpdateRetention, and is useful for accessing the field via an interface. +func (v *UpdateStorageBasedRetentionResponse) GetUpdateRetention() UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation { + return v.UpdateRetention +} + +// UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation includes the requested fields of the GraphQL type UpdateRetentionMutation. +type UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation.Typename, and is useful for accessing the field via an interface. +func (v *UpdateStorageBasedRetentionUpdateRetentionUpdateRetentionMutation) GetTypename() *string { + return v.Typename +} + +// UpdateTimeBasedRetentionResponse is returned by UpdateTimeBasedRetention on success. +type UpdateTimeBasedRetentionResponse struct { + // Update the retention policy of a repository. + UpdateRetention UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation `json:"updateRetention"` +} + +// GetUpdateRetention returns UpdateTimeBasedRetentionResponse.UpdateRetention, and is useful for accessing the field via an interface. +func (v *UpdateTimeBasedRetentionResponse) GetUpdateRetention() UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation { + return v.UpdateRetention +} + +// UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation includes the requested fields of the GraphQL type UpdateRetentionMutation. +type UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation.Typename, and is useful for accessing the field via an interface. +func (v *UpdateTimeBasedRetentionUpdateRetentionUpdateRetentionMutation) GetTypename() *string { + return v.Typename +} + +// UpdateUploadFileActionResponse is returned by UpdateUploadFileAction on success. +type UpdateUploadFileActionResponse struct { + // Update an upload file action. + UpdateUploadFileAction UpdateUploadFileActionUpdateUploadFileAction `json:"updateUploadFileAction"` +} + +// GetUpdateUploadFileAction returns UpdateUploadFileActionResponse.UpdateUploadFileAction, and is useful for accessing the field via an interface. +func (v *UpdateUploadFileActionResponse) GetUpdateUploadFileAction() UpdateUploadFileActionUpdateUploadFileAction { + return v.UpdateUploadFileAction +} + +// UpdateUploadFileActionUpdateUploadFileAction includes the requested fields of the GraphQL type UploadFileAction. +// The GraphQL type's documentation follows. +// +// An upload file action. +type UpdateUploadFileActionUpdateUploadFileAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // File name for the uploaded file. + FileName string `json:"fileName"` +} + +// GetId returns UpdateUploadFileActionUpdateUploadFileAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateUploadFileActionUpdateUploadFileAction) GetId() string { return v.Id } + +// GetName returns UpdateUploadFileActionUpdateUploadFileAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateUploadFileActionUpdateUploadFileAction) GetName() string { return v.Name } + +// GetFileName returns UpdateUploadFileActionUpdateUploadFileAction.FileName, and is useful for accessing the field via an interface. +func (v *UpdateUploadFileActionUpdateUploadFileAction) GetFileName() string { return v.FileName } + +// UpdateUserResponse is returned by UpdateUser on success. +type UpdateUserResponse struct { + // Updates a user. Requires Root Permission. + UpdateUser UpdateUserUpdateUserUpdateUserMutation `json:"updateUser"` +} + +// GetUpdateUser returns UpdateUserResponse.UpdateUser, and is useful for accessing the field via an interface. +func (v *UpdateUserResponse) GetUpdateUser() UpdateUserUpdateUserUpdateUserMutation { + return v.UpdateUser +} + +// UpdateUserUpdateUserUpdateUserMutation includes the requested fields of the GraphQL type UpdateUserMutation. +type UpdateUserUpdateUserUpdateUserMutation struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns UpdateUserUpdateUserUpdateUserMutation.Typename, and is useful for accessing the field via an interface. +func (v *UpdateUserUpdateUserUpdateUserMutation) GetTypename() *string { return v.Typename } + +// UpdateVictorOpsActionResponse is returned by UpdateVictorOpsAction on success. +type UpdateVictorOpsActionResponse struct { + // Update a VictorOps action. + UpdateVictorOpsAction UpdateVictorOpsActionUpdateVictorOpsAction `json:"updateVictorOpsAction"` +} + +// GetUpdateVictorOpsAction returns UpdateVictorOpsActionResponse.UpdateVictorOpsAction, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionResponse) GetUpdateVictorOpsAction() UpdateVictorOpsActionUpdateVictorOpsAction { + return v.UpdateVictorOpsAction +} + +// UpdateVictorOpsActionUpdateVictorOpsAction includes the requested fields of the GraphQL type VictorOpsAction. +// The GraphQL type's documentation follows. +// +// A VictorOps action. +type UpdateVictorOpsActionUpdateVictorOpsAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Type of the VictorOps message to make. + MessageType string `json:"messageType"` + // VictorOps webhook url to send the request to. + NotifyUrl string `json:"notifyUrl"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateVictorOpsActionUpdateVictorOpsAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionUpdateVictorOpsAction) GetId() string { return v.Id } + +// GetName returns UpdateVictorOpsActionUpdateVictorOpsAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionUpdateVictorOpsAction) GetName() string { return v.Name } + +// GetMessageType returns UpdateVictorOpsActionUpdateVictorOpsAction.MessageType, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionUpdateVictorOpsAction) GetMessageType() string { return v.MessageType } + +// GetNotifyUrl returns UpdateVictorOpsActionUpdateVictorOpsAction.NotifyUrl, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionUpdateVictorOpsAction) GetNotifyUrl() string { return v.NotifyUrl } + +// GetUseProxy returns UpdateVictorOpsActionUpdateVictorOpsAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateVictorOpsActionUpdateVictorOpsAction) GetUseProxy() bool { return v.UseProxy } + +// UpdateViewConnectionsResponse is returned by UpdateViewConnections on success. +type UpdateViewConnectionsResponse struct { + // Update a view. + UpdateView UpdateViewConnectionsUpdateView `json:"updateView"` +} + +// GetUpdateView returns UpdateViewConnectionsResponse.UpdateView, and is useful for accessing the field via an interface. +func (v *UpdateViewConnectionsResponse) GetUpdateView() UpdateViewConnectionsUpdateView { + return v.UpdateView +} + +// UpdateViewConnectionsUpdateView includes the requested fields of the GraphQL type View. +// The GraphQL type's documentation follows. +// +// Represents information about a view, pulling data from one or several repositories. +type UpdateViewConnectionsUpdateView struct { + Name string `json:"name"` +} + +// GetName returns UpdateViewConnectionsUpdateView.Name, and is useful for accessing the field via an interface. +func (v *UpdateViewConnectionsUpdateView) GetName() string { return v.Name } + +// UpdateWebhookActionResponse is returned by UpdateWebhookAction on success. +type UpdateWebhookActionResponse struct { + // Update a webhook action. + UpdateWebhookAction UpdateWebhookActionUpdateWebhookAction `json:"updateWebhookAction"` +} + +// GetUpdateWebhookAction returns UpdateWebhookActionResponse.UpdateWebhookAction, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionResponse) GetUpdateWebhookAction() UpdateWebhookActionUpdateWebhookAction { + return v.UpdateWebhookAction +} + +// UpdateWebhookActionUpdateWebhookAction includes the requested fields of the GraphQL type WebhookAction. +// The GraphQL type's documentation follows. +// +// A webhook action +type UpdateWebhookActionUpdateWebhookAction struct { + // The id of the action. + Id string `json:"id"` + // The name of the action. + Name string `json:"name"` + // Url to send the http(s) request to. + Url string `json:"url"` + // Method to use for the request. + Method string `json:"method"` + // Headers of the http(s) request. + Headers []UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry `json:"headers"` + // Body of the http(s) request. Can be templated with values from the result. + BodyTemplate string `json:"bodyTemplate"` + // Flag indicating whether SSL should be ignored for the request. + IgnoreSSL bool `json:"ignoreSSL"` + // Defines whether the action should use the configured proxy to make web requests. + UseProxy bool `json:"useProxy"` +} + +// GetId returns UpdateWebhookActionUpdateWebhookAction.Id, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetId() string { return v.Id } + +// GetName returns UpdateWebhookActionUpdateWebhookAction.Name, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetName() string { return v.Name } + +// GetUrl returns UpdateWebhookActionUpdateWebhookAction.Url, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetUrl() string { return v.Url } + +// GetMethod returns UpdateWebhookActionUpdateWebhookAction.Method, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetMethod() string { return v.Method } + +// GetHeaders returns UpdateWebhookActionUpdateWebhookAction.Headers, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetHeaders() []UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry { + return v.Headers +} + +// GetBodyTemplate returns UpdateWebhookActionUpdateWebhookAction.BodyTemplate, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetBodyTemplate() string { return v.BodyTemplate } + +// GetIgnoreSSL returns UpdateWebhookActionUpdateWebhookAction.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetIgnoreSSL() bool { return v.IgnoreSSL } + +// GetUseProxy returns UpdateWebhookActionUpdateWebhookAction.UseProxy, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookAction) GetUseProxy() bool { return v.UseProxy } + +// UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry includes the requested fields of the GraphQL type HttpHeaderEntry. +// The GraphQL type's documentation follows. +// +// A http request header. +type UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry struct { + // Value of a http(s) header. + Value string `json:"value"` + // Key of a http(s) header. + Header string `json:"header"` +} + +// GetValue returns UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry.Value, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry) GetValue() string { + return v.Value +} + +// GetHeader returns UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry.Header, and is useful for accessing the field via an interface. +func (v *UpdateWebhookActionUpdateWebhookActionHeadersHttpHeaderEntry) GetHeader() string { + return v.Header +} + +// UserDetails includes the GraphQL fields of User requested by the fragment UserDetails. +// The GraphQL type's documentation follows. +// +// A user profile. +type UserDetails struct { + Id string `json:"id"` + Username string `json:"username"` + FullName *string `json:"fullName"` + Email *string `json:"email"` + Company *string `json:"company"` + CountryCode *string `json:"countryCode"` + Picture *string `json:"picture"` + IsRoot bool `json:"isRoot"` + CreatedAt time.Time `json:"createdAt"` +} + +// GetId returns UserDetails.Id, and is useful for accessing the field via an interface. +func (v *UserDetails) GetId() string { return v.Id } + +// GetUsername returns UserDetails.Username, and is useful for accessing the field via an interface. +func (v *UserDetails) GetUsername() string { return v.Username } + +// GetFullName returns UserDetails.FullName, and is useful for accessing the field via an interface. +func (v *UserDetails) GetFullName() *string { return v.FullName } + +// GetEmail returns UserDetails.Email, and is useful for accessing the field via an interface. +func (v *UserDetails) GetEmail() *string { return v.Email } + +// GetCompany returns UserDetails.Company, and is useful for accessing the field via an interface. +func (v *UserDetails) GetCompany() *string { return v.Company } + +// GetCountryCode returns UserDetails.CountryCode, and is useful for accessing the field via an interface. +func (v *UserDetails) GetCountryCode() *string { return v.CountryCode } + +// GetPicture returns UserDetails.Picture, and is useful for accessing the field via an interface. +func (v *UserDetails) GetPicture() *string { return v.Picture } + +// GetIsRoot returns UserDetails.IsRoot, and is useful for accessing the field via an interface. +func (v *UserDetails) GetIsRoot() bool { return v.IsRoot } + +// GetCreatedAt returns UserDetails.CreatedAt, and is useful for accessing the field via an interface. +func (v *UserDetails) GetCreatedAt() time.Time { return v.CreatedAt } + +// The repositories this view will read from. +type ViewConnectionInput struct { + // The repositories this view will read from. + RepositoryName string `json:"repositoryName"` + // The repositories this view will read from. + Filter string `json:"filter"` + // The repositories this view will read from. + LanguageVersion *LanguageVersionEnum `json:"languageVersion"` +} + +// GetRepositoryName returns ViewConnectionInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *ViewConnectionInput) GetRepositoryName() string { return v.RepositoryName } + +// GetFilter returns ViewConnectionInput.Filter, and is useful for accessing the field via an interface. +func (v *ViewConnectionInput) GetFilter() string { return v.Filter } + +// GetLanguageVersion returns ViewConnectionInput.LanguageVersion, and is useful for accessing the field via an interface. +func (v *ViewConnectionInput) GetLanguageVersion() *LanguageVersionEnum { return v.LanguageVersion } + +// __AddIngestTokenInput is used internally by genqlient +type __AddIngestTokenInput struct { + RepositoryName string `json:"RepositoryName"` + Name string `json:"Name"` + ParserName *string `json:"ParserName"` +} + +// GetRepositoryName returns __AddIngestTokenInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__AddIngestTokenInput) GetRepositoryName() string { return v.RepositoryName } + +// GetName returns __AddIngestTokenInput.Name, and is useful for accessing the field via an interface. +func (v *__AddIngestTokenInput) GetName() string { return v.Name } + +// GetParserName returns __AddIngestTokenInput.ParserName, and is useful for accessing the field via an interface. +func (v *__AddIngestTokenInput) GetParserName() *string { return v.ParserName } + +// __AddUserInput is used internally by genqlient +type __AddUserInput struct { + Username string `json:"Username"` + Company *string `json:"Company"` + IsRoot *bool `json:"IsRoot"` + FullName *string `json:"FullName"` + Picture *string `json:"Picture"` + Email *string `json:"Email"` + CountryCode *string `json:"CountryCode"` +} + +// GetUsername returns __AddUserInput.Username, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetUsername() string { return v.Username } + +// GetCompany returns __AddUserInput.Company, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetCompany() *string { return v.Company } + +// GetIsRoot returns __AddUserInput.IsRoot, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetIsRoot() *bool { return v.IsRoot } + +// GetFullName returns __AddUserInput.FullName, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetFullName() *string { return v.FullName } + +// GetPicture returns __AddUserInput.Picture, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetPicture() *string { return v.Picture } + +// GetEmail returns __AddUserInput.Email, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetEmail() *string { return v.Email } + +// GetCountryCode returns __AddUserInput.CountryCode, and is useful for accessing the field via an interface. +func (v *__AddUserInput) GetCountryCode() *string { return v.CountryCode } + +// __AddUserToGroupInput is used internally by genqlient +type __AddUserToGroupInput struct { + GroupID string `json:"GroupID"` + UserID string `json:"UserID"` +} + +// GetGroupID returns __AddUserToGroupInput.GroupID, and is useful for accessing the field via an interface. +func (v *__AddUserToGroupInput) GetGroupID() string { return v.GroupID } + +// GetUserID returns __AddUserToGroupInput.UserID, and is useful for accessing the field via an interface. +func (v *__AddUserToGroupInput) GetUserID() string { return v.UserID } + +// __AssignParserToIngestTokenInput is used internally by genqlient +type __AssignParserToIngestTokenInput struct { + RepositoryName string `json:"RepositoryName"` + IngestTokenName string `json:"IngestTokenName"` + ParserName string `json:"ParserName"` +} + +// GetRepositoryName returns __AssignParserToIngestTokenInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__AssignParserToIngestTokenInput) GetRepositoryName() string { return v.RepositoryName } + +// GetIngestTokenName returns __AssignParserToIngestTokenInput.IngestTokenName, and is useful for accessing the field via an interface. +func (v *__AssignParserToIngestTokenInput) GetIngestTokenName() string { return v.IngestTokenName } + +// GetParserName returns __AssignParserToIngestTokenInput.ParserName, and is useful for accessing the field via an interface. +func (v *__AssignParserToIngestTokenInput) GetParserName() string { return v.ParserName } + +// __CreateAggregateAlertInput is used internally by genqlient +type __CreateAggregateAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + SearchIntervalSeconds int64 `json:"SearchIntervalSeconds"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + Labels []string `json:"Labels"` + Enabled bool `json:"Enabled"` + RunAsUserID *string `json:"RunAsUserID"` + ThrottleField *string `json:"ThrottleField"` + ThrottleTimeSeconds int64 `json:"ThrottleTimeSeconds"` + TriggerMode TriggerMode `json:"TriggerMode"` + QueryTimestampMode QueryTimestampType `json:"QueryTimestampMode"` + QueryOwnershipType QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __CreateAggregateAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetName returns __CreateAggregateAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetName() string { return v.Name } + +// GetDescription returns __CreateAggregateAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __CreateAggregateAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetQueryString() string { return v.QueryString } + +// GetSearchIntervalSeconds returns __CreateAggregateAlertInput.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetSearchIntervalSeconds() int64 { + return v.SearchIntervalSeconds +} + +// GetActionIdsOrNames returns __CreateAggregateAlertInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetLabels returns __CreateAggregateAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetLabels() []string { return v.Labels } + +// GetEnabled returns __CreateAggregateAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetEnabled() bool { return v.Enabled } + +// GetRunAsUserID returns __CreateAggregateAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetThrottleField returns __CreateAggregateAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// GetThrottleTimeSeconds returns __CreateAggregateAlertInput.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetThrottleTimeSeconds() int64 { return v.ThrottleTimeSeconds } + +// GetTriggerMode returns __CreateAggregateAlertInput.TriggerMode, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetTriggerMode() TriggerMode { return v.TriggerMode } + +// GetQueryTimestampMode returns __CreateAggregateAlertInput.QueryTimestampMode, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetQueryTimestampMode() QueryTimestampType { + return v.QueryTimestampMode +} + +// GetQueryOwnershipType returns __CreateAggregateAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__CreateAggregateAlertInput) GetQueryOwnershipType() QueryOwnershipType { + return v.QueryOwnershipType +} + +// __CreateAlertInput is used internally by genqlient +type __CreateAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + QueryStart string `json:"QueryStart"` + ThrottleTimeMillis int64 `json:"ThrottleTimeMillis"` + Enabled *bool `json:"Enabled"` + Actions []string `json:"Actions"` + Labels []string `json:"Labels"` + RunAsUserID *string `json:"RunAsUserID"` + QueryOwnershipType *QueryOwnershipType `json:"QueryOwnershipType"` + ThrottleField *string `json:"ThrottleField"` +} + +// GetSearchDomainName returns __CreateAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetName returns __CreateAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetName() string { return v.Name } + +// GetDescription returns __CreateAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __CreateAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetQueryString() string { return v.QueryString } + +// GetQueryStart returns __CreateAlertInput.QueryStart, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetQueryStart() string { return v.QueryStart } + +// GetThrottleTimeMillis returns __CreateAlertInput.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetThrottleTimeMillis() int64 { return v.ThrottleTimeMillis } + +// GetEnabled returns __CreateAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetEnabled() *bool { return v.Enabled } + +// GetActions returns __CreateAlertInput.Actions, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetActions() []string { return v.Actions } + +// GetLabels returns __CreateAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetLabels() []string { return v.Labels } + +// GetRunAsUserID returns __CreateAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetQueryOwnershipType returns __CreateAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetQueryOwnershipType() *QueryOwnershipType { return v.QueryOwnershipType } + +// GetThrottleField returns __CreateAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__CreateAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// __CreateEmailActionInput is used internally by genqlient +type __CreateEmailActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + Recipients []string `json:"Recipients"` + SubjectTemplate *string `json:"SubjectTemplate"` + BodyTemplate *string `json:"BodyTemplate"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateEmailActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateEmailActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetActionName() string { return v.ActionName } + +// GetRecipients returns __CreateEmailActionInput.Recipients, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetRecipients() []string { return v.Recipients } + +// GetSubjectTemplate returns __CreateEmailActionInput.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetSubjectTemplate() *string { return v.SubjectTemplate } + +// GetBodyTemplate returns __CreateEmailActionInput.BodyTemplate, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetBodyTemplate() *string { return v.BodyTemplate } + +// GetUseProxy returns __CreateEmailActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateEmailActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreateFilterAlertInput is used internally by genqlient +type __CreateFilterAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + Labels []string `json:"Labels"` + Enabled bool `json:"Enabled"` + RunAsUserID *string `json:"RunAsUserID"` + ThrottleField *string `json:"ThrottleField"` + ThrottleTimeSeconds int64 `json:"ThrottleTimeSeconds"` + QueryOwnershipType QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __CreateFilterAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetName returns __CreateFilterAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetName() string { return v.Name } + +// GetDescription returns __CreateFilterAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __CreateFilterAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetQueryString() string { return v.QueryString } + +// GetActionIdsOrNames returns __CreateFilterAlertInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetLabels returns __CreateFilterAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetLabels() []string { return v.Labels } + +// GetEnabled returns __CreateFilterAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetEnabled() bool { return v.Enabled } + +// GetRunAsUserID returns __CreateFilterAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetThrottleField returns __CreateFilterAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// GetThrottleTimeSeconds returns __CreateFilterAlertInput.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetThrottleTimeSeconds() int64 { return v.ThrottleTimeSeconds } + +// GetQueryOwnershipType returns __CreateFilterAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__CreateFilterAlertInput) GetQueryOwnershipType() QueryOwnershipType { + return v.QueryOwnershipType +} + +// __CreateHumioRepoActionInput is used internally by genqlient +type __CreateHumioRepoActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + IngestToken string `json:"IngestToken"` +} + +// GetSearchDomainName returns __CreateHumioRepoActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateHumioRepoActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateHumioRepoActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateHumioRepoActionInput) GetActionName() string { return v.ActionName } + +// GetIngestToken returns __CreateHumioRepoActionInput.IngestToken, and is useful for accessing the field via an interface. +func (v *__CreateHumioRepoActionInput) GetIngestToken() string { return v.IngestToken } + +// __CreateOpsGenieActionInput is used internally by genqlient +type __CreateOpsGenieActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + ApiUrl string `json:"ApiUrl"` + GenieKey string `json:"GenieKey"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateOpsGenieActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateOpsGenieActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateOpsGenieActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateOpsGenieActionInput) GetActionName() string { return v.ActionName } + +// GetApiUrl returns __CreateOpsGenieActionInput.ApiUrl, and is useful for accessing the field via an interface. +func (v *__CreateOpsGenieActionInput) GetApiUrl() string { return v.ApiUrl } + +// GetGenieKey returns __CreateOpsGenieActionInput.GenieKey, and is useful for accessing the field via an interface. +func (v *__CreateOpsGenieActionInput) GetGenieKey() string { return v.GenieKey } + +// GetUseProxy returns __CreateOpsGenieActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateOpsGenieActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreatePagerDutyActionInput is used internally by genqlient +type __CreatePagerDutyActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + Severity string `json:"Severity"` + RoutingKey string `json:"RoutingKey"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreatePagerDutyActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreatePagerDutyActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreatePagerDutyActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreatePagerDutyActionInput) GetActionName() string { return v.ActionName } + +// GetSeverity returns __CreatePagerDutyActionInput.Severity, and is useful for accessing the field via an interface. +func (v *__CreatePagerDutyActionInput) GetSeverity() string { return v.Severity } + +// GetRoutingKey returns __CreatePagerDutyActionInput.RoutingKey, and is useful for accessing the field via an interface. +func (v *__CreatePagerDutyActionInput) GetRoutingKey() string { return v.RoutingKey } + +// GetUseProxy returns __CreatePagerDutyActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreatePagerDutyActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreateParserInput is used internally by genqlient +type __CreateParserInput struct { + RepositoryName string `json:"RepositoryName"` + Name string `json:"Name"` + Script string `json:"Script"` + TestCases []ParserTestCaseInput `json:"TestCases"` + FieldsToTag []string `json:"FieldsToTag"` + FieldsToBeRemovedBeforeParsing []string `json:"FieldsToBeRemovedBeforeParsing"` + AllowOverridingExistingParser bool `json:"AllowOverridingExistingParser"` +} + +// GetRepositoryName returns __CreateParserInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetRepositoryName() string { return v.RepositoryName } + +// GetName returns __CreateParserInput.Name, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetName() string { return v.Name } + +// GetScript returns __CreateParserInput.Script, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetScript() string { return v.Script } + +// GetTestCases returns __CreateParserInput.TestCases, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetTestCases() []ParserTestCaseInput { return v.TestCases } + +// GetFieldsToTag returns __CreateParserInput.FieldsToTag, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetFieldsToTag() []string { return v.FieldsToTag } + +// GetFieldsToBeRemovedBeforeParsing returns __CreateParserInput.FieldsToBeRemovedBeforeParsing, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetFieldsToBeRemovedBeforeParsing() []string { + return v.FieldsToBeRemovedBeforeParsing +} + +// GetAllowOverridingExistingParser returns __CreateParserInput.AllowOverridingExistingParser, and is useful for accessing the field via an interface. +func (v *__CreateParserInput) GetAllowOverridingExistingParser() bool { + return v.AllowOverridingExistingParser +} + +// __CreateRepositoryInput is used internally by genqlient +type __CreateRepositoryInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __CreateRepositoryInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__CreateRepositoryInput) GetRepositoryName() string { return v.RepositoryName } + +// __CreateRoleInput is used internally by genqlient +type __CreateRoleInput struct { + RoleName string `json:"RoleName"` + ViewPermissions []Permission `json:"ViewPermissions"` + OrganizationPermissions []OrganizationPermission `json:"OrganizationPermissions"` + SystemPermissions []SystemPermission `json:"SystemPermissions"` +} + +// GetRoleName returns __CreateRoleInput.RoleName, and is useful for accessing the field via an interface. +func (v *__CreateRoleInput) GetRoleName() string { return v.RoleName } + +// GetViewPermissions returns __CreateRoleInput.ViewPermissions, and is useful for accessing the field via an interface. +func (v *__CreateRoleInput) GetViewPermissions() []Permission { return v.ViewPermissions } + +// GetOrganizationPermissions returns __CreateRoleInput.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *__CreateRoleInput) GetOrganizationPermissions() []OrganizationPermission { + return v.OrganizationPermissions +} + +// GetSystemPermissions returns __CreateRoleInput.SystemPermissions, and is useful for accessing the field via an interface. +func (v *__CreateRoleInput) GetSystemPermissions() []SystemPermission { return v.SystemPermissions } + +// __CreateScheduledSearchInput is used internally by genqlient +type __CreateScheduledSearchInput struct { + SearchDomainName string `json:"SearchDomainName"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + QueryStart string `json:"QueryStart"` + QueryEnd string `json:"QueryEnd"` + Schedule string `json:"Schedule"` + TimeZone string `json:"TimeZone"` + BackfillLimit int `json:"BackfillLimit"` + Enabled bool `json:"Enabled"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + RunAsUserID *string `json:"RunAsUserID"` + Labels []string `json:"Labels"` + QueryOwnershipType *QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __CreateScheduledSearchInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetName returns __CreateScheduledSearchInput.Name, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetName() string { return v.Name } + +// GetDescription returns __CreateScheduledSearchInput.Description, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __CreateScheduledSearchInput.QueryString, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetQueryString() string { return v.QueryString } + +// GetQueryStart returns __CreateScheduledSearchInput.QueryStart, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetQueryStart() string { return v.QueryStart } + +// GetQueryEnd returns __CreateScheduledSearchInput.QueryEnd, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetQueryEnd() string { return v.QueryEnd } + +// GetSchedule returns __CreateScheduledSearchInput.Schedule, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetSchedule() string { return v.Schedule } + +// GetTimeZone returns __CreateScheduledSearchInput.TimeZone, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetTimeZone() string { return v.TimeZone } + +// GetBackfillLimit returns __CreateScheduledSearchInput.BackfillLimit, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetBackfillLimit() int { return v.BackfillLimit } + +// GetEnabled returns __CreateScheduledSearchInput.Enabled, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetEnabled() bool { return v.Enabled } + +// GetActionIdsOrNames returns __CreateScheduledSearchInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetRunAsUserID returns __CreateScheduledSearchInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetLabels returns __CreateScheduledSearchInput.Labels, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetLabels() []string { return v.Labels } + +// GetQueryOwnershipType returns __CreateScheduledSearchInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__CreateScheduledSearchInput) GetQueryOwnershipType() *QueryOwnershipType { + return v.QueryOwnershipType +} + +// __CreateSlackActionInput is used internally by genqlient +type __CreateSlackActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + Fields []SlackFieldEntryInput `json:"Fields"` + Url string `json:"Url"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateSlackActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateSlackActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateSlackActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateSlackActionInput) GetActionName() string { return v.ActionName } + +// GetFields returns __CreateSlackActionInput.Fields, and is useful for accessing the field via an interface. +func (v *__CreateSlackActionInput) GetFields() []SlackFieldEntryInput { return v.Fields } + +// GetUrl returns __CreateSlackActionInput.Url, and is useful for accessing the field via an interface. +func (v *__CreateSlackActionInput) GetUrl() string { return v.Url } + +// GetUseProxy returns __CreateSlackActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateSlackActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreateSlackPostMessageActionInput is used internally by genqlient +type __CreateSlackPostMessageActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + ApiToken string `json:"ApiToken"` + Channels []string `json:"Channels"` + Fields []SlackFieldEntryInput `json:"Fields"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateSlackPostMessageActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateSlackPostMessageActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetActionName() string { return v.ActionName } + +// GetApiToken returns __CreateSlackPostMessageActionInput.ApiToken, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetApiToken() string { return v.ApiToken } + +// GetChannels returns __CreateSlackPostMessageActionInput.Channels, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetChannels() []string { return v.Channels } + +// GetFields returns __CreateSlackPostMessageActionInput.Fields, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetFields() []SlackFieldEntryInput { return v.Fields } + +// GetUseProxy returns __CreateSlackPostMessageActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateSlackPostMessageActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreateUploadFileActionInput is used internally by genqlient +type __CreateUploadFileActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + FileName string `json:"FileName"` +} + +// GetSearchDomainName returns __CreateUploadFileActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateUploadFileActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateUploadFileActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateUploadFileActionInput) GetActionName() string { return v.ActionName } + +// GetFileName returns __CreateUploadFileActionInput.FileName, and is useful for accessing the field via an interface. +func (v *__CreateUploadFileActionInput) GetFileName() string { return v.FileName } + +// __CreateVictorOpsActionInput is used internally by genqlient +type __CreateVictorOpsActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + MessageType string `json:"MessageType"` + NotifyUrl string `json:"NotifyUrl"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateVictorOpsActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateVictorOpsActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateVictorOpsActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateVictorOpsActionInput) GetActionName() string { return v.ActionName } + +// GetMessageType returns __CreateVictorOpsActionInput.MessageType, and is useful for accessing the field via an interface. +func (v *__CreateVictorOpsActionInput) GetMessageType() string { return v.MessageType } + +// GetNotifyUrl returns __CreateVictorOpsActionInput.NotifyUrl, and is useful for accessing the field via an interface. +func (v *__CreateVictorOpsActionInput) GetNotifyUrl() string { return v.NotifyUrl } + +// GetUseProxy returns __CreateVictorOpsActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateVictorOpsActionInput) GetUseProxy() bool { return v.UseProxy } + +// __CreateViewInput is used internally by genqlient +type __CreateViewInput struct { + ViewName string `json:"ViewName"` + Description *string `json:"Description"` + Connections []ViewConnectionInput `json:"Connections"` +} + +// GetViewName returns __CreateViewInput.ViewName, and is useful for accessing the field via an interface. +func (v *__CreateViewInput) GetViewName() string { return v.ViewName } + +// GetDescription returns __CreateViewInput.Description, and is useful for accessing the field via an interface. +func (v *__CreateViewInput) GetDescription() *string { return v.Description } + +// GetConnections returns __CreateViewInput.Connections, and is useful for accessing the field via an interface. +func (v *__CreateViewInput) GetConnections() []ViewConnectionInput { return v.Connections } + +// __CreateWebhookActionInput is used internally by genqlient +type __CreateWebhookActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionName string `json:"ActionName"` + Url string `json:"Url"` + Method string `json:"Method"` + Headers []HttpHeaderEntryInput `json:"Headers"` + BodyTemplate string `json:"BodyTemplate"` + IgnoreSSL bool `json:"IgnoreSSL"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __CreateWebhookActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionName returns __CreateWebhookActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetActionName() string { return v.ActionName } + +// GetUrl returns __CreateWebhookActionInput.Url, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetUrl() string { return v.Url } + +// GetMethod returns __CreateWebhookActionInput.Method, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetMethod() string { return v.Method } + +// GetHeaders returns __CreateWebhookActionInput.Headers, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetHeaders() []HttpHeaderEntryInput { return v.Headers } + +// GetBodyTemplate returns __CreateWebhookActionInput.BodyTemplate, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetBodyTemplate() string { return v.BodyTemplate } + +// GetIgnoreSSL returns __CreateWebhookActionInput.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetIgnoreSSL() bool { return v.IgnoreSSL } + +// GetUseProxy returns __CreateWebhookActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__CreateWebhookActionInput) GetUseProxy() bool { return v.UseProxy } + +// __DeleteActionByIDInput is used internally by genqlient +type __DeleteActionByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` +} + +// GetSearchDomainName returns __DeleteActionByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteActionByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __DeleteActionByIDInput.ActionID, and is useful for accessing the field via an interface. +func (v *__DeleteActionByIDInput) GetActionID() string { return v.ActionID } + +// __DeleteAggregateAlertInput is used internally by genqlient +type __DeleteAggregateAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + AggregateAlertID string `json:"AggregateAlertID"` +} + +// GetSearchDomainName returns __DeleteAggregateAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteAggregateAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetAggregateAlertID returns __DeleteAggregateAlertInput.AggregateAlertID, and is useful for accessing the field via an interface. +func (v *__DeleteAggregateAlertInput) GetAggregateAlertID() string { return v.AggregateAlertID } + +// __DeleteAlertInput is used internally by genqlient +type __DeleteAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + AlertID string `json:"AlertID"` +} + +// GetSearchDomainName returns __DeleteAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetAlertID returns __DeleteAlertInput.AlertID, and is useful for accessing the field via an interface. +func (v *__DeleteAlertInput) GetAlertID() string { return v.AlertID } + +// __DeleteFilterAlertInput is used internally by genqlient +type __DeleteFilterAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + FilterAlertID string `json:"FilterAlertID"` +} + +// GetSearchDomainName returns __DeleteFilterAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteFilterAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetFilterAlertID returns __DeleteFilterAlertInput.FilterAlertID, and is useful for accessing the field via an interface. +func (v *__DeleteFilterAlertInput) GetFilterAlertID() string { return v.FilterAlertID } + +// __DeleteParserByIDInput is used internally by genqlient +type __DeleteParserByIDInput struct { + RepositoryName string `json:"RepositoryName"` + ParserID string `json:"ParserID"` +} + +// GetRepositoryName returns __DeleteParserByIDInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__DeleteParserByIDInput) GetRepositoryName() string { return v.RepositoryName } + +// GetParserID returns __DeleteParserByIDInput.ParserID, and is useful for accessing the field via an interface. +func (v *__DeleteParserByIDInput) GetParserID() string { return v.ParserID } + +// __DeleteScheduledSearchByIDInput is used internally by genqlient +type __DeleteScheduledSearchByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + ScheduledSearchID string `json:"ScheduledSearchID"` +} + +// GetSearchDomainName returns __DeleteScheduledSearchByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteScheduledSearchByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetScheduledSearchID returns __DeleteScheduledSearchByIDInput.ScheduledSearchID, and is useful for accessing the field via an interface. +func (v *__DeleteScheduledSearchByIDInput) GetScheduledSearchID() string { return v.ScheduledSearchID } + +// __DeleteSearchDomainInput is used internally by genqlient +type __DeleteSearchDomainInput struct { + SearchDomainName string `json:"SearchDomainName"` + DeleteMessage string `json:"DeleteMessage"` +} + +// GetSearchDomainName returns __DeleteSearchDomainInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__DeleteSearchDomainInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetDeleteMessage returns __DeleteSearchDomainInput.DeleteMessage, and is useful for accessing the field via an interface. +func (v *__DeleteSearchDomainInput) GetDeleteMessage() string { return v.DeleteMessage } + +// __DisableFeatureFlagForOrganizationInput is used internally by genqlient +type __DisableFeatureFlagForOrganizationInput struct { + Flag FeatureFlag `json:"Flag"` + OrganizationID string `json:"OrganizationID"` +} + +// GetFlag returns __DisableFeatureFlagForOrganizationInput.Flag, and is useful for accessing the field via an interface. +func (v *__DisableFeatureFlagForOrganizationInput) GetFlag() FeatureFlag { return v.Flag } + +// GetOrganizationID returns __DisableFeatureFlagForOrganizationInput.OrganizationID, and is useful for accessing the field via an interface. +func (v *__DisableFeatureFlagForOrganizationInput) GetOrganizationID() string { + return v.OrganizationID +} + +// __DisableFeatureFlagForUserInput is used internally by genqlient +type __DisableFeatureFlagForUserInput struct { + Flag FeatureFlag `json:"Flag"` + UserID string `json:"UserID"` +} + +// GetFlag returns __DisableFeatureFlagForUserInput.Flag, and is useful for accessing the field via an interface. +func (v *__DisableFeatureFlagForUserInput) GetFlag() FeatureFlag { return v.Flag } + +// GetUserID returns __DisableFeatureFlagForUserInput.UserID, and is useful for accessing the field via an interface. +func (v *__DisableFeatureFlagForUserInput) GetUserID() string { return v.UserID } + +// __DisableFeatureFlagGloballyInput is used internally by genqlient +type __DisableFeatureFlagGloballyInput struct { + Flag FeatureFlag `json:"Flag"` +} + +// GetFlag returns __DisableFeatureFlagGloballyInput.Flag, and is useful for accessing the field via an interface. +func (v *__DisableFeatureFlagGloballyInput) GetFlag() FeatureFlag { return v.Flag } + +// __DisableS3ArchivingInput is used internally by genqlient +type __DisableS3ArchivingInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __DisableS3ArchivingInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__DisableS3ArchivingInput) GetRepositoryName() string { return v.RepositoryName } + +// __EnableFeatureFlagForOrganizationInput is used internally by genqlient +type __EnableFeatureFlagForOrganizationInput struct { + Flag FeatureFlag `json:"Flag"` + OrganizationID string `json:"OrganizationID"` +} + +// GetFlag returns __EnableFeatureFlagForOrganizationInput.Flag, and is useful for accessing the field via an interface. +func (v *__EnableFeatureFlagForOrganizationInput) GetFlag() FeatureFlag { return v.Flag } + +// GetOrganizationID returns __EnableFeatureFlagForOrganizationInput.OrganizationID, and is useful for accessing the field via an interface. +func (v *__EnableFeatureFlagForOrganizationInput) GetOrganizationID() string { return v.OrganizationID } + +// __EnableFeatureFlagForUserInput is used internally by genqlient +type __EnableFeatureFlagForUserInput struct { + Flag FeatureFlag `json:"Flag"` + UserID string `json:"UserID"` +} + +// GetFlag returns __EnableFeatureFlagForUserInput.Flag, and is useful for accessing the field via an interface. +func (v *__EnableFeatureFlagForUserInput) GetFlag() FeatureFlag { return v.Flag } + +// GetUserID returns __EnableFeatureFlagForUserInput.UserID, and is useful for accessing the field via an interface. +func (v *__EnableFeatureFlagForUserInput) GetUserID() string { return v.UserID } + +// __EnableFeatureFlagGloballyInput is used internally by genqlient +type __EnableFeatureFlagGloballyInput struct { + Flag FeatureFlag `json:"Flag"` +} + +// GetFlag returns __EnableFeatureFlagGloballyInput.Flag, and is useful for accessing the field via an interface. +func (v *__EnableFeatureFlagGloballyInput) GetFlag() FeatureFlag { return v.Flag } + +// __EnableS3ArchivingInput is used internally by genqlient +type __EnableS3ArchivingInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __EnableS3ArchivingInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__EnableS3ArchivingInput) GetRepositoryName() string { return v.RepositoryName } + +// __GetActionByIDInput is used internally by genqlient +type __GetActionByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` +} + +// GetSearchDomainName returns __GetActionByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__GetActionByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __GetActionByIDInput.ActionID, and is useful for accessing the field via an interface. +func (v *__GetActionByIDInput) GetActionID() string { return v.ActionID } + +// __GetAggregateAlertByIDInput is used internally by genqlient +type __GetAggregateAlertByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + AggregateAlertID string `json:"AggregateAlertID"` +} + +// GetSearchDomainName returns __GetAggregateAlertByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__GetAggregateAlertByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetAggregateAlertID returns __GetAggregateAlertByIDInput.AggregateAlertID, and is useful for accessing the field via an interface. +func (v *__GetAggregateAlertByIDInput) GetAggregateAlertID() string { return v.AggregateAlertID } + +// __GetFilterAlertByIDInput is used internally by genqlient +type __GetFilterAlertByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + FilterAlertID string `json:"FilterAlertID"` +} + +// GetSearchDomainName returns __GetFilterAlertByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__GetFilterAlertByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetFilterAlertID returns __GetFilterAlertByIDInput.FilterAlertID, and is useful for accessing the field via an interface. +func (v *__GetFilterAlertByIDInput) GetFilterAlertID() string { return v.FilterAlertID } + +// __GetParserByIDInput is used internally by genqlient +type __GetParserByIDInput struct { + RepositoryName string `json:"RepositoryName"` + ParserID string `json:"ParserID"` +} + +// GetRepositoryName returns __GetParserByIDInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__GetParserByIDInput) GetRepositoryName() string { return v.RepositoryName } + +// GetParserID returns __GetParserByIDInput.ParserID, and is useful for accessing the field via an interface. +func (v *__GetParserByIDInput) GetParserID() string { return v.ParserID } + +// __GetParserYAMLByNameInput is used internally by genqlient +type __GetParserYAMLByNameInput struct { + RepositoryName string `json:"RepositoryName"` + ParserName string `json:"ParserName"` +} + +// GetRepositoryName returns __GetParserYAMLByNameInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__GetParserYAMLByNameInput) GetRepositoryName() string { return v.RepositoryName } + +// GetParserName returns __GetParserYAMLByNameInput.ParserName, and is useful for accessing the field via an interface. +func (v *__GetParserYAMLByNameInput) GetParserName() string { return v.ParserName } + +// __GetRepositoryInput is used internally by genqlient +type __GetRepositoryInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __GetRepositoryInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__GetRepositoryInput) GetRepositoryName() string { return v.RepositoryName } + +// __GetRoleByIDInput is used internally by genqlient +type __GetRoleByIDInput struct { + RoleID string `json:"RoleID"` +} + +// GetRoleID returns __GetRoleByIDInput.RoleID, and is useful for accessing the field via an interface. +func (v *__GetRoleByIDInput) GetRoleID() string { return v.RoleID } + +// __GetScheduledSearchByIDInput is used internally by genqlient +type __GetScheduledSearchByIDInput struct { + SearchDomainName string `json:"SearchDomainName"` + ScheduledSearchID string `json:"ScheduledSearchID"` +} + +// GetSearchDomainName returns __GetScheduledSearchByIDInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__GetScheduledSearchByIDInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetScheduledSearchID returns __GetScheduledSearchByIDInput.ScheduledSearchID, and is useful for accessing the field via an interface. +func (v *__GetScheduledSearchByIDInput) GetScheduledSearchID() string { return v.ScheduledSearchID } + +// __GetSearchDomainInput is used internally by genqlient +type __GetSearchDomainInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __GetSearchDomainInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__GetSearchDomainInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __GetUsersByUsernameInput is used internally by genqlient +type __GetUsersByUsernameInput struct { + Username string `json:"Username"` +} + +// GetUsername returns __GetUsersByUsernameInput.Username, and is useful for accessing the field via an interface. +func (v *__GetUsersByUsernameInput) GetUsername() string { return v.Username } + +// __LegacyCreateParserInput is used internally by genqlient +type __LegacyCreateParserInput struct { + RepositoryName string `json:"RepositoryName"` + Name string `json:"Name"` + TestData []string `json:"TestData"` + TagFields []string `json:"TagFields"` + SourceCode string `json:"SourceCode"` + Force bool `json:"Force"` +} + +// GetRepositoryName returns __LegacyCreateParserInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetRepositoryName() string { return v.RepositoryName } + +// GetName returns __LegacyCreateParserInput.Name, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetName() string { return v.Name } + +// GetTestData returns __LegacyCreateParserInput.TestData, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetTestData() []string { return v.TestData } + +// GetTagFields returns __LegacyCreateParserInput.TagFields, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetTagFields() []string { return v.TagFields } + +// GetSourceCode returns __LegacyCreateParserInput.SourceCode, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetSourceCode() string { return v.SourceCode } + +// GetForce returns __LegacyCreateParserInput.Force, and is useful for accessing the field via an interface. +func (v *__LegacyCreateParserInput) GetForce() bool { return v.Force } + +// __LegacyDeleteParserByIDInput is used internally by genqlient +type __LegacyDeleteParserByIDInput struct { + RepositoryName string `json:"RepositoryName"` + ParserID string `json:"ParserID"` +} + +// GetRepositoryName returns __LegacyDeleteParserByIDInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__LegacyDeleteParserByIDInput) GetRepositoryName() string { return v.RepositoryName } + +// GetParserID returns __LegacyDeleteParserByIDInput.ParserID, and is useful for accessing the field via an interface. +func (v *__LegacyDeleteParserByIDInput) GetParserID() string { return v.ParserID } + +// __LegacyGetParserInput is used internally by genqlient +type __LegacyGetParserInput struct { + RepositoryName string `json:"RepositoryName"` + ParserName string `json:"ParserName"` +} + +// GetRepositoryName returns __LegacyGetParserInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__LegacyGetParserInput) GetRepositoryName() string { return v.RepositoryName } + +// GetParserName returns __LegacyGetParserInput.ParserName, and is useful for accessing the field via an interface. +func (v *__LegacyGetParserInput) GetParserName() string { return v.ParserName } + +// __ListActionsInput is used internally by genqlient +type __ListActionsInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListActionsInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListActionsInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListAggregateAlertsInput is used internally by genqlient +type __ListAggregateAlertsInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListAggregateAlertsInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListAggregateAlertsInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListAlertsInput is used internally by genqlient +type __ListAlertsInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListAlertsInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListAlertsInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListFilesInput is used internally by genqlient +type __ListFilesInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListFilesInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListFilesInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListFilterAlertsInput is used internally by genqlient +type __ListFilterAlertsInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListFilterAlertsInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListFilterAlertsInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListIngestTokensInput is used internally by genqlient +type __ListIngestTokensInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __ListIngestTokensInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__ListIngestTokensInput) GetRepositoryName() string { return v.RepositoryName } + +// __ListInstalledPackagesInput is used internally by genqlient +type __ListInstalledPackagesInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListInstalledPackagesInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListInstalledPackagesInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __ListParsersInput is used internally by genqlient +type __ListParsersInput struct { + RepositoryName string `json:"RepositoryName"` +} + +// GetRepositoryName returns __ListParsersInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__ListParsersInput) GetRepositoryName() string { return v.RepositoryName } + +// __ListScheduledSearchesInput is used internally by genqlient +type __ListScheduledSearchesInput struct { + SearchDomainName string `json:"SearchDomainName"` +} + +// GetSearchDomainName returns __ListScheduledSearchesInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__ListScheduledSearchesInput) GetSearchDomainName() string { return v.SearchDomainName } + +// __RemoveFileInput is used internally by genqlient +type __RemoveFileInput struct { + SearchDomainName string `json:"SearchDomainName"` + FileName string `json:"FileName"` +} + +// GetSearchDomainName returns __RemoveFileInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__RemoveFileInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetFileName returns __RemoveFileInput.FileName, and is useful for accessing the field via an interface. +func (v *__RemoveFileInput) GetFileName() string { return v.FileName } + +// __RemoveIngestTokenInput is used internally by genqlient +type __RemoveIngestTokenInput struct { + RepositoryName string `json:"RepositoryName"` + Name string `json:"Name"` +} + +// GetRepositoryName returns __RemoveIngestTokenInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__RemoveIngestTokenInput) GetRepositoryName() string { return v.RepositoryName } + +// GetName returns __RemoveIngestTokenInput.Name, and is useful for accessing the field via an interface. +func (v *__RemoveIngestTokenInput) GetName() string { return v.Name } + +// __RemoveRoleByIDInput is used internally by genqlient +type __RemoveRoleByIDInput struct { + RoleID string `json:"RoleID"` +} + +// GetRoleID returns __RemoveRoleByIDInput.RoleID, and is useful for accessing the field via an interface. +func (v *__RemoveRoleByIDInput) GetRoleID() string { return v.RoleID } + +// __RemoveUserFromGroupInput is used internally by genqlient +type __RemoveUserFromGroupInput struct { + GroupID string `json:"GroupID"` + UserID string `json:"UserID"` +} + +// GetGroupID returns __RemoveUserFromGroupInput.GroupID, and is useful for accessing the field via an interface. +func (v *__RemoveUserFromGroupInput) GetGroupID() string { return v.GroupID } + +// GetUserID returns __RemoveUserFromGroupInput.UserID, and is useful for accessing the field via an interface. +func (v *__RemoveUserFromGroupInput) GetUserID() string { return v.UserID } + +// __RemoveUserInput is used internally by genqlient +type __RemoveUserInput struct { + Username string `json:"Username"` +} + +// GetUsername returns __RemoveUserInput.Username, and is useful for accessing the field via an interface. +func (v *__RemoveUserInput) GetUsername() string { return v.Username } + +// __RotateTokenByIDInput is used internally by genqlient +type __RotateTokenByIDInput struct { + TokenID string `json:"TokenID"` +} + +// GetTokenID returns __RotateTokenByIDInput.TokenID, and is useful for accessing the field via an interface. +func (v *__RotateTokenByIDInput) GetTokenID() string { return v.TokenID } + +// __SetAutomaticSearchingInput is used internally by genqlient +type __SetAutomaticSearchingInput struct { + SearchDomainName string `json:"SearchDomainName"` + AutomaticSearch bool `json:"AutomaticSearch"` +} + +// GetSearchDomainName returns __SetAutomaticSearchingInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__SetAutomaticSearchingInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetAutomaticSearch returns __SetAutomaticSearchingInput.AutomaticSearch, and is useful for accessing the field via an interface. +func (v *__SetAutomaticSearchingInput) GetAutomaticSearch() bool { return v.AutomaticSearch } + +// __UnassignParserToIngestTokenInput is used internally by genqlient +type __UnassignParserToIngestTokenInput struct { + RepositoryName string `json:"RepositoryName"` + IngestTokenName string `json:"IngestTokenName"` +} + +// GetRepositoryName returns __UnassignParserToIngestTokenInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__UnassignParserToIngestTokenInput) GetRepositoryName() string { return v.RepositoryName } + +// GetIngestTokenName returns __UnassignParserToIngestTokenInput.IngestTokenName, and is useful for accessing the field via an interface. +func (v *__UnassignParserToIngestTokenInput) GetIngestTokenName() string { return v.IngestTokenName } + +// __UninstallPackageInput is used internally by genqlient +type __UninstallPackageInput struct { + SearchDomainName string `json:"SearchDomainName"` + PackageID string `json:"PackageID"` +} + +// GetSearchDomainName returns __UninstallPackageInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UninstallPackageInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetPackageID returns __UninstallPackageInput.PackageID, and is useful for accessing the field via an interface. +func (v *__UninstallPackageInput) GetPackageID() string { return v.PackageID } + +// __UnregisterClusterNodeInput is used internally by genqlient +type __UnregisterClusterNodeInput struct { + NodeID int `json:"NodeID"` + Force bool `json:"Force"` +} + +// GetNodeID returns __UnregisterClusterNodeInput.NodeID, and is useful for accessing the field via an interface. +func (v *__UnregisterClusterNodeInput) GetNodeID() int { return v.NodeID } + +// GetForce returns __UnregisterClusterNodeInput.Force, and is useful for accessing the field via an interface. +func (v *__UnregisterClusterNodeInput) GetForce() bool { return v.Force } + +// __UpdateAggregateAlertInput is used internally by genqlient +type __UpdateAggregateAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + ID string `json:"ID"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + SearchIntervalSeconds int64 `json:"SearchIntervalSeconds"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + Labels []string `json:"Labels"` + Enabled bool `json:"Enabled"` + RunAsUserID *string `json:"RunAsUserID"` + ThrottleField *string `json:"ThrottleField"` + ThrottleTimeSeconds int64 `json:"ThrottleTimeSeconds"` + TriggerMode TriggerMode `json:"TriggerMode"` + QueryTimestampMode QueryTimestampType `json:"QueryTimestampMode"` + QueryOwnershipType QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __UpdateAggregateAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetID returns __UpdateAggregateAlertInput.ID, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetID() string { return v.ID } + +// GetName returns __UpdateAggregateAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetName() string { return v.Name } + +// GetDescription returns __UpdateAggregateAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __UpdateAggregateAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetQueryString() string { return v.QueryString } + +// GetSearchIntervalSeconds returns __UpdateAggregateAlertInput.SearchIntervalSeconds, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetSearchIntervalSeconds() int64 { + return v.SearchIntervalSeconds +} + +// GetActionIdsOrNames returns __UpdateAggregateAlertInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetLabels returns __UpdateAggregateAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetLabels() []string { return v.Labels } + +// GetEnabled returns __UpdateAggregateAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetEnabled() bool { return v.Enabled } + +// GetRunAsUserID returns __UpdateAggregateAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetThrottleField returns __UpdateAggregateAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// GetThrottleTimeSeconds returns __UpdateAggregateAlertInput.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetThrottleTimeSeconds() int64 { return v.ThrottleTimeSeconds } + +// GetTriggerMode returns __UpdateAggregateAlertInput.TriggerMode, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetTriggerMode() TriggerMode { return v.TriggerMode } + +// GetQueryTimestampMode returns __UpdateAggregateAlertInput.QueryTimestampMode, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetQueryTimestampMode() QueryTimestampType { + return v.QueryTimestampMode +} + +// GetQueryOwnershipType returns __UpdateAggregateAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__UpdateAggregateAlertInput) GetQueryOwnershipType() QueryOwnershipType { + return v.QueryOwnershipType +} + +// __UpdateAlertInput is used internally by genqlient +type __UpdateAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + AlertID string `json:"AlertID"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + QueryStart string `json:"QueryStart"` + ThrottleTimeMillis int64 `json:"ThrottleTimeMillis"` + Enabled bool `json:"Enabled"` + Actions []string `json:"Actions"` + Labels []string `json:"Labels"` + RunAsUserID *string `json:"RunAsUserID"` + QueryOwnershipType *QueryOwnershipType `json:"QueryOwnershipType"` + ThrottleField *string `json:"ThrottleField"` +} + +// GetSearchDomainName returns __UpdateAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetAlertID returns __UpdateAlertInput.AlertID, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetAlertID() string { return v.AlertID } + +// GetName returns __UpdateAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetName() string { return v.Name } + +// GetDescription returns __UpdateAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __UpdateAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetQueryString() string { return v.QueryString } + +// GetQueryStart returns __UpdateAlertInput.QueryStart, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetQueryStart() string { return v.QueryStart } + +// GetThrottleTimeMillis returns __UpdateAlertInput.ThrottleTimeMillis, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetThrottleTimeMillis() int64 { return v.ThrottleTimeMillis } + +// GetEnabled returns __UpdateAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetEnabled() bool { return v.Enabled } + +// GetActions returns __UpdateAlertInput.Actions, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetActions() []string { return v.Actions } + +// GetLabels returns __UpdateAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetLabels() []string { return v.Labels } + +// GetRunAsUserID returns __UpdateAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetQueryOwnershipType returns __UpdateAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetQueryOwnershipType() *QueryOwnershipType { return v.QueryOwnershipType } + +// GetThrottleField returns __UpdateAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__UpdateAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// __UpdateDescriptionForSearchDomainInput is used internally by genqlient +type __UpdateDescriptionForSearchDomainInput struct { + SearchDomainName string `json:"SearchDomainName"` + NewDescription string `json:"NewDescription"` +} + +// GetSearchDomainName returns __UpdateDescriptionForSearchDomainInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateDescriptionForSearchDomainInput) GetSearchDomainName() string { + return v.SearchDomainName +} + +// GetNewDescription returns __UpdateDescriptionForSearchDomainInput.NewDescription, and is useful for accessing the field via an interface. +func (v *__UpdateDescriptionForSearchDomainInput) GetNewDescription() string { return v.NewDescription } + +// __UpdateEmailActionInput is used internally by genqlient +type __UpdateEmailActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + Recipients []string `json:"Recipients"` + SubjectTemplate *string `json:"SubjectTemplate"` + BodyTemplate *string `json:"BodyTemplate"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateEmailActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateEmailActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateEmailActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetActionName() string { return v.ActionName } + +// GetRecipients returns __UpdateEmailActionInput.Recipients, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetRecipients() []string { return v.Recipients } + +// GetSubjectTemplate returns __UpdateEmailActionInput.SubjectTemplate, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetSubjectTemplate() *string { return v.SubjectTemplate } + +// GetBodyTemplate returns __UpdateEmailActionInput.BodyTemplate, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetBodyTemplate() *string { return v.BodyTemplate } + +// GetUseProxy returns __UpdateEmailActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateEmailActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdateFilterAlertInput is used internally by genqlient +type __UpdateFilterAlertInput struct { + SearchDomainName string `json:"SearchDomainName"` + ID string `json:"ID"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + Labels []string `json:"Labels"` + Enabled bool `json:"Enabled"` + RunAsUserID *string `json:"RunAsUserID"` + ThrottleField *string `json:"ThrottleField"` + ThrottleTimeSeconds int64 `json:"ThrottleTimeSeconds"` + QueryOwnershipType QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __UpdateFilterAlertInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetID returns __UpdateFilterAlertInput.ID, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetID() string { return v.ID } + +// GetName returns __UpdateFilterAlertInput.Name, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetName() string { return v.Name } + +// GetDescription returns __UpdateFilterAlertInput.Description, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __UpdateFilterAlertInput.QueryString, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetQueryString() string { return v.QueryString } + +// GetActionIdsOrNames returns __UpdateFilterAlertInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetLabels returns __UpdateFilterAlertInput.Labels, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetLabels() []string { return v.Labels } + +// GetEnabled returns __UpdateFilterAlertInput.Enabled, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetEnabled() bool { return v.Enabled } + +// GetRunAsUserID returns __UpdateFilterAlertInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetRunAsUserID() *string { return v.RunAsUserID } + +// GetThrottleField returns __UpdateFilterAlertInput.ThrottleField, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetThrottleField() *string { return v.ThrottleField } + +// GetThrottleTimeSeconds returns __UpdateFilterAlertInput.ThrottleTimeSeconds, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetThrottleTimeSeconds() int64 { return v.ThrottleTimeSeconds } + +// GetQueryOwnershipType returns __UpdateFilterAlertInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__UpdateFilterAlertInput) GetQueryOwnershipType() QueryOwnershipType { + return v.QueryOwnershipType +} + +// __UpdateHumioRepoActionInput is used internally by genqlient +type __UpdateHumioRepoActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + IngestToken string `json:"IngestToken"` +} + +// GetSearchDomainName returns __UpdateHumioRepoActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateHumioRepoActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateHumioRepoActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateHumioRepoActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateHumioRepoActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateHumioRepoActionInput) GetActionName() string { return v.ActionName } + +// GetIngestToken returns __UpdateHumioRepoActionInput.IngestToken, and is useful for accessing the field via an interface. +func (v *__UpdateHumioRepoActionInput) GetIngestToken() string { return v.IngestToken } + +// __UpdateIngestBasedRetentionInput is used internally by genqlient +type __UpdateIngestBasedRetentionInput struct { + RepositoryName string `json:"RepositoryName"` + IngestInGB *float64 `json:"IngestInGB"` +} + +// GetRepositoryName returns __UpdateIngestBasedRetentionInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__UpdateIngestBasedRetentionInput) GetRepositoryName() string { return v.RepositoryName } + +// GetIngestInGB returns __UpdateIngestBasedRetentionInput.IngestInGB, and is useful for accessing the field via an interface. +func (v *__UpdateIngestBasedRetentionInput) GetIngestInGB() *float64 { return v.IngestInGB } + +// __UpdateLicenseKeyInput is used internally by genqlient +type __UpdateLicenseKeyInput struct { + LicenseKey string `json:"LicenseKey"` +} + +// GetLicenseKey returns __UpdateLicenseKeyInput.LicenseKey, and is useful for accessing the field via an interface. +func (v *__UpdateLicenseKeyInput) GetLicenseKey() string { return v.LicenseKey } + +// __UpdateOpsGenieActionInput is used internally by genqlient +type __UpdateOpsGenieActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + ApiUrl string `json:"ApiUrl"` + GenieKey string `json:"GenieKey"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateOpsGenieActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateOpsGenieActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateOpsGenieActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetActionName() string { return v.ActionName } + +// GetApiUrl returns __UpdateOpsGenieActionInput.ApiUrl, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetApiUrl() string { return v.ApiUrl } + +// GetGenieKey returns __UpdateOpsGenieActionInput.GenieKey, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetGenieKey() string { return v.GenieKey } + +// GetUseProxy returns __UpdateOpsGenieActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateOpsGenieActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdatePagerDutyActionInput is used internally by genqlient +type __UpdatePagerDutyActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + Severity string `json:"Severity"` + RoutingKey string `json:"RoutingKey"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdatePagerDutyActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdatePagerDutyActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdatePagerDutyActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetActionName() string { return v.ActionName } + +// GetSeverity returns __UpdatePagerDutyActionInput.Severity, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetSeverity() string { return v.Severity } + +// GetRoutingKey returns __UpdatePagerDutyActionInput.RoutingKey, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetRoutingKey() string { return v.RoutingKey } + +// GetUseProxy returns __UpdatePagerDutyActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdatePagerDutyActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdateRoleInput is used internally by genqlient +type __UpdateRoleInput struct { + RoleID string `json:"RoleID"` + RoleName string `json:"RoleName"` + ViewPermissions []Permission `json:"ViewPermissions"` + OrganizationPermissions []OrganizationPermission `json:"OrganizationPermissions"` + SystemPermissions []SystemPermission `json:"SystemPermissions"` +} + +// GetRoleID returns __UpdateRoleInput.RoleID, and is useful for accessing the field via an interface. +func (v *__UpdateRoleInput) GetRoleID() string { return v.RoleID } + +// GetRoleName returns __UpdateRoleInput.RoleName, and is useful for accessing the field via an interface. +func (v *__UpdateRoleInput) GetRoleName() string { return v.RoleName } + +// GetViewPermissions returns __UpdateRoleInput.ViewPermissions, and is useful for accessing the field via an interface. +func (v *__UpdateRoleInput) GetViewPermissions() []Permission { return v.ViewPermissions } + +// GetOrganizationPermissions returns __UpdateRoleInput.OrganizationPermissions, and is useful for accessing the field via an interface. +func (v *__UpdateRoleInput) GetOrganizationPermissions() []OrganizationPermission { + return v.OrganizationPermissions +} + +// GetSystemPermissions returns __UpdateRoleInput.SystemPermissions, and is useful for accessing the field via an interface. +func (v *__UpdateRoleInput) GetSystemPermissions() []SystemPermission { return v.SystemPermissions } + +// __UpdateS3ArchivingConfigurationInput is used internally by genqlient +type __UpdateS3ArchivingConfigurationInput struct { + RepositoryName string `json:"RepositoryName"` + BucketName string `json:"BucketName"` + BucketRegion string `json:"BucketRegion"` + Format S3ArchivingFormat `json:"Format"` +} + +// GetRepositoryName returns __UpdateS3ArchivingConfigurationInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__UpdateS3ArchivingConfigurationInput) GetRepositoryName() string { return v.RepositoryName } + +// GetBucketName returns __UpdateS3ArchivingConfigurationInput.BucketName, and is useful for accessing the field via an interface. +func (v *__UpdateS3ArchivingConfigurationInput) GetBucketName() string { return v.BucketName } + +// GetBucketRegion returns __UpdateS3ArchivingConfigurationInput.BucketRegion, and is useful for accessing the field via an interface. +func (v *__UpdateS3ArchivingConfigurationInput) GetBucketRegion() string { return v.BucketRegion } + +// GetFormat returns __UpdateS3ArchivingConfigurationInput.Format, and is useful for accessing the field via an interface. +func (v *__UpdateS3ArchivingConfigurationInput) GetFormat() S3ArchivingFormat { return v.Format } + +// __UpdateScheduledSearchInput is used internally by genqlient +type __UpdateScheduledSearchInput struct { + SearchDomainName string `json:"SearchDomainName"` + ID string `json:"ID"` + Name string `json:"Name"` + Description *string `json:"Description"` + QueryString string `json:"QueryString"` + QueryStart string `json:"QueryStart"` + QueryEnd string `json:"QueryEnd"` + Schedule string `json:"Schedule"` + TimeZone string `json:"TimeZone"` + BackfillLimit int `json:"BackfillLimit"` + Enabled bool `json:"Enabled"` + ActionIdsOrNames []string `json:"ActionIdsOrNames"` + RunAsUserID string `json:"RunAsUserID"` + Labels []string `json:"Labels"` + QueryOwnershipType *QueryOwnershipType `json:"QueryOwnershipType"` +} + +// GetSearchDomainName returns __UpdateScheduledSearchInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetID returns __UpdateScheduledSearchInput.ID, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetID() string { return v.ID } + +// GetName returns __UpdateScheduledSearchInput.Name, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetName() string { return v.Name } + +// GetDescription returns __UpdateScheduledSearchInput.Description, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetDescription() *string { return v.Description } + +// GetQueryString returns __UpdateScheduledSearchInput.QueryString, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetQueryString() string { return v.QueryString } + +// GetQueryStart returns __UpdateScheduledSearchInput.QueryStart, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetQueryStart() string { return v.QueryStart } + +// GetQueryEnd returns __UpdateScheduledSearchInput.QueryEnd, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetQueryEnd() string { return v.QueryEnd } + +// GetSchedule returns __UpdateScheduledSearchInput.Schedule, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetSchedule() string { return v.Schedule } + +// GetTimeZone returns __UpdateScheduledSearchInput.TimeZone, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetTimeZone() string { return v.TimeZone } + +// GetBackfillLimit returns __UpdateScheduledSearchInput.BackfillLimit, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetBackfillLimit() int { return v.BackfillLimit } + +// GetEnabled returns __UpdateScheduledSearchInput.Enabled, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetEnabled() bool { return v.Enabled } + +// GetActionIdsOrNames returns __UpdateScheduledSearchInput.ActionIdsOrNames, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetActionIdsOrNames() []string { return v.ActionIdsOrNames } + +// GetRunAsUserID returns __UpdateScheduledSearchInput.RunAsUserID, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetRunAsUserID() string { return v.RunAsUserID } + +// GetLabels returns __UpdateScheduledSearchInput.Labels, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetLabels() []string { return v.Labels } + +// GetQueryOwnershipType returns __UpdateScheduledSearchInput.QueryOwnershipType, and is useful for accessing the field via an interface. +func (v *__UpdateScheduledSearchInput) GetQueryOwnershipType() *QueryOwnershipType { + return v.QueryOwnershipType +} + +// __UpdateSlackActionInput is used internally by genqlient +type __UpdateSlackActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + Fields []SlackFieldEntryInput `json:"Fields"` + Url string `json:"Url"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateSlackActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateSlackActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateSlackActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetActionName() string { return v.ActionName } + +// GetFields returns __UpdateSlackActionInput.Fields, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetFields() []SlackFieldEntryInput { return v.Fields } + +// GetUrl returns __UpdateSlackActionInput.Url, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetUrl() string { return v.Url } + +// GetUseProxy returns __UpdateSlackActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateSlackActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdateSlackPostMessageActionInput is used internally by genqlient +type __UpdateSlackPostMessageActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + ApiToken string `json:"ApiToken"` + Channels []string `json:"Channels"` + Fields []SlackFieldEntryInput `json:"Fields"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateSlackPostMessageActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateSlackPostMessageActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateSlackPostMessageActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetActionName() string { return v.ActionName } + +// GetApiToken returns __UpdateSlackPostMessageActionInput.ApiToken, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetApiToken() string { return v.ApiToken } + +// GetChannels returns __UpdateSlackPostMessageActionInput.Channels, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetChannels() []string { return v.Channels } + +// GetFields returns __UpdateSlackPostMessageActionInput.Fields, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetFields() []SlackFieldEntryInput { return v.Fields } + +// GetUseProxy returns __UpdateSlackPostMessageActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateSlackPostMessageActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdateStorageBasedRetentionInput is used internally by genqlient +type __UpdateStorageBasedRetentionInput struct { + RepositoryName string `json:"RepositoryName"` + StorageInGB *float64 `json:"StorageInGB"` +} + +// GetRepositoryName returns __UpdateStorageBasedRetentionInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__UpdateStorageBasedRetentionInput) GetRepositoryName() string { return v.RepositoryName } + +// GetStorageInGB returns __UpdateStorageBasedRetentionInput.StorageInGB, and is useful for accessing the field via an interface. +func (v *__UpdateStorageBasedRetentionInput) GetStorageInGB() *float64 { return v.StorageInGB } + +// __UpdateTimeBasedRetentionInput is used internally by genqlient +type __UpdateTimeBasedRetentionInput struct { + RepositoryName string `json:"RepositoryName"` + RetentionInDays *float64 `json:"RetentionInDays"` +} + +// GetRepositoryName returns __UpdateTimeBasedRetentionInput.RepositoryName, and is useful for accessing the field via an interface. +func (v *__UpdateTimeBasedRetentionInput) GetRepositoryName() string { return v.RepositoryName } + +// GetRetentionInDays returns __UpdateTimeBasedRetentionInput.RetentionInDays, and is useful for accessing the field via an interface. +func (v *__UpdateTimeBasedRetentionInput) GetRetentionInDays() *float64 { return v.RetentionInDays } + +// __UpdateUploadFileActionInput is used internally by genqlient +type __UpdateUploadFileActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + FileName string `json:"FileName"` +} + +// GetSearchDomainName returns __UpdateUploadFileActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateUploadFileActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateUploadFileActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateUploadFileActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateUploadFileActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateUploadFileActionInput) GetActionName() string { return v.ActionName } + +// GetFileName returns __UpdateUploadFileActionInput.FileName, and is useful for accessing the field via an interface. +func (v *__UpdateUploadFileActionInput) GetFileName() string { return v.FileName } + +// __UpdateUserInput is used internally by genqlient +type __UpdateUserInput struct { + Username string `json:"Username"` + Company *string `json:"Company"` + IsRoot *bool `json:"IsRoot"` + FullName *string `json:"FullName"` + Picture *string `json:"Picture"` + Email *string `json:"Email"` + CountryCode *string `json:"CountryCode"` +} + +// GetUsername returns __UpdateUserInput.Username, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetUsername() string { return v.Username } + +// GetCompany returns __UpdateUserInput.Company, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetCompany() *string { return v.Company } + +// GetIsRoot returns __UpdateUserInput.IsRoot, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetIsRoot() *bool { return v.IsRoot } + +// GetFullName returns __UpdateUserInput.FullName, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetFullName() *string { return v.FullName } + +// GetPicture returns __UpdateUserInput.Picture, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetPicture() *string { return v.Picture } + +// GetEmail returns __UpdateUserInput.Email, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetEmail() *string { return v.Email } + +// GetCountryCode returns __UpdateUserInput.CountryCode, and is useful for accessing the field via an interface. +func (v *__UpdateUserInput) GetCountryCode() *string { return v.CountryCode } + +// __UpdateVictorOpsActionInput is used internally by genqlient +type __UpdateVictorOpsActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + MessageType string `json:"MessageType"` + NotifyUrl string `json:"NotifyUrl"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateVictorOpsActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateVictorOpsActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateVictorOpsActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetActionName() string { return v.ActionName } + +// GetMessageType returns __UpdateVictorOpsActionInput.MessageType, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetMessageType() string { return v.MessageType } + +// GetNotifyUrl returns __UpdateVictorOpsActionInput.NotifyUrl, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetNotifyUrl() string { return v.NotifyUrl } + +// GetUseProxy returns __UpdateVictorOpsActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateVictorOpsActionInput) GetUseProxy() bool { return v.UseProxy } + +// __UpdateViewConnectionsInput is used internally by genqlient +type __UpdateViewConnectionsInput struct { + ViewName string `json:"ViewName"` + Connections []ViewConnectionInput `json:"Connections"` +} + +// GetViewName returns __UpdateViewConnectionsInput.ViewName, and is useful for accessing the field via an interface. +func (v *__UpdateViewConnectionsInput) GetViewName() string { return v.ViewName } + +// GetConnections returns __UpdateViewConnectionsInput.Connections, and is useful for accessing the field via an interface. +func (v *__UpdateViewConnectionsInput) GetConnections() []ViewConnectionInput { return v.Connections } + +// __UpdateWebhookActionInput is used internally by genqlient +type __UpdateWebhookActionInput struct { + SearchDomainName string `json:"SearchDomainName"` + ActionID string `json:"ActionID"` + ActionName string `json:"ActionName"` + Url string `json:"Url"` + Method string `json:"Method"` + Headers []HttpHeaderEntryInput `json:"Headers"` + BodyTemplate string `json:"BodyTemplate"` + IgnoreSSL bool `json:"IgnoreSSL"` + UseProxy bool `json:"UseProxy"` +} + +// GetSearchDomainName returns __UpdateWebhookActionInput.SearchDomainName, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetSearchDomainName() string { return v.SearchDomainName } + +// GetActionID returns __UpdateWebhookActionInput.ActionID, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetActionID() string { return v.ActionID } + +// GetActionName returns __UpdateWebhookActionInput.ActionName, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetActionName() string { return v.ActionName } + +// GetUrl returns __UpdateWebhookActionInput.Url, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetUrl() string { return v.Url } + +// GetMethod returns __UpdateWebhookActionInput.Method, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetMethod() string { return v.Method } + +// GetHeaders returns __UpdateWebhookActionInput.Headers, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetHeaders() []HttpHeaderEntryInput { return v.Headers } + +// GetBodyTemplate returns __UpdateWebhookActionInput.BodyTemplate, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetBodyTemplate() string { return v.BodyTemplate } + +// GetIgnoreSSL returns __UpdateWebhookActionInput.IgnoreSSL, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetIgnoreSSL() bool { return v.IgnoreSSL } + +// GetUseProxy returns __UpdateWebhookActionInput.UseProxy, and is useful for accessing the field via an interface. +func (v *__UpdateWebhookActionInput) GetUseProxy() bool { return v.UseProxy } + +// The query or mutation executed by AddIngestToken. +const AddIngestToken_Operation = ` +mutation AddIngestToken ($RepositoryName: String!, $Name: String!, $ParserName: String) { + addIngestTokenV3(input: {repositoryName:$RepositoryName,name:$Name,parser:$ParserName}) { + ... IngestTokenDetails + } +} +fragment IngestTokenDetails on IngestToken { + name + token + parser { + name + } +} +` + +func AddIngestToken( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + Name string, + ParserName *string, +) (*AddIngestTokenResponse, error) { + req_ := &graphql.Request{ + OpName: "AddIngestToken", + Query: AddIngestToken_Operation, + Variables: &__AddIngestTokenInput{ + RepositoryName: RepositoryName, + Name: Name, + ParserName: ParserName, + }, + } + var err_ error + + var data_ AddIngestTokenResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by AddUser. +const AddUser_Operation = ` +mutation AddUser ($Username: String!, $Company: String, $IsRoot: Boolean, $FullName: String, $Picture: String, $Email: String, $CountryCode: String) { + addUserV2(input: {username:$Username,company:$Company,isRoot:$IsRoot,fullName:$FullName,picture:$Picture,email:$Email,countryCode:$CountryCode}) { + __typename + ... on User { + ... UserDetails + } + } +} +fragment UserDetails on User { + id + username + fullName + email + company + countryCode + picture + isRoot + createdAt +} +` + +func AddUser( + ctx_ context.Context, + client_ graphql.Client, + Username string, + Company *string, + IsRoot *bool, + FullName *string, + Picture *string, + Email *string, + CountryCode *string, +) (*AddUserResponse, error) { + req_ := &graphql.Request{ + OpName: "AddUser", + Query: AddUser_Operation, + Variables: &__AddUserInput{ + Username: Username, + Company: Company, + IsRoot: IsRoot, + FullName: FullName, + Picture: Picture, + Email: Email, + CountryCode: CountryCode, + }, + } + var err_ error + + var data_ AddUserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by AddUserToGroup. +const AddUserToGroup_Operation = ` +mutation AddUserToGroup ($GroupID: String!, $UserID: String!) { + addUsersToGroup(input: {groupId:$GroupID,users:[$UserID]}) { + __typename + } +} +` + +func AddUserToGroup( + ctx_ context.Context, + client_ graphql.Client, + GroupID string, + UserID string, +) (*AddUserToGroupResponse, error) { + req_ := &graphql.Request{ + OpName: "AddUserToGroup", + Query: AddUserToGroup_Operation, + Variables: &__AddUserToGroupInput{ + GroupID: GroupID, + UserID: UserID, + }, + } + var err_ error + + var data_ AddUserToGroupResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by AssignParserToIngestToken. +const AssignParserToIngestToken_Operation = ` +mutation AssignParserToIngestToken ($RepositoryName: String!, $IngestTokenName: String!, $ParserName: String!) { + assignParserToIngestTokenV2(input: {repositoryName:$RepositoryName,parser:$ParserName,tokenName:$IngestTokenName}) { + __typename + } +} +` + +func AssignParserToIngestToken( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + IngestTokenName string, + ParserName string, +) (*AssignParserToIngestTokenResponse, error) { + req_ := &graphql.Request{ + OpName: "AssignParserToIngestToken", + Query: AssignParserToIngestToken_Operation, + Variables: &__AssignParserToIngestTokenInput{ + RepositoryName: RepositoryName, + IngestTokenName: IngestTokenName, + ParserName: ParserName, + }, + } + var err_ error + + var data_ AssignParserToIngestTokenResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateAggregateAlert. +const CreateAggregateAlert_Operation = ` +mutation CreateAggregateAlert ($SearchDomainName: RepoOrViewName!, $Name: String!, $Description: String, $QueryString: String!, $SearchIntervalSeconds: Long!, $ActionIdsOrNames: [String!]!, $Labels: [String!]!, $Enabled: Boolean!, $RunAsUserID: String, $ThrottleField: String, $ThrottleTimeSeconds: Long!, $TriggerMode: TriggerMode!, $QueryTimestampMode: QueryTimestampType!, $QueryOwnershipType: QueryOwnershipType!) { + createAggregateAlert(input: {viewName:$SearchDomainName,name:$Name,description:$Description,queryString:$QueryString,searchIntervalSeconds:$SearchIntervalSeconds,actionIdsOrNames:$ActionIdsOrNames,labels:$Labels,enabled:$Enabled,runAsUserId:$RunAsUserID,throttleField:$ThrottleField,throttleTimeSeconds:$ThrottleTimeSeconds,triggerMode:$TriggerMode,queryTimestampType:$QueryTimestampMode,queryOwnershipType:$QueryOwnershipType}) { + ... AggregateAlertDetails + } +} +fragment AggregateAlertDetails on AggregateAlert { + id + name + description + queryString + searchIntervalSeconds + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + triggerMode + queryTimestampType + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func CreateAggregateAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + Name string, + Description *string, + QueryString string, + SearchIntervalSeconds int64, + ActionIdsOrNames []string, + Labels []string, + Enabled bool, + RunAsUserID *string, + ThrottleField *string, + ThrottleTimeSeconds int64, + TriggerMode TriggerMode, + QueryTimestampMode QueryTimestampType, + QueryOwnershipType QueryOwnershipType, +) (*CreateAggregateAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateAggregateAlert", + Query: CreateAggregateAlert_Operation, + Variables: &__CreateAggregateAlertInput{ + SearchDomainName: SearchDomainName, + Name: Name, + Description: Description, + QueryString: QueryString, + SearchIntervalSeconds: SearchIntervalSeconds, + ActionIdsOrNames: ActionIdsOrNames, + Labels: Labels, + Enabled: Enabled, + RunAsUserID: RunAsUserID, + ThrottleField: ThrottleField, + ThrottleTimeSeconds: ThrottleTimeSeconds, + TriggerMode: TriggerMode, + QueryTimestampMode: QueryTimestampMode, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ CreateAggregateAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateAlert. +const CreateAlert_Operation = ` +mutation CreateAlert ($SearchDomainName: String!, $Name: String!, $Description: String, $QueryString: String!, $QueryStart: String!, $ThrottleTimeMillis: Long!, $Enabled: Boolean, $Actions: [String!]!, $Labels: [String!], $RunAsUserID: String, $QueryOwnershipType: QueryOwnershipType, $ThrottleField: String) { + createAlert(input: {viewName:$SearchDomainName,name:$Name,description:$Description,queryString:$QueryString,queryStart:$QueryStart,throttleTimeMillis:$ThrottleTimeMillis,enabled:$Enabled,actions:$Actions,labels:$Labels,runAsUserId:$RunAsUserID,queryOwnershipType:$QueryOwnershipType,throttleField:$ThrottleField}) { + ... AlertDetails + } +} +fragment AlertDetails on Alert { + id + name + queryString + queryStart + throttleField + timeOfLastTrigger + isStarred + description + throttleTimeMillis + enabled + actions + labels + lastError + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func CreateAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + Name string, + Description *string, + QueryString string, + QueryStart string, + ThrottleTimeMillis int64, + Enabled *bool, + Actions []string, + Labels []string, + RunAsUserID *string, + QueryOwnershipType *QueryOwnershipType, + ThrottleField *string, +) (*CreateAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateAlert", + Query: CreateAlert_Operation, + Variables: &__CreateAlertInput{ + SearchDomainName: SearchDomainName, + Name: Name, + Description: Description, + QueryString: QueryString, + QueryStart: QueryStart, + ThrottleTimeMillis: ThrottleTimeMillis, + Enabled: Enabled, + Actions: Actions, + Labels: Labels, + RunAsUserID: RunAsUserID, + QueryOwnershipType: QueryOwnershipType, + ThrottleField: ThrottleField, + }, + } + var err_ error + + var data_ CreateAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateEmailAction. +const CreateEmailAction_Operation = ` +mutation CreateEmailAction ($SearchDomainName: String!, $ActionName: String!, $Recipients: [String!]!, $SubjectTemplate: String, $BodyTemplate: String, $UseProxy: Boolean!) { + createEmailAction(input: {viewName:$SearchDomainName,name:$ActionName,recipients:$Recipients,subjectTemplate:$SubjectTemplate,bodyTemplate:$BodyTemplate,useProxy:$UseProxy}) { + id + name + recipients + subjectTemplate + bodyTemplate + useProxy + } +} +` + +func CreateEmailAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + Recipients []string, + SubjectTemplate *string, + BodyTemplate *string, + UseProxy bool, +) (*CreateEmailActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateEmailAction", + Query: CreateEmailAction_Operation, + Variables: &__CreateEmailActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + Recipients: Recipients, + SubjectTemplate: SubjectTemplate, + BodyTemplate: BodyTemplate, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateEmailActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateFilterAlert. +const CreateFilterAlert_Operation = ` +mutation CreateFilterAlert ($SearchDomainName: RepoOrViewName!, $Name: String!, $Description: String, $QueryString: String!, $ActionIdsOrNames: [String!]!, $Labels: [String!]!, $Enabled: Boolean!, $RunAsUserID: String, $ThrottleField: String, $ThrottleTimeSeconds: Long!, $QueryOwnershipType: QueryOwnershipType!) { + createFilterAlert(input: {viewName:$SearchDomainName,name:$Name,description:$Description,queryString:$QueryString,actionIdsOrNames:$ActionIdsOrNames,labels:$Labels,enabled:$Enabled,runAsUserId:$RunAsUserID,throttleField:$ThrottleField,throttleTimeSeconds:$ThrottleTimeSeconds,queryOwnershipType:$QueryOwnershipType}) { + ... FilterAlertDetails + } +} +fragment FilterAlertDetails on FilterAlert { + id + name + description + queryString + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func CreateFilterAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + Name string, + Description *string, + QueryString string, + ActionIdsOrNames []string, + Labels []string, + Enabled bool, + RunAsUserID *string, + ThrottleField *string, + ThrottleTimeSeconds int64, + QueryOwnershipType QueryOwnershipType, +) (*CreateFilterAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateFilterAlert", + Query: CreateFilterAlert_Operation, + Variables: &__CreateFilterAlertInput{ + SearchDomainName: SearchDomainName, + Name: Name, + Description: Description, + QueryString: QueryString, + ActionIdsOrNames: ActionIdsOrNames, + Labels: Labels, + Enabled: Enabled, + RunAsUserID: RunAsUserID, + ThrottleField: ThrottleField, + ThrottleTimeSeconds: ThrottleTimeSeconds, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ CreateFilterAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateHumioRepoAction. +const CreateHumioRepoAction_Operation = ` +mutation CreateHumioRepoAction ($SearchDomainName: String!, $ActionName: String!, $IngestToken: String!) { + createHumioRepoAction(input: {viewName:$SearchDomainName,name:$ActionName,ingestToken:$IngestToken}) { + id + name + ingestToken + } +} +` + +func CreateHumioRepoAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + IngestToken string, +) (*CreateHumioRepoActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateHumioRepoAction", + Query: CreateHumioRepoAction_Operation, + Variables: &__CreateHumioRepoActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + IngestToken: IngestToken, + }, + } + var err_ error + + var data_ CreateHumioRepoActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateOpsGenieAction. +const CreateOpsGenieAction_Operation = ` +mutation CreateOpsGenieAction ($SearchDomainName: String!, $ActionName: String!, $ApiUrl: String!, $GenieKey: String!, $UseProxy: Boolean!) { + createOpsGenieAction(input: {viewName:$SearchDomainName,name:$ActionName,apiUrl:$ApiUrl,genieKey:$GenieKey,useProxy:$UseProxy}) { + id + name + apiUrl + genieKey + useProxy + } +} +` + +func CreateOpsGenieAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + ApiUrl string, + GenieKey string, + UseProxy bool, +) (*CreateOpsGenieActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateOpsGenieAction", + Query: CreateOpsGenieAction_Operation, + Variables: &__CreateOpsGenieActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + ApiUrl: ApiUrl, + GenieKey: GenieKey, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateOpsGenieActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreatePagerDutyAction. +const CreatePagerDutyAction_Operation = ` +mutation CreatePagerDutyAction ($SearchDomainName: String!, $ActionName: String!, $Severity: String!, $RoutingKey: String!, $UseProxy: Boolean!) { + createPagerDutyAction(input: {viewName:$SearchDomainName,name:$ActionName,severity:$Severity,routingKey:$RoutingKey,useProxy:$UseProxy}) { + id + name + severity + routingKey + useProxy + } +} +` + +func CreatePagerDutyAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + Severity string, + RoutingKey string, + UseProxy bool, +) (*CreatePagerDutyActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreatePagerDutyAction", + Query: CreatePagerDutyAction_Operation, + Variables: &__CreatePagerDutyActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + Severity: Severity, + RoutingKey: RoutingKey, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreatePagerDutyActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateParser. +const CreateParser_Operation = ` +mutation CreateParser ($RepositoryName: RepoOrViewName!, $Name: String!, $Script: String!, $TestCases: [ParserTestCaseInput!]!, $FieldsToTag: [String!]!, $FieldsToBeRemovedBeforeParsing: [String!]!, $AllowOverridingExistingParser: Boolean!) { + createParserV2(input: {name:$Name,script:$Script,testCases:$TestCases,repositoryName:$RepositoryName,fieldsToTag:$FieldsToTag,fieldsToBeRemovedBeforeParsing:$FieldsToBeRemovedBeforeParsing,allowOverwritingExistingParser:$AllowOverridingExistingParser}) { + ... ParserDetails + } +} +fragment ParserDetails on Parser { + id + name + displayName + description + isBuiltIn + script + fieldsToTag + fieldsToBeRemovedBeforeParsing + testCases { + event { + rawString + } + outputAssertions { + assertions { + fieldsHaveValues { + fieldName + expectedValue + } + fieldsNotPresent + } + outputEventIndex + } + } +} +` + +func CreateParser( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + Name string, + Script string, + TestCases []ParserTestCaseInput, + FieldsToTag []string, + FieldsToBeRemovedBeforeParsing []string, + AllowOverridingExistingParser bool, +) (*CreateParserResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateParser", + Query: CreateParser_Operation, + Variables: &__CreateParserInput{ + RepositoryName: RepositoryName, + Name: Name, + Script: Script, + TestCases: TestCases, + FieldsToTag: FieldsToTag, + FieldsToBeRemovedBeforeParsing: FieldsToBeRemovedBeforeParsing, + AllowOverridingExistingParser: AllowOverridingExistingParser, + }, + } + var err_ error + + var data_ CreateParserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateRepository. +const CreateRepository_Operation = ` +mutation CreateRepository ($RepositoryName: String!) { + createRepository(name: $RepositoryName) { + repository { + ... RepositoryDetails + } + } +} +fragment RepositoryDetails on Repository { + id + name + description + timeBasedRetention + ingestSizeBasedRetention + storageSizeBasedRetention + compressedByteSize + automaticSearch + s3ArchivingConfiguration { + bucket + region + disabled + format + } +} +` + +func CreateRepository( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*CreateRepositoryResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateRepository", + Query: CreateRepository_Operation, + Variables: &__CreateRepositoryInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ CreateRepositoryResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateRole. +const CreateRole_Operation = ` +mutation CreateRole ($RoleName: String!, $ViewPermissions: [Permission!]!, $OrganizationPermissions: [OrganizationPermission!], $SystemPermissions: [SystemPermission!]) { + createRole(input: {displayName:$RoleName,viewPermissions:$ViewPermissions,organizationPermissions:$OrganizationPermissions,systemPermissions:$SystemPermissions}) { + role { + ... RoleDetails + } + } +} +fragment RoleDetails on Role { + id + displayName + viewPermissions + organizationPermissions + systemPermissions +} +` + +func CreateRole( + ctx_ context.Context, + client_ graphql.Client, + RoleName string, + ViewPermissions []Permission, + OrganizationPermissions []OrganizationPermission, + SystemPermissions []SystemPermission, +) (*CreateRoleResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateRole", + Query: CreateRole_Operation, + Variables: &__CreateRoleInput{ + RoleName: RoleName, + ViewPermissions: ViewPermissions, + OrganizationPermissions: OrganizationPermissions, + SystemPermissions: SystemPermissions, + }, + } + var err_ error + + var data_ CreateRoleResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateScheduledSearch. +const CreateScheduledSearch_Operation = ` +mutation CreateScheduledSearch ($SearchDomainName: String!, $Name: String!, $Description: String, $QueryString: String!, $QueryStart: String!, $QueryEnd: String!, $Schedule: String!, $TimeZone: String!, $BackfillLimit: Int!, $Enabled: Boolean!, $ActionIdsOrNames: [String!]!, $RunAsUserID: String, $Labels: [String!]!, $QueryOwnershipType: QueryOwnershipType) { + createScheduledSearch(input: {viewName:$SearchDomainName,name:$Name,description:$Description,queryString:$QueryString,queryStart:$QueryStart,queryEnd:$QueryEnd,schedule:$Schedule,timeZone:$TimeZone,backfillLimit:$BackfillLimit,enabled:$Enabled,actions:$ActionIdsOrNames,runAsUserId:$RunAsUserID,labels:$Labels,queryOwnershipType:$QueryOwnershipType}) { + ... ScheduledSearchDetails + } +} +fragment ScheduledSearchDetails on ScheduledSearch { + id + name + description + queryString + start + end + timeZone + schedule + backfillLimit + enabled + actionsV2 { + __typename + name + } + labels + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func CreateScheduledSearch( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + Name string, + Description *string, + QueryString string, + QueryStart string, + QueryEnd string, + Schedule string, + TimeZone string, + BackfillLimit int, + Enabled bool, + ActionIdsOrNames []string, + RunAsUserID *string, + Labels []string, + QueryOwnershipType *QueryOwnershipType, +) (*CreateScheduledSearchResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateScheduledSearch", + Query: CreateScheduledSearch_Operation, + Variables: &__CreateScheduledSearchInput{ + SearchDomainName: SearchDomainName, + Name: Name, + Description: Description, + QueryString: QueryString, + QueryStart: QueryStart, + QueryEnd: QueryEnd, + Schedule: Schedule, + TimeZone: TimeZone, + BackfillLimit: BackfillLimit, + Enabled: Enabled, + ActionIdsOrNames: ActionIdsOrNames, + RunAsUserID: RunAsUserID, + Labels: Labels, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ CreateScheduledSearchResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateSlackAction. +const CreateSlackAction_Operation = ` +mutation CreateSlackAction ($SearchDomainName: String!, $ActionName: String!, $Fields: [SlackFieldEntryInput!]!, $Url: String!, $UseProxy: Boolean!) { + createSlackAction(input: {viewName:$SearchDomainName,name:$ActionName,fields:$Fields,url:$Url,useProxy:$UseProxy}) { + id + name + fields { + value + fieldName + } + url + useProxy + } +} +` + +func CreateSlackAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + Fields []SlackFieldEntryInput, + Url string, + UseProxy bool, +) (*CreateSlackActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateSlackAction", + Query: CreateSlackAction_Operation, + Variables: &__CreateSlackActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + Fields: Fields, + Url: Url, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateSlackActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateSlackPostMessageAction. +const CreateSlackPostMessageAction_Operation = ` +mutation CreateSlackPostMessageAction ($SearchDomainName: String!, $ActionName: String!, $ApiToken: String!, $Channels: [String!]!, $Fields: [SlackFieldEntryInput!]!, $UseProxy: Boolean!) { + createSlackPostMessageAction(input: {viewName:$SearchDomainName,name:$ActionName,apiToken:$ApiToken,channels:$Channels,fields:$Fields,useProxy:$UseProxy}) { + id + name + apiToken + channels + fields { + value + fieldName + } + useProxy + } +} +` + +func CreateSlackPostMessageAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + ApiToken string, + Channels []string, + Fields []SlackFieldEntryInput, + UseProxy bool, +) (*CreateSlackPostMessageActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateSlackPostMessageAction", + Query: CreateSlackPostMessageAction_Operation, + Variables: &__CreateSlackPostMessageActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + ApiToken: ApiToken, + Channels: Channels, + Fields: Fields, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateSlackPostMessageActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateUploadFileAction. +const CreateUploadFileAction_Operation = ` +mutation CreateUploadFileAction ($SearchDomainName: String!, $ActionName: String!, $FileName: String!) { + createUploadFileAction(input: {viewName:$SearchDomainName,name:$ActionName,fileName:$FileName}) { + id + name + fileName + } +} +` + +func CreateUploadFileAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + FileName string, +) (*CreateUploadFileActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateUploadFileAction", + Query: CreateUploadFileAction_Operation, + Variables: &__CreateUploadFileActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + FileName: FileName, + }, + } + var err_ error + + var data_ CreateUploadFileActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateVictorOpsAction. +const CreateVictorOpsAction_Operation = ` +mutation CreateVictorOpsAction ($SearchDomainName: String!, $ActionName: String!, $MessageType: String!, $NotifyUrl: String!, $UseProxy: Boolean!) { + createVictorOpsAction(input: {viewName:$SearchDomainName,name:$ActionName,messageType:$MessageType,notifyUrl:$NotifyUrl,useProxy:$UseProxy}) { + id + name + messageType + notifyUrl + useProxy + } +} +` + +func CreateVictorOpsAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + MessageType string, + NotifyUrl string, + UseProxy bool, +) (*CreateVictorOpsActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateVictorOpsAction", + Query: CreateVictorOpsAction_Operation, + Variables: &__CreateVictorOpsActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + MessageType: MessageType, + NotifyUrl: NotifyUrl, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateVictorOpsActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateView. +const CreateView_Operation = ` +mutation CreateView ($ViewName: String!, $Description: String, $Connections: [ViewConnectionInput!]) { + createView(name: $ViewName, description: $Description, connections: $Connections) { + __typename + } +} +` + +func CreateView( + ctx_ context.Context, + client_ graphql.Client, + ViewName string, + Description *string, + Connections []ViewConnectionInput, +) (*CreateViewResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateView", + Query: CreateView_Operation, + Variables: &__CreateViewInput{ + ViewName: ViewName, + Description: Description, + Connections: Connections, + }, + } + var err_ error + + var data_ CreateViewResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by CreateWebhookAction. +const CreateWebhookAction_Operation = ` +mutation CreateWebhookAction ($SearchDomainName: String!, $ActionName: String!, $Url: String!, $Method: String!, $Headers: [HttpHeaderEntryInput!]!, $BodyTemplate: String!, $IgnoreSSL: Boolean!, $UseProxy: Boolean!) { + createWebhookAction(input: {viewName:$SearchDomainName,name:$ActionName,url:$Url,method:$Method,headers:$Headers,bodyTemplate:$BodyTemplate,ignoreSSL:$IgnoreSSL,useProxy:$UseProxy}) { + id + name + url + method + headers { + value + header + } + bodyTemplate + ignoreSSL + useProxy + } +} +` + +func CreateWebhookAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionName string, + Url string, + Method string, + Headers []HttpHeaderEntryInput, + BodyTemplate string, + IgnoreSSL bool, + UseProxy bool, +) (*CreateWebhookActionResponse, error) { + req_ := &graphql.Request{ + OpName: "CreateWebhookAction", + Query: CreateWebhookAction_Operation, + Variables: &__CreateWebhookActionInput{ + SearchDomainName: SearchDomainName, + ActionName: ActionName, + Url: Url, + Method: Method, + Headers: Headers, + BodyTemplate: BodyTemplate, + IgnoreSSL: IgnoreSSL, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ CreateWebhookActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteActionByID. +const DeleteActionByID_Operation = ` +mutation DeleteActionByID ($SearchDomainName: String!, $ActionID: String!) { + deleteAction(input: {viewName:$SearchDomainName,id:$ActionID}) +} +` + +func DeleteActionByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, +) (*DeleteActionByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteActionByID", + Query: DeleteActionByID_Operation, + Variables: &__DeleteActionByIDInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + }, + } + var err_ error + + var data_ DeleteActionByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteAggregateAlert. +const DeleteAggregateAlert_Operation = ` +mutation DeleteAggregateAlert ($SearchDomainName: RepoOrViewName!, $AggregateAlertID: String!) { + deleteAggregateAlert(input: {id:$AggregateAlertID,viewName:$SearchDomainName}) +} +` + +func DeleteAggregateAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + AggregateAlertID string, +) (*DeleteAggregateAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteAggregateAlert", + Query: DeleteAggregateAlert_Operation, + Variables: &__DeleteAggregateAlertInput{ + SearchDomainName: SearchDomainName, + AggregateAlertID: AggregateAlertID, + }, + } + var err_ error + + var data_ DeleteAggregateAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteAlert. +const DeleteAlert_Operation = ` +mutation DeleteAlert ($SearchDomainName: String!, $AlertID: String!) { + deleteAlert(input: {viewName:$SearchDomainName,id:$AlertID}) +} +` + +func DeleteAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + AlertID string, +) (*DeleteAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteAlert", + Query: DeleteAlert_Operation, + Variables: &__DeleteAlertInput{ + SearchDomainName: SearchDomainName, + AlertID: AlertID, + }, + } + var err_ error + + var data_ DeleteAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteFilterAlert. +const DeleteFilterAlert_Operation = ` +mutation DeleteFilterAlert ($SearchDomainName: RepoOrViewName!, $FilterAlertID: String!) { + deleteFilterAlert(input: {id:$FilterAlertID,viewName:$SearchDomainName}) +} +` + +func DeleteFilterAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + FilterAlertID string, +) (*DeleteFilterAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteFilterAlert", + Query: DeleteFilterAlert_Operation, + Variables: &__DeleteFilterAlertInput{ + SearchDomainName: SearchDomainName, + FilterAlertID: FilterAlertID, + }, + } + var err_ error + + var data_ DeleteFilterAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteParserByID. +const DeleteParserByID_Operation = ` +mutation DeleteParserByID ($RepositoryName: RepoOrViewName!, $ParserID: String!) { + deleteParser(input: {repositoryName:$RepositoryName,id:$ParserID}) { + __typename + } +} +` + +func DeleteParserByID( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + ParserID string, +) (*DeleteParserByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteParserByID", + Query: DeleteParserByID_Operation, + Variables: &__DeleteParserByIDInput{ + RepositoryName: RepositoryName, + ParserID: ParserID, + }, + } + var err_ error + + var data_ DeleteParserByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteScheduledSearchByID. +const DeleteScheduledSearchByID_Operation = ` +mutation DeleteScheduledSearchByID ($SearchDomainName: String!, $ScheduledSearchID: String!) { + deleteScheduledSearch(input: {viewName:$SearchDomainName,id:$ScheduledSearchID}) +} +` + +func DeleteScheduledSearchByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ScheduledSearchID string, +) (*DeleteScheduledSearchByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteScheduledSearchByID", + Query: DeleteScheduledSearchByID_Operation, + Variables: &__DeleteScheduledSearchByIDInput{ + SearchDomainName: SearchDomainName, + ScheduledSearchID: ScheduledSearchID, + }, + } + var err_ error + + var data_ DeleteScheduledSearchByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DeleteSearchDomain. +const DeleteSearchDomain_Operation = ` +mutation DeleteSearchDomain ($SearchDomainName: String!, $DeleteMessage: String!) { + deleteSearchDomain(name: $SearchDomainName, deleteMessage: $DeleteMessage) { + __typename + } +} +` + +func DeleteSearchDomain( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + DeleteMessage string, +) (*DeleteSearchDomainResponse, error) { + req_ := &graphql.Request{ + OpName: "DeleteSearchDomain", + Query: DeleteSearchDomain_Operation, + Variables: &__DeleteSearchDomainInput{ + SearchDomainName: SearchDomainName, + DeleteMessage: DeleteMessage, + }, + } + var err_ error + + var data_ DeleteSearchDomainResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DisableFeatureFlagForOrganization. +const DisableFeatureFlagForOrganization_Operation = ` +mutation DisableFeatureFlagForOrganization ($Flag: FeatureFlag!, $OrganizationID: String!) { + disableFeatureForOrg(feature: $Flag, orgId: $OrganizationID) +} +` + +func DisableFeatureFlagForOrganization( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, + OrganizationID string, +) (*DisableFeatureFlagForOrganizationResponse, error) { + req_ := &graphql.Request{ + OpName: "DisableFeatureFlagForOrganization", + Query: DisableFeatureFlagForOrganization_Operation, + Variables: &__DisableFeatureFlagForOrganizationInput{ + Flag: Flag, + OrganizationID: OrganizationID, + }, + } + var err_ error + + var data_ DisableFeatureFlagForOrganizationResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DisableFeatureFlagForUser. +const DisableFeatureFlagForUser_Operation = ` +mutation DisableFeatureFlagForUser ($Flag: FeatureFlag!, $UserID: String!) { + disableFeatureForUser(feature: $Flag, userId: $UserID) +} +` + +func DisableFeatureFlagForUser( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, + UserID string, +) (*DisableFeatureFlagForUserResponse, error) { + req_ := &graphql.Request{ + OpName: "DisableFeatureFlagForUser", + Query: DisableFeatureFlagForUser_Operation, + Variables: &__DisableFeatureFlagForUserInput{ + Flag: Flag, + UserID: UserID, + }, + } + var err_ error + + var data_ DisableFeatureFlagForUserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DisableFeatureFlagGlobally. +const DisableFeatureFlagGlobally_Operation = ` +mutation DisableFeatureFlagGlobally ($Flag: FeatureFlag!) { + disableFeature(feature: $Flag) +} +` + +func DisableFeatureFlagGlobally( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, +) (*DisableFeatureFlagGloballyResponse, error) { + req_ := &graphql.Request{ + OpName: "DisableFeatureFlagGlobally", + Query: DisableFeatureFlagGlobally_Operation, + Variables: &__DisableFeatureFlagGloballyInput{ + Flag: Flag, + }, + } + var err_ error + + var data_ DisableFeatureFlagGloballyResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by DisableS3Archiving. +const DisableS3Archiving_Operation = ` +mutation DisableS3Archiving ($RepositoryName: String!) { + s3DisableArchiving(repositoryName: $RepositoryName) { + __typename + } +} +` + +func DisableS3Archiving( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*DisableS3ArchivingResponse, error) { + req_ := &graphql.Request{ + OpName: "DisableS3Archiving", + Query: DisableS3Archiving_Operation, + Variables: &__DisableS3ArchivingInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ DisableS3ArchivingResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by EnableFeatureFlagForOrganization. +const EnableFeatureFlagForOrganization_Operation = ` +mutation EnableFeatureFlagForOrganization ($Flag: FeatureFlag!, $OrganizationID: String!) { + enableFeatureForOrg(feature: $Flag, orgId: $OrganizationID) +} +` + +func EnableFeatureFlagForOrganization( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, + OrganizationID string, +) (*EnableFeatureFlagForOrganizationResponse, error) { + req_ := &graphql.Request{ + OpName: "EnableFeatureFlagForOrganization", + Query: EnableFeatureFlagForOrganization_Operation, + Variables: &__EnableFeatureFlagForOrganizationInput{ + Flag: Flag, + OrganizationID: OrganizationID, + }, + } + var err_ error + + var data_ EnableFeatureFlagForOrganizationResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by EnableFeatureFlagForUser. +const EnableFeatureFlagForUser_Operation = ` +mutation EnableFeatureFlagForUser ($Flag: FeatureFlag!, $UserID: String!) { + enableFeatureForUser(feature: $Flag, userId: $UserID) +} +` + +func EnableFeatureFlagForUser( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, + UserID string, +) (*EnableFeatureFlagForUserResponse, error) { + req_ := &graphql.Request{ + OpName: "EnableFeatureFlagForUser", + Query: EnableFeatureFlagForUser_Operation, + Variables: &__EnableFeatureFlagForUserInput{ + Flag: Flag, + UserID: UserID, + }, + } + var err_ error + + var data_ EnableFeatureFlagForUserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by EnableFeatureFlagGlobally. +const EnableFeatureFlagGlobally_Operation = ` +mutation EnableFeatureFlagGlobally ($Flag: FeatureFlag!) { + enableFeature(feature: $Flag) +} +` + +func EnableFeatureFlagGlobally( + ctx_ context.Context, + client_ graphql.Client, + Flag FeatureFlag, +) (*EnableFeatureFlagGloballyResponse, error) { + req_ := &graphql.Request{ + OpName: "EnableFeatureFlagGlobally", + Query: EnableFeatureFlagGlobally_Operation, + Variables: &__EnableFeatureFlagGloballyInput{ + Flag: Flag, + }, + } + var err_ error + + var data_ EnableFeatureFlagGloballyResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by EnableS3Archiving. +const EnableS3Archiving_Operation = ` +mutation EnableS3Archiving ($RepositoryName: String!) { + s3EnableArchiving(repositoryName: $RepositoryName) { + __typename + } +} +` + +func EnableS3Archiving( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*EnableS3ArchivingResponse, error) { + req_ := &graphql.Request{ + OpName: "EnableS3Archiving", + Query: EnableS3Archiving_Operation, + Variables: &__EnableS3ArchivingInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ EnableS3ArchivingResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetActionByID. +const GetActionByID_Operation = ` +query GetActionByID ($SearchDomainName: String!, $ActionID: String!) { + searchDomain(name: $SearchDomainName) { + __typename + action(id: $ActionID) { + __typename + ... ActionDetails + } + } +} +fragment ActionDetails on Action { + id + name + ... on EmailAction { + recipients + subjectTemplate + emailBodyTemplate: bodyTemplate + useProxy + } + ... on HumioRepoAction { + ingestToken + } + ... on OpsGenieAction { + apiUrl + genieKey + useProxy + } + ... on PagerDutyAction { + severity + routingKey + useProxy + } + ... on SlackAction { + url + fields { + fieldName + value + } + useProxy + } + ... on SlackPostMessageAction { + apiToken + channels + fields { + fieldName + value + } + useProxy + } + ... on VictorOpsAction { + messageType + notifyUrl + useProxy + } + ... on UploadFileAction { + fileName + } + ... on WebhookAction { + method + url + headers { + header + value + } + WebhookBodyTemplate: bodyTemplate + ignoreSSL + useProxy + } +} +` + +func GetActionByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, +) (*GetActionByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetActionByID", + Query: GetActionByID_Operation, + Variables: &__GetActionByIDInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + }, + } + var err_ error + + var data_ GetActionByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetAggregateAlertByID. +const GetAggregateAlertByID_Operation = ` +query GetAggregateAlertByID ($SearchDomainName: String!, $AggregateAlertID: String!) { + searchDomain(name: $SearchDomainName) { + __typename + aggregateAlert(id: $AggregateAlertID) { + ... AggregateAlertDetails + } + } +} +fragment AggregateAlertDetails on AggregateAlert { + id + name + description + queryString + searchIntervalSeconds + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + triggerMode + queryTimestampType + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func GetAggregateAlertByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + AggregateAlertID string, +) (*GetAggregateAlertByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetAggregateAlertByID", + Query: GetAggregateAlertByID_Operation, + Variables: &__GetAggregateAlertByIDInput{ + SearchDomainName: SearchDomainName, + AggregateAlertID: AggregateAlertID, + }, + } + var err_ error + + var data_ GetAggregateAlertByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetCluster. +const GetCluster_Operation = ` +query GetCluster { + cluster { + ... ClusterNode + clusterInfoAgeSeconds + underReplicatedSegmentSize + overReplicatedSegmentSize + missingSegmentSize + properlyReplicatedSegmentSize + targetUnderReplicatedSegmentSize + targetOverReplicatedSegmentSize + targetMissingSegmentSize + targetProperlyReplicatedSegmentSize + ingestPartitions { + id + nodeIds + } + } +} +fragment ClusterNode on Cluster { + nodes { + id + name + uri + uuid + clusterInfoAgeSeconds + inboundSegmentSize + outboundSegmentSize + canBeSafelyUnregistered + currentSize + primarySize + secondarySize + totalSizeOfPrimary + totalSizeOfSecondary + freeOnPrimary + freeOnSecondary + wipSize + targetSize + solitarySegmentSize + isAvailable + lastHeartbeat + zone + } +} +` + +func GetCluster( + ctx_ context.Context, + client_ graphql.Client, +) (*GetClusterResponse, error) { + req_ := &graphql.Request{ + OpName: "GetCluster", + Query: GetCluster_Operation, + } + var err_ error + + var data_ GetClusterResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetFilterAlertByID. +const GetFilterAlertByID_Operation = ` +query GetFilterAlertByID ($SearchDomainName: String!, $FilterAlertID: String!) { + searchDomain(name: $SearchDomainName) { + __typename + filterAlert(id: $FilterAlertID) { + ... FilterAlertDetails + } + } +} +fragment FilterAlertDetails on FilterAlert { + id + name + description + queryString + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func GetFilterAlertByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + FilterAlertID string, +) (*GetFilterAlertByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetFilterAlertByID", + Query: GetFilterAlertByID_Operation, + Variables: &__GetFilterAlertByIDInput{ + SearchDomainName: SearchDomainName, + FilterAlertID: FilterAlertID, + }, + } + var err_ error + + var data_ GetFilterAlertByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetLicense. +const GetLicense_Operation = ` +query GetLicense { + installedLicense { + __typename + expiresAt + issuedAt + ... on OnPremLicense { + uid + owner + maxUsers + } + } +} +` + +func GetLicense( + ctx_ context.Context, + client_ graphql.Client, +) (*GetLicenseResponse, error) { + req_ := &graphql.Request{ + OpName: "GetLicense", + Query: GetLicense_Operation, + } + var err_ error + + var data_ GetLicenseResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetParserByID. +const GetParserByID_Operation = ` +query GetParserByID ($RepositoryName: String!, $ParserID: String!) { + repository(name: $RepositoryName) { + parser(id: $ParserID) { + ... ParserDetails + } + } +} +fragment ParserDetails on Parser { + id + name + displayName + description + isBuiltIn + script + fieldsToTag + fieldsToBeRemovedBeforeParsing + testCases { + event { + rawString + } + outputAssertions { + assertions { + fieldsHaveValues { + fieldName + expectedValue + } + fieldsNotPresent + } + outputEventIndex + } + } +} +` + +func GetParserByID( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + ParserID string, +) (*GetParserByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetParserByID", + Query: GetParserByID_Operation, + Variables: &__GetParserByIDInput{ + RepositoryName: RepositoryName, + ParserID: ParserID, + }, + } + var err_ error + + var data_ GetParserByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetParserYAMLByName. +const GetParserYAMLByName_Operation = ` +query GetParserYAMLByName ($RepositoryName: String!, $ParserName: String!) { + repository(name: $RepositoryName) { + parser(name: $ParserName) { + name + yamlTemplate + } + } +} +` + +func GetParserYAMLByName( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + ParserName string, +) (*GetParserYAMLByNameResponse, error) { + req_ := &graphql.Request{ + OpName: "GetParserYAMLByName", + Query: GetParserYAMLByName_Operation, + Variables: &__GetParserYAMLByNameInput{ + RepositoryName: RepositoryName, + ParserName: ParserName, + }, + } + var err_ error + + var data_ GetParserYAMLByNameResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetRepository. +const GetRepository_Operation = ` +query GetRepository ($RepositoryName: String!) { + repository(name: $RepositoryName) { + ... RepositoryDetails + } +} +fragment RepositoryDetails on Repository { + id + name + description + timeBasedRetention + ingestSizeBasedRetention + storageSizeBasedRetention + compressedByteSize + automaticSearch + s3ArchivingConfiguration { + bucket + region + disabled + format + } +} +` + +func GetRepository( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*GetRepositoryResponse, error) { + req_ := &graphql.Request{ + OpName: "GetRepository", + Query: GetRepository_Operation, + Variables: &__GetRepositoryInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ GetRepositoryResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetRoleByID. +const GetRoleByID_Operation = ` +query GetRoleByID ($RoleID: String!) { + role(roleId: $RoleID) { + ... RoleDetails + } +} +fragment RoleDetails on Role { + id + displayName + viewPermissions + organizationPermissions + systemPermissions +} +` + +func GetRoleByID( + ctx_ context.Context, + client_ graphql.Client, + RoleID string, +) (*GetRoleByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetRoleByID", + Query: GetRoleByID_Operation, + Variables: &__GetRoleByIDInput{ + RoleID: RoleID, + }, + } + var err_ error + + var data_ GetRoleByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetScheduledSearchByID. +const GetScheduledSearchByID_Operation = ` +query GetScheduledSearchByID ($SearchDomainName: String!, $ScheduledSearchID: String!) { + searchDomain(name: $SearchDomainName) { + __typename + scheduledSearch(id: $ScheduledSearchID) { + ... ScheduledSearchDetails + } + } +} +fragment ScheduledSearchDetails on ScheduledSearch { + id + name + description + queryString + start + end + timeZone + schedule + backfillLimit + enabled + actionsV2 { + __typename + name + } + labels + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func GetScheduledSearchByID( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ScheduledSearchID string, +) (*GetScheduledSearchByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "GetScheduledSearchByID", + Query: GetScheduledSearchByID_Operation, + Variables: &__GetScheduledSearchByIDInput{ + SearchDomainName: SearchDomainName, + ScheduledSearchID: ScheduledSearchID, + }, + } + var err_ error + + var data_ GetScheduledSearchByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetSearchDomain. +const GetSearchDomain_Operation = ` +query GetSearchDomain ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + id + name + description + automaticSearch + ... on View { + connections { + repository { + name + } + filter + } + } + __typename + } +} +` + +func GetSearchDomain( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*GetSearchDomainResponse, error) { + req_ := &graphql.Request{ + OpName: "GetSearchDomain", + Query: GetSearchDomain_Operation, + Variables: &__GetSearchDomainInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ GetSearchDomainResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetSupportedFeatureFlags. +const GetSupportedFeatureFlags_Operation = ` +query GetSupportedFeatureFlags { + featureFlags(includeExperimentalFeatures: true) { + flag + experimental + description + } +} +` + +func GetSupportedFeatureFlags( + ctx_ context.Context, + client_ graphql.Client, +) (*GetSupportedFeatureFlagsResponse, error) { + req_ := &graphql.Request{ + OpName: "GetSupportedFeatureFlags", + Query: GetSupportedFeatureFlags_Operation, + } + var err_ error + + var data_ GetSupportedFeatureFlagsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetUsername. +const GetUsername_Operation = ` +query GetUsername { + viewer { + username + } +} +` + +func GetUsername( + ctx_ context.Context, + client_ graphql.Client, +) (*GetUsernameResponse, error) { + req_ := &graphql.Request{ + OpName: "GetUsername", + Query: GetUsername_Operation, + } + var err_ error + + var data_ GetUsernameResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by GetUsersByUsername. +const GetUsersByUsername_Operation = ` +query GetUsersByUsername ($Username: String!) { + users(search: $Username) { + ... UserDetails + } +} +fragment UserDetails on User { + id + username + fullName + email + company + countryCode + picture + isRoot + createdAt +} +` + +func GetUsersByUsername( + ctx_ context.Context, + client_ graphql.Client, + Username string, +) (*GetUsersByUsernameResponse, error) { + req_ := &graphql.Request{ + OpName: "GetUsersByUsername", + Query: GetUsersByUsername_Operation, + Variables: &__GetUsersByUsernameInput{ + Username: Username, + }, + } + var err_ error + + var data_ GetUsersByUsernameResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by LegacyCreateParser. +const LegacyCreateParser_Operation = ` +mutation LegacyCreateParser ($RepositoryName: String!, $Name: String!, $TestData: [String!]!, $TagFields: [String!]!, $SourceCode: String!, $Force: Boolean!) { + createParser(input: {name:$Name,repositoryName:$RepositoryName,testData:$TestData,tagFields:$TagFields,sourceCode:$SourceCode,force:$Force}) { + parser { + ... ParserDetails + } + } +} +fragment ParserDetails on Parser { + id + name + displayName + description + isBuiltIn + script + fieldsToTag + fieldsToBeRemovedBeforeParsing + testCases { + event { + rawString + } + outputAssertions { + assertions { + fieldsHaveValues { + fieldName + expectedValue + } + fieldsNotPresent + } + outputEventIndex + } + } +} +` + +func LegacyCreateParser( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + Name string, + TestData []string, + TagFields []string, + SourceCode string, + Force bool, +) (*LegacyCreateParserResponse, error) { + req_ := &graphql.Request{ + OpName: "LegacyCreateParser", + Query: LegacyCreateParser_Operation, + Variables: &__LegacyCreateParserInput{ + RepositoryName: RepositoryName, + Name: Name, + TestData: TestData, + TagFields: TagFields, + SourceCode: SourceCode, + Force: Force, + }, + } + var err_ error + + var data_ LegacyCreateParserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by LegacyDeleteParserByID. +const LegacyDeleteParserByID_Operation = ` +mutation LegacyDeleteParserByID ($RepositoryName: String!, $ParserID: String!) { + removeParser(input: {repositoryName:$RepositoryName,id:$ParserID}) { + __typename + } +} +` + +func LegacyDeleteParserByID( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + ParserID string, +) (*LegacyDeleteParserByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "LegacyDeleteParserByID", + Query: LegacyDeleteParserByID_Operation, + Variables: &__LegacyDeleteParserByIDInput{ + RepositoryName: RepositoryName, + ParserID: ParserID, + }, + } + var err_ error + + var data_ LegacyDeleteParserByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by LegacyGetParser. +const LegacyGetParser_Operation = ` +query LegacyGetParser ($RepositoryName: String!, $ParserName: String!) { + repository(name: $RepositoryName) { + parser(name: $ParserName) { + id + name + sourceCode + testData + tagFields + } + } +} +` + +func LegacyGetParser( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + ParserName string, +) (*LegacyGetParserResponse, error) { + req_ := &graphql.Request{ + OpName: "LegacyGetParser", + Query: LegacyGetParser_Operation, + Variables: &__LegacyGetParserInput{ + RepositoryName: RepositoryName, + ParserName: ParserName, + }, + } + var err_ error + + var data_ LegacyGetParserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListActions. +const ListActions_Operation = ` +query ListActions ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + actions { + __typename + ... ActionDetails + } + } +} +fragment ActionDetails on Action { + id + name + ... on EmailAction { + recipients + subjectTemplate + emailBodyTemplate: bodyTemplate + useProxy + } + ... on HumioRepoAction { + ingestToken + } + ... on OpsGenieAction { + apiUrl + genieKey + useProxy + } + ... on PagerDutyAction { + severity + routingKey + useProxy + } + ... on SlackAction { + url + fields { + fieldName + value + } + useProxy + } + ... on SlackPostMessageAction { + apiToken + channels + fields { + fieldName + value + } + useProxy + } + ... on VictorOpsAction { + messageType + notifyUrl + useProxy + } + ... on UploadFileAction { + fileName + } + ... on WebhookAction { + method + url + headers { + header + value + } + WebhookBodyTemplate: bodyTemplate + ignoreSSL + useProxy + } +} +` + +func ListActions( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListActionsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListActions", + Query: ListActions_Operation, + Variables: &__ListActionsInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListActionsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListAggregateAlerts. +const ListAggregateAlerts_Operation = ` +query ListAggregateAlerts ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + aggregateAlerts { + ... AggregateAlertDetails + } + } +} +fragment AggregateAlertDetails on AggregateAlert { + id + name + description + queryString + searchIntervalSeconds + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + triggerMode + queryTimestampType + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func ListAggregateAlerts( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListAggregateAlertsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListAggregateAlerts", + Query: ListAggregateAlerts_Operation, + Variables: &__ListAggregateAlertsInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListAggregateAlertsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListAlerts. +const ListAlerts_Operation = ` +query ListAlerts ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + alerts { + ... AlertDetails + } + } +} +fragment AlertDetails on Alert { + id + name + queryString + queryStart + throttleField + timeOfLastTrigger + isStarred + description + throttleTimeMillis + enabled + actions + labels + lastError + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func ListAlerts( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListAlertsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListAlerts", + Query: ListAlerts_Operation, + Variables: &__ListAlertsInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListAlertsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListClusterNodes. +const ListClusterNodes_Operation = ` +query ListClusterNodes { + cluster { + ... ClusterNode + } +} +fragment ClusterNode on Cluster { + nodes { + id + name + uri + uuid + clusterInfoAgeSeconds + inboundSegmentSize + outboundSegmentSize + canBeSafelyUnregistered + currentSize + primarySize + secondarySize + totalSizeOfPrimary + totalSizeOfSecondary + freeOnPrimary + freeOnSecondary + wipSize + targetSize + solitarySegmentSize + isAvailable + lastHeartbeat + zone + } +} +` + +func ListClusterNodes( + ctx_ context.Context, + client_ graphql.Client, +) (*ListClusterNodesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListClusterNodes", + Query: ListClusterNodes_Operation, + } + var err_ error + + var data_ ListClusterNodesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListFiles. +const ListFiles_Operation = ` +query ListFiles ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + files { + contentHash + nameAndPath { + name + } + } + } +} +` + +func ListFiles( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListFilesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListFiles", + Query: ListFiles_Operation, + Variables: &__ListFilesInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListFilesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListFilterAlerts. +const ListFilterAlerts_Operation = ` +query ListFilterAlerts ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + filterAlerts { + ... FilterAlertDetails + } + } +} +fragment FilterAlertDetails on FilterAlert { + id + name + description + queryString + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func ListFilterAlerts( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListFilterAlertsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListFilterAlerts", + Query: ListFilterAlerts_Operation, + Variables: &__ListFilterAlertsInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListFilterAlertsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListGroups. +const ListGroups_Operation = ` +query ListGroups { + groupsPage(pageNumber: 1, pageSize: 2147483647) { + page { + id + displayName + } + } +} +` + +func ListGroups( + ctx_ context.Context, + client_ graphql.Client, +) (*ListGroupsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListGroups", + Query: ListGroups_Operation, + } + var err_ error + + var data_ ListGroupsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListIngestTokens. +const ListIngestTokens_Operation = ` +query ListIngestTokens ($RepositoryName: String!) { + repository(name: $RepositoryName) { + ingestTokens { + ... IngestTokenDetails + } + } +} +fragment IngestTokenDetails on IngestToken { + name + token + parser { + name + } +} +` + +func ListIngestTokens( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*ListIngestTokensResponse, error) { + req_ := &graphql.Request{ + OpName: "ListIngestTokens", + Query: ListIngestTokens_Operation, + Variables: &__ListIngestTokensInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ ListIngestTokensResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListInstalledPackages. +const ListInstalledPackages_Operation = ` +query ListInstalledPackages ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + installedPackages { + id + installedBy { + username + timestamp + } + updatedBy { + username + timestamp + } + source + availableUpdate + } + } +} +` + +func ListInstalledPackages( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListInstalledPackagesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListInstalledPackages", + Query: ListInstalledPackages_Operation, + Variables: &__ListInstalledPackagesInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListInstalledPackagesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListParsers. +const ListParsers_Operation = ` +query ListParsers ($RepositoryName: String!) { + repository(name: $RepositoryName) { + parsers { + id + name + isBuiltIn + } + } +} +` + +func ListParsers( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, +) (*ListParsersResponse, error) { + req_ := &graphql.Request{ + OpName: "ListParsers", + Query: ListParsers_Operation, + Variables: &__ListParsersInput{ + RepositoryName: RepositoryName, + }, + } + var err_ error + + var data_ ListParsersResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListRepositories. +const ListRepositories_Operation = ` +query ListRepositories { + repositories { + id + name + compressedByteSize + } +} +` + +func ListRepositories( + ctx_ context.Context, + client_ graphql.Client, +) (*ListRepositoriesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListRepositories", + Query: ListRepositories_Operation, + } + var err_ error + + var data_ ListRepositoriesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListRoles. +const ListRoles_Operation = ` +query ListRoles { + roles { + ... RoleDetails + } +} +fragment RoleDetails on Role { + id + displayName + viewPermissions + organizationPermissions + systemPermissions +} +` + +func ListRoles( + ctx_ context.Context, + client_ graphql.Client, +) (*ListRolesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListRoles", + Query: ListRoles_Operation, + } + var err_ error + + var data_ ListRolesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListScheduledSearches. +const ListScheduledSearches_Operation = ` +query ListScheduledSearches ($SearchDomainName: String!) { + searchDomain(name: $SearchDomainName) { + __typename + scheduledSearches { + ... ScheduledSearchDetails + } + } +} +fragment ScheduledSearchDetails on ScheduledSearch { + id + name + description + queryString + start + end + timeZone + schedule + backfillLimit + enabled + actionsV2 { + __typename + name + } + labels + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func ListScheduledSearches( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, +) (*ListScheduledSearchesResponse, error) { + req_ := &graphql.Request{ + OpName: "ListScheduledSearches", + Query: ListScheduledSearches_Operation, + Variables: &__ListScheduledSearchesInput{ + SearchDomainName: SearchDomainName, + }, + } + var err_ error + + var data_ ListScheduledSearchesResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListSearchDomains. +const ListSearchDomains_Operation = ` +query ListSearchDomains { + searchDomains { + __typename + name + automaticSearch + } +} +` + +func ListSearchDomains( + ctx_ context.Context, + client_ graphql.Client, +) (*ListSearchDomainsResponse, error) { + req_ := &graphql.Request{ + OpName: "ListSearchDomains", + Query: ListSearchDomains_Operation, + } + var err_ error + + var data_ ListSearchDomainsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by ListUsers. +const ListUsers_Operation = ` +query ListUsers { + users { + ... UserDetails + } +} +fragment UserDetails on User { + id + username + fullName + email + company + countryCode + picture + isRoot + createdAt +} +` + +func ListUsers( + ctx_ context.Context, + client_ graphql.Client, +) (*ListUsersResponse, error) { + req_ := &graphql.Request{ + OpName: "ListUsers", + Query: ListUsers_Operation, + } + var err_ error + + var data_ ListUsersResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RemoveFile. +const RemoveFile_Operation = ` +mutation RemoveFile ($SearchDomainName: String!, $FileName: String!) { + removeFile(name: $SearchDomainName, fileName: $FileName) { + __typename + } +} +` + +func RemoveFile( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + FileName string, +) (*RemoveFileResponse, error) { + req_ := &graphql.Request{ + OpName: "RemoveFile", + Query: RemoveFile_Operation, + Variables: &__RemoveFileInput{ + SearchDomainName: SearchDomainName, + FileName: FileName, + }, + } + var err_ error + + var data_ RemoveFileResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RemoveIngestToken. +const RemoveIngestToken_Operation = ` +mutation RemoveIngestToken ($RepositoryName: String!, $Name: String!) { + removeIngestToken(repositoryName: $RepositoryName, name: $Name) { + __typename + } +} +` + +func RemoveIngestToken( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + Name string, +) (*RemoveIngestTokenResponse, error) { + req_ := &graphql.Request{ + OpName: "RemoveIngestToken", + Query: RemoveIngestToken_Operation, + Variables: &__RemoveIngestTokenInput{ + RepositoryName: RepositoryName, + Name: Name, + }, + } + var err_ error + + var data_ RemoveIngestTokenResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RemoveRoleByID. +const RemoveRoleByID_Operation = ` +mutation RemoveRoleByID ($RoleID: String!) { + removeRole(roleId: $RoleID) { + __typename + } +} +` + +func RemoveRoleByID( + ctx_ context.Context, + client_ graphql.Client, + RoleID string, +) (*RemoveRoleByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "RemoveRoleByID", + Query: RemoveRoleByID_Operation, + Variables: &__RemoveRoleByIDInput{ + RoleID: RoleID, + }, + } + var err_ error + + var data_ RemoveRoleByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RemoveUser. +const RemoveUser_Operation = ` +mutation RemoveUser ($Username: String!) { + removeUser(input: {username:$Username}) { + user { + ... UserDetails + } + } +} +fragment UserDetails on User { + id + username + fullName + email + company + countryCode + picture + isRoot + createdAt +} +` + +func RemoveUser( + ctx_ context.Context, + client_ graphql.Client, + Username string, +) (*RemoveUserResponse, error) { + req_ := &graphql.Request{ + OpName: "RemoveUser", + Query: RemoveUser_Operation, + Variables: &__RemoveUserInput{ + Username: Username, + }, + } + var err_ error + + var data_ RemoveUserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RemoveUserFromGroup. +const RemoveUserFromGroup_Operation = ` +mutation RemoveUserFromGroup ($GroupID: String!, $UserID: String!) { + removeUsersFromGroup(input: {groupId:$GroupID,users:[$UserID]}) { + __typename + } +} +` + +func RemoveUserFromGroup( + ctx_ context.Context, + client_ graphql.Client, + GroupID string, + UserID string, +) (*RemoveUserFromGroupResponse, error) { + req_ := &graphql.Request{ + OpName: "RemoveUserFromGroup", + Query: RemoveUserFromGroup_Operation, + Variables: &__RemoveUserFromGroupInput{ + GroupID: GroupID, + UserID: UserID, + }, + } + var err_ error + + var data_ RemoveUserFromGroupResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by RotateTokenByID. +const RotateTokenByID_Operation = ` +mutation RotateTokenByID ($TokenID: String!) { + rotateToken(input: {id:$TokenID}) +} +` + +func RotateTokenByID( + ctx_ context.Context, + client_ graphql.Client, + TokenID string, +) (*RotateTokenByIDResponse, error) { + req_ := &graphql.Request{ + OpName: "RotateTokenByID", + Query: RotateTokenByID_Operation, + Variables: &__RotateTokenByIDInput{ + TokenID: TokenID, + }, + } + var err_ error + + var data_ RotateTokenByIDResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by SetAutomaticSearching. +const SetAutomaticSearching_Operation = ` +mutation SetAutomaticSearching ($SearchDomainName: String!, $AutomaticSearch: Boolean!) { + setAutomaticSearching(name: $SearchDomainName, automaticSearch: $AutomaticSearch) { + __typename + } +} +` + +func SetAutomaticSearching( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + AutomaticSearch bool, +) (*SetAutomaticSearchingResponse, error) { + req_ := &graphql.Request{ + OpName: "SetAutomaticSearching", + Query: SetAutomaticSearching_Operation, + Variables: &__SetAutomaticSearchingInput{ + SearchDomainName: SearchDomainName, + AutomaticSearch: AutomaticSearch, + }, + } + var err_ error + + var data_ SetAutomaticSearchingResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UnassignParserToIngestToken. +const UnassignParserToIngestToken_Operation = ` +mutation UnassignParserToIngestToken ($RepositoryName: String!, $IngestTokenName: String!) { + unassignIngestToken(repositoryName: $RepositoryName, tokenName: $IngestTokenName) { + __typename + } +} +` + +func UnassignParserToIngestToken( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + IngestTokenName string, +) (*UnassignParserToIngestTokenResponse, error) { + req_ := &graphql.Request{ + OpName: "UnassignParserToIngestToken", + Query: UnassignParserToIngestToken_Operation, + Variables: &__UnassignParserToIngestTokenInput{ + RepositoryName: RepositoryName, + IngestTokenName: IngestTokenName, + }, + } + var err_ error + + var data_ UnassignParserToIngestTokenResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UninstallPackage. +const UninstallPackage_Operation = ` +mutation UninstallPackage ($SearchDomainName: String!, $PackageID: UnversionedPackageSpecifier!) { + uninstallPackage(viewName: $SearchDomainName, packageId: $PackageID) { + __typename + } +} +` + +func UninstallPackage( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + PackageID string, +) (*UninstallPackageResponse, error) { + req_ := &graphql.Request{ + OpName: "UninstallPackage", + Query: UninstallPackage_Operation, + Variables: &__UninstallPackageInput{ + SearchDomainName: SearchDomainName, + PackageID: PackageID, + }, + } + var err_ error + + var data_ UninstallPackageResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UnregisterClusterNode. +const UnregisterClusterNode_Operation = ` +mutation UnregisterClusterNode ($NodeID: Int!, $Force: Boolean!) { + clusterUnregisterNode(nodeID: $NodeID, force: $Force) { + __typename + } +} +` + +func UnregisterClusterNode( + ctx_ context.Context, + client_ graphql.Client, + NodeID int, + Force bool, +) (*UnregisterClusterNodeResponse, error) { + req_ := &graphql.Request{ + OpName: "UnregisterClusterNode", + Query: UnregisterClusterNode_Operation, + Variables: &__UnregisterClusterNodeInput{ + NodeID: NodeID, + Force: Force, + }, + } + var err_ error + + var data_ UnregisterClusterNodeResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateAggregateAlert. +const UpdateAggregateAlert_Operation = ` +mutation UpdateAggregateAlert ($SearchDomainName: RepoOrViewName!, $ID: String!, $Name: String!, $Description: String, $QueryString: String!, $SearchIntervalSeconds: Long!, $ActionIdsOrNames: [String!]!, $Labels: [String!]!, $Enabled: Boolean!, $RunAsUserID: String, $ThrottleField: String, $ThrottleTimeSeconds: Long!, $TriggerMode: TriggerMode!, $QueryTimestampMode: QueryTimestampType!, $QueryOwnershipType: QueryOwnershipType!) { + updateAggregateAlert(input: {viewName:$SearchDomainName,id:$ID,name:$Name,description:$Description,queryString:$QueryString,searchIntervalSeconds:$SearchIntervalSeconds,actionIdsOrNames:$ActionIdsOrNames,labels:$Labels,enabled:$Enabled,runAsUserId:$RunAsUserID,throttleField:$ThrottleField,throttleTimeSeconds:$ThrottleTimeSeconds,triggerMode:$TriggerMode,queryTimestampType:$QueryTimestampMode,queryOwnershipType:$QueryOwnershipType}) { + ... AggregateAlertDetails + } +} +fragment AggregateAlertDetails on AggregateAlert { + id + name + description + queryString + searchIntervalSeconds + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + triggerMode + queryTimestampType + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func UpdateAggregateAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ID string, + Name string, + Description *string, + QueryString string, + SearchIntervalSeconds int64, + ActionIdsOrNames []string, + Labels []string, + Enabled bool, + RunAsUserID *string, + ThrottleField *string, + ThrottleTimeSeconds int64, + TriggerMode TriggerMode, + QueryTimestampMode QueryTimestampType, + QueryOwnershipType QueryOwnershipType, +) (*UpdateAggregateAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateAggregateAlert", + Query: UpdateAggregateAlert_Operation, + Variables: &__UpdateAggregateAlertInput{ + SearchDomainName: SearchDomainName, + ID: ID, + Name: Name, + Description: Description, + QueryString: QueryString, + SearchIntervalSeconds: SearchIntervalSeconds, + ActionIdsOrNames: ActionIdsOrNames, + Labels: Labels, + Enabled: Enabled, + RunAsUserID: RunAsUserID, + ThrottleField: ThrottleField, + ThrottleTimeSeconds: ThrottleTimeSeconds, + TriggerMode: TriggerMode, + QueryTimestampMode: QueryTimestampMode, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ UpdateAggregateAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateAlert. +const UpdateAlert_Operation = ` +mutation UpdateAlert ($SearchDomainName: String!, $AlertID: String!, $Name: String!, $Description: String, $QueryString: String!, $QueryStart: String!, $ThrottleTimeMillis: Long!, $Enabled: Boolean!, $Actions: [String!]!, $Labels: [String!]!, $RunAsUserID: String, $QueryOwnershipType: QueryOwnershipType, $ThrottleField: String) { + updateAlert(input: {id:$AlertID,viewName:$SearchDomainName,name:$Name,description:$Description,queryString:$QueryString,queryStart:$QueryStart,throttleTimeMillis:$ThrottleTimeMillis,enabled:$Enabled,actions:$Actions,labels:$Labels,runAsUserId:$RunAsUserID,queryOwnershipType:$QueryOwnershipType,throttleField:$ThrottleField}) { + ... AlertDetails + } +} +fragment AlertDetails on Alert { + id + name + queryString + queryStart + throttleField + timeOfLastTrigger + isStarred + description + throttleTimeMillis + enabled + actions + labels + lastError + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func UpdateAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + AlertID string, + Name string, + Description *string, + QueryString string, + QueryStart string, + ThrottleTimeMillis int64, + Enabled bool, + Actions []string, + Labels []string, + RunAsUserID *string, + QueryOwnershipType *QueryOwnershipType, + ThrottleField *string, +) (*UpdateAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateAlert", + Query: UpdateAlert_Operation, + Variables: &__UpdateAlertInput{ + SearchDomainName: SearchDomainName, + AlertID: AlertID, + Name: Name, + Description: Description, + QueryString: QueryString, + QueryStart: QueryStart, + ThrottleTimeMillis: ThrottleTimeMillis, + Enabled: Enabled, + Actions: Actions, + Labels: Labels, + RunAsUserID: RunAsUserID, + QueryOwnershipType: QueryOwnershipType, + ThrottleField: ThrottleField, + }, + } + var err_ error + + var data_ UpdateAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateDescriptionForSearchDomain. +const UpdateDescriptionForSearchDomain_Operation = ` +mutation UpdateDescriptionForSearchDomain ($SearchDomainName: String!, $NewDescription: String!) { + updateDescriptionForSearchDomain(name: $SearchDomainName, newDescription: $NewDescription) { + __typename + } +} +` + +func UpdateDescriptionForSearchDomain( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + NewDescription string, +) (*UpdateDescriptionForSearchDomainResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateDescriptionForSearchDomain", + Query: UpdateDescriptionForSearchDomain_Operation, + Variables: &__UpdateDescriptionForSearchDomainInput{ + SearchDomainName: SearchDomainName, + NewDescription: NewDescription, + }, + } + var err_ error + + var data_ UpdateDescriptionForSearchDomainResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateEmailAction. +const UpdateEmailAction_Operation = ` +mutation UpdateEmailAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $Recipients: [String!]!, $SubjectTemplate: String, $BodyTemplate: String, $UseProxy: Boolean!) { + updateEmailAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,recipients:$Recipients,subjectTemplate:$SubjectTemplate,bodyTemplate:$BodyTemplate,useProxy:$UseProxy}) { + id + name + recipients + subjectTemplate + bodyTemplate + useProxy + } +} +` + +func UpdateEmailAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + Recipients []string, + SubjectTemplate *string, + BodyTemplate *string, + UseProxy bool, +) (*UpdateEmailActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateEmailAction", + Query: UpdateEmailAction_Operation, + Variables: &__UpdateEmailActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + Recipients: Recipients, + SubjectTemplate: SubjectTemplate, + BodyTemplate: BodyTemplate, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateEmailActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateFilterAlert. +const UpdateFilterAlert_Operation = ` +mutation UpdateFilterAlert ($SearchDomainName: RepoOrViewName!, $ID: String!, $Name: String!, $Description: String, $QueryString: String!, $ActionIdsOrNames: [String!]!, $Labels: [String!]!, $Enabled: Boolean!, $RunAsUserID: String, $ThrottleField: String, $ThrottleTimeSeconds: Long!, $QueryOwnershipType: QueryOwnershipType!) { + updateFilterAlert(input: {viewName:$SearchDomainName,id:$ID,name:$Name,description:$Description,queryString:$QueryString,actionIdsOrNames:$ActionIdsOrNames,labels:$Labels,enabled:$Enabled,runAsUserId:$RunAsUserID,throttleField:$ThrottleField,throttleTimeSeconds:$ThrottleTimeSeconds,queryOwnershipType:$QueryOwnershipType}) { + ... FilterAlertDetails + } +} +fragment FilterAlertDetails on FilterAlert { + id + name + description + queryString + throttleTimeSeconds + throttleField + actions { + __typename + name + } + labels + enabled + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func UpdateFilterAlert( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ID string, + Name string, + Description *string, + QueryString string, + ActionIdsOrNames []string, + Labels []string, + Enabled bool, + RunAsUserID *string, + ThrottleField *string, + ThrottleTimeSeconds int64, + QueryOwnershipType QueryOwnershipType, +) (*UpdateFilterAlertResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateFilterAlert", + Query: UpdateFilterAlert_Operation, + Variables: &__UpdateFilterAlertInput{ + SearchDomainName: SearchDomainName, + ID: ID, + Name: Name, + Description: Description, + QueryString: QueryString, + ActionIdsOrNames: ActionIdsOrNames, + Labels: Labels, + Enabled: Enabled, + RunAsUserID: RunAsUserID, + ThrottleField: ThrottleField, + ThrottleTimeSeconds: ThrottleTimeSeconds, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ UpdateFilterAlertResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateHumioRepoAction. +const UpdateHumioRepoAction_Operation = ` +mutation UpdateHumioRepoAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $IngestToken: String!) { + updateHumioRepoAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,ingestToken:$IngestToken}) { + id + name + ingestToken + } +} +` + +func UpdateHumioRepoAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + IngestToken string, +) (*UpdateHumioRepoActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateHumioRepoAction", + Query: UpdateHumioRepoAction_Operation, + Variables: &__UpdateHumioRepoActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + IngestToken: IngestToken, + }, + } + var err_ error + + var data_ UpdateHumioRepoActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateIngestBasedRetention. +const UpdateIngestBasedRetention_Operation = ` +mutation UpdateIngestBasedRetention ($RepositoryName: String!, $IngestInGB: Float) { + updateRetention(repositoryName: $RepositoryName, ingestSizeBasedRetention: $IngestInGB) { + __typename + } +} +` + +func UpdateIngestBasedRetention( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + IngestInGB *float64, +) (*UpdateIngestBasedRetentionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateIngestBasedRetention", + Query: UpdateIngestBasedRetention_Operation, + Variables: &__UpdateIngestBasedRetentionInput{ + RepositoryName: RepositoryName, + IngestInGB: IngestInGB, + }, + } + var err_ error + + var data_ UpdateIngestBasedRetentionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateLicenseKey. +const UpdateLicenseKey_Operation = ` +mutation UpdateLicenseKey ($LicenseKey: String!) { + updateLicenseKey(license: $LicenseKey) { + __typename + } +} +` + +func UpdateLicenseKey( + ctx_ context.Context, + client_ graphql.Client, + LicenseKey string, +) (*UpdateLicenseKeyResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateLicenseKey", + Query: UpdateLicenseKey_Operation, + Variables: &__UpdateLicenseKeyInput{ + LicenseKey: LicenseKey, + }, + } + var err_ error + + var data_ UpdateLicenseKeyResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateOpsGenieAction. +const UpdateOpsGenieAction_Operation = ` +mutation UpdateOpsGenieAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $ApiUrl: String!, $GenieKey: String!, $UseProxy: Boolean!) { + updateOpsGenieAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,apiUrl:$ApiUrl,genieKey:$GenieKey,useProxy:$UseProxy}) { + id + name + apiUrl + genieKey + useProxy + } +} +` + +func UpdateOpsGenieAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + ApiUrl string, + GenieKey string, + UseProxy bool, +) (*UpdateOpsGenieActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateOpsGenieAction", + Query: UpdateOpsGenieAction_Operation, + Variables: &__UpdateOpsGenieActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + ApiUrl: ApiUrl, + GenieKey: GenieKey, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateOpsGenieActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdatePagerDutyAction. +const UpdatePagerDutyAction_Operation = ` +mutation UpdatePagerDutyAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $Severity: String!, $RoutingKey: String!, $UseProxy: Boolean!) { + updatePagerDutyAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,severity:$Severity,routingKey:$RoutingKey,useProxy:$UseProxy}) { + id + name + severity + routingKey + useProxy + } +} +` + +func UpdatePagerDutyAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + Severity string, + RoutingKey string, + UseProxy bool, +) (*UpdatePagerDutyActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdatePagerDutyAction", + Query: UpdatePagerDutyAction_Operation, + Variables: &__UpdatePagerDutyActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + Severity: Severity, + RoutingKey: RoutingKey, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdatePagerDutyActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateRole. +const UpdateRole_Operation = ` +mutation UpdateRole ($RoleID: String!, $RoleName: String!, $ViewPermissions: [Permission!]!, $OrganizationPermissions: [OrganizationPermission!], $SystemPermissions: [SystemPermission!]) { + updateRole(input: {roleId:$RoleID,displayName:$RoleName,viewPermissions:$ViewPermissions,organizationPermissions:$OrganizationPermissions,systemPermissions:$SystemPermissions}) { + role { + ... RoleDetails + } + } +} +fragment RoleDetails on Role { + id + displayName + viewPermissions + organizationPermissions + systemPermissions +} +` + +func UpdateRole( + ctx_ context.Context, + client_ graphql.Client, + RoleID string, + RoleName string, + ViewPermissions []Permission, + OrganizationPermissions []OrganizationPermission, + SystemPermissions []SystemPermission, +) (*UpdateRoleResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateRole", + Query: UpdateRole_Operation, + Variables: &__UpdateRoleInput{ + RoleID: RoleID, + RoleName: RoleName, + ViewPermissions: ViewPermissions, + OrganizationPermissions: OrganizationPermissions, + SystemPermissions: SystemPermissions, + }, + } + var err_ error + + var data_ UpdateRoleResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateS3ArchivingConfiguration. +const UpdateS3ArchivingConfiguration_Operation = ` +mutation UpdateS3ArchivingConfiguration ($RepositoryName: String!, $BucketName: String!, $BucketRegion: String!, $Format: S3ArchivingFormat!) { + s3ConfigureArchiving(repositoryName: $RepositoryName, bucket: $BucketName, region: $BucketRegion, format: $Format) { + __typename + } +} +` + +func UpdateS3ArchivingConfiguration( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + BucketName string, + BucketRegion string, + Format S3ArchivingFormat, +) (*UpdateS3ArchivingConfigurationResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateS3ArchivingConfiguration", + Query: UpdateS3ArchivingConfiguration_Operation, + Variables: &__UpdateS3ArchivingConfigurationInput{ + RepositoryName: RepositoryName, + BucketName: BucketName, + BucketRegion: BucketRegion, + Format: Format, + }, + } + var err_ error + + var data_ UpdateS3ArchivingConfigurationResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateScheduledSearch. +const UpdateScheduledSearch_Operation = ` +mutation UpdateScheduledSearch ($SearchDomainName: String!, $ID: String!, $Name: String!, $Description: String, $QueryString: String!, $QueryStart: String!, $QueryEnd: String!, $Schedule: String!, $TimeZone: String!, $BackfillLimit: Int!, $Enabled: Boolean!, $ActionIdsOrNames: [String!]!, $RunAsUserID: String!, $Labels: [String!]!, $QueryOwnershipType: QueryOwnershipType) { + updateScheduledSearch(input: {viewName:$SearchDomainName,id:$ID,name:$Name,description:$Description,queryString:$QueryString,queryStart:$QueryStart,queryEnd:$QueryEnd,schedule:$Schedule,timeZone:$TimeZone,backfillLimit:$BackfillLimit,enabled:$Enabled,actions:$ActionIdsOrNames,runAsUserId:$RunAsUserID,labels:$Labels,queryOwnershipType:$QueryOwnershipType}) { + ... ScheduledSearchDetails + } +} +fragment ScheduledSearchDetails on ScheduledSearch { + id + name + description + queryString + start + end + timeZone + schedule + backfillLimit + enabled + actionsV2 { + __typename + name + } + labels + queryOwnership { + __typename + ... QueryOwnership + } +} +fragment QueryOwnership on QueryOwnership { + id +} +` + +func UpdateScheduledSearch( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ID string, + Name string, + Description *string, + QueryString string, + QueryStart string, + QueryEnd string, + Schedule string, + TimeZone string, + BackfillLimit int, + Enabled bool, + ActionIdsOrNames []string, + RunAsUserID string, + Labels []string, + QueryOwnershipType *QueryOwnershipType, +) (*UpdateScheduledSearchResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateScheduledSearch", + Query: UpdateScheduledSearch_Operation, + Variables: &__UpdateScheduledSearchInput{ + SearchDomainName: SearchDomainName, + ID: ID, + Name: Name, + Description: Description, + QueryString: QueryString, + QueryStart: QueryStart, + QueryEnd: QueryEnd, + Schedule: Schedule, + TimeZone: TimeZone, + BackfillLimit: BackfillLimit, + Enabled: Enabled, + ActionIdsOrNames: ActionIdsOrNames, + RunAsUserID: RunAsUserID, + Labels: Labels, + QueryOwnershipType: QueryOwnershipType, + }, + } + var err_ error + + var data_ UpdateScheduledSearchResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateSlackAction. +const UpdateSlackAction_Operation = ` +mutation UpdateSlackAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $Fields: [SlackFieldEntryInput!]!, $Url: String!, $UseProxy: Boolean!) { + updateSlackAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,fields:$Fields,url:$Url,useProxy:$UseProxy}) { + id + name + fields { + value + fieldName + } + url + useProxy + } +} +` + +func UpdateSlackAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + Fields []SlackFieldEntryInput, + Url string, + UseProxy bool, +) (*UpdateSlackActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateSlackAction", + Query: UpdateSlackAction_Operation, + Variables: &__UpdateSlackActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + Fields: Fields, + Url: Url, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateSlackActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateSlackPostMessageAction. +const UpdateSlackPostMessageAction_Operation = ` +mutation UpdateSlackPostMessageAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $ApiToken: String!, $Channels: [String!]!, $Fields: [SlackFieldEntryInput!]!, $UseProxy: Boolean!) { + updateSlackPostMessageAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,apiToken:$ApiToken,channels:$Channels,fields:$Fields,useProxy:$UseProxy}) { + id + name + apiToken + channels + fields { + value + fieldName + } + useProxy + } +} +` + +func UpdateSlackPostMessageAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + ApiToken string, + Channels []string, + Fields []SlackFieldEntryInput, + UseProxy bool, +) (*UpdateSlackPostMessageActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateSlackPostMessageAction", + Query: UpdateSlackPostMessageAction_Operation, + Variables: &__UpdateSlackPostMessageActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + ApiToken: ApiToken, + Channels: Channels, + Fields: Fields, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateSlackPostMessageActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateStorageBasedRetention. +const UpdateStorageBasedRetention_Operation = ` +mutation UpdateStorageBasedRetention ($RepositoryName: String!, $StorageInGB: Float) { + updateRetention(repositoryName: $RepositoryName, storageSizeBasedRetention: $StorageInGB) { + __typename + } +} +` + +func UpdateStorageBasedRetention( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + StorageInGB *float64, +) (*UpdateStorageBasedRetentionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateStorageBasedRetention", + Query: UpdateStorageBasedRetention_Operation, + Variables: &__UpdateStorageBasedRetentionInput{ + RepositoryName: RepositoryName, + StorageInGB: StorageInGB, + }, + } + var err_ error + + var data_ UpdateStorageBasedRetentionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateTimeBasedRetention. +const UpdateTimeBasedRetention_Operation = ` +mutation UpdateTimeBasedRetention ($RepositoryName: String!, $RetentionInDays: Float) { + updateRetention(repositoryName: $RepositoryName, timeBasedRetention: $RetentionInDays) { + __typename + } +} +` + +func UpdateTimeBasedRetention( + ctx_ context.Context, + client_ graphql.Client, + RepositoryName string, + RetentionInDays *float64, +) (*UpdateTimeBasedRetentionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateTimeBasedRetention", + Query: UpdateTimeBasedRetention_Operation, + Variables: &__UpdateTimeBasedRetentionInput{ + RepositoryName: RepositoryName, + RetentionInDays: RetentionInDays, + }, + } + var err_ error + + var data_ UpdateTimeBasedRetentionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateUploadFileAction. +const UpdateUploadFileAction_Operation = ` +mutation UpdateUploadFileAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $FileName: String!) { + updateUploadFileAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,fileName:$FileName}) { + id + name + fileName + } +} +` + +func UpdateUploadFileAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + FileName string, +) (*UpdateUploadFileActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateUploadFileAction", + Query: UpdateUploadFileAction_Operation, + Variables: &__UpdateUploadFileActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + FileName: FileName, + }, + } + var err_ error + + var data_ UpdateUploadFileActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateUser. +const UpdateUser_Operation = ` +mutation UpdateUser ($Username: String!, $Company: String, $IsRoot: Boolean, $FullName: String, $Picture: String, $Email: String, $CountryCode: String) { + updateUser(input: {username:$Username,company:$Company,isRoot:$IsRoot,fullName:$FullName,picture:$Picture,email:$Email,countryCode:$CountryCode}) { + __typename + } +} +` + +func UpdateUser( + ctx_ context.Context, + client_ graphql.Client, + Username string, + Company *string, + IsRoot *bool, + FullName *string, + Picture *string, + Email *string, + CountryCode *string, +) (*UpdateUserResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateUser", + Query: UpdateUser_Operation, + Variables: &__UpdateUserInput{ + Username: Username, + Company: Company, + IsRoot: IsRoot, + FullName: FullName, + Picture: Picture, + Email: Email, + CountryCode: CountryCode, + }, + } + var err_ error + + var data_ UpdateUserResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateVictorOpsAction. +const UpdateVictorOpsAction_Operation = ` +mutation UpdateVictorOpsAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $MessageType: String!, $NotifyUrl: String!, $UseProxy: Boolean!) { + updateVictorOpsAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,messageType:$MessageType,notifyUrl:$NotifyUrl,useProxy:$UseProxy}) { + id + name + messageType + notifyUrl + useProxy + } +} +` + +func UpdateVictorOpsAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + MessageType string, + NotifyUrl string, + UseProxy bool, +) (*UpdateVictorOpsActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateVictorOpsAction", + Query: UpdateVictorOpsAction_Operation, + Variables: &__UpdateVictorOpsActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + MessageType: MessageType, + NotifyUrl: NotifyUrl, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateVictorOpsActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateViewConnections. +const UpdateViewConnections_Operation = ` +mutation UpdateViewConnections ($ViewName: String!, $Connections: [ViewConnectionInput!]!) { + updateView(viewName: $ViewName, connections: $Connections) { + name + } +} +` + +func UpdateViewConnections( + ctx_ context.Context, + client_ graphql.Client, + ViewName string, + Connections []ViewConnectionInput, +) (*UpdateViewConnectionsResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateViewConnections", + Query: UpdateViewConnections_Operation, + Variables: &__UpdateViewConnectionsInput{ + ViewName: ViewName, + Connections: Connections, + }, + } + var err_ error + + var data_ UpdateViewConnectionsResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} + +// The query or mutation executed by UpdateWebhookAction. +const UpdateWebhookAction_Operation = ` +mutation UpdateWebhookAction ($SearchDomainName: String!, $ActionID: String!, $ActionName: String!, $Url: String!, $Method: String!, $Headers: [HttpHeaderEntryInput!]!, $BodyTemplate: String!, $IgnoreSSL: Boolean!, $UseProxy: Boolean!) { + updateWebhookAction(input: {viewName:$SearchDomainName,id:$ActionID,name:$ActionName,url:$Url,method:$Method,headers:$Headers,bodyTemplate:$BodyTemplate,ignoreSSL:$IgnoreSSL,useProxy:$UseProxy}) { + id + name + url + method + headers { + value + header + } + bodyTemplate + ignoreSSL + useProxy + } +} +` + +func UpdateWebhookAction( + ctx_ context.Context, + client_ graphql.Client, + SearchDomainName string, + ActionID string, + ActionName string, + Url string, + Method string, + Headers []HttpHeaderEntryInput, + BodyTemplate string, + IgnoreSSL bool, + UseProxy bool, +) (*UpdateWebhookActionResponse, error) { + req_ := &graphql.Request{ + OpName: "UpdateWebhookAction", + Query: UpdateWebhookAction_Operation, + Variables: &__UpdateWebhookActionInput{ + SearchDomainName: SearchDomainName, + ActionID: ActionID, + ActionName: ActionName, + Url: Url, + Method: Method, + Headers: Headers, + BodyTemplate: BodyTemplate, + IgnoreSSL: IgnoreSSL, + UseProxy: UseProxy, + }, + } + var err_ error + + var data_ UpdateWebhookActionResponse + resp_ := &graphql.Response{Data: &data_} + + err_ = client_.MakeRequest( + ctx_, + req_, + resp_, + ) + + return &data_, err_ +} diff --git a/internal/api/humiographql/schema/_schema.graphql b/internal/api/humiographql/schema/_schema.graphql new file mode 100644 index 00000000..b64561dd --- /dev/null +++ b/internal/api/humiographql/schema/_schema.graphql @@ -0,0 +1,19091 @@ +""" +Directs the executor to include this field or fragment only when the `if` argument is true. +""" +directive @include( +""" +Included when true. +""" + if: Boolean! +) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + +""" +Directs the executor to skip this field or fragment when the `if` argument is true. +""" +directive @skip( +""" +Included when true. +""" + if: Boolean! +) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + +""" +Marks an element of a GraphQL schema as no longer supported. +""" +directive @deprecated( +""" +Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/). +""" + reason: String +) on ENUM_VALUE | FIELD_DEFINITION + +directive @preview( + reason: String! +) on ENUM_VALUE | FIELD_DEFINITION + +""" +Data for updating action security policies +""" +input ActionSecurityPoliciesInput { +""" +Data for updating action security policies +""" + emailActionEnabled: Boolean! +""" +Data for updating action security policies +""" + emailActionRecipientAllowList: [String!] +""" +Data for updating action security policies +""" + repoActionEnabled: Boolean! +""" +Data for updating action security policies +""" + opsGenieActionEnabled: Boolean! +""" +Data for updating action security policies +""" + pagerDutyActionEnabled: Boolean! +""" +Data for updating action security policies +""" + slackSingleChannelActionEnabled: Boolean! +""" +Data for updating action security policies +""" + slackMultiChannelActionEnabled: Boolean! +""" +Data for updating action security policies +""" + uploadFileActionEnabled: Boolean! +""" +Data for updating action security policies +""" + victorOpsActionEnabled: Boolean! +""" +Data for updating action security policies +""" + webhookActionEnabled: Boolean! +""" +Data for updating action security policies +""" + webhookActionUrlAllowList: [String!] +} + +""" +Data for adding a label to an alert +""" +input AddAlertLabel { +""" +Data for adding a label to an alert +""" + viewName: String! +""" +Data for adding a label to an alert +""" + id: String! +""" +Data for adding a label to an alert +""" + label: String! +} + +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field addFieldAliasMapping +""" +input AddAliasMappingInput { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field addFieldAliasMapping +""" + schemaId: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field addFieldAliasMapping +""" + aliasMapping: AliasMappingInput! +} + +type AddGroupMutation { + group: Group! +} + +""" +Input data to create an ingest token +""" +input AddIngestTokenV3Input { +""" +Input data to create an ingest token +""" + repositoryName: String! +""" +Input data to create an ingest token +""" + name: String! +""" +Input data to create an ingest token +""" + parser: String +""" +Input data to create an ingest token +""" + customToken: String +} + +""" +Data for adding a label to a scheduled search +""" +input AddLabelScheduledSearch { +""" +Data for adding a label to a scheduled search +""" + viewName: String! +""" +Data for adding a label to a scheduled search +""" + id: String! +""" +Data for adding a label to a scheduled search +""" + label: String! +} + +input AddLimitInput { + limitName: String! + allowLogin: Boolean! + dailyIngest: Long! + retention: Int! + allowSelfService: Boolean! + expiration: Long + contractVersion: Organizations__ContractVersion + userLimit: Int +} + +input AddLimitV2Input { + limitName: String! + allowLogin: Boolean! + dailyIngest: Long + dailyIngestContractualType: Organizations__ContractualType! + storageContractualType: Organizations__ContractualType! + dailyScanContractualType: Organizations__ContractualType! + measurementType: Organizations__MeasurementType! + dailyScan: Long + retention: Int! + maxRetention: Int! + allowSelfService: Boolean! + expiration: Long + userLimit: Int + dateType: String! + trial: Boolean! + allowFlightControl: Boolean! + repositoryLimit: Int +} + +type AddRecentQuery { + recentQueries: [RecentQuery!]! +} + +input AddRecentQueryInput { + viewName: String! + queryArguments: [InputDictionaryEntry!]! + queryString: String! + start: String! + end: String! + isLive: Boolean! + widgetType: String + options: JSON +} + +input AddRoleInput { + displayName: String! + viewPermissions: [Permission!]! + color: String + systemPermissions: [SystemPermission!] + organizationPermissions: [OrganizationPermission!] + objectAction: ObjectAction + organizationManagementPermissions: [OrganizationManagementPermission!] +} + +type AddRoleMutation { + role: Role! +} + +""" +Data for adding a star to a scheduled search +""" +input AddStarScheduledSearch { +""" +Data for adding a star to a scheduled search +""" + viewName: String! +""" +Data for adding a star to a scheduled search +""" + id: String! +} + +""" +Data for adding a star to an alert +""" +input AddStarToAlert { +""" +Data for adding a star to an alert +""" + viewName: String! +""" +Data for adding a star to an alert +""" + id: String! +} + +input AddStarToFieldInput { + fieldName: String! + searchDomainName: String! +} + +type AddStarToFieldMutation { + starredFields: [String!]! +} + +input AddStarToQueryInput { + savedQueryId: String! + searchDomainName: String! +} + +input AddSubdomainInput { + subdomain: String! +} + +""" +Data for adding to the blocklist +""" +input AddToBlocklistByIdInput { +""" +Data for adding to the blocklist +""" + pattern: String! +""" +Data for adding to the blocklist +""" + type: BlockedQueryMatcherType! +""" +Data for adding to the blocklist +""" + viewId: String +""" +Data for adding to the blocklist +""" + clusterWide: Boolean +} + +""" +Data for adding to the blocklist +""" +input AddToBlocklistInput { +""" +Data for adding to the blocklist +""" + pattern: String! +""" +Data for adding to the blocklist +""" + type: BlockedQueryMatcherType! +""" +Data for adding to the blocklist +""" + viewName: String +""" +Data for adding to the blocklist +""" + clusterWide: Boolean +} + +input AddUserInput { + username: String! + company: String + isRoot: Boolean + firstName: String + lastName: String + fullName: String + picture: String + email: String + countryCode: String + stateCode: String +} + +input AddUserInputV2 { + username: String! + company: String + isRoot: Boolean + firstName: String + lastName: String + fullName: String + picture: String + email: String + countryCode: String + stateCode: String + sendInvite: Boolean + verificationToken: String + isOrgOwner: Boolean +} + +input AddUsersToGroupInput { + users: [String!]! + groupId: String! +} + +type AddUsersToGroupMutation { + group: Group! +} + +input AliasInfoInput { + source: String! + alias: String! +} + +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for creating a new alias mapping. +""" +input AliasMappingInput { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for creating a new alias mapping. +""" + name: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for creating a new alias mapping. +""" + tags: [TagsInput!]! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for creating a new alias mapping. +""" + aliases: [AliasInfoInput!]! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for creating a new alias mapping. +""" + originalFieldsToKeep: [String!] +} + +input AnalyticsBrowser { + info: AnalyticsBrowserInfo! + isChrome: Boolean! + isChromeHeadless: Boolean! + isEdge: Boolean! + isFirefox: Boolean! + isIE: Boolean! + isSafari: Boolean! +} + +input AnalyticsBrowserInfo { + name: String + version: String + major: String +} + +input AnalyticsDevice { + info: AnalyticsDeviceInfo! + isConsole: Boolean! + isDesktop: Boolean! + isMobile: Boolean! + isTablet: Boolean! +} + +input AnalyticsDeviceInfo { + model: String + type: String + vendor: String +} + +input AnalyticsEngine { + info: AnalyticsInfo! + isWebkit: Boolean! +} + +input AnalyticsFeature { + name: String! + value: Boolean! +} + +input AnalyticsInfo { + name: String! + version: String! +} + +input AnalyticsLog { + category: String! + action: String! + message: String +} + +input AnalyticsLogWithTimestamp { + eventId: String! + timestamp: Long! + route: String! + action: String! + system: String! + arguments: [String!]! + feature: String + features: [AnalyticsFeature!]! + context: String! + metrics: AnalyticsMetrics! + userAgent: AnalyticsUserAgent! +} + +input AnalyticsMetrics { + fps: Int! +} + +input AnalyticsOS { + info: AnalyticsInfo! + isAndroid: Boolean! + isIOS: Boolean! + isLinux: Boolean! + isMacOS: Boolean! + isWindows: Boolean! +} + +input AnalyticsUserAgent { + browser: AnalyticsBrowser! + device: AnalyticsDevice! + engine: AnalyticsEngine! + os: AnalyticsOS! +} + +input ArgumentInput { + key: String! + value: String! +} + +""" +A gap in th array. Null values represent missing bounds +""" +type ArrayGap { +""" +[PREVIEW: API under active development] Array gap starts at this index (inclusive) +""" + startsAtIndex: Int! +""" +[PREVIEW: API under active development] Array gap ends at this index (exclusive) +""" + endsAtIndex: Int! +} + +""" +Array gaps identified for a given prefix +""" +type ArrayWithGap { +""" +[PREVIEW: API under active development] Prefix that represents a field up until the point at which a gap was identified. For instance, the field `a[0].b[1]` would give the prefix `a[0].b` as the gap occurs when indexing `b` with `1`. For `a[1].b[0]` we would get the prefix `a`. +""" + lastValidPrefix: String! +""" +[PREVIEW: API under active development] Gaps identified for array prefix +""" + gaps: [ArrayGap!]! +} + +""" +Different ways in which an assertion may fail. +""" +union AssertionFailureOnField =FieldUnexpectedlyPresent | FieldHadUnexpectedValue | FieldHadConflictingAssertions | AssertionOnFieldWasOrphaned + +""" +This occurs when an assertion was set to run on some output event that wasn't produced by the parser. That is, the assertion may be set to run on output event number 2, but the parser only produced one event. +""" +type AssertionOnFieldWasOrphaned { +""" +Field being asserted on. +""" + fieldName: String! +} + +input AssignAssetPermissionsToGroupInputType { + groupId: String! + assetId: String! + assetType: AssetPermissionsAssetType! + searchDomainId: String + assetPermissions: [AssetPermissionInputEnum!]! +} + +input AssignAssetPermissionsToUserInputType { + userId: String! + assetId: String! + assetType: AssetPermissionsAssetType! + searchDomainId: String + assetPermissions: [AssetPermissionInputEnum!]! +} + +input AssignOrganizationManagementRoleToGroupInput { + groupId: String! + roleId: String! + organizationIds: [String!]! +} + +type AssignOrganizationManagementRoleToGroupMutation { + group: GroupOrganizationManagementRole! +} + +input AssignOrganizationRoleToGroupInput { + groupId: String! + roleId: String! +} + +type AssignOrganizationRoleToGroupMutation { + group: GroupOrganizationRole! +} + +""" +Input data to assign a parser to an ingest token +""" +input AssignParserToIngestTokenInputV2 { +""" +Input data to assign a parser to an ingest token +""" + repositoryName: String! +""" +Input data to assign a parser to an ingest token +""" + tokenName: String! +""" +Input data to assign a parser to an ingest token +""" + parser: String! +} + +input AssignRoleToGroupInput { + viewId: String! + groupId: String! + roleId: String! + overrideExistingAssignmentsForView: Boolean +} + +type AssignRoleToGroupMutation { + group: SearchDomainRole! +} + +input AssignSystemRoleToGroupInput { + groupId: String! + roleId: String! +} + +type AssignSystemRoleToGroupMutation { + group: GroupSystemRole! +} + +input AssignUserRolesInSearchDomainInput { + searchDomainId: String! + roleAssignments: [UserRoleAssignmentInput!]! +} + +""" +Authentication through Auth0. +""" +type Auth0Authentication implements AuthenticationMethod{ + auth0Domain: String! + clientId: String! + allowSignup: Boolean! + redirectUrl: String! +""" +The display name of the authentication method. +""" + name: String! +} + +""" +Payload for specifying targets for batch updating query ownership +""" +input BatchUpdateQueryOwnershipInput { +""" +Payload for specifying targets for batch updating query ownership +""" + targetType: QueryOwnership_SelectionTargetType! +""" +Payload for specifying targets for batch updating query ownership +""" + ids: [String!]! +} + +type BlockIngestMutation { + repository: Repository! +} + +input BlockIngestOnOrgInput { + blockIngest: Boolean! +} + +type BooleanResultType { + result: Boolean! +} + +""" +By proxy authentication. Authentication is provided by proxy. +""" +type ByProxyAuthentication implements AuthenticationMethod{ + name: String! +} + +""" +A policy for choosing which segments to cache on local disk when overcommiting +local storage with bucket storage. + +This can be used to protect certain repositories for local storage, such that +searching other repositories does not evict them. + +A cache policy in LogScale divides segments into prioritized and non-prioritized +segments. When segments needs to be evicted from local storage, we always try +evicting non-prioritized segments before prioritized segments. + +A cache policy can be set either on one of three levels (in order of precedence): + - Repo + - Org + - Globally + + When determining the cache policy for a repo we first check if there is a cache + policy set on the repo. If none is set on the repo, we check the the org. If none + is set there either we check the global setting. + +""" +input CachePolicyInput { +""" +A policy for choosing which segments to cache on local disk when overcommiting +local storage with bucket storage. + +This can be used to protect certain repositories for local storage, such that +searching other repositories does not evict them. + +A cache policy in LogScale divides segments into prioritized and non-prioritized +segments. When segments needs to be evicted from local storage, we always try +evicting non-prioritized segments before prioritized segments. + +A cache policy can be set either on one of three levels (in order of precedence): + - Repo + - Org + - Globally + + When determining the cache policy for a repo we first check if there is a cache + policy set on the repo. If none is set on the repo, we check the the org. If none + is set there either we check the global setting. + +""" + prioritizeMillis: Long +} + +input CancelRedactEventsInput { + repositoryName: String! + redactionTaskId: String! +} + +""" +Data for clearing the error on an aggregate alert. +""" +input ClearErrorOnAggregateAlertInput { +""" +Data for clearing the error on an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for clearing the error on an aggregate alert. +""" + id: String! +} + +""" +Data for clearing the error on an alert +""" +input ClearErrorOnAlertInput { +""" +Data for clearing the error on an alert +""" + viewName: String! +""" +Data for clearing the error on an alert +""" + id: String! +} + +""" +Data for clearing the error on a filter alert +""" +input ClearErrorOnFilterAlertInput { +""" +Data for clearing the error on a filter alert +""" + viewName: RepoOrViewName! +""" +Data for clearing the error on a filter alert +""" + id: String! +} + +""" +Data for clearing the error on a scheduled search +""" +input ClearErrorOnScheduledSearchInput { +""" +Data for clearing the error on a scheduled search +""" + viewName: String! +""" +Data for clearing the error on a scheduled search +""" + id: String! +} + +input ClearFieldConfigurationsInput { + viewOrRepositoryName: String! +} + +input ClearRecentQueriesInput { + viewOrRepositoryName: String! +} + +""" +Data for clearing the search limit on a search domain. +""" +input ClearSearchLimitForSearchDomain { +""" +Data for clearing the search limit on a search domain. +""" + id: String! +} + +""" +Input data to clone an existing parser +""" +input CloneParserInput { +""" +Input data to clone an existing parser +""" + newParserName: String! +""" +Input data to clone an existing parser +""" + repositoryName: String! +""" +Input data to clone an existing parser +""" + parserIdToClone: String! +} + +""" +Whether a column has been added or removed at the given index +""" +input ColumnChange { +""" +Whether a column has been added or removed at the given index +""" + changeKind: ColumnChangeKind! +""" +Whether a column has been added or removed at the given index +""" + index: Int! +} + +enum ColumnChangeKind { + Remove + Add +} + +input ConflictResolutionConfiguration { + entityType: AssetType! + entityName: String! + conflictResolution: MergeStrategy! +} + +type CopyDashboardMutation { + dashboard: Dashboard! +} + +type CreateActionFromPackageTemplateMutation { + action: Action! +} + +""" +Data for creating an action from a yaml template +""" +input CreateActionFromTemplateInput { +""" +Data for creating an action from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for creating an action from a yaml template +""" + name: String! +""" +Data for creating an action from a yaml template +""" + yamlTemplate: YAML! +} + +""" +Data for creating an aggregate alert. +""" +input CreateAggregateAlert { +""" +Data for creating an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for creating an aggregate alert. +""" + name: String! +""" +Data for creating an aggregate alert. +""" + description: String +""" +Data for creating an aggregate alert. +""" + queryString: String! +""" +Data for creating an aggregate alert. +""" + actionIdsOrNames: [String!]! +""" +Data for creating an aggregate alert. +""" + labels: [String!] +""" +Data for creating an aggregate alert. +""" + enabled: Boolean +""" +Data for creating an aggregate alert. +""" + throttleTimeSeconds: Long! +""" +Data for creating an aggregate alert. +""" + throttleField: String +""" +Data for creating an aggregate alert. +""" + searchIntervalSeconds: Long! +""" +Data for creating an aggregate alert. +""" + queryTimestampType: QueryTimestampType! +""" +Data for creating an aggregate alert. +""" + triggerMode: TriggerMode +""" +Data for creating an aggregate alert. +""" + runAsUserId: String +""" +Data for creating an aggregate alert. +""" + queryOwnershipType: QueryOwnershipType! +} + +""" +Data for creating an alert +""" +input CreateAlert { +""" +Data for creating an alert +""" + viewName: String! +""" +Data for creating an alert +""" + name: String! +""" +Data for creating an alert +""" + description: String +""" +Data for creating an alert +""" + queryString: String! +""" +Data for creating an alert +""" + queryStart: String! +""" +Data for creating an alert +""" + throttleTimeMillis: Long! +""" +Data for creating an alert +""" + throttleField: String +""" +Data for creating an alert +""" + runAsUserId: String +""" +Data for creating an alert +""" + enabled: Boolean +""" +Data for creating an alert +""" + actions: [String!]! +""" +Data for creating an alert +""" + labels: [String!] +""" +Data for creating an alert +""" + queryOwnershipType: QueryOwnershipType +} + +type CreateAlertFromPackageTemplateMutation { + alert: Alert! +} + +""" +Data for creating an alert from a yaml template +""" +input CreateAlertFromTemplateInput { +""" +Data for creating an alert from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for creating an alert from a yaml template +""" + name: String! +""" +Data for creating an alert from a yaml template +""" + yamlTemplate: YAML! +} + +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" +input CreateAwsS3SqsIngestFeed { +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + repositoryName: RepoOrViewName! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + name: String! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + description: String +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + parser: String! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + authentication: IngestFeedAwsAuthenticationInput! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + sqsUrl: String! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + region: String! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + enabled: Boolean! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + preprocessing: IngestFeedPreprocessingInput! +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + compression: IngestFeedCompression! +} + +input CreateCustomLinkInteractionInput { + path: String! + customLinkInteractionInput: CustomLinkInteractionInput! +} + +type CreateDashboardFromPackageTemplateMutation { + dashboard: Dashboard! +} + +""" +Data for creating a dashboard from a yaml specification. +""" +input CreateDashboardFromTemplateV2Input { +""" +Data for creating a dashboard from a yaml specification. +""" + viewName: RepoOrViewName! +""" +Data for creating a dashboard from a yaml specification. +""" + name: String! +""" +Data for creating a dashboard from a yaml specification. +""" + yamlTemplate: YAML! +} + +input CreateDashboardInput { + searchDomainName: String! + name: String! + labels: [String!] + widgets: [WidgetInput!] + sections: [SectionInput!] + links: [LinkInput!] + defaultFilterId: String + filters: [FilterInput!] + parameters: [ParameterInput!] + description: String + updateFrequency: DashboardUpdateFrequencyInput +} + +input CreateDashboardLinkInteractionInput { + path: String! + dashboardLinkInteractionInput: DashboardLinkInteractionInput! +} + +type CreateDashboardMutation { + dashboard: Dashboard! +} + +""" +Data for creating an email action +""" +input CreateEmailAction { +""" +Data for creating an email action +""" + viewName: String! +""" +Data for creating an email action +""" + name: String! +""" +Data for creating an email action +""" + recipients: [String!]! +""" +Data for creating an email action +""" + subjectTemplate: String +""" +Data for creating an email action +""" + bodyTemplate: String +""" +Data for creating an email action +""" + useProxy: Boolean! +""" +Data for creating an email action +""" + attachCsv: Boolean +} + +""" +Data for creating an event forwarding rule +""" +input CreateEventForwardingRule { +""" +Data for creating an event forwarding rule +""" + repoName: String! +""" +Data for creating an event forwarding rule +""" + queryString: String! +""" +Data for creating an event forwarding rule +""" + eventForwarderId: String! +""" +Data for creating an event forwarding rule +""" + languageVersion: LanguageVersionEnum +} + +""" +Data for creating an FDR feed +""" +input CreateFdrFeed { +""" +Data for creating an FDR feed +""" + repositoryName: String! +""" +Data for creating an FDR feed +""" + name: String! +""" +Data for creating an FDR feed +""" + description: String +""" +Data for creating an FDR feed +""" + parser: String! +""" +Data for creating an FDR feed +""" + clientId: String! +""" +Data for creating an FDR feed +""" + clientSecret: String! +""" +Data for creating an FDR feed +""" + sqsUrl: String! +""" +Data for creating an FDR feed +""" + s3Identifier: String! +""" +Data for creating an FDR feed +""" + enabled: Boolean +} + +input CreateFieldAliasSchemaInput { + name: String! + fields: [SchemaFieldInput!]! + aliasMappings: [AliasMappingInput!] +} + +""" +Data for creating a filter alert +""" +input CreateFilterAlert { +""" +Data for creating a filter alert +""" + viewName: RepoOrViewName! +""" +Data for creating a filter alert +""" + name: String! +""" +Data for creating a filter alert +""" + description: String +""" +Data for creating a filter alert +""" + queryString: String! +""" +Data for creating a filter alert +""" + actionIdsOrNames: [String!]! +""" +Data for creating a filter alert +""" + labels: [String!] +""" +Data for creating a filter alert +""" + enabled: Boolean +""" +Data for creating a filter alert +""" + throttleTimeSeconds: Long +""" +Data for creating a filter alert +""" + throttleField: String +""" +Data for creating a filter alert +""" + runAsUserId: String +""" +Data for creating a filter alert +""" + queryOwnershipType: QueryOwnershipType! +} + +""" +Data for creating a LogScale repository action +""" +input CreateHumioRepoAction { +""" +Data for creating a LogScale repository action +""" + viewName: String! +""" +Data for creating a LogScale repository action +""" + name: String! +""" +Data for creating a LogScale repository action +""" + ingestToken: String! +} + +""" +Input data to create an ingest listener +""" +input CreateIngestListenerV3Input { +""" +Input data to create an ingest listener +""" + repositoryName: String! +""" +Input data to create an ingest listener +""" + port: Int! +""" +Input data to create an ingest listener +""" + protocol: IngestListenerProtocol! +""" +Input data to create an ingest listener +""" + vHost: Int +""" +Input data to create an ingest listener +""" + name: String! +""" +Input data to create an ingest listener +""" + bindInterface: String! +""" +Input data to create an ingest listener +""" + parser: String! +""" +Input data to create an ingest listener +""" + charset: String! +} + +""" +Data for creating a Kafka event forwarder +""" +input CreateKafkaEventForwarder { +""" +Data for creating a Kafka event forwarder +""" + name: String! +""" +Data for creating a Kafka event forwarder +""" + description: String! +""" +Data for creating a Kafka event forwarder +""" + properties: String! +""" +Data for creating a Kafka event forwarder +""" + topic: String! +""" +Data for creating a Kafka event forwarder +""" + enabled: Boolean +} + +""" +Data for creating a local multi-cluster connection +""" +input CreateLocalClusterConnectionInput { +""" +Data for creating a local multi-cluster connection +""" + multiClusterViewName: String! +""" +Data for creating a local multi-cluster connection +""" + targetViewName: String! +""" +Data for creating a local multi-cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for creating a local multi-cluster connection +""" + queryPrefix: String +} + +""" +Data for creating an OpsGenie action +""" +input CreateOpsGenieAction { +""" +Data for creating an OpsGenie action +""" + viewName: String! +""" +Data for creating an OpsGenie action +""" + name: String! +""" +Data for creating an OpsGenie action +""" + apiUrl: String! +""" +Data for creating an OpsGenie action +""" + genieKey: String! +""" +Data for creating an OpsGenie action +""" + useProxy: Boolean! +} + +""" +The specification of an external function. +""" +input CreateOrUpdateExternalFunctionInput { +""" +The specification of an external function. +""" + name: String! +""" +The specification of an external function. +""" + procedureURL: String! +""" +The specification of an external function. +""" + parameters: [ParameterSpecificationInput!]! +""" +The specification of an external function. +""" + description: String! +""" +The specification of an external function. +""" + kind: KindInput! +} + +input CreateOrganizationPermissionTokenInput { + name: String! + expireAt: Long + ipFilterId: String + permissions: [OrganizationPermission!]! +} + +""" +Data for creating a PagerDuty action. +""" +input CreatePagerDutyAction { +""" +Data for creating a PagerDuty action. +""" + viewName: String! +""" +Data for creating a PagerDuty action. +""" + name: String! +""" +Data for creating a PagerDuty action. +""" + severity: String! +""" +Data for creating a PagerDuty action. +""" + routingKey: String! +""" +Data for creating a PagerDuty action. +""" + useProxy: Boolean! +} + +type CreateParserFromPackageTemplateMutation { + parser: Parser! +} + +""" +Data for creating a parser from a yaml template +""" +input CreateParserFromTemplateInput { +""" +Data for creating a parser from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for creating a parser from a yaml template +""" + name: String! +""" +Data for creating a parser from a yaml template +""" + yamlTemplate: YAML! +} + +input CreateParserInput { + name: String! + testData: [String!]! + sourceCode: String! + repositoryName: String! + tagFields: [String!]! + force: Boolean! + languageVersion: LanguageVersionEnum +} + +""" +Input for creating a parser. +""" +input CreateParserInputV2 { +""" +Input for creating a parser. +""" + name: String! +""" +Input for creating a parser. +""" + script: String! +""" +Input for creating a parser. +""" + testCases: [ParserTestCaseInput!]! +""" +Input for creating a parser. +""" + repositoryName: RepoOrViewName! +""" +Input for creating a parser. +""" + fieldsToTag: [String!]! +""" +Input for creating a parser. +""" + fieldsToBeRemovedBeforeParsing: [String!]! +""" +Input for creating a parser. +""" + allowOverwritingExistingParser: Boolean +""" +Input for creating a parser. +""" + languageVersion: LanguageVersionInputType +} + +type CreateParserMutation { + parser: Parser! +} + +input CreatePersonalUserTokenInput { + expireAt: Long + ipFilterId: String +} + +""" +Data for creating a post message Slack action. +""" +input CreatePostMessageSlackAction { +""" +Data for creating a post message Slack action. +""" + viewName: String! +""" +Data for creating a post message Slack action. +""" + name: String! +""" +Data for creating a post message Slack action. +""" + apiToken: String! +""" +Data for creating a post message Slack action. +""" + channels: [String!]! +""" +Data for creating a post message Slack action. +""" + fields: [SlackFieldEntryInput!]! +""" +Data for creating a post message Slack action. +""" + useProxy: Boolean! +} + +""" +Data for creating a remote cluster connection +""" +input CreateRemoteClusterConnectionInput { +""" +Data for creating a remote cluster connection +""" + multiClusterViewName: String! +""" +Data for creating a remote cluster connection +""" + publicUrl: String! +""" +Data for creating a remote cluster connection +""" + token: String! +""" +Data for creating a remote cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for creating a remote cluster connection +""" + queryPrefix: String +} + +type CreateRepositoryMutation { + repository: Repository! +} + +type CreateSavedQueryFromPackageTemplateMutation { + savedQuery: SavedQuery! +} + +input CreateSavedQueryInput { + name: String! + viewName: String! + queryString: String! + start: String + end: String + isLive: Boolean + widgetType: String + options: String + dashboardLinkInteractions: [DashboardLinkInteractionInput!] + customLinkInteractions: [CustomLinkInteractionInput!] + searchLinkInteractions: [SearchLinkInteractionInput!] + updateParametersInteractions: [UpdateParametersInteractionInput!] +} + +type CreateSavedQueryPayload { + savedQuery: SavedQuery! +} + +""" +Data for creating a scheduled report. +""" +input CreateScheduledReportInput { +""" +Data for creating a scheduled report. +""" + viewName: String! +""" +Data for creating a scheduled report. +""" + name: String! +""" +Data for creating a scheduled report. +""" + password: String +""" +Data for creating a scheduled report. +""" + enabled: Boolean! +""" +Data for creating a scheduled report. +""" + description: String! +""" +Data for creating a scheduled report. +""" + dashboardId: String! +""" +Data for creating a scheduled report. +""" + timeIntervalFrom: String +""" +Data for creating a scheduled report. +""" + schedule: CreateScheduledReportScheduleInput! +""" +Data for creating a scheduled report. +""" + labels: [String!]! +""" +Data for creating a scheduled report. +""" + parameters: [CreateScheduledReportParameterValueInput!]! +""" +Data for creating a scheduled report. +""" + recipients: [String!]! +""" +Data for creating a scheduled report. +""" + layout: CreateScheduledReportLayoutInput! +} + +""" +Layout of the scheduled report. +""" +input CreateScheduledReportLayoutInput { +""" +Layout of the scheduled report. +""" + paperSize: String! +""" +Layout of the scheduled report. +""" + paperOrientation: String! +""" +Layout of the scheduled report. +""" + paperLayout: String! +""" +Layout of the scheduled report. +""" + showDescription: Boolean! +""" +Layout of the scheduled report. +""" + showTitleFrontpage: Boolean! +""" +Layout of the scheduled report. +""" + showParameters: Boolean! +""" +Layout of the scheduled report. +""" + maxNumberOfRows: Int! +""" +Layout of the scheduled report. +""" + showTitleHeader: Boolean! +""" +Layout of the scheduled report. +""" + showExportDate: Boolean! +""" +Layout of the scheduled report. +""" + footerShowPageNumbers: Boolean! +} + +""" +List of parameter value configurations. +""" +input CreateScheduledReportParameterValueInput { +""" +List of parameter value configurations. +""" + id: String! +""" +List of parameter value configurations. +""" + value: String! +} + +""" +The schedule to run the report by. +""" +input CreateScheduledReportScheduleInput { +""" +The schedule to run the report by. +""" + cronExpression: String! +""" +The schedule to run the report by. +""" + timeZone: String! +""" +The schedule to run the report by. +""" + startDate: Long! +""" +The schedule to run the report by. +""" + endDate: Long +} + +""" +Data for creating a scheduled search +""" +input CreateScheduledSearch { +""" +Data for creating a scheduled search +""" + viewName: String! +""" +Data for creating a scheduled search +""" + name: String! +""" +Data for creating a scheduled search +""" + description: String +""" +Data for creating a scheduled search +""" + queryString: String! +""" +Data for creating a scheduled search +""" + queryStart: String! +""" +Data for creating a scheduled search +""" + queryEnd: String! +""" +Data for creating a scheduled search +""" + schedule: String! +""" +Data for creating a scheduled search +""" + timeZone: String! +""" +Data for creating a scheduled search +""" + backfillLimit: Int! +""" +Data for creating a scheduled search +""" + enabled: Boolean +""" +Data for creating a scheduled search +""" + actions: [String!]! +""" +Data for creating a scheduled search +""" + labels: [String!] +""" +Data for creating a scheduled search +""" + runAsUserId: String +""" +Data for creating a scheduled search +""" + queryOwnershipType: QueryOwnershipType +} + +""" +Data for creating a scheduled search from a yaml template. +""" +input CreateScheduledSearchFromTemplateInput { +""" +Data for creating a scheduled search from a yaml template. +""" + viewName: RepoOrViewName! +""" +Data for creating a scheduled search from a yaml template. +""" + name: String! +""" +Data for creating a scheduled search from a yaml template. +""" + yamlTemplate: YAML! +} + +input CreateSearchLinkInteractionInput { + path: String! + searchLinkInteractionInput: SearchLinkInteractionInput! +} + +""" +Data for creating a Slack action. +""" +input CreateSlackAction { +""" +Data for creating a Slack action. +""" + viewName: String! +""" +Data for creating a Slack action. +""" + name: String! +""" +Data for creating a Slack action. +""" + url: String! +""" +Data for creating a Slack action. +""" + fields: [SlackFieldEntryInput!]! +""" +Data for creating a Slack action. +""" + useProxy: Boolean! +} + +input CreateSystemPermissionTokenInput { + name: String! + expireAt: Long + ipFilterId: String + permissions: [SystemPermission!]! +} + +""" +Data for creating an upload file action. +""" +input CreateUploadFileAction { +""" +Data for creating an upload file action. +""" + viewName: String! +""" +Data for creating an upload file action. +""" + name: String! +""" +Data for creating an upload file action. +""" + fileName: String! +} + +""" +Data for creating a VictorOps action. +""" +input CreateVictorOpsAction { +""" +Data for creating a VictorOps action. +""" + viewName: String! +""" +Data for creating a VictorOps action. +""" + name: String! +""" +Data for creating a VictorOps action. +""" + messageType: String! +""" +Data for creating a VictorOps action. +""" + notifyUrl: String! +""" +Data for creating a VictorOps action. +""" + useProxy: Boolean! +} + +input CreateViewPermissionsTokenInput { + name: String! + expireAt: Long + ipFilterId: String + viewIds: [String!]! + permissions: [Permission!]! +} + +""" +Data for creating a webhook action. +""" +input CreateWebhookAction { +""" +Data for creating a webhook action. +""" + viewName: String! +""" +Data for creating a webhook action. +""" + name: String! +""" +Data for creating a webhook action. +""" + url: String! +""" +Data for creating a webhook action. +""" + method: String! +""" +Data for creating a webhook action. +""" + headers: [HttpHeaderEntryInput!]! +""" +Data for creating a webhook action. +""" + bodyTemplate: String! +""" +Data for creating a webhook action. +""" + ignoreSSL: Boolean! +""" +Data for creating a webhook action. +""" + useProxy: Boolean! +} + +input CustomLinkInteractionInput { + name: String! + titleTemplate: String + urlTemplate: String! + openInNewTab: Boolean! + urlEncodeArgs: Boolean + fieldInteractionConditions: [FieldInteractionConditionInput!] +} + +input DashboardLinkInteractionInput { + name: String! + titleTemplate: String + arguments: [ArgumentInput!]! + dashboardId: String + dashboardName: String + dashboardRepoOrViewName: RepoOrViewName + packageSpecifier: UnversionedPackageSpecifier + openInNewTab: Boolean! + useWidgetTimeWindow: Boolean! + fieldInteractionConditions: [FieldInteractionConditionInput!] +} + +""" +The frequency at which a dashboard updates its results. +""" +enum DashboardUpdateFrequency { + RealTime + Never +} + +input DashboardUpdateFrequencyInput { + updateFrequencyType: DashboardUpdateFrequency! +} + +""" +Data for deleting an action. +""" +input DeleteAction { +""" +Data for deleting an action. +""" + viewName: String! +""" +Data for deleting an action. +""" + id: String! +} + +""" +Data for deleting an aggregate alert. +""" +input DeleteAggregateAlert { +""" +Data for deleting an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for deleting an aggregate alert. +""" + id: String! +} + +""" +Data for deleting an alert +""" +input DeleteAlert { +""" +Data for deleting an alert +""" + viewName: String! +""" +Data for deleting an alert +""" + id: String! +} + +""" +Data for deleting a cluster connection +""" +input DeleteClusterConnectionInput { +""" +Data for deleting a cluster connection +""" + multiClusterViewName: String! +""" +Data for deleting a cluster connection +""" + connectionId: String! +} + +input DeleteDashboardInput { + id: String! +} + +""" +The data for deleting a dashboard +""" +input DeleteDashboardInputV2 { +""" +The data for deleting a dashboard +""" + viewId: String! +""" +The data for deleting a dashboard +""" + dashboardId: String! +} + +type DeleteDashboardMutation { + dashboard: Dashboard! +} + +""" +Data for deleting an event forwarder +""" +input DeleteEventForwarderInput { +""" +Data for deleting an event forwarder +""" + id: String! +} + +""" +Data for deleting an event forwarding rule +""" +input DeleteEventForwardingRule { +""" +Data for deleting an event forwarding rule +""" + repoName: String! +""" +Data for deleting an event forwarding rule +""" + id: String! +} + +""" +Data for deleting an FDR feed +""" +input DeleteFdrFeed { +""" +Data for deleting an FDR feed +""" + repositoryName: String! +""" +Data for deleting an FDR feed +""" + id: String! +} + +input DeleteFieldAliasSchema { + schemaId: String! +} + +""" +Data for deleting a filter alert +""" +input DeleteFilterAlert { +""" +Data for deleting a filter alert +""" + viewName: RepoOrViewName! +""" +Data for deleting a filter alert +""" + id: String! +} + +""" +Data for deleting an ingest feed +""" +input DeleteIngestFeed { +""" +Data for deleting an ingest feed +""" + repositoryName: RepoOrViewName! +""" +Data for deleting an ingest feed +""" + id: String! +} + +input DeleteInteractionInput { + path: String! + id: String! +} + +input DeleteParserInput { + id: String! + repositoryName: RepoOrViewName! +} + +input DeleteSavedQueryInput { + id: String! + viewName: String! +} + +""" +Data for deleting a scheduled report. +""" +input DeleteScheduledReportInput { +""" +Data for deleting a scheduled report. +""" + viewName: String! +""" +Data for deleting a scheduled report. +""" + id: String! +} + +""" +Data for deleting a scheduled search +""" +input DeleteScheduledSearch { +""" +Data for deleting a scheduled search +""" + viewName: String! +""" +Data for deleting a scheduled search +""" + id: String! +} + +input DeleteSearchDomainByIdInput { + id: String! + deleteMessage: String +} + +""" +Data for disabling an aggregate alert. +""" +input DisableAggregateAlert { +""" +Data for disabling an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for disabling an aggregate alert. +""" + id: String! +} + +""" +Data for disabling an alert +""" +input DisableAlert { +""" +Data for disabling an alert +""" + viewName: RepoOrViewName! +""" +Data for disabling an alert +""" + id: String! +} + +""" +Data for disabling an event forwarder +""" +input DisableEventForwarderInput { +""" +Data for disabling an event forwarder +""" + id: String! +} + +input DisableFieldAliasSchemaOnOrgInput { + schemaId: String! +} + +input DisableFieldAliasSchemaOnViewInput { + viewName: String! + schemaId: String! +} + +""" +Data for disabling a filter alert +""" +input DisableFilterAlert { +""" +Data for disabling a filter alert +""" + viewName: RepoOrViewName! +""" +Data for disabling a filter alert +""" + id: String! +} + +""" +Data for disabling access to IOCs (indicators of compromise) for an organization +""" +input DisableOrganizationIocAccess { +""" +Data for disabling access to IOCs (indicators of compromise) for an organization +""" + organizationId: String! +} + +""" +Data for disabling a scheduled report. +""" +input DisableScheduledReportInput { +""" +Data for disabling a scheduled report. +""" + viewName: String! +""" +Data for disabling a scheduled report. +""" + id: String! +} + +""" +Data for disabling a scheduled search +""" +input DisableStarScheduledSearch { +""" +Data for disabling a scheduled search +""" + viewName: String! +""" +Data for disabling a scheduled search +""" + id: String! +} + +input DynamicConfigInputObject { + config: DynamicConfig! + value: String! +} + +""" +An email action. +""" +type EmailAction implements Action{ +""" +List of email addresses to send an email to. +""" + recipients: [String!]! +""" +Subject of the email. Can be templated with values from the result. +""" + subjectTemplate: String +""" +Body of the email. Can be templated with values from the result. +""" + bodyTemplate: String +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +Whether the result set should be be attached as a CSV file. +""" + attachCsv: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +Data for enabling an aggregate alert. +""" +input EnableAggregateAlert { +""" +Data for enabling an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for enabling an aggregate alert. +""" + id: String! +} + +""" +Data for enabling an alert +""" +input EnableAlert { +""" +Data for enabling an alert +""" + viewName: RepoOrViewName! +""" +Data for enabling an alert +""" + id: String! +} + +""" +Data for enabling an event forwarder +""" +input EnableEventForwarderInput { +""" +Data for enabling an event forwarder +""" + id: String! +} + +input EnableFieldAliasSchemaOnOrgInput { + schemaId: String! +} + +input EnableFieldAliasSchemaOnViewsInput { + viewNames: [String!]! + schemaId: String! +} + +""" +Data for enabling a filter alert +""" +input EnableFilterAlert { +""" +Data for enabling a filter alert +""" + viewName: RepoOrViewName! +""" +Data for enabling a filter alert +""" + id: String! +} + +""" +Data for enabling access to IOCs (indicators of compromise) for an organization +""" +input EnableOrganizationIocAccess { +""" +Data for enabling access to IOCs (indicators of compromise) for an organization +""" + organizationId: String! +} + +""" +Data for enabling a scheduled report. +""" +input EnableScheduledReportInput { +""" +Data for enabling a scheduled report. +""" + viewName: String! +""" +Data for enabling a scheduled report. +""" + id: String! +} + +""" +Data for enabling a scheduled search +""" +input EnableStarScheduledSearch { +""" +Data for enabling a scheduled search +""" + viewName: String! +""" +Data for enabling a scheduled search +""" + id: String! +} + +input EnableWorkerQueryTracingInputType { + quotaKey: String! + expiry: DateTime! +} + +""" +Enable or disable language restrictions +""" +input EnabledInput { +""" +Enable or disable language restrictions +""" + version: LanguageVersionEnum! +""" +Enable or disable language restrictions +""" + enabled: Boolean! +} + +input EnforceSubdomainsInput { + enforce: Boolean! +} + +""" +Information about an enrolled collector +""" +type EnrolledCollector { + id: String! + configId: String + machineId: String! +} + +""" +Enterprise only authentication. +""" +type EnterpriseOnlyAuthentication implements AuthenticationMethod{ + name: String! +} + +""" +A single field in an event with a name and a value +""" +type EventField { +""" +The name of the field +""" + fieldName: String! +""" +The value of the field +""" + value: String! +} + +""" +A single field in an event with a key and a value +""" +type Field { +""" +The key of the field +""" + key: String! +""" +The value of the field +""" + value: String! +} + +input FieldConfigurationInput { + viewId: String! + fieldName: String! + json: JSON! +} + +""" +Assertion results can be uniquely identified by the output event index and the field name they operate on. So if the same field on the same event has multiple assertions attached, this failure is produced. +""" +type FieldHadConflictingAssertions { +""" +Field being asserted on. +""" + fieldName: String! +} + +""" +An assertion was made that a field had some value, and this assertion failed due to an unexpected value for the field. +""" +type FieldHadUnexpectedValue { +""" +Field being asserted on. +""" + fieldName: String! +""" +Value that was asserted to be contained in the field. +""" + expectedValue: String! +""" +The actual value of the field. Note that this is null in the case where the field wasn't present at all. +""" + actualValue: String +} + +""" +Asserts that a given field has an expected value after having been parsed. +""" +input FieldHasValueInput { +""" +Asserts that a given field has an expected value after having been parsed. +""" + fieldName: String! +""" +Asserts that a given field has an expected value after having been parsed. +""" + expectedValue: String! +} + +input FieldInteractionConditionInput { + fieldName: String! + operator: FieldConditionOperatorType! + argument: String! +} + +""" +An assertion was made that a field should not be present, and this assertion failed. +""" +type FieldUnexpectedlyPresent { +""" +Field being asserted on. +""" + fieldName: String! +""" +The value that the field contained. +""" + actualValue: String! +} + +""" +A dashboard parameter where suggestions are taken from uploaded files. +""" +type FileDashboardParameter implements DashboardParameter{ +""" +The name of the file to perform lookups in. +""" + fileName: String! +""" +The column where the value of suggestions are taken from, +""" + valueColumn: String! +""" +The column where the label of suggestions are taken from, +""" + labelColumn: String +""" +Fields and values, where an entry in a file must match one of the given values for each field. +""" + valueFilters: [FileParameterValueFilter!]! +""" +Regex patterns used to block parameter input. +""" + invalidInputPatterns: [String!] +""" +Message when parameter input is blocked. +""" + invalidInputMessage: String +""" +The ID of the parameter. +""" + id: String! +""" +The label or 'name' displayed next to the input for the variable to make it more human-readable. +""" + label: String! +""" +The value assigned to the parameter on dashboard load, if no other value is specified. +""" + defaultValueV2: String +""" +A number that determines the order in which parameters are displayed on a dashboard. If null, the parameter is ordered after other parameters in alphanumerical order. +""" + order: Int +""" +A number that determines the width of a parameter. +""" + width: Int +""" +[PREVIEW: The multi-value parameters feature is still in development.] A flag indicating whether the parameter supports having multiple values +""" + isMultiParam: Boolean +""" +[PREVIEW: The multi-value parameters feature is still in development.] The value assigned to the multi-value parameter on dashboard load, if no other value is specified. This replaces defaultValue whenever isMultiParam is true +""" + defaultMultiValues: [String!] +} + +""" +A filter to reduce entries from files down to those with a matching value in the field. +""" +type FileParameterValueFilter { + field: String! + values: [String!]! +} + +input FilterInput { + id: String! + name: String! + prefix: String! +} + +""" +A dashboard parameter with a fixed list of values to select from. +""" +type FixedListDashboardParameter implements DashboardParameter{ + values: [FixedListParameterOption!]! +""" +The ID of the parameter. +""" + id: String! +""" +The label or 'name' displayed next to the input for the variable to make it more human-readable. +""" + label: String! +""" +The value assigned to the parameter on dashboard load, if no other value is specified. +""" + defaultValueV2: String +""" +A number that determines the order in which parameters are displayed on a dashboard. If null, the parameter is ordered after other parameters in alphanumerical order. +""" + order: Int +""" +A number that determines the width of a parameter. +""" + width: Int +""" +[PREVIEW: The multi-value parameters feature is still in development.] A flag indicating whether the parameter supports having multiple values +""" + isMultiParam: Boolean +""" +[PREVIEW: The multi-value parameters feature is still in development.] The value assigned to the multi-value parameter on dashboard load, if no other value is specified. This replaces defaultValue whenever isMultiParam is true +""" + defaultMultiValues: [String!] +} + +""" +An option in a fixed list parameter. +""" +type FixedListParameterOption { + label: String! + value: String! +} + +type FleetConfigurationTest { + collectorIds: [String!]! + configId: String! +} + +""" +A dashboard parameter without restrictions or suggestions. +""" +type FreeTextDashboardParameter implements DashboardParameter{ +""" +Regex patterns used to block parameter input. +""" + invalidInputPatterns: [String!] +""" +Message when parameter input is blocked. +""" + invalidInputMessage: String +""" +The ID of the parameter. +""" + id: String! +""" +The label or 'name' displayed next to the input for the variable to make it more human-readable. +""" + label: String! +""" +The value assigned to the parameter on dashboard load, if no other value is specified. +""" + defaultValueV2: String +""" +A number that determines the order in which parameters are displayed on a dashboard. If null, the parameter is ordered after other parameters in alphanumerical order. +""" + order: Int +""" +A number that determines the width of a parameter. +""" + width: Int +""" +[PREVIEW: The multi-value parameters feature is still in development.] A flag indicating whether the parameter supports having multiple values +""" + isMultiParam: Boolean +""" +[PREVIEW: The multi-value parameters feature is still in development.] The value assigned to the multi-value parameter on dashboard load, if no other value is specified. This replaces defaultValue whenever isMultiParam is true +""" + defaultMultiValues: [String!] +} + +""" +Input list of function names +""" +input FunctionListInput { +""" +Input list of function names +""" + version: LanguageVersionEnum! +""" +Input list of function names +""" + functions: [String!]! +} + +""" +The organization management roles of the group. +""" +type GroupOrganizationManagementRole { + role: Role! +} + +input GroupRoleAssignment { + groupId: String! + roleId: String! +} + +""" +A http request header. +""" +type HttpHeaderEntry { +""" +Key of a http(s) header. +""" + header: String! +""" +Value of a http(s) header. +""" + value: String! +} + +""" +Http(s) Header entry. +""" +input HttpHeaderEntryInput { +""" +Http(s) Header entry. +""" + header: String! +""" +Http(s) Header entry. +""" + value: String! +} + +""" +A LogScale repository action. +""" +type HumioRepoAction implements Action{ +""" +Humio ingest token for the dataspace that the action should ingest into. +""" + ingestToken: String! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input IPFilterIdInput { + id: String! +} + +input IPFilterInput { + name: String! + ipFilter: String! +} + +input IPFilterUpdateInput { + id: String! + name: String + ipFilter: String +} + +type Ignored implements contractual{ + includeUsage: Boolean! +} + +""" +How to authenticate to AWS. +""" +input IngestFeedAwsAuthenticationInput { +""" +How to authenticate to AWS. +""" + kind: IngestFeedAwsAuthenticationKind! +""" +How to authenticate to AWS. +""" + roleArn: String +} + +""" +The kind of AWS authentication to use. +""" +enum IngestFeedAwsAuthenticationKind { +""" +IAM role authentication +""" + IamRole +} + +""" +The preprocessing to apply to an ingest feed before parsing. +""" +input IngestFeedPreprocessingInput { +""" +The preprocessing to apply to an ingest feed before parsing. +""" + kind: IngestFeedPreprocessingKind! +} + +input IngestPartitionInput { + id: Int! + nodeIds: [Int!]! +} + +input InputData { + id: String! +} + +input InputDictionaryEntry { + key: String! + value: String! +} + +input InstallPackageFromRegistryInput { + viewName: RepoOrViewName! + packageId: VersionedPackageSpecifier! + queryOwnershipType: QueryOwnershipType +} + +type InstallPackageFromRegistryResult { + package: Package2! +} + +type InstallPackageFromZipResult { + wasSuccessful: Boolean! +} + +type InteractionId { + id: String! +} + +""" +A Kafka event forwarder +""" +type KafkaEventForwarder implements EventForwarder{ +""" +The Kafka topic the events should be forwarded to +""" + topic: String! +""" +The Kafka producer configuration used to forward events in the form of properties (x.y.z=abc). See https://library.humio.com/humio-server/ingesting-data-event-forwarders.html#kafka-configuration. +""" + properties: String! +""" +Id of the event forwarder +""" + id: String! +""" +Name of the event forwarder +""" + name: String! +""" +Description of the event forwarder +""" + description: String! +""" +Is the event forwarder enabled +""" + enabled: Boolean! +} + +""" +Defines how the external function is executed. +""" +input KindInput { +""" +Defines how the external function is executed. +""" + name: KindEnum! +""" +Defines how the external function is executed. +""" + parametersDefiningKeyFields: [String!] +""" +Defines how the external function is executed. +""" + fixedKeyFields: [String!] +} + +type Limited implements contractual{ + limit: Long! + includeUsage: Boolean! +} + +input LinkInput { + name: String! + token: String! +} + +""" +A widget that lists links to other dashboards. +""" +type LinkWidget implements Widget{ + labels: [String!]! + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! +} + +""" +A local cluster connection. +""" +type LocalClusterConnection implements ClusterConnection{ +""" +Id of the local view to connect with +""" + targetViewId: String! +""" +Name of the local view to connect with +""" + targetViewName: RepoOrViewName! + targetViewType: LocalTargetType! +""" +Id of the connection +""" + id: String! +""" +Cluster identity of the connection +""" + clusterId: String! +""" +Cluster connection tags +""" + tags: [ClusterConnectionTag!]! +""" +Cluster connection query prefix +""" + queryPrefix: String! +} + +""" +Indicates whether the target of a local cluster connection is a view or a repo +""" +enum LocalTargetType { + View + Repo +} + +input LoginBridgeInput { + name: String! + description: String! + issuer: String! + remoteId: String! + loginUrl: String! + relayStateUrl: String! + samlEntityId: String! + privateSamlCertificate: String! + publicSamlCertificate: String! + allowedUsers: [String!]! + groupAttribute: String! + groups: [String!]! + organizationIdAttributeName: String! + additionalAttributes: String + organizationNameAttribute: String + generateUserName: Boolean! + termsDescription: String! + termsLink: String! +} + +input LoginBridgeUpdateInput { + name: String + description: String + issuer: String + remoteId: String + loginUrl: String + relayStateUrl: String + samlEntityId: String + privateSamlCertificate: String + publicSamlCertificate: String + allowedUsers: [String!] + groupAttribute: String + groups: [String!] + organizationIdAttributeName: String + additionalAttributes: String + organizationNameAttribute: String + generateUserName: Boolean + termsDescription: String + termsLink: String +} + +input MarkLimitDeletedInput { + limitName: String! + deleted: Boolean! +} + +enum MergeStrategy { + Theirs + Ours +} + +input MigrateLimitsInput { + createLogLimit: Boolean! + defaultLimit: String +} + +type Mutation { +""" +[PREVIEW: Feature still in development] Will clear the search limit and excluded repository making future searches done on this view behave normally, i.e. having no search time-limit applied +""" + ClearSearchLimitForSearchDomain( +""" +Data for clearing the search limit on a search domain. +""" + input: ClearSearchLimitForSearchDomain! + ): View! +""" +[PREVIEW: Feature still in development] Will update search limit, which will restrict future searches to the specified limit, a list of repository names can be supplied and will not be restricted by this limit. +""" + SetSearchLimitForSearchDomain( +""" +Data for updating search limit on a search domain. +""" + input: SetSearchLimitForSearchDomain! + ): View! +""" +Client accepts LogScale's Terms and Conditions without providing any additional info +""" + acceptTermsAndConditions: Account! +""" +Activates a user account supplying additional personal info. By activating the account the client accepts LogScale's Terms and Conditions: https://www.humio.com/terms-and-conditions +""" + activateAccount( +""" +The first name of the user. +""" + firstName: String! +""" +The last name of the user. +""" + lastName: String! +""" +The email address of the user. +""" + email: String! +""" +The name of company the user represents or is associated with. +""" + company: String! +""" +The two letter ISO 3166-1 Alpha-2 country code for the country where the company is located. +""" + countryCode: String! +""" +Optional country subdivision following ISO 3166-2. +""" + stateCode: String +""" +Optional zip code. Required for community mode. +""" + zip: String +""" +Optional phone number. Required for community mode. +""" + phoneNumber: String + utmParams: UtmParams + ): Account! +""" +Add a label to an alert. +""" + addAlertLabelV2( +""" +Data for adding a label to an alert +""" + input: AddAlertLabel! + ): Alert! +""" +Add a new filter to a dashboard's list of filters. +""" + addDashboardFilter( + name: String! + prefixFilter: String! + id: String! + searchDomainName: String! + ): Dashboard! +""" +Add a label to a dashboard. +""" + addDashboardLabel( + id: String! + label: String! + ): Dashboard! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Adds a field alias mapping to an existing schema. Returns the ID of the alias mapping if created successfully. +""" + addFieldAliasMapping( + input: AddAliasMappingInput! + ): String! +""" +[PREVIEW: Internal testing.] Enable functions for use with specified language version. +""" + addFunctionsToAllowList( + input: FunctionListInput! + ): Boolean! +""" +Creates a new group. +""" + addGroup( + displayName: String! + lookupName: String + ): AddGroupMutation! +""" +Create a new Ingest API Token. +""" + addIngestTokenV3( + input: AddIngestTokenV3Input! + ): IngestToken! +""" +Add a Limit to the given organization +""" + addLimit( + input: AddLimitInput! + ): Boolean! +""" +Add a Limit to the given organization +""" + addLimitV2( + input: AddLimitV2Input! + ): LimitV2! + addLoginBridgeAllowedUsers( + userID: String! + ): LoginBridge! +""" +Add or update default Query Quota Settings +""" + addOrUpdateQueryQuotaDefaultSettings( + input: QueryQuotaDefaultSettingsInput! + ): QueryQuotaDefaultSettings! +""" +Add or update existing Query Quota User Settings +""" + addOrUpdateQueryQuotaUserSettings( + input: QueryQuotaUserSettingsInput! + ): QueryQuotaUserSettings! +""" +Adds a query to the list of recent queries. The query is a JSON encoded query and visualization structure produced by the UI. +""" + addRecentQuery( + input: AddRecentQueryInput! + ): AddRecentQuery! +""" +Add a label to a scheduled search. +""" + addScheduledSearchLabel( +""" +Data for adding a label to a scheduled search +""" + input: AddLabelScheduledSearch! + ): ScheduledSearch! +""" +Add a star to an alert. +""" + addStarToAlertV2( +""" +Data for adding a star to an alert +""" + input: AddStarToAlert! + ): Alert! +""" +Add a star to a dashboard. +""" + addStarToDashboard( + id: String! + ): Dashboard! + addStarToField( + input: AddStarToFieldInput! + ): AddStarToFieldMutation! +""" +Add a star to a scheduled search. +""" + addStarToScheduledSearch( +""" +Data for adding a star to a scheduled search +""" + input: AddStarScheduledSearch! + ): ScheduledSearch! +""" +Add a star to a repository or view. +""" + addStarToSearchDomain( + name: String! + ): SearchDomain! +""" +[PREVIEW: Requires the feature enabled for the organization.] Adds a subdomain to the organization. Becomes primary subdomain if no primary has been set, and secondary otherwise +""" + addSubdomain( + input: AddSubdomainInput! + ): Organization! +""" +Blocklist a query based on a pattern based on a regex or exact match. +""" + addToBlocklist( +""" +Data for adding to the blocklist +""" + input: AddToBlocklistInput! + ): [BlockedQuery!]! +""" +Blocklist a query based on a pattern based on a regex or exact match. +""" + addToBlocklistById( +""" +Data for adding to the blocklist +""" + input: AddToBlocklistByIdInput! + ): [BlockedQuery!]! +""" +[PREVIEW: Under development] +""" + addToLogCollectorConfigurationTest( + configId: String! + collectorIds: [String!]! + ): FleetConfigurationTest! +""" +Add or invite a user. Calling this with an invitation token, will activate the account. By activating the account the client accepts LogScale's Terms and Conditions: https://www.humio.com/terms-and-conditions +""" + addUserV2( + input: AddUserInputV2! + ): userOrPendingUser! +""" +Adds users to an existing group. +""" + addUsersToGroup( + input: AddUsersToGroupInput! + ): AddUsersToGroupMutation! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Assigns asset permissions to group. Unassignment can be done by providing an empty list of asset permissions for an asset +""" + assignAssetPermissionsToGroup( + input: AssignAssetPermissionsToGroupInputType! + ): Group! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Assigns asset permissions to user. Unassignment can be done by providing an empty list of asset permissions for an asset +""" + assignAssetPermissionsToUser( + input: AssignAssetPermissionsToUserInputType! + ): User! +""" +[PREVIEW: Under development] +""" + assignLogCollectorConfiguration( + configId: String + id: String! + ): Boolean! +""" +[PREVIEW: Under development] +""" + assignLogCollectorsToConfiguration( + configId: String + ids: [String!] + ): [EnrolledCollector!]! +""" +[PREVIEW: Experimental feature to allow assigning permissions to manage a subset of organizations.] Assigns an organization management role to a group for the provided organizations. +""" + assignOrganizationManagementRoleToGroup( + input: AssignOrganizationManagementRoleToGroupInput! + ): AssignOrganizationManagementRoleToGroupMutation! +""" +[PREVIEW: No note] Assigns a organization role to a group. +""" + assignOrganizationRoleToGroup( + input: AssignOrganizationRoleToGroupInput! + ): AssignOrganizationRoleToGroupMutation! +""" +Assign an ingest token to be associated with a parser. +""" + assignParserToIngestTokenV2( + input: AssignParserToIngestTokenInputV2! + ): IngestToken! +""" +Assigns a role to a group for a given view. If called with overrideExistingAssignmentsForView=false, this mutation can assign multiple roles for the same view. Calling with overrideExistingAssignmentsForView=false is thus only available if the MultipleViewRoleBindings feature is enabled. +""" + assignRoleToGroup( + input: AssignRoleToGroupInput! + ): AssignRoleToGroupMutation! +""" +Assigns a system role to a group. +""" + assignSystemRoleToGroup( + input: AssignSystemRoleToGroupInput! + ): AssignSystemRoleToGroupMutation! +""" +Assign node tasks. This is not a replacement, but will add to the existing assigned node tasks. Returns the set of assigned tasks after the assign operation has completed. +""" + assignTasks( +""" +ID of the node to assign node tasks to. +""" + nodeID: Int! +""" +List of tasks to assign. +""" + tasks: [NodeTaskEnum!]! + ): [NodeTaskEnum!]! +""" +[PREVIEW: This mutation is dependent on the MultipleViewRoleBindings feature being enabled.] Assigns roles for the user in the search domain. This mutation allows assigning multiple roles for the same view and is thus dependent on the MultipleViewRoleBindings feature being enabled. +""" + assignUserRolesInSearchDomain( + input: AssignUserRolesInSearchDomainInput! + ): [User!]! +""" +Batch update query ownership to run queries on behalf of the organization for triggers and shared dashboards. +""" + batchUpdateQueryOwnership( + input: BatchUpdateQueryOwnershipInput! + ): Boolean! +""" +Block ingest to the specified repository for a number of seconds (at most 1 year) into the future +""" + blockIngest( + repositoryName: String! + seconds: Int! + ): BlockIngestMutation! +""" +Set whether the organization is blocking ingest and dataspaces are pausing ingest +""" + blockIngestOnOrg( + input: BlockIngestOnOrgInput! + ): Organization! +""" +Cancel a previously submitted redaction. Returns true if the redaction was cancelled, false otherwise. Cancellation is best effort. If some events have already been redacted, they are not restored. +""" + cancelRedactEvents( + input: CancelRedactEventsInput! + ): Boolean! + changeUserAndGroupRolesForSearchDomain( + searchDomainId: String! + groups: [GroupRoleAssignment!]! + users: [UserRoleAssignment!]! + ): [UserOrGroup!]! +""" +Set CID of provisioned organization +""" + clearCid: Organization! +""" +Clear the error status on an aggregate alert. The status will be updated if the error reoccurs. +""" + clearErrorOnAggregateAlert( +""" +Data for clearing the error on an aggregate alert. +""" + input: ClearErrorOnAggregateAlertInput! + ): AggregateAlert! +""" +Clear the error status on an alert. The status will be updated if the error reoccurs. +""" + clearErrorOnAlert( +""" +Data for clearing the error on an alert +""" + input: ClearErrorOnAlertInput! + ): Alert! +""" +Clear the error status on a filter alert. The status will be updated if the error reoccurs. +""" + clearErrorOnFilterAlert( +""" +Data for clearing the error on a filter alert +""" + input: ClearErrorOnFilterAlertInput! + ): FilterAlert! +""" +Clear the error status on a scheduled search. The status will be updated if the error reoccurs. +""" + clearErrorOnScheduledSearch( +""" +Data for clearing the error on a scheduled search +""" + input: ClearErrorOnScheduledSearchInput! + ): ScheduledSearch! +""" +Clears UI configurations for all fields for the current user +""" + clearFieldConfigurations( + input: ClearFieldConfigurationsInput! + ): Boolean! +""" +Clear recent queries for current user on a given view or repository. +""" + clearRecentQueries( + input: ClearRecentQueriesInput! + ): Boolean! +""" +Create a clone of an existing parser. +""" + cloneParser( + input: CloneParserInput! + ): Parser! +""" +Unregisters a node from the cluster. +""" + clusterUnregisterNode( +""" +Force removal of the node. I hope you know what you are doing! +""" + force: Boolean! +""" +ID of the node to unregister. +""" + nodeID: Int! + ): UnregisterNodeMutation! +""" +Create a clone of a dashboard. +""" + copyDashboard( + id: String! +""" +The name of the repository or view where the dashboard to be copied to. +""" + targetSearchDomainName: String +""" +The name of the repository or view where the dashboard to be copied from. +""" + sourceSearchDomainName: String! +""" +The name the copied dashboard should have. +""" + name: String! + ): CopyDashboardMutation! +""" +Create an action from a package action template. +""" + createActionFromPackageTemplate( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +The id of the package to fetch the action template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the action template in the package. +""" + actionTemplateName: String! +""" +The name of the new action to create. +""" + overrideName: String + ): CreateActionFromPackageTemplateMutation! +""" +Create an action from yaml template +""" + createActionFromTemplate( +""" +Data for creating an action from a yaml template +""" + input: CreateActionFromTemplateInput! + ): Action! +""" +Create an aggregate alert. +""" + createAggregateAlert( +""" +Data for creating an aggregate alert. +""" + input: CreateAggregateAlert! + ): AggregateAlert! +""" +Create an alert. +""" + createAlert( +""" +Data for creating an alert +""" + input: CreateAlert! + ): Alert! +""" +Create an alert from a package alert template. +""" + createAlertFromPackageTemplate( +""" +The name of the view or repo the package is installed in. +""" + searchDomainName: String! +""" +The id of the package to fetch the alert template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the alert template in the package. +""" + alertTemplateName: String! +""" +The name of the new alert to create. +""" + alertName: String! + ): CreateAlertFromPackageTemplateMutation! +""" +Create an alert from yaml template +""" + createAlertFromTemplate( +""" +Data for creating an alert from a yaml template +""" + input: CreateAlertFromTemplateInput! + ): Alert! +""" +Create an ingest feed that uses AWS S3 and SQS +""" + createAwsS3SqsIngestFeed( +""" +Data for creating an ingest feed that uses AWS S3 and SQS +""" + input: CreateAwsS3SqsIngestFeed! + ): IngestFeed! +""" +[PREVIEW: in development.] Create a custom link interaction. +""" + createCustomLinkInteraction( + input: CreateCustomLinkInteractionInput! + ): InteractionId! +""" +Create a dashboard. +""" + createDashboard( + input: CreateDashboardInput! + ): CreateDashboardMutation! +""" +Create a dashboard from a package dashboard template. +""" + createDashboardFromPackageTemplate( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +The id of the package to fetch the dashboard template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the dashboard template in the package. +""" + dashboardTemplateName: String! +""" +The name of the new dashboard to create. +""" + overrideName: String + ): CreateDashboardFromPackageTemplateMutation! +""" +Create a dashboard from a yaml specification. +""" + createDashboardFromTemplateV2( +""" +Data for creating a dashboard from a yaml specification. +""" + input: CreateDashboardFromTemplateV2Input! + ): Dashboard! +""" +[PREVIEW: in development.] Create a dashboard link interaction. +""" + createDashboardLinkInteraction( + input: CreateDashboardLinkInteractionInput! + ): InteractionId! +""" +Gets or create a new demo data view. +""" + createDemoDataRepository( + demoDataType: String! + ): Repository! +""" +Create an email action. +""" + createEmailAction( +""" +Data for creating an email action +""" + input: CreateEmailAction! + ): EmailAction! +""" +Create an organization. Root operation. +""" + createEmptyOrganization( + name: String! + description: String + organizationId: String + subdomain: String + cid: String + ): Organization! +""" +Create an event forwarding rule on a repository and return it +""" + createEventForwardingRule( +""" +Data for creating an event forwarding rule +""" + input: CreateEventForwardingRule! + ): EventForwardingRule! +""" +Create an FDR feed +""" + createFdrFeed( +""" +Data for creating an FDR feed +""" + input: CreateFdrFeed! + ): FdrFeed! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Creates a schema. If another schema already exists with the same name, then this overwrites it. +""" + createFieldAliasSchema( + input: CreateFieldAliasSchemaInput! + ): FieldAliasSchema! +""" +Create a filter alert. +""" + createFilterAlert( +""" +Data for creating a filter alert +""" + input: CreateFilterAlert! + ): FilterAlert! +""" +[PREVIEW: Under development] +""" + createFleetInstallToken( + name: String! + configId: String + ): FleetInstallationToken! +""" +Create a LogScale repository action. +""" + createHumioRepoAction( +""" +Data for creating a LogScale repository action +""" + input: CreateHumioRepoAction! + ): HumioRepoAction! +""" +Create a new IP filter. +""" + createIPFilter( + input: IPFilterInput! + ): IPFilter! +""" +Create a new ingest listener. +""" + createIngestListenerV3( + input: CreateIngestListenerV3Input! + ): IngestListener! +""" +Create a Kafka event forwarder and return it +""" + createKafkaEventForwarder( +""" +Data for creating a Kafka event forwarder +""" + input: CreateKafkaEventForwarder! + ): KafkaEventForwarder! +""" +[PREVIEW: Experimental feature, not ready for production.] Create a cluster connection to a local view. +""" + createLocalClusterConnection( +""" +Data for creating a local multi-cluster connection +""" + input: CreateLocalClusterConnectionInput! + ): LocalClusterConnection! +""" +[PREVIEW: Under development] Creates a log collector configuration. +""" + createLogCollectorConfiguration( + name: String! + draft: String + ): LogCollectorConfiguration! +""" +[PREVIEW: Under development] +""" + createLogCollectorGroup( + name: String! + filter: String + configIds: [String!] + ): LogCollectorGroup! +""" +Create a lookup file from a package lookup file template. +""" + createLookupFileFromPackageTemplate( +""" +The name of the view the package is installed in. +""" + viewName: RepoOrViewName! +""" +The id of the package to fetch the lookup file template from. +""" + packageId: VersionedPackageSpecifier! +""" +The filename of the lookup file template in the package. +""" + lookupFileTemplateName: String! +""" +The name of the new lookup file to create. +""" + overrideName: String + ): FileNameAndPath! +""" +Create an OpsGenie action. +""" + createOpsGenieAction( +""" +Data for creating an OpsGenie action +""" + input: CreateOpsGenieAction! + ): OpsGenieAction! +""" +[PREVIEW: Feature still in development] +""" + createOrUpdateCrossOrganizationView( + name: String! + limitIds: [String!]! + filter: String + repoFilters: [RepoFilterInput!] + ): View! +""" +[PREVIEW: Experimental prototype not ready for production use] Creates or updates an external function specification. +""" + createOrUpdateExternalFunction( + input: CreateOrUpdateExternalFunctionInput! + ): ExternalFunctionSpecificationOutput! +""" +Create a organization permissions token for organizational-level access. +""" + createOrganizationPermissionsToken( + input: CreateOrganizationPermissionTokenInput! + ): String! +""" +Create a metric view, usage view and log view for each organization. (Root operation) +""" + createOrganizationsViews( + includeDebugView: Boolean + specificOrganization: String + ): Boolean! +""" +Create a PagerDuty action. +""" + createPagerDutyAction( +""" +Data for creating a PagerDuty action. +""" + input: CreatePagerDutyAction! + ): PagerDutyAction! +""" +Create a parser. +""" + createParser( + input: CreateParserInput! + ): CreateParserMutation! +""" +Create a parser from a package parser template. +""" + createParserFromPackageTemplate( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +The id of the package to fetch the parser template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the parser template in the package. +""" + parserTemplateName: String! +""" +The name of the new parser to create. +""" + overrideName: String + ): CreateParserFromPackageTemplateMutation! +""" +Create a parser from a yaml specification +""" + createParserFromTemplate( +""" +Data for creating a parser from a yaml template +""" + input: CreateParserFromTemplateInput! + ): Parser! +""" +Create a parser. +""" + createParserV2( + input: CreateParserInputV2! + ): Parser! +""" +Create a personal user token for the user. It will inherit the same permissions as the user. +""" + createPersonalUserToken( + input: CreatePersonalUserTokenInput! + ): String! +""" +Create a new sharable link to a dashboard. +""" + createReadonlyToken( + id: String! + name: String! + ipFilterId: String +""" +Ownership of the queries run by this shared dashboard. If value is User, ownership wil be based the calling user +""" + queryOwnershipType: QueryOwnershipType + ): DashboardLink! +""" +[PREVIEW: Experimental feature, not ready for production.] Create a cluster connection to a remote view. +""" + createRemoteClusterConnection( +""" +Data for creating a remote cluster connection +""" + input: CreateRemoteClusterConnectionInput! + ): RemoteClusterConnection! +""" +Create a new repository. +""" + createRepository( + name: String! + description: String + retentionInMillis: Long + retentionInIngestSizeBytes: Long + retentionInStorageSizeBytes: Long + organizationId: String + type: RepositoryType + repositoryId: String + dataType: RepositoryDataType +""" +The limit the repository should be attached to, only a cloud feature. If not specified a default will be found and used +""" + limitId: String + ): CreateRepositoryMutation! +""" +Adds a role. Only usable if roles are not managed externally, e.g. in LDAP. +""" + createRole( + input: AddRoleInput! + ): AddRoleMutation! +""" +Create a saved query. +""" + createSavedQuery( + input: CreateSavedQueryInput! + ): CreateSavedQueryPayload! +""" +Create a saved query from a package saved query template. +""" + createSavedQueryFromPackageTemplate( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +The id of the package to fetch the saved query template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the saved query template in the package. +""" + savedQueryTemplateName: String! +""" +The name of the new saved query to create. +""" + overrideName: String + ): CreateSavedQueryFromPackageTemplateMutation! +""" +Create a scheduled report. +""" + createScheduledReport( +""" +Data for creating a scheduled report. +""" + input: CreateScheduledReportInput! + ): ScheduledReport! +""" +Create a scheduled search. +""" + createScheduledSearch( +""" +Data for creating a scheduled search +""" + input: CreateScheduledSearch! + ): ScheduledSearch! +""" +Create a scheduled search from a package scheduled search template. +""" + createScheduledSearchFromPackageTemplate( +""" +The name of the view or repo the package is installed in. +""" + searchDomainName: RepoOrViewName! +""" +The id of the package to fetch the scheduled search template from. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the scheduled search template in the package. +""" + scheduledSearchTemplateName: String! +""" +The name of the new scheduled search to create. +""" + scheduledSearchName: String! + ): ScheduledSearch! +""" +Create a scheduled search from a yaml specification. +""" + createScheduledSearchFromTemplate( +""" +Data for creating a scheduled search from a yaml template. +""" + input: CreateScheduledSearchFromTemplateInput! + ): ScheduledSearch! +""" +[PREVIEW: in development.] Create a search link interaction. +""" + createSearchLinkInteraction( + input: CreateSearchLinkInteractionInput! + ): InteractionId! +""" +Create a Slack action. +""" + createSlackAction( +""" +Data for creating a Slack action. +""" + input: CreateSlackAction! + ): SlackAction! +""" +Create a post message Slack action. +""" + createSlackPostMessageAction( +""" +Data for creating a post message Slack action. +""" + input: CreatePostMessageSlackAction! + ): SlackPostMessageAction! +""" +Create a system permissions token for system-level access. +""" + createSystemPermissionsToken( + input: CreateSystemPermissionTokenInput! + ): String! +""" +Create an upload file action. +""" + createUploadFileAction( +""" +Data for creating an upload file action. +""" + input: CreateUploadFileAction! + ): UploadFileAction! +""" +Create a VictorOps action. +""" + createVictorOpsAction( +""" +Data for creating a VictorOps action. +""" + input: CreateVictorOpsAction! + ): VictorOpsAction! +""" +Create a new view. +""" + createView( + name: String! + description: String + connections: [ViewConnectionInput!] + federatedViews: [String!] + isFederated: Boolean + ): View! +""" +Create a view permission token. The permissions will take effect across all the views. +""" + createViewPermissionsToken( + input: CreateViewPermissionsTokenInput! + ): String! +""" +Create a webhook action. +""" + createWebhookAction( +""" +Data for creating a webhook action. +""" + input: CreateWebhookAction! + ): WebhookAction! +""" +Delete an action. +""" + deleteAction( +""" +Data for deleting an action. +""" + input: DeleteAction! + ): Boolean! +""" +Delete an aggregate alert. +""" + deleteAggregateAlert( +""" +Data for deleting an aggregate alert. +""" + input: DeleteAggregateAlert! + ): Boolean! +""" +Delete an alert. +""" + deleteAlert( +""" +Data for deleting an alert +""" + input: DeleteAlert! + ): Boolean! +""" +[PREVIEW: Experimental feature, not ready for production.] Delete a cluster connection from a view. +""" + deleteClusterConnection( +""" +Data for deleting a cluster connection +""" + input: DeleteClusterConnectionInput! + ): Boolean! +""" +Delete a dashboard. +""" + deleteDashboard( + input: DeleteDashboardInput! + ): DeleteDashboardMutation! +""" +Delete a dashboard by looking up the view with the given viewId and then the dashboard in the view with the given dashboardId. +""" + deleteDashboardV2( + input: DeleteDashboardInputV2! + ): SearchDomain! +""" +Delete an event forwarder +""" + deleteEventForwarder( +""" +Data for deleting an event forwarder +""" + input: DeleteEventForwarderInput! + ): Boolean! +""" +Delete an event forwarding rule on a repository +""" + deleteEventForwardingRule( +""" +Data for deleting an event forwarding rule +""" + input: DeleteEventForwardingRule! + ): Boolean! +""" +[PREVIEW: Experimental prototype not ready for production use] Deletes a given external function specification. +""" + deleteExternalFunction( + input: deleteExternalFunctionInput! + ): Boolean! +""" +Delete an FDR feed +""" + deleteFdrFeed( +""" +Data for deleting an FDR feed +""" + input: DeleteFdrFeed! + ): Boolean! +""" +Delete a feature flag. +""" + deleteFeatureFlag( + feature: String! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] deletes an alias mapping +""" + deleteFieldAliasSchema( + input: DeleteFieldAliasSchema! + ): Boolean! +""" +Delete a filter alert. +""" + deleteFilterAlert( +""" +Data for deleting a filter alert +""" + input: DeleteFilterAlert! + ): Boolean! +""" +[PREVIEW: Under development] +""" + deleteFleetInstallToken( + token: String! + ): Boolean! +""" +Delete IP filter. +""" + deleteIPFilter( + input: IPFilterIdInput! + ): Boolean! +""" +For deleting an identity provider. Root operation. +""" + deleteIdentityProvider( + id: String! + ): Boolean! +""" +Delete an ingest feed +""" + deleteIngestFeed( +""" +Data for deleting an ingest feed +""" + input: DeleteIngestFeed! + ): Boolean! +""" +Delete an ingest listener. +""" + deleteIngestListener( + id: String! + ): BooleanResultType! +""" +[PREVIEW: in development.] Delete an interaction. +""" + deleteInteraction( + input: DeleteInteractionInput! + ): Boolean! +""" +[PREVIEW: Under development] +""" + deleteLogCollectorConfiguration( + configId: String! + versionId: Int! + ): Boolean! +""" +[PREVIEW: Under development] +""" + deleteLogCollectorGroup( + id: String! + ): Boolean! +""" +[PREVIEW: Under development] +""" + deleteLostCollectors( + dryRun: Boolean! + days: Int! + ): Int! +""" +Delete notification from the system. Requires root. +""" + deleteNotification( + notificationId: String! + ): Boolean! +""" +Delete a parser. +""" + deleteParser( + input: DeleteParserInput! + ): BooleanResultType! +""" +Remove a shared link to a dashboard. +""" + deleteReadonlyToken( + id: String! + token: String! + ): BooleanResultType! +""" +Deletes a saved query. +""" + deleteSavedQuery( + input: DeleteSavedQueryInput! + ): BooleanResultType! +""" +Delete a scheduled report. +""" + deleteScheduledReport( + input: DeleteScheduledReportInput! + ): Boolean! +""" +Delete a scheduled search. +""" + deleteScheduledSearch( +""" +Data for deleting a scheduled search +""" + input: DeleteScheduledSearch! + ): Boolean! +""" +Delete a repository or view. +""" + deleteSearchDomain( + name: String! + deleteMessage: String + ): BooleanResultType! +""" +Delete a repository or view. +""" + deleteSearchDomainById( + input: DeleteSearchDomainByIdInput! + ): Boolean! +""" +Delete a token +""" + deleteToken( + input: InputData! + ): Boolean! +""" +Disable an aggregate alert. +""" + disableAggregateAlert( +""" +Data for disabling an aggregate alert. +""" + input: DisableAggregateAlert! + ): Boolean! +""" +Disable an alert. +""" + disableAlert( +""" +Data for disabling an alert +""" + input: DisableAlert! + ): Boolean! +""" +Removes demo view. +""" + disableDemoDataForUser: Boolean! +""" +Disables an event forwarder +""" + disableEventForwarder( +""" +Data for disabling an event forwarder +""" + input: DisableEventForwarderInput! + ): Boolean! +""" +Disable a feature. +""" + disableFeature( + feature: FeatureFlag! + ): Boolean! +""" +Disable a feature for a specific organization. +""" + disableFeatureForOrg( + orgId: String! + feature: FeatureFlag! + ): Boolean! +""" +Disable a feature for a specific user. +""" + disableFeatureForUser( + feature: FeatureFlag! + userId: String! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Disables the schema on this organization +""" + disableFieldAliasSchemaOnOrg( + input: DisableFieldAliasSchemaOnOrgInput! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Disables the schema on the given view or repository. +""" + disableFieldAliasSchemaOnView( + input: DisableFieldAliasSchemaOnViewInput! + ): Boolean! +""" +Disable a filter alert. +""" + disableFilterAlert( +""" +Data for disabling a filter alert +""" + input: DisableFilterAlert! + ): Boolean! +""" +[PREVIEW: Under development] +""" + disableLogCollectorDebugLogging: Boolean! +""" +[PREVIEW: Under development] +""" + disableLogCollectorInstanceDebugLogging( + id: String! + ): Boolean! +""" +Disable access to IOCs (indicators of compromise) for an organization. (Requires Organization Manager Permission) +""" + disableOrganizationIocAccess( +""" +Data for disabling access to IOCs (indicators of compromise) for an organization +""" + input: DisableOrganizationIocAccess! + ): Organization! +""" +Disable a scheduled report. +""" + disableScheduledReport( + input: DisableScheduledReportInput! + ): Boolean! +""" +Disable execution of a scheduled search. +""" + disableScheduledSearch( +""" +Data for disabling a scheduled search +""" + input: DisableStarScheduledSearch! + ): ScheduledSearch! +""" +[PREVIEW: Internal debugging tool, do not use without explicit instruction from support] Disable query tracing on worker nodes for queries with the given quota key +""" + disableWorkerQueryTracing( +""" +The quota key to disable tracing for +""" + quotaKey: String! + ): Boolean! +""" +Dismiss notification for specific user, if allowed by notification type. +""" + dismissNotification( + notificationId: String! + ): Boolean! +""" +Enable an aggregate alert. +""" + enableAggregateAlert( +""" +Data for enabling an aggregate alert. +""" + input: EnableAggregateAlert! + ): Boolean! +""" +Enable an alert. +""" + enableAlert( +""" +Data for enabling an alert +""" + input: EnableAlert! + ): Boolean! +""" +Gets or create a new demo data view. +""" + enableDemoDataForUser( + demoDataType: String! + ): View! +""" +Enables an event forwarder +""" + enableEventForwarder( +""" +Data for enabling an event forwarder +""" + input: EnableEventForwarderInput! + ): Boolean! +""" +Enable a feature. +""" + enableFeature( + feature: FeatureFlag! + ): Boolean! +""" +Enable a feature for a specific organization. +""" + enableFeatureForOrg( + orgId: String! + feature: FeatureFlag! + ): Boolean! +""" +Enable a feature for a specific user. +""" + enableFeatureForUser( + feature: FeatureFlag! + userId: String! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Enables the schema on this organization. Field alias mappings in this schema will be active during search across all views and repositories within this org. +""" + enableFieldAliasSchemaOnOrg( + input: EnableFieldAliasSchemaOnOrgInput! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] +Enables the schema on the given list of views or repositories. +Field alias mappings in this schema will be active during search within this view or repository. +If at least one view fails to be enabled on the given view, then no changes are performed on any of the views. + +""" + enableFieldAliasSchemaOnViews( + input: EnableFieldAliasSchemaOnViewsInput! + ): Boolean! +""" +Enable a filter alert. +""" + enableFilterAlert( +""" +Data for enabling a filter alert +""" + input: EnableFilterAlert! + ): Boolean! +""" +[PREVIEW: Under development] +""" + enableLogCollectorDebugLogging( + url: String + token: String! + level: String! + repository: String + ): Boolean! +""" +[PREVIEW: Under development] +""" + enableLogCollectorInstanceDebugLogging( + id: String! + url: String + token: String! + level: String! + repositoryName: String + ): Boolean! +""" +Enable access to IOCs (indicators of compromise) for an organization. (Requires Organization Manager Permission). +""" + enableOrganizationIocAccess( +""" +Data for enabling access to IOCs (indicators of compromise) for an organization +""" + input: EnableOrganizationIocAccess! + ): Organization! +""" +Enable a scheduled report. +""" + enableScheduledReport( + input: EnableScheduledReportInput! + ): Boolean! +""" +Enable execution of a scheduled search. +""" + enableScheduledSearch( +""" +Data for enabling a scheduled search +""" + input: EnableStarScheduledSearch! + ): ScheduledSearch! +""" +[PREVIEW: Internal debugging tool, do not use without explicit instruction from support] Enable query tracing on worker nodes for queries with the given quota key +""" + enableWorkerQueryTracing( + input: EnableWorkerQueryTracingInputType! + ): Boolean! +""" +Extend a Cloud Trial. (Requires Root Permissions) +""" + extendCloudTrial( + organizationId: String! + days: Int! + ): Boolean! +""" +Set the primary bucket target for the organization. +""" + findOrCreateBucketStorageEntity( + organizationId: String! + ): Int! +""" +Installs a package in a specific view. +""" + installPackageFromRegistryV2( + InstallPackageFromRegistryInput: InstallPackageFromRegistryInput! + ): InstallPackageFromRegistryResult! +""" +Installs a package from file provided in multipart/form-data (name=file) in a specific view. +""" + installPackageFromZip( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +Overwrite existing installed package +""" + overwrite: Boolean +""" +[PREVIEW: The query ownership feature is still in development] Ownership of the queries run by the triggers (e.g. alerts and scheduled searches) that are installed as part of this package. If value is User, ownership will be based on the calling user. +""" + queryOwnershipType: QueryOwnershipType + ): InstallPackageFromZipResult! + killQuery( + viewName: String! + pattern: String! + ): BooleanResultType! +""" +[PREVIEW: Internal testing.] Enable a or disable language restrictions for specified version. +""" + languageRestrictionsEnable( + input: EnabledInput! + ): Boolean! +""" +[PREVIEW: Feature still in development] +""" + linkChildOrganization( + childId: String! + ): OrganizationLink! +""" +Log UI Action. +""" + logAnalytics( + input: AnalyticsLog! + ): Boolean! +""" +[PREVIEW: New analytics implementation] Log UI Action. +""" + logAnalyticsBatch( + input: [AnalyticsLogWithTimestamp!]! + ): Boolean! +""" +[PREVIEW: This feature is under development] Logs a service level indicator to the humio repo with #kind=frontend. +""" + logFrontendServiceLevelIndicators( + input: [ServiceLevelIndicatorLogArg!]! + ): Boolean! +""" +Logs out of a users session. +""" + logoutOfSession: Boolean! +""" +Set a limits deleted mark +""" + markLimitDeleted( + input: MarkLimitDeletedInput! + ): Boolean! +""" +Migrate all organizations to the new Limits model (requires root). +""" + migrateToNewLimits( + input: MigrateLimitsInput! + ): Boolean! +""" +For setting up a new Azure AD OIDC idp. Root operation. +""" + newAzureAdOidcIdentityProvider( + name: String! + tenantId: String! + clientID: String! + clientSecret: String! + domains: [String!]! + enableDebug: Boolean + scopeClaim: String + ): OidcIdentityProvider! +""" +Create new file +""" + newFile( + fileName: String! + name: String! + ): UploadedFileSnapshot! +""" +For setting up a new OIDC idp. Root operation. +""" + newOIDCIdentityProvider( + input: OidcConfigurationInput! + ): OidcIdentityProvider! + newSamlIdentityProvider( +""" +Optional specify the ID externally (root only) +""" + id: String + name: String! + signOnUrl: String! + idpCertificateInBase64: String! + idpEntityId: String! + domains: [String!]! + groupMembershipAttribute: String + userAttribute: String + enableDebug: Boolean +""" +Only used internal +""" + adminAttribute: String +""" +Only used internal +""" + adminAttributeMatch: String +""" +If multiple Idp's are defined the default idp is used whenever redirecting to login +""" + defaultIdp: Boolean +""" +Only used internal +""" + humioOwned: Boolean +""" +Lazy create users during login +""" + lazyCreateUsers: Boolean + ): SamlIdentityProvider! +""" +Create notification. Required permissions depends on targets. + Examples: + mutation{notify(Target:Group, ids: ["GroupId1", "GroupId2"],...)} #Notify users in group1 and group2 + mutation{notify(Target:OrgRoot, ids: ["OrgId1", "OrgId2"],...)} # Notify org roots in org1 and org2 + mutation{notify(Target:Root,...)} #Notify all root users + mutation{notify(Target:All,...)} # Notify all users + mutation{notify(Target:All,["UserId1", "UserId2", "UserId3"],...)} #Notify user 1, 2 & 3 + +""" + notify( + input: NotificationInput! + ): Notification! +""" +Override whether feature should be rolled out. +""" + overrideRolledOutFeatureFlag( + feature: FeatureFlag! + rollOut: Boolean! + ): Boolean! +""" +Proxy mutation through a specific organization. Root operation. +""" + proxyOrganization( + organizationId: String! + ): Organization! +""" +[PREVIEW: Under development] Updates a log collector configuration. +""" + publishLogCollectorConfiguration( + id: String! + yaml: String + currentVersion: Int! + ): LogCollectorConfiguration! +""" +Recover the organization with the given id. +""" + recoverOrganization( + organizationId: String! + ): Organization! +""" +Redact events matching a certain query within a certain time interval. Returns the id of the submitted redaction task +""" + redactEvents( + input: RedactEventsInputType! + ): String! +""" +Refresh the list of regions +""" + refreshRegions: Boolean! +""" +Remove a label from an alert. +""" + removeAlertLabelV2( +""" +Data for removing a label from an alert +""" + input: RemoveAlertLabel! + ): Alert! +""" +Remove a filter from a dashboard's list of filters. +""" + removeDashboardFilter( + id: String! + filterId: String! + ): Dashboard! +""" +Remove a label from a dashboard. +""" + removeDashboardLabel( + id: String! + label: String! + ): Dashboard! +""" +Gets or create a new demo data view. +""" + removeDemoDataRepository( + demoDataType: String! + ): Boolean! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Removes a field alias mapping to an existing schema. +""" + removeFieldAliasMapping( + input: RemoveAliasMappingInput! + ): Boolean! +""" +Remove file +""" + removeFile( + fileName: String! + name: String! + ): BooleanResultType! +""" +Remove an item on the query blocklist. +""" + removeFromBlocklist( +""" +Data for removing a blocklist entry +""" + input: RemoveFromBlocklistInput! + ): Boolean! +""" +[PREVIEW: Under development] +""" + removeFromLogCollectorConfigurationTest( + configId: String! + collectorIds: [String!]! + ): FleetConfigurationTest! +""" +[PREVIEW: Internal testing.] Disable functions for use with specified language version. +""" + removeFunctionsFromAllowList( + input: FunctionListInput! + ): Boolean! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Removes the global default cache policy +""" + removeGlobalDefaultCachePolicy: Boolean! +""" +Removes a group. Only usable if roles are not managed externally, e.g. in LDAP. +""" + removeGroup( + groupId: String! + ): RemoveGroupMutation! +""" +Remove an Ingest Token. +""" + removeIngestToken( +""" +The name of the repository to remove the ingest token from. +""" + repositoryName: String! +""" +The name of the token to delete. +""" + name: String! + ): BooleanResultType! +""" +Remove a limit in the given organization +""" + removeLimit( + input: RemoveLimitInput! + ): Boolean! + removeLoginBridge: Boolean! + removeLoginBridgeAllowedUsers( + userID: String! + ): LoginBridge! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Removes the default cache policy of the current organization. +""" + removeOrgDefaultCachePolicy: Boolean! +""" +Remove the organization with the given id (needs to be the same organization ID as the requesting user is in). +""" + removeOrganization( + organizationId: String! + ): Boolean! +""" +Remove the bucket config for the organization. +""" + removeOrganizationBucketConfig: Organization! +""" +Remove a parser. +""" + removeParser( + input: RemoveParserInput! + ): RemoveParserMutation! + removeQueryQuotaDefaultSettings: Boolean! + removeQueryQuotaUserSettings( + username: String! + ): Boolean! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Removes the cache policy of a repository +""" + removeRepoCachePolicy( +""" +Data to remove a repository cache policy +""" + input: RemoveRepoCachePolicyInput! + ): Boolean! +""" +Removes a role. Only usable if roles are not managed externally, e.g. in LDAP. +""" + removeRole( + roleId: String! + ): BooleanResultType! +""" +Remove a label from a scheduled search. +""" + removeScheduledSearchLabel( +""" +Data for removing a label +""" + input: RemoveLabelScheduledSearch! + ): ScheduledSearch! +""" +[PREVIEW: Requires the feature enabled for the organization.] Removes a secondary subdomain from the organization +""" + removeSecondarySubdomain( + input: RemoveSecondarySubdomainInput! + ): Organization! +""" +Temporary mutation to remove all size based retention for all organizations. +""" + removeSizeBasedRetentionForAllOrganizations: [String!]! +""" +Remove a star from an alert. +""" + removeStarFromAlertV2( +""" +Data for removing a star from an alert +""" + input: RemoveStarFromAlert! + ): Alert! +""" +Remove a star from a dashboard. +""" + removeStarFromDashboard( + id: String! + ): Dashboard! + removeStarFromField( + input: RemoveStarToFieldInput! + ): RemoveStarToFieldMutation! +""" +Remove a star from a scheduled search. +""" + removeStarFromScheduledSearch( +""" +Data for removing a star +""" + input: RemoveStarScheduledSearch! + ): ScheduledSearch! +""" +Remove a star from a repository or view. +""" + removeStarFromSearchDomain( + name: String! + ): SearchDomain! +""" +[PREVIEW: Requires the feature enabled for the organization.] Remove the subdomain settings for the organization. +""" + removeSubdomainSettings: Organization! +""" +Remove a user. +""" + removeUser( + input: RemoveUserInput! + ): RemoveUserMutation! +""" +Remove a user. +""" + removeUserById( + input: RemoveUserByIdInput! + ): RemoveUserByIdMutation! +""" +Removes users from an existing group. +""" + removeUsersFromGroup( + input: RemoveUsersFromGroupInput! + ): RemoveUsersFromGroupMutation! +""" +Rename a dashboard. +""" + renameDashboard( + id: String! + name: String! + ): Dashboard! +""" +Rename a Repository or View. +""" + renameSearchDomain( +""" +Old name for Repository or View +""" + name: String! +""" +New name for Repository or View. Note that this changes the URLs for accessing the Repository or View. +""" + renameTo: String! + ): SearchDomain! +""" +Rename a Repository or View. +""" + renameSearchDomainById( + input: RenameSearchDomainByIdInput! + ): SearchDomain! + renameWidget( + id: String! + widgetId: String! + title: String! + ): Dashboard! +""" +Resend an invite to a pending user. +""" + resendInvitation( + input: TokenInput! + ): Boolean! +""" +[PREVIEW: Feature still in development] Resets the flight recorder settings to default for the given vhost +""" + resetFlightRecorderSettings( +""" +The vhost to change the settings for. +""" + vhost: Int! + ): Boolean! +""" +Sets the quota and rate to the given value or resets it to defaults +""" + resetQuota( +""" +Data for resetting quota +""" + input: ResetQuotaInput! + ): Boolean! + resetToFactorySettings: Account! +""" +[PREVIEW: BETA feature.] Restore a deleted search domain. +""" + restoreDeletedSearchDomain( + input: RestoreDeletedSearchDomainInput! + ): SearchDomain! +""" +Resubmit marketo lead. Requires root level privileges and an organization owner in the organization (the lead). +""" + resubmitMarketoLead( + input: ResubmitMarketoLeadData! + ): Boolean! +""" +Revoke a pending user. Once revoked, the invitation link sent to the user becomes invalid. +""" + revokePendingUser( + input: TokenInput! + ): Boolean! +""" +Revoke the specified session. Can be a single session, all sessions for a user or all sessions in an organization. +""" + revokeSession( + input: RevokeSessionInput! + ): Boolean! +""" +Rollback the organization with the given id. +""" + rollbackOrganization( + organizationId: String! + ): Boolean! +""" +Rotate a token +""" + rotateToken( + input: RotateTokenInputData! + ): String! +""" +[PREVIEW: This feature is under development] Manually start the organization inconsistency job. This job will check for inconsistencies like orphaned entities, references to non-existent entities. The job can be run in a dry-run mode that only logs what would have happened. +""" + runInconsistencyCheck( + input: RunInconsistencyCheckInput! + ): String! +""" +Configures S3 archiving for a repository. E.g. bucket and region. +""" + s3ConfigureArchiving( + repositoryName: String! + bucket: String! + region: String! + format: S3ArchivingFormat! + tagOrderInName: [String!] + startFromDateTime: DateTime + ): BooleanResultType! +""" +Disables the archiving job for the repository. +""" + s3DisableArchiving( + repositoryName: String! + ): BooleanResultType! +""" +Enables the archiving job for the repository. +""" + s3EnableArchiving( + repositoryName: String! + ): BooleanResultType! +""" +Mark all segment files as unarchived. +""" + s3ResetArchiving( + repositoryName: String! + ): BooleanResultType! +""" +Scheduled report result failed. +""" + scheduledReportResultFailed( + input: ScheduledReportResultFailedInput! + ): Boolean! +""" +Scheduled report result succeeded. +""" + scheduledReportResultSucceeded( + input: ScheduledReportResultSucceededInput! + ): Boolean! +""" +[PREVIEW: Feature still in development] Set to true to allow moving existing segments between nodes to achieve a better data distribution +""" + setAllowRebalanceExistingSegments( +""" +true if the cluster should allow moving existing segments between nodes to achieve a better data distribution +""" + allowRebalanceExistingSegments: Boolean! + ): Boolean! +""" +[PREVIEW: Feature still in development] Set whether or not to allow updating the desired digesters automatically +""" + setAllowUpdateDesiredDigesters( +""" +Whether or not to allow updating the desired digesters automatically +""" + allowUpdateDesiredDigesters: Boolean! + ): Boolean! +""" +Automatically search when arriving at the search page +""" + setAutomaticSearching( + name: String! + automaticSearch: Boolean! + ): setAutomaticSearching! +""" +Set CID of provisioned organization +""" + setCid( + cid: String! + ): Organization! +""" +Set a duration from now, until which this host will be considered alive by LogScale, even when it's offline. +""" + setConsideredAliveFor( +""" +ID of the node to consider alive. +""" + nodeID: Int! +""" +Amount of millis that the node will be considered alive for (from now). +""" + aliveForMillis: Long + ): DateTime +""" +Set a time in the future, until which this host will be considered alive by LogScale, even when it's offline. +""" + setConsideredAliveUntil( +""" +ID of the node to consider alive. +""" + nodeID: Int! +""" +Time in the future +""" + aliveUntil: DateTime + ): DateTime +""" +Mark a filter as the default for a dashboard. This filter will automatically be active when the dashboard is opened. +""" + setDefaultDashboardFilter( + id: String! + filterId: String + ): Dashboard! +""" +Set the query that should be loaded on entering the search page in a specific view. +""" + setDefaultSavedQuery( + input: SetDefaultSavedQueryInput! + ): BooleanResultType! +""" +[PREVIEW: Feature still in development] Sets the digest replication factor to the supplied value +""" + setDigestReplicationFactor( +""" +The replication factor for segments newly written to digest nodes. Applies until the segments are moved to storage nodes. +""" + digestReplicationFactor: Int! + ): Int! +""" +Set a dynamic config. Requires root level access. +""" + setDynamicConfig( + input: DynamicConfigInputObject! + ): Boolean! +""" +[PREVIEW: Requires the feature enabled for the organization.] Configures whether subdomains are enforced for the organization +""" + setEnforceSubdomains( + input: EnforceSubdomainsInput! + ): Organization! +""" +Save UI styling and other properties for a field. These will be used whenever that field is added to a table or event list in LogScale's UI. +""" + setFieldConfiguration( + input: FieldConfigurationInput! + ): Boolean! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Sets the global default cache policy. This policy will be applied to a repo if neither a repo or org cache policy is set. +""" + setGlobalDefaultCachePolicy( +""" +Data to set a global default cache policy +""" + input: SetGlobalDefaultCachePolicyInput! + ): Boolean! +""" +[PREVIEW: Feature still in development] Toggle whether the specified host should be prepared for eviction from the cluster. If preparing for eviction, the cluster will attempt to move data and work away from the host. +""" + setIsBeingEvicted( +""" +ID of the node to set the isBeingEvicted flag for. +""" + vhost: Int! +""" +Eviction flag indicating whether a node should be prepared for eviction from the cluster. +""" + isBeingEvicted: Boolean! + ): Boolean! +""" +Remove a limit in the given organization +""" + setLimitDisplayName( + input: SetLimitDisplayNameInput! + ): Boolean! + setLoginBridge( + input: LoginBridgeInput! + ): LoginBridge! + setLoginBridgeTermsState( + accepted: Boolean! + ): LoginBridge! +""" +[PREVIEW: Under development] +""" + setLostCollectorDays( + days: Int + ): Boolean! +""" +[PREVIEW: Feature still in development] Sets the percentage of all hosts relevant to a particular cluster rebalance operation that need to be alive before we allow the system to automatically execute the operation to the supplied value. Cluster rebalance operations currently include reassigning digest work, and moving existing segments to balance disk usage. +""" + setMinHostAlivePercentageToEnableClusterRebalancing( +""" +Percentage of all hosts relevant to a particular cluster rebalance operation that need to be alive before we allow the system to automatically execute the operation. Cluster rebalance operations currently include reassigning digest work, and moving existing segments to balance disk usage. Must be between 0 and 100, both inclusive +""" + minHostAlivePercentageToEnableClusterRebalancing: Int! + ): Int! +""" +[PREVIEW: Feature still in development] Sets the duration old object sampling will run for before dumping results and restarting +""" + setOldObjectSampleDurationMinutes( +""" +The vhost to change the setting for. +""" + vhost: Int! +""" +The duration old object sampling will run for before dumping results and restarting +""" + oldObjectSampleDurationMinutes: Long! + ): Long! +""" +[PREVIEW: Feature still in development] Toggles the OldObjectSample event on or off +""" + setOldObjectSampleEnabled( +""" +The vhost to change the setting for. +""" + vhost: Int! +""" +true to enable the OldObjectSample event +""" + oldObjectSampleEnabled: Boolean! + ): Boolean! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Sets the default cache policy of the current organization. This policy will be applied to repos within the current organizatio if a repo cache policy is set. +""" + setOrgDefaultCachePolicy( +""" +Data to set a organization default cache policy +""" + input: SetOrgDefaultCachePolicyInput! + ): Boolean! +""" +Set the primary bucket target for the organization. +""" + setOrganizationBucket1( + targetBucketId1: String! + ): Organization! +""" +Set the secondary bucket target for the organization. +""" + setOrganizationBucket2( + targetBucketId2: String! + ): Organization! +""" +[PREVIEW: Requires the feature enabled for the organization.] Set the primary domain for the organization. If a primary domain is already set the existing primary domain is converted to a secondary domain +""" + setPrimarySubdomain( + input: SetPrimarySubdomainInput! + ): Organization! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] Sets the cache policy of a repository. +""" + setRepoCachePolicy( +""" +Data to set a repo cache policy +""" + input: SetRepoCachePolicyInput! + ): Boolean! +""" +[PREVIEW: Feature still in development] Sets the segment replication factor to the supplied value +""" + setSegmentReplicationFactor( +""" +replication factor for segment storage +""" + segmentReplicationFactor: Int! + ): Int! +""" +[PREVIEW: Requires the feature enabled for the organization.] Set the subdomain settings for an organization. This overrides previously configured settings +""" + setSubdomainSettings( + input: SetSubdomainSettingsInput! + ): Organization! +""" +Set current tag groupings for a repository. +""" + setTagGroupings( +""" +The name of the repository on which to apply the new tag groupings. +""" + repositoryName: String! +""" +The tag groupings to set for the repository. +""" + tagGroupings: [TagGroupingRuleInput!]! + ): [TagGroupingRule!]! +""" +[PREVIEW: Under development] +""" + setWantedLogCollectorVersion( + id: String! + version: String + timeOfUpdate: DateTime + ): Boolean! +""" +Star a saved query in user settings. +""" + starQuery( + input: AddStarToQueryInput! + ): BooleanResultType! +""" +[PREVIEW: Under development] +""" + startLogCollectorConfigurationTest( + configId: String! + collectorIds: [String!]! + ): FleetConfigurationTest! +""" +[PREVIEW: Feature still in development] Stops all running queries including streaming queries +""" + stopAllQueries( +""" +Input to stopping queries. +""" + input: StopQueriesInput + ): Boolean! +""" +[PREVIEW: Feature still in development] Stops all historical queries, ignores live and streaming queries +""" + stopHistoricalQueries( +""" +Input to stopping queries. +""" + input: StopQueriesInput + ): Boolean! +""" +[PREVIEW: Under development] +""" + stopLogCollectorConfigurationTest( + configId: String! + ): FleetConfigurationTest! +""" +Stops all streaming queries +""" + stopStreamingQueries( +""" +Input to stopping queries. +""" + input: StopQueriesInput + ): Boolean! +""" +Tests whether the Iam role is setup correctly and that there is a connection to the SQS queue. +""" + testAwsS3SqsIngestFeed( +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" + input: TestAwsS3SqsIngestFeed! + ): Boolean! +""" +Test an email action +""" + testEmailAction( +""" +Data for testing an email action +""" + input: TestEmailAction! + ): TestResult! +""" +[PREVIEW: Not used by UI yet. Output is subject to change.] Test an FDR feed. +""" + testFdrFeed( +""" +Data for testing an FDR feed. +""" + input: TestFdrFeed! + ): TestFdrResult! +""" +Test a Humio repo action. +""" + testHumioRepoAction( +""" +Data for testing a Humio repo action +""" + input: TestHumioRepoAction! + ): TestResult! +""" +Test that a Kafka event forwarder can connect to the specified Kafka server and topic. +Note that this may create the topic on the broker if the Kafka broker is configured to automatically create +topics. +""" + testKafkaEventForwarderV2( +""" +Data for testing a Kafka event forwarder +""" + input: TestKafkaEventForwarder! + ): TestResult! +""" +Test an OpsGenie action. +""" + testOpsGenieAction( +""" +Data for testing an OpsGenie action +""" + input: TestOpsGenieAction! + ): TestResult! +""" +Test a PagerDuty action. +""" + testPagerDutyAction( +""" +Data for testing a PagerDuty action. +""" + input: TestPagerDutyAction! + ): TestResult! +""" +Test a parser on some test events. If the parser fails to run, an error is returned. Otherwise, a list of results, one for each test event, is returned. +""" + testParser( + input: TestParserInputV2! + ): TestParserResultV2! +""" +Test a parser on some test cases. +""" + testParserV2( + input: ParserTestRunInput! + ): ParserTestRunOutput! +""" +Test a Slack action. +""" + testSlackAction( +""" +Data for testing a Slack action. +""" + input: TestSlackAction! + ): TestResult! +""" +Test a post message Slack action. +""" + testSlackPostMessageAction( +""" +Data for testing a post message Slack action. +""" + input: TestPostMessageSlackAction! + ): TestResult! +""" +Test an upload file action +""" + testUploadFileAction( +""" +Data for testing an upload file action. +""" + input: TestUploadFileAction! + ): TestResult! +""" +Test a VictorOps action. +""" + testVictorOpsAction( +""" +Data for testing a VictorOps action. +""" + input: TestVictorOpsAction! + ): TestResult! +""" +Test a webhook action. +""" + testWebhookAction( +""" +Data for testing a webhook action. +""" + input: TestWebhookAction! + ): TestResult! +""" +Will attempt to trigger a poll on an ingest feed. +""" + triggerPollIngestFeed( +""" +Data for trigger polling an ingest feed +""" + input: TriggerPollIngestFeed! + ): Boolean! +""" +Un-associates a token with its currently assigned parser. +""" + unassignIngestToken( +""" +The name of the repository the ingest token belongs to. +""" + repositoryName: String! +""" +The name of the token. +""" + tokenName: String! + ): UnassignIngestTokenMutation! +""" +[PREVIEW: Experimental feature to allow unassigning permissions to manage a subset of organizations.] Removes the organization management role assigned to the group for the provided organizations. +""" + unassignOrganizationManagementRoleFromGroup( + input: UnassignOrganizationManagementRoleFromGroupInput! + ): UnassignSystemRoleFromGroup! +""" +[PREVIEW: No note] Removes the organization role assigned to the group. +""" + unassignOrganizationRoleFromGroup( + input: RemoveOrganizationRoleFromGroupInput! + ): UnassignOrganizationRoleFromGroup! +""" +Removes the role assigned to the group for a given view. +""" + unassignRoleFromGroup( + input: RemoveRoleFromGroupInput! + ): UnassignRoleFromGroup! +""" +[PREVIEW: No note] Removes the system role assigned to the group. +""" + unassignSystemRoleFromGroup( + input: RemoveSystemRoleFromGroupInput! + ): UnassignSystemRoleFromGroup! +""" +Unassign node tasks. Returns the set of assigned tasks after the unassign operation has completed. +""" + unassignTasks( +""" +ID of the node to assign node tasks to. +""" + nodeID: Int! +""" +List of tasks to unassign. +""" + tasks: [NodeTaskEnum!]! + ): [NodeTaskEnum!]! + unassignUserRoleForSearchDomain( + userId: String! + searchDomainId: String! +""" +If specified, only unassigns the role with the specified id. If not specified, unassigns all user roles for the user in the search domain. +""" + roleId: String + ): User! +""" +Unblock ingest to the specified repository. (Requires ManageCluster Permission) +""" + unblockIngest( + repositoryName: String! + ): UnblockIngestMutation! +""" +[PREVIEW: Under development] +""" + unenrollLogCollectors( + ids: [String!] + ): [EnrolledCollector!]! +""" +Uninstalls a package from a specific view. +""" + uninstallPackage( +""" +The id of the package to uninstall. +""" + packageId: UnversionedPackageSpecifier! +""" +The name of the view the package to uninstall is installed in. +""" + viewName: String! + ): BooleanResultType! +""" +[PREVIEW: Feature still in development] +""" + unlinkChildOrganization( + childId: String! + ): Boolean! +""" +Unset a dynamic config. Requires Manage Cluster permission. +""" + unsetDynamicConfig( + input: UnsetDynamicConfigInputObject! + ): Boolean! +""" +Unset the secondary bucket target for the organization. +""" + unsetOrganizationBucket2: Organization! +""" +Unstar a saved query in user settings. +""" + unstarQuery( + input: RemoveStarFromQueryInput! + ): SavedQueryStarredUpdate! +""" +Update the action security policies for the organization +""" + updateActionSecurityPolicies( + input: ActionSecurityPoliciesInput! + ): Organization! +""" +Update an aggregate alert. +""" + updateAggregateAlert( +""" +Data for updating an aggregate alert. +""" + input: UpdateAggregateAlert! + ): AggregateAlert! +""" +Update an alert. +""" + updateAlert( +""" +Data for updating an alert +""" + input: UpdateAlert! + ): Alert! +""" +Update an ingest feed, which uses AWS S3 and SQS +""" + updateAwsS3SqsIngestFeed( +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + input: UpdateAwsS3SqsIngestFeed! + ): IngestFeed! +""" +[PREVIEW: in development.] Update a custom link interaction. +""" + updateCustomLinkInteraction( + input: UpdateCustomLinkInteractionInput! + ): InteractionId! +""" +Update a dashboard. +""" + updateDashboard( + input: UpdateDashboardInput! + ): UpdateDashboardMutation! +""" +Update a dashboard filter. +""" + updateDashboardFilter( + id: String! + filterId: String! + name: String! + prefixFilter: String! + ): Dashboard! +""" +[PREVIEW: in development.] Update a dashboard link interaction. +""" + updateDashboardLinkInteraction( + input: UpdateDashboardLinkInteractionInput! + ): InteractionId! +""" +Update a dashboard token to run as another user +""" + updateDashboardToken( + viewId: String! +""" +Deprecated in favor of queryOwnershipType. If field is set to anything else than the calling user id, an exception will be thrown. +""" + userId: String + dashboardToken: String! +""" +Ownership of the query run by this shared dashboard. If value is User, ownership will be based on the calling user. +""" + queryOwnershipType: QueryOwnershipType + ): View! +""" +Updates the default queryprefix for a group. +""" + updateDefaultQueryPrefix( + input: UpdateDefaultQueryPrefixInput! + ): UpdateDefaultQueryPrefixMutation! +""" +Updates the default role for a group. +""" + updateDefaultRole( + input: UpdateDefaultRoleInput! + ): updateDefaultRoleMutation! + updateDescriptionForSearchDomain( + name: String! + newDescription: String! + ): UpdateDescriptionMutation! +""" +[PREVIEW: Under development] Updates a log collector configuration. +""" + updateDraftLogCollectorConfiguration( + id: String! + draft: String + ): LogCollectorConfiguration! +""" +Update an email action. +""" + updateEmailAction( +""" +Data for updating an email action. +""" + input: UpdateEmailAction! + ): EmailAction! +""" +Update an event forwarding rule on a repository and return it +""" + updateEventForwardingRule( +""" +Data for updating an event forwarding rule +""" + input: UpdateEventForwardingRule! + ): EventForwardingRule! +""" +Update an FDR feed with the supplied changes. Note that the input fields to this method, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + updateFdrFeed( +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + input: UpdateFdrFeed! + ): FdrFeed! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] FDR feed administrator control update +""" + updateFdrFeedControl( +""" +Data for updating the administrator control of an FDR feed. +""" + input: UpdateFdrFeedControl! + ): FdrFeedControl! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Updates an alias mapping on a schema. +""" + updateFieldAliasMapping( + input: UpdateFieldAliasMappingInput! + ): String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Updates an existing schema. +""" + updateFieldAliasSchema( + input: UpdateFieldAliasSchemaInput! + ): FieldAliasSchema! +""" +Change file +""" + updateFile( + fileName: String! + name: String! +""" +The rows within the offset and limit. They will overwrite all existing rows that are also within the offset and limit. +""" + changedRows: [[String!]!]! +""" +Table headers +""" + headers: [String!]! +""" +List of column changes that will be applied to all rows in the file. Ordering is important, as the first change in the list will be executed first, and the next change will be executed on the resulting rows. +""" + columnChanges: [ColumnChange!]! +""" +Used to find when to stop replacing rows, by adding the limit to the offset. If no offset is given, the file will be truncated to match the updated rows. +""" + limit: Int +""" +Starting index to replace the old rows with the updated ones. It does not take into account the header row. +""" + offset: Int + ): UploadedFileSnapshot! +""" +Update a filter alert. +""" + updateFilterAlert( +""" +Data for updating a filter alert +""" + input: UpdateFilterAlert! + ): FilterAlert! +""" +[PREVIEW: Under development] +""" + updateFleetInstallTokenConfigId( + token: String! + configId: String + ): FleetInstallationToken! +""" +[PREVIEW: Under development] +""" + updateFleetInstallTokenName( + token: String! + name: String! + ): FleetInstallationToken! +""" +Updates the group. +""" + updateGroup( + input: UpdateGroupInput! + ): UpdateGroupMutation! +""" +Update a LogScale repository action. +""" + updateHumioRepoAction( +""" +Data for updating a LogScale repository action. +""" + input: UpdateHumioRepoAction! + ): HumioRepoAction! +""" +Update IP filter. +""" + updateIPFilter( + input: IPFilterUpdateInput! + ): IPFilter! +""" +Update an ingest listener. +""" + updateIngestListenerV3( + input: UpdateIngestListenerV3Input! + ): IngestListener! +""" +Sets the ingest partition scheme of the LogScale cluster. Requires ManageCluster permission. Be aware that the ingest partition scheme is normally automated, and changes will be overwritten by the automation. This mutation should generally not be used unless the automation is temporarily disabled. +""" + updateIngestPartitionScheme( +""" +The list of ingest partitions. If partitions are missing in the input, they are left unchanged. +""" + partitions: [IngestPartitionInput!]! + ): BooleanResultType! +""" +Update a Kafka event forwarder and return it +""" + updateKafkaEventForwarder( +""" +Data for updating a Kafka event forwarder +""" + input: UpdateKafkaEventForwarder! + ): KafkaEventForwarder! +""" +Update the license key for the LogScale cluster. If there is an existing license on this cluster this operation requires permission to manage cluster. +""" + updateLicenseKey( + license: String! + ): License! +""" +Update the limit with the given name, only the arguments defined will be updated +""" + updateLimit( + input: UpdateLimitInput! + ): Boolean! +""" +Update the limit with the given name, only the arguments defined will be updated +""" + updateLimitV2( + input: UpdateLimitInputV2! + ): LimitV2! +""" +[PREVIEW: Experimental feature, not ready for production.] Update a cluster connection to a local view. +""" + updateLocalClusterConnection( +""" +Data for updating a local cluster connection +""" + input: UpdateLocalClusterConnectionInput! + ): LocalClusterConnection! +""" +[PREVIEW: Under development] +""" + updateLogCollectorConfigurationDescription( + configId: String! + description: String + ): LogCollectorConfiguration! +""" +[PREVIEW: Under development] +""" + updateLogCollectorConfigurationName( + configId: String! + name: String! + ): LogCollectorConfiguration! +""" +[PREVIEW: Under development] +""" + updateLogCollectorGroupConfigIds( + id: String! + configIds: [String!] + ): LogCollectorGroup! +""" +[PREVIEW: Under development] +""" + updateLogCollectorGroupFilter( + id: String! + filter: String + ): LogCollectorGroup! +""" +[PREVIEW: Under development] +""" + updateLogCollectorGroupName( + id: String! + name: String! + ): LogCollectorGroup! +""" +[PREVIEW: Under development] +""" + updateLogCollectorGroupWantedVersion( + id: String! + wantedVersion: String + ): LogCollectorGroup! + updateLoginBridge( + input: LoginBridgeUpdateInput! + ): LoginBridge! +""" +Override the globally configured maximum number of auto shards. +""" + updateMaxAutoShardCount( + repositoryName: String! +""" +New override value. Set to zero to remove current override. +""" + maxAutoShardCount: Int! + ): Repository! +""" +Override the globally configured maximum size of ingest requests. +""" + updateMaxIngestRequestSize( + repositoryName: String! +""" +New override value. Set to zero to remove current override. +""" + maxIngestRequestSize: Int! + ): Repository! + updateOIDCIdentityProvider( + input: UpdateOidcConfigurationInput! + ): OidcIdentityProvider! +""" +Update an OpsGenie action. +""" + updateOpsGenieAction( +""" +Data for updating an OpsGenie action +""" + input: UpdateOpsGenieAction! + ): OpsGenieAction! +""" +For manually fixing bad references. Root operation. +""" + updateOrganizationForeignKey( + id: String! + foreignType: Organizations__ForeignType! + operation: Organizations__Operation! + ): Organization! +""" +Update information about the organization +""" + updateOrganizationInfo( + name: String! + countryCode: String! + industry: String! + useCases: [Organizations__UseCases!]! + ): Organization! +""" +For manually updating contract limits. System operation. +""" + updateOrganizationLimits( + input: OrganizationLimitsInput! + ): Organization! +""" +Update mutability of the organization +""" + updateOrganizationMutability( + organizationId: String! + blockIngest: Boolean! + readonly: Boolean! + ): Organization! +""" +Update a note for a given organization. Requires root. +""" + updateOrganizationNotes( + notes: String! + ): Boolean! +""" +Update the permissions of an organization permission token. +""" + updateOrganizationPermissionsTokenPermissions( + input: UpdateOrganizationPermissionsTokenPermissionsInput! + ): String! +""" +Update an users organizations root state +""" + updateOrganizationRoot( + userId: String! + organizationRoot: Boolean! + ): Organization! +""" +Update the subscription of the organization. Root operation. +""" + updateOrganizationSubscription( + input: UpdateSubscriptionInputObject! + ): Organization! +""" +Updates a package in a specific view. +""" + updatePackageFromRegistryV2( + UpdatePackageFromRegistryInput: UpdatePackageFromRegistryInput! + ): PackageUpdateResult! +""" +Updates a package from file provided in multipart/form-data (name=file) in a specific view. +""" + updatePackageFromZip( +""" +The name of the view the package is installed in. +""" + viewName: String! +""" +how to handle conflicts +""" + conflictResolutions: [ConflictResolutionConfiguration!]! +""" +[PREVIEW: The query ownership feature is still in development] Ownership of the queries run by the triggers (e.g. alerts and scheduled searches) that are installed as part of this package. If value is User, ownership will be based on the calling user. +""" + queryOwnershipType: QueryOwnershipType + ): BooleanResultType! +""" +Update a PagerDuty action. +""" + updatePagerDutyAction( +""" +Data for updating a PagerDuty action +""" + input: UpdatePagerDutyAction! + ): PagerDutyAction! +""" +Update a parser. +""" + updateParser( + input: UpdateParserInput! + ): UpdateParserMutation! +""" +Update a parser. Only the provided fields are updated on the parser, and the remaining fields not provided are unchanged. +""" + updateParserV2( + input: UpdateParserInputV2! + ): Parser! +""" +Update the viewers profile. +""" + updateProfile( + firstName: String + lastName: String + ): Account! +""" +Updates queryprefix for a group in a view. +""" + updateQueryPrefix( + input: UpdateQueryPrefixInput! + ): UpdateQueryPrefixMutation! +""" +Update the readonly dashboard ip filter +""" + updateReadonlyDashboardIPFilter( + ipFilter: String + ): Boolean! +""" +[PREVIEW: Experimental feature, not ready for production.] Update a cluster connection to a remote view. +""" + updateRemoteClusterConnection( +""" +Data for updating a remote cluster connection +""" + input: UpdateRemoteClusterConnectionInput! + ): RemoteClusterConnection! +""" +Change the data type of a repository. +""" + updateRepositoryDataType( + input: UpdateRepoDataTypeInputObject! + ): Boolean! +""" +Change the limit id of a repository. +""" + updateRepositoryLimitId( + input: UpdateRepoLimitIdInputObject! + ): Boolean! +""" +Change the type of a repository. Only useful in Cloud setups. +""" + updateRepositoryType( + name: String! + type: String! + ): BooleanResultType! +""" +Change the usage tag of a repository. +""" + updateRepositoryUsageTag( + name: String! + usageTag: String! + ): Boolean! +""" +Update the retention policy of a repository. +""" + updateRetention( +""" +The name of the repository to change retention for. +""" + repositoryName: String! +""" +The maximum time (in days) to keep data. Data old than this will be deleted. +""" + timeBasedRetention: Float +""" +Sets retention (in gigabytes) based on the size of data when it arrives to LogScale, that is before parsing and compression. LogScale will keep `at most` this amount of data. +""" + ingestSizeBasedRetention: Float +""" +Sets retention (in gigabytes) based on the size of data when it is stored in LogScale, that is after parsing and compression. LogScale will keep `at most` this amount of data. +""" + storageSizeBasedRetention: Float +""" +Sets time (in days) to keep backups before they are deleted. +""" + timeBasedBackupRetention: Float + ): UpdateRetentionMutation! + updateRole( + input: UpdateRoleInput! + ): UpdateRoleMutation! + updateSamlIdentityProvider( + id: String! + name: String! + signOnUrl: String! + idpCertificateInBase64: String! + idpEntityId: String! + domains: [String!]! + groupMembershipAttribute: String + userAttribute: String + enableDebug: Boolean +""" +Only used internal +""" + adminAttribute: String +""" +Only used internal +""" + adminAttributeMatch: String +""" +If multiple Idp's are defined the default idp is used whenever redirecting to login +""" + defaultIdp: Boolean +""" +Only used internal +""" + humioOwned: Boolean +""" +Lazy create users during login +""" + lazyCreateUsers: Boolean + ): SamlIdentityProvider! +""" +Updates a saved query. +""" + updateSavedQuery( + input: UpdateSavedQueryInput! + ): UpdateSavedQueryPayload! +""" +Update a scheduled report. Only the supplied property values are updated. +""" + updateScheduledReport( + input: UpdateScheduledReportInput! + ): ScheduledReport! +""" +Update a scheduled search. +""" + updateScheduledSearch( +""" +Data for updating a scheduled search +""" + input: UpdateScheduledSearch! + ): ScheduledSearch! +""" +[PREVIEW: in development.] Update a search link interaction. +""" + updateSearchLinkInteraction( + input: UpdateSearchLinkInteractionInput! + ): InteractionId! +""" +Update session settings for the organization. +""" + updateSessionSettings( + input: SessionInput! + ): Organization! +""" +[PREVIEW: This mutation is dictated by the needs of the LogScale UI, and may include unstable or ephemeral settings.] Set flags for UI states and help messages. +""" + updateSettings( + isWelcomeMessageDismissed: Boolean + isGettingStartedMessageDismissed: Boolean + isCommunityMessageDismissed: Boolean + isPackageDocsMessageDismissed: Boolean + isEventListOrderedWithNewestAtBottom: Boolean + isFieldPanelOpenByDefault: Boolean + automaticallySearch: Boolean + automaticallyHighlighting: Boolean + uiTheme: UiTheme + isDarkModeMessageDismissed: Boolean + isResizableQueryFieldMessageDismissed: Boolean + featureAnnouncementsToDismiss: [FeatureAnnouncement!] + defaultTimeZone: String + ): UserSettings! +""" +Update the shared dashboards security policies for the organization. Updating the policies will update or delete all existing tokens that do not fit into the changes. For instance, enforcing an IP filter will set the IP filter on all shared dashboard tokens. Disabling shared dashboard tokens, will delete all shared dashboard tokens. +""" + updateSharedDashboardsSecurityPolicies( + input: SharedDashboardsSecurityPoliciesInput! + ): Organization! +""" +Update a Slack action. +""" + updateSlackAction( +""" +Data for updating a Slack action +""" + input: UpdateSlackAction! + ): SlackAction! +""" +Update a post-message Slack action. +""" + updateSlackPostMessageAction( +""" +Data for updating a post-message Slack action +""" + input: UpdatePostMessageSlackAction! + ): SlackPostMessageAction! +""" +[PREVIEW: Requires the feature enabled for the organization.] Update the social login options for the organization +""" + updateSocialLoginSettings( + input: [SocialLoginSettingsInput!]! + ): Organization! +""" +Update the permissions of a system permission token. +""" + updateSystemPermissionsTokenPermissions( + input: UpdateSystemPermissionsTokenPermissionsInput! + ): String! +""" +Update the token security policies for the organization. Updating the policies will update or delete all existing tokens that do not fit into the changes. For instance, enforcing an IP filter for personal user tokens will set the IP filter on all tokens of that type. Disabling a token type, will delete all tokens of that type. Finally setting an enforce expiration after will set that on all tokens that are above the interval and keep their current expiration if inside the interval. Tokens below the expiration will be deleted. +""" + updateTokenSecurityPolicies( + input: TokenSecurityPoliciesInput! + ): Organization! +""" +Update an upload file action. +""" + updateUploadFileAction( +""" +Data for updating an upload file action. +""" + input: UpdateUploadFileAction! + ): UploadFileAction! +""" +Updates a user. Requires Root Permission. +""" + updateUser( + input: AddUserInput! + ): UpdateUserMutation! +""" +Updates a user. +""" + updateUserById( + input: UpdateUserByIdInput! + ): UpdateUserByIdMutation! +""" +Update user default settings for the organization. +""" + updateUserDefaultSettings( + input: UserDefaultSettingsInput! + ): Organization! +""" +Update a VictorOps action. +""" + updateVictorOpsAction( +""" +Data for updating a VictorOps action. +""" + input: UpdateVictorOpsAction! + ): VictorOpsAction! +""" +Update a view. +""" + updateView( + viewName: String! + connections: [ViewConnectionInput!]! + ): View! +""" +Update the permissions of a view permission token. +""" + updateViewPermissionsTokenPermissions( + input: UpdateViewPermissionsTokenPermissionsInput! + ): String! +""" +Update a webhook action. +""" + updateWebhookAction( +""" +Data for updating a webhook action +""" + input: UpdateWebhookAction! + ): WebhookAction! +""" +Upgrade the account. +""" + upgradeAccount( + input: UpgradeAccountData! + ): Boolean! +} + +""" +This authentication type can be used to use LogScale without authentication. This should only be considered for testing and development purposes, it is not recommended for production systems and prevents LogScale from doing proper Audit Logging. +""" +type NoAuthentication implements AuthenticationMethod{ + name: String! +} + +""" +A widget get text, links, etc. +""" +type NoteWidget implements Widget{ + backgroundColor: String + textColor: String + text: String! + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! +} + +input NotificationInput { + message: String! + target: Targets! + ids: [String!] + title: String! + dismissable: Boolean! + severity: NotificationSeverity! + link: String + linkDescription: String + notificationType: NotificationTypes! +} + +""" +Authentication through OAuth Identity Providers. +""" +type OAuthAuthentication implements AuthenticationMethod{ + name: String! + uiLoginFlow: Boolean! + google: OAuthProvider + github: OAuthProvider + bitbucket: OAuthProvider + oidc: OIDCProvider +} + +""" +An OAuth Identity Provider. +""" +type OAuthProvider { + id: String! + clientId: String! + redirectUrl: String! +} + +""" +An OIDC identity provider +""" +type OIDCProvider { + id: String! + clientId: String! + redirectUrl: String! + authorizationEndpoint: String + serviceName: String + scopes: [String!]! + federatedIdp: String +} + +enum ObjectAction { + Unknown + ReadOnlyAndHidden + ReadWriteAndVisible +} + +input OidcConfigurationInput { + name: String! + clientID: String! + clientSecret: String! + issuer: String! + tokenEndpointAuthMethod: String! + authorizationEndpoint: String! + tokenEndpoint: String + userInfoEndpoint: String + registrationEndpoint: String + groupsClaim: String + JWKSEndpoint: String + domains: [String!]! + scopes: [String!]! + userClaim: String + enableDebug: Boolean! + defaultIdp: Boolean + humioOwned: Boolean + lazyCreateUsers: Boolean + federatedIdp: String + scopeClaim: String +} + +type OidcIdentityProviderAuth implements AuthenticationMethodAuth{ + redirectUrl: String! + authType: String! + name: String! + scopes: [String!]! + serviceName: String! + authorizeEndpoint: String! + clientId: String! + federatedIdp: String +} + +""" +Represents information about a LogScale License. +""" +type OnPremLicense implements License{ +""" +The time at which the license expires. +""" + expiresAt: DateTime! +""" +The time at which the license was issued. +""" + issuedAt: DateTime! +""" +license id. +""" + uid: String! +""" +The maximum number of user accounts allowed in LogScale. Unlimited if undefined. +""" + maxUsers: Int +""" +The name of the entity the license was issued to. +""" + owner: String! +""" +Indicates whether the license allows running LogScale as a SaaS platform. +""" + isSaaS: Boolean! +""" +Indicates whether the license is an OEM license. +""" + isOem: Boolean! +} + +""" +An OpsGenie action +""" +type OpsGenieAction implements Action{ +""" +OpsGenie webhook url to send the request to. +""" + apiUrl: String! +""" +Key to authenticate with OpsGenie. +""" + genieKey: String! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input OrganizationLimitsInput { + ingest: Long! + retention: Int! + users: Int! + expiration: Long! + allowSelfService: Boolean + contractVersion: Organizations__ContractVersion +} + +""" +A link between two organizations +""" +type OrganizationLink { + parentOrganization: Organization! + childOrganization: Organization! +} + +""" +Query running with organization based ownership +""" +type OrganizationOwnership implements QueryOwnership{ +""" +Organization owning and running the query +""" + organization: Organization! +""" +Id of organization owning and running the query +""" + id: String! +} + +""" +Organization permissions token. The token allows the caller to work with organization-level permissions. +""" +type OrganizationPermissionsToken implements Token{ +""" +The set of permissions on the token +""" + permissions: [String!]! +""" +The id of the token. +""" + id: String! +""" +The name of the token. +""" + name: String! +""" +The time at which the token expires. +""" + expireAt: Long +""" +The ip filter on the token. +""" + ipFilter: String +""" +The ip filter on the token. +""" + ipFilterV2: IPFilter +""" +The date the token was created. +""" + createdAt: Long! +} + +enum Organizations__ContractualType { + Limited + Unlimited + Ignored +} + +enum Organizations__ForeignType { + Unknown + Role + Group + Idp + View + User +} + +enum Organizations__Operation { + Remove + Add +} + +""" +An event produced by a parser in a test run +""" +type OutputEvent { +""" +The fields of the event +""" + fields: [EventField!]! +} + +type PackageUpdateResult { + package: Package2! +} + +""" +A PagerDuty action. +""" +type PagerDutyAction implements Action{ +""" +Severity level to give to the message. +""" + severity: String! +""" +Routing key to authenticate with PagerDuty. +""" + routingKey: String! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input ParameterFilePropertiesInput { + fileName: String! + valueColumn: String! + labelColumn: String + valueFilters: [ParameterFileValueFilter!]! + invalidInputPatterns: [String!] + invalidInputMessage: String +} + +input ParameterFileValueFilter { + field: String! + values: [String!]! +} + +input ParameterFixedListOption { + label: String! + value: String! +} + +input ParameterFixedListPropertiesInput { + values: [ParameterFixedListOption!]! +} + +input ParameterFreeTextPropertiesInput { + invalidInputPatterns: [String!] + invalidInputMessage: String +} + +input ParameterInput { + id: String! + label: String! + defaultValue: String + order: Int + width: Int + freeTextOptions: ParameterFreeTextPropertiesInput + queryOptions: ParameterQueryPropertiesInput + fixedListOptions: ParameterFixedListPropertiesInput + fileOptions: ParameterFilePropertiesInput + isMultiParam: Boolean + defaultMultiValues: [String!] +} + +""" +A widget that contains dashboard parameters. +""" +type ParameterPanel implements Widget{ + parameterIds: [String!]! + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! +} + +input ParameterQueryPropertiesInput { + queryString: String! + timeWindow: String! + optionValueField: String! + optionLabelField: String! + useDashboardTimeIfSet: Boolean! + invalidInputPatterns: [String!] + invalidInputMessage: String +} + +""" +The specification of a parameter +""" +input ParameterSpecificationInput { +""" +The specification of a parameter +""" + name: String! +""" +The specification of a parameter +""" + parameterType: ParameterTypeEnum! +""" +The specification of a parameter +""" + minLong: Long +""" +The specification of a parameter +""" + maxLong: Long +""" +The specification of a parameter +""" + minDouble: Float +""" +The specification of a parameter +""" + maxDouble: Float +""" +The specification of a parameter +""" + minLength: Int +""" +The specification of a parameter +""" + defaultValue: [String!] +} + +""" +The result of parsing a single test event +""" +type ParseEventResult { +""" +The status of parsing the test event +""" + status: ParseEventStatus! +""" +A potential error message +""" + errorMessage: String +""" +The parsed events. Can be empty if the test was dropped by the parser or contain one or more events +""" + events: [ParsedEvent!]! +} + +""" +Staus of parsing a test event +""" +enum ParseEventStatus { +""" +The event was parsed successfully +""" + success +""" +There was an error parsing the event +""" + parseError +""" +There was an error extracting a timestamp from the event +""" + timestampError +} + +""" +A parsed event +""" +type ParsedEvent { +""" +The fields of the event +""" + fields: [Field!]! +} + +""" +Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. +""" +input ParserTestCaseAssertionsForOutputInput { +""" +Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. +""" + outputEventIndex: Int! +""" +Assertions on the shape of a given test case output event. It is a key-pair value, where the index of the output event is the key, and the assertions are the value. +""" + assertions: ParserTestCaseOutputAssertionsInput! +} + +""" +Contains any test failures that relates to a specific output event. This is a key-value pair, where the index of the output event is the key, and the failures are the value. +""" +type ParserTestCaseFailuresForOutput { +""" +The index of the output event which these failures pertain to. Note that there may be failures pointing to non-existing output events, if e.g. an assertion was made on an output event which was not produced. +""" + outputEventIndex: Int! +""" +Failures for the output event. +""" + failures: ParserTestCaseOutputFailures! +} + +""" +A test case for a parser. +""" +input ParserTestCaseInput { +""" +A test case for a parser. +""" + event: ParserTestEventInput! +""" +A test case for a parser. +""" + outputAssertions: [ParserTestCaseAssertionsForOutputInput!] +} + +""" +Assertions on the shape of a given test case output event. +""" +input ParserTestCaseOutputAssertionsInput { +""" +Assertions on the shape of a given test case output event. +""" + fieldsNotPresent: [String!] +""" +Assertions on the shape of a given test case output event. +""" + fieldsHaveValues: [FieldHasValueInput!] +} + +""" +Failures for an output event. +""" +type ParserTestCaseOutputFailures { +""" +Any errors produced by the parser when creating an output event. +""" + parsingErrors: [String!]! +""" +Any assertion failures on the given output event. Note that all assertion failures can be uniquely identified by the output event index and the field name they operate on. +""" + assertionFailuresOnFields: [AssertionFailureOnField!]! +""" +[PREVIEW: API under active development] Fields where the name begins with `#` even though they are not a tag. In LogScale, field names beginning with `#` are treated specially, and should only be constructed through the tagging mechanism. Fields which do begin with `#`, but are not proper tags, will be effectively unsearchable. +""" + falselyTaggedFields: [String!]! +""" +[PREVIEW: API under active development] Any arrays with gaps in them. That is, if the fields `a[0]` and `a[2]` exist on an event, but not `a[1]`, we consider the array `a` to have a gap. This means LogScale will not include the `a[2]` field when doing array-based searches, since it considers `a[0]` to be the last element of the array. +""" + arraysWithGaps: [ArrayWithGap!]! +} + +""" +The output for parsing and verifying a test case +""" +type ParserTestCaseResult { +""" +The events produced by the parser. Contains zero to many events, as a parser can both drop events, or produce multiple output events from a single input. +""" + outputEvents: [OutputEvent!]! +""" +Any failures produced during testing. If the list is empty, the test case can be considered to have passed. If the list contains elements, they are key-value pairs to be treated as a map-construct, where the index of the output event is the key, and the failures are the value. +""" + outputFailures: [ParserTestCaseFailuresForOutput!]! +} + +""" +An event for a parser to parse during testing. +""" +input ParserTestEventInput { +""" +An event for a parser to parse during testing. +""" + rawString: String! +} + +""" +A parser test result, where an unexpected error occurred during parsing. +""" +type ParserTestRunAborted { + errorMessage: String! +} + +""" +A parser test result, where all test cases were parsed and assertions run. Each result is given in the same order as the test cases were put in, so they can be matched by index. +""" +type ParserTestRunCompleted { +""" +The results for running each test case. +""" + results: [ParserTestCaseResult!]! +} + +""" +Input for testing a parser +""" +input ParserTestRunInput { +""" +Input for testing a parser +""" + repositoryName: RepoOrViewName! +""" +Input for testing a parser +""" + parserName: String! +""" +Input for testing a parser +""" + script: String! +""" +Input for testing a parser +""" + fieldsToTag: [String!]! +""" +Input for testing a parser +""" + fieldsToBeRemovedBeforeParsing: [String!]! +""" +Input for testing a parser +""" + testCases: [ParserTestCaseInput!]! +""" +Input for testing a parser +""" + languageVersion: LanguageVersionInputType +} + +""" +The output of running all the parser test cases. +""" +union ParserTestRunOutput =ParserTestRunCompleted | ParserTestRunAborted + +enum Purposes { + MSP + ITOps + IOT + SecOps + DevOps +} + +""" +A dashboard parameter where suggestions are sourced from query results from LogScale. +""" +type QueryBasedDashboardParameter implements DashboardParameter{ +""" +The LogScale query executed to find suggestions for the parameter value. +""" + queryString: String! +""" +The time window (relative to now) in which LogScale will search for suggestions. E.g. 24h or 30d. +""" + timeWindow: String! +""" +The field in the result set used as the 'value' of the suggestions. +""" + optionValueField: String! +""" +The field in the result set used as the 'label' (the text in the dropdown) of the suggestions. +""" + optionLabelField: String! +""" +If true, the parameters search time window will automatically change to match the dashboard's global time when active. +""" + useDashboardTimeIfSet: Boolean! +""" +Regex patterns used to block parameter input. +""" + invalidInputPatterns: [String!] +""" +Message when parameter input is blocked. +""" + invalidInputMessage: String +""" +The ID of the parameter. +""" + id: String! +""" +The label or 'name' displayed next to the input for the variable to make it more human-readable. +""" + label: String! +""" +The value assigned to the parameter on dashboard load, if no other value is specified. +""" + defaultValueV2: String +""" +A number that determines the order in which parameters are displayed on a dashboard. If null, the parameter is ordered after other parameters in alphanumerical order. +""" + order: Int +""" +A number that determines the width of a parameter. +""" + width: Int +""" +[PREVIEW: The multi-value parameters feature is still in development.] A flag indicating whether the parameter supports having multiple values +""" + isMultiParam: Boolean +""" +[PREVIEW: The multi-value parameters feature is still in development.] The value assigned to the multi-value parameter on dashboard load, if no other value is specified. This replaces defaultValue whenever isMultiParam is true +""" + defaultMultiValues: [String!] +} + +""" +A widget with a visualization of a query result. +""" +type QueryBasedWidget implements Widget{ + queryString: String! + start: String! + end: String! + isLive: Boolean! + widgetType: String! +""" +An optional JSON value containing styling and other settings for the widget. This is solely used by the UI. +""" + options: JSON +""" +[PREVIEW: Widget based interaction feature is under preview.] +""" + interactions: [QueryBasedWidgetInteraction!]! + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! +} + +""" +The type of query ownership +""" +enum QueryOwnershipType { +""" +Queries run on behalf of user +""" + User +""" +Queries run on behalf of the organization +""" + Organization +} + +""" +The target type to select +""" +enum QueryOwnership_SelectionTargetType { +""" +A single trigger or shared dashboard +""" + PersistentQuery +""" +All triggers and shared dashboard connected to this view +""" + View +""" +All triggers and shared dashboards within the organization +""" + Organization +} + +""" +Default Query Quota Settings for users which have not had specific settings assigned +""" +type QueryQuotaDefaultSettings { +""" +List of the rules that apply +""" + settings: [QueryQuotaIntervalSetting!]! +} + +input QueryQuotaDefaultSettingsInput { + settings: [QueryQuotaIntervalSettingInput!]! +} + +input QueryQuotaIntervalSettingInput { + interval: QueryQuotaInterval! + measurementKind: QueryQuotaMeasurementKind! + value: Long + valueKind: QueryQuotaIntervalSettingKind! +} + +input QueryQuotaUserSettingsInput { + username: String! + settings: [QueryQuotaIntervalSettingInput!]! +} + +input RedactEventsInputType { + repositoryName: String! + start: DateTime! + end: DateTime! + query: String! + userMessage: String +} + +""" +A remote cluster connection. +""" +type RemoteClusterConnection implements ClusterConnection{ +""" +Public URL of the remote cluster to connect with +""" + publicUrl: String! +""" +Id of the connection +""" + id: String! +""" +Cluster identity of the connection +""" + clusterId: String! +""" +Cluster connection tags +""" + tags: [ClusterConnectionTag!]! +""" +Cluster connection query prefix +""" + queryPrefix: String! +} + +""" +Data for removing a label from an alert +""" +input RemoveAlertLabel { +""" +Data for removing a label from an alert +""" + viewName: String! +""" +Data for removing a label from an alert +""" + id: String! +""" +Data for removing a label from an alert +""" + label: String! +} + +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field removeFieldAliasMapping +""" +input RemoveAliasMappingInput { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field removeFieldAliasMapping +""" + schemaId: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field removeFieldAliasMapping +""" + aliasMappingId: String! +} + +""" +Data for removing a blocklist entry +""" +input RemoveFromBlocklistInput { +""" +Data for removing a blocklist entry +""" + id: String! +} + +type RemoveGroupMutation { + group: Group! +} + +""" +Data for removing a label +""" +input RemoveLabelScheduledSearch { +""" +Data for removing a label +""" + viewName: String! +""" +Data for removing a label +""" + id: String! +""" +Data for removing a label +""" + label: String! +} + +input RemoveLimitInput { + limitName: String! +} + +input RemoveOrganizationRoleFromGroupInput { + groupId: String! + roleId: String! +} + +input RemoveParserInput { + id: String! + repositoryName: String! +} + +type RemoveParserMutation { + parser: Parser! +} + +""" +Data to remove a repository cache policy +""" +input RemoveRepoCachePolicyInput { +""" +Data to remove a repository cache policy +""" + repositoryName: String! +} + +input RemoveRoleFromGroupInput { + viewId: String! + groupId: String! + roleId: String! +} + +input RemoveSecondarySubdomainInput { + subdomain: String! +} + +""" +Data for removing a star from an alert +""" +input RemoveStarFromAlert { +""" +Data for removing a star from an alert +""" + viewName: String! +""" +Data for removing a star from an alert +""" + id: String! +} + +input RemoveStarFromQueryInput { + savedQueryId: String! + searchDomainName: String! +} + +""" +Data for removing a star +""" +input RemoveStarScheduledSearch { +""" +Data for removing a star +""" + viewName: String! +""" +Data for removing a star +""" + id: String! +} + +input RemoveStarToFieldInput { + fieldName: String! + searchDomainName: String! +} + +type RemoveStarToFieldMutation { + starredFields: [String!]! +} + +input RemoveSystemRoleFromGroupInput { + groupId: String! + roleId: String! +} + +input RemoveUserByIdInput { + id: String! +} + +type RemoveUserByIdMutation { + user: User! +} + +input RemoveUserInput { + username: String! +} + +type RemoveUserMutation { + user: User! +} + +input RemoveUsersFromGroupInput { + users: [String!]! + groupId: String! +} + +type RemoveUsersFromGroupMutation { + group: Group! +} + +input RenameSearchDomainByIdInput { + id: String! + newName: String! + renameMessage: String +} + +input RepoFilterInput { + name: String! + filter: String! +} + +""" +Data for a reported warning or error. +""" +input ReportErrorInput { +""" +Data for a reported warning or error. +""" + errorType: String! +""" +Data for a reported warning or error. +""" + errorMessage: String! +} + +""" +Data for resetting quota +""" +input ResetQuotaInput { +""" +Data for resetting quota +""" + newQuota: Long +""" +Data for resetting quota +""" + newRate: Long +} + +input RestoreDeletedSearchDomainInput { + id: String! +} + +input ResubmitMarketoLeadData { + utmParams: UtmParams + zip: String +} + +input RevokeSessionInput { + id: String! + revocationType: SessionRevocation__Type! +} + +input RotateTokenInputData { + id: String! +} + +input RunInconsistencyCheckInput { + dryRun: Boolean! +} + +""" +This authentication type implements the SAML 2.0 Web Browser SSO Profile. +""" +type SAMLAuthentication implements AuthenticationMethod{ + name: String! +} + +type SamlIdentityProviderAuth implements AuthenticationMethodAuth{ + name: String! + authType: String! +} + +type SavedQueryIsStarred { + id: String! + isStarred: Boolean! +} + +type SavedQueryStarredUpdate { + savedQuery: SavedQueryIsStarred! +} + +""" +Data for reporting a failed report generation attempt. +""" +input ScheduledReportResultFailedInput { +""" +Data for reporting a failed report generation attempt. +""" + reportErrors: [ReportErrorInput!]! +} + +""" +Data for reporting a successful report generation attempt. +""" +input ScheduledReportResultSucceededInput { +""" +Data for reporting a successful report generation attempt. +""" + filename: String! +} + +input SchemaFieldInput { + name: String! + description: String +} + +input SearchLinkInteractionInput { + name: String! + titleTemplate: String + repoOrViewName: RepoOrViewName + queryString: String! + isLive: Boolean! + arguments: [ArgumentInput!]! + openInNewTab: Boolean! + useWidgetTimeWindow: Boolean! + fieldInteractionConditions: [FieldInteractionConditionInput!] +} + +input SectionInput { + id: String! + title: String + description: String + collapsed: Boolean! + timeSelector: TimeIntervalInput + widgetIds: [String!]! + order: Int! +} + +input ServiceLevelIndicatorLogArg { + frontendVersion: String! + content: JSON! +} + +input SessionInput { + maxInactivityPeriod: Long! + forceReauthenticationAfter: Long! +} + +enum SessionRevocation__Type { + Organization + User + Session +} + +input SetDefaultSavedQueryInput { + savedQueryId: String + viewName: String! +} + +""" +Data to set a global default cache policy +""" +input SetGlobalDefaultCachePolicyInput { +""" +Data to set a global default cache policy +""" + policy: CachePolicyInput! +} + +input SetLimitDisplayNameInput { + limitName: String! + displayName: String +} + +""" +Data to set a organization default cache policy +""" +input SetOrgDefaultCachePolicyInput { +""" +Data to set a organization default cache policy +""" + policy: CachePolicyInput! +} + +input SetPrimarySubdomainInput { + subdomain: String! +} + +""" +Data to set a repo cache policy +""" +input SetRepoCachePolicyInput { +""" +Data to set a repo cache policy +""" + repositoryName: String! +""" +Data to set a repo cache policy +""" + policy: CachePolicyInput! +} + +""" +Data for updating search limit on a search domain. +""" +input SetSearchLimitForSearchDomain { +""" +Data for updating search limit on a search domain. +""" + id: String! +""" +Data for updating search limit on a search domain. +""" + searchLimitMs: Long! +""" +Data for updating search limit on a search domain. +""" + excludedRepoIds: [String!]! +} + +input SetSubdomainSettingsInput { + primarySubdomain: String! + secondarySubdomains: [String!] + enforceSubdomains: Boolean! +} + +""" +Data for updating shared dashboards security policies +""" +input SharedDashboardsSecurityPoliciesInput { +""" +Data for updating shared dashboards security policies +""" + sharedDashboardsEnabled: Boolean! +""" +Data for updating shared dashboards security policies +""" + enforceIpFilterId: String +} + +""" +A Slack action +""" +type SlackAction implements Action{ +""" +Slack webhook url to send the request to. +""" + url: String! +""" +Fields to include within the Slack message. Can be templated with values from the result. +""" + fields: [SlackFieldEntry!]! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +Field entry in a Slack message +""" +type SlackFieldEntry { +""" +Key of a Slack field. +""" + fieldName: String! +""" +Value of a Slack field. +""" + value: String! +} + +""" +Slack message field entry. +""" +input SlackFieldEntryInput { +""" +Slack message field entry. +""" + fieldName: String! +""" +Slack message field entry. +""" + value: String! +} + +""" +A slack post-message action. +""" +type SlackPostMessageAction implements Action{ +""" +Api token to authenticate with Slack. +""" + apiToken: String! +""" +List of Slack channels to message. +""" + channels: [String!]! +""" +Fields to include within the Slack message. Can be templated with values from the result. +""" + fields: [SlackFieldEntry!]! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input SocialLoginSettingsInput { + socialProviderProfile: SocialProviderProfile! + filter: SocialLoginField! + allowList: [String!]! +} + +input StopQueriesInput { + clusterWide: Boolean +} + +""" +System permissions token. The token allows the caller to work with system-level permissions. +""" +type SystemPermissionsToken implements Token{ +""" +The set of permissions on the token +""" + permissions: [String!]! +""" +The id of the token. +""" + id: String! +""" +The name of the token. +""" + name: String! +""" +The time at which the token expires. +""" + expireAt: Long +""" +The ip filter on the token. +""" + ipFilter: String +""" +The ip filter on the token. +""" + ipFilterV2: IPFilter +""" +The date the token was created. +""" + createdAt: Long! +} + +""" +The grouping rule for a given tag. +""" +input TagGroupingRuleInput { +""" +The grouping rule for a given tag. +""" + tagName: String! +""" +The grouping rule for a given tag. +""" + groupCount: Int! +} + +input TagsInput { + name: String! + value: String! +} + +enum Targets { + All + Group + Root + OrgRoot +} + +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" +input TestAwsS3SqsIngestFeed { +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" + repositoryName: RepoOrViewName! +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" + authentication: IngestFeedAwsAuthenticationInput! +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" + sqsUrl: String! +""" +Data for testing an ingest feed that uses AWS S3 and SQS +""" + region: String! +} + +""" +Data for testing an email action +""" +input TestEmailAction { +""" +Data for testing an email action +""" + viewName: String! +""" +Data for testing an email action +""" + name: String! +""" +Data for testing an email action +""" + recipients: [String!]! +""" +Data for testing an email action +""" + subjectTemplate: String +""" +Data for testing an email action +""" + bodyTemplate: String +""" +Data for testing an email action +""" + useProxy: Boolean! +""" +Data for testing an email action +""" + attachCsv: Boolean +""" +Data for testing an email action +""" + triggerName: String! +""" +Data for testing an email action +""" + eventData: String! +} + +""" +Collection of errors, which occurred during test. +""" +type TestFdrErrorResult { +""" +List of test errors. +""" + errors: [error!]! +} + +""" +Data for testing an FDR feed. +""" +input TestFdrFeed { +""" +Data for testing an FDR feed. +""" + repositoryName: String! +""" +Data for testing an FDR feed. +""" + feedId: String +""" +Data for testing an FDR feed. +""" + clientId: String +""" +Data for testing an FDR feed. +""" + clientSecret: String +""" +Data for testing an FDR feed. +""" + sqsUrl: String +""" +Data for testing an FDR feed. +""" + s3Identifier: String +} + +""" +An error, which occurred when making a request towards an AWS resource. +""" +type TestFdrRequestError { +""" +Name of the AWS resource, which the request was made towards. +""" + resourceName: String! +""" +Message specifying the request error. +""" + message: String! +} + +""" +Result of testing an FDR feed. +""" +union TestFdrResult =TestFdrErrorResult | TestFdrSuccessResult + +""" +Test was a success. +""" +type TestFdrSuccessResult { +""" +This field is always 'true' +""" + result: Boolean! +} + +""" +A validation error related to a particular input field. +""" +type TestFdrValidationError { +""" +Name of the field, which the error relates to. +""" + fieldName: String! +""" +Message specifying the validation error. +""" + message: String! +} + +""" +Data for testing a Humio repo action +""" +input TestHumioRepoAction { +""" +Data for testing a Humio repo action +""" + viewName: String! +""" +Data for testing a Humio repo action +""" + name: String! +""" +Data for testing a Humio repo action +""" + ingestToken: String! +""" +Data for testing a Humio repo action +""" + triggerName: String! +""" +Data for testing a Humio repo action +""" + eventData: String! +} + +""" +Data for testing a Kafka event forwarder +""" +input TestKafkaEventForwarder { +""" +Data for testing a Kafka event forwarder +""" + name: String! +""" +Data for testing a Kafka event forwarder +""" + description: String! +""" +Data for testing a Kafka event forwarder +""" + properties: String! +""" +Data for testing a Kafka event forwarder +""" + topic: String! +""" +Data for testing a Kafka event forwarder +""" + enabled: Boolean +} + +""" +Data for testing an OpsGenie action +""" +input TestOpsGenieAction { +""" +Data for testing an OpsGenie action +""" + viewName: String! +""" +Data for testing an OpsGenie action +""" + name: String! +""" +Data for testing an OpsGenie action +""" + apiUrl: String! +""" +Data for testing an OpsGenie action +""" + genieKey: String! +""" +Data for testing an OpsGenie action +""" + useProxy: Boolean! +""" +Data for testing an OpsGenie action +""" + triggerName: String! +""" +Data for testing an OpsGenie action +""" + eventData: String! +} + +""" +Data for testing a PagerDuty action. +""" +input TestPagerDutyAction { +""" +Data for testing a PagerDuty action. +""" + viewName: String! +""" +Data for testing a PagerDuty action. +""" + name: String! +""" +Data for testing a PagerDuty action. +""" + severity: String! +""" +Data for testing a PagerDuty action. +""" + routingKey: String! +""" +Data for testing a PagerDuty action. +""" + useProxy: Boolean! +""" +Data for testing a PagerDuty action. +""" + triggerName: String! +""" +Data for testing a PagerDuty action. +""" + eventData: String! +} + +""" +An error occurred while running the parser and no events were parsed +""" +type TestParserErrorResult { +""" +An error message +""" + errorMessage: String! +} + +""" +Input for testing a parser +""" +input TestParserInputV2 { +""" +Input for testing a parser +""" + repositoryName: String! +""" +Input for testing a parser +""" + parserId: String! +""" +Input for testing a parser +""" + parserName: String! +""" +Input for testing a parser +""" + parserScript: String! +""" +Input for testing a parser +""" + testData: [String!]! +} + +""" +The result of running the parser on all the test events +""" +union TestParserResultV2 =TestParserSuccessResultV2 | TestParserErrorResult + +""" +The parser produced results for each test event +""" +type TestParserSuccessResultV2 { +""" +The results of parsing the test events +""" + results: [ParseEventResult!]! +} + +""" +Data for testing a post message Slack action. +""" +input TestPostMessageSlackAction { +""" +Data for testing a post message Slack action. +""" + viewName: String! +""" +Data for testing a post message Slack action. +""" + name: String! +""" +Data for testing a post message Slack action. +""" + apiToken: String! +""" +Data for testing a post message Slack action. +""" + channels: [String!]! +""" +Data for testing a post message Slack action. +""" + fields: [SlackFieldEntryInput!]! +""" +Data for testing a post message Slack action. +""" + useProxy: Boolean! +""" +Data for testing a post message Slack action. +""" + triggerName: String! +""" +Data for testing a post message Slack action. +""" + eventData: String! +} + +""" +The result of the test +""" +type TestResult { +""" +True if the test was a success, false otherwise +""" + success: Boolean! +""" +A message explaining the test result +""" + message: String! +} + +""" +Data for testing a Slack action. +""" +input TestSlackAction { +""" +Data for testing a Slack action. +""" + viewName: String! +""" +Data for testing a Slack action. +""" + name: String! +""" +Data for testing a Slack action. +""" + url: String! +""" +Data for testing a Slack action. +""" + fields: [SlackFieldEntryInput!]! +""" +Data for testing a Slack action. +""" + useProxy: Boolean! +""" +Data for testing a Slack action. +""" + triggerName: String! +""" +Data for testing a Slack action. +""" + eventData: String! +} + +""" +Data for testing an upload file action. +""" +input TestUploadFileAction { +""" +Data for testing an upload file action. +""" + viewName: String! +""" +Data for testing an upload file action. +""" + name: String! +""" +Data for testing an upload file action. +""" + fileName: String! +""" +Data for testing an upload file action. +""" + triggerName: String! +""" +Data for testing an upload file action. +""" + eventData: String! +} + +""" +Data for testing a VictorOps action. +""" +input TestVictorOpsAction { +""" +Data for testing a VictorOps action. +""" + viewName: String! +""" +Data for testing a VictorOps action. +""" + name: String! +""" +Data for testing a VictorOps action. +""" + messageType: String! +""" +Data for testing a VictorOps action. +""" + notifyUrl: String! +""" +Data for testing a VictorOps action. +""" + useProxy: Boolean! +""" +Data for testing a VictorOps action. +""" + triggerName: String! +""" +Data for testing a VictorOps action. +""" + eventData: String! +} + +""" +Data for testing a webhook action. +""" +input TestWebhookAction { +""" +Data for testing a webhook action. +""" + viewName: String! +""" +Data for testing a webhook action. +""" + name: String! +""" +Data for testing a webhook action. +""" + url: String! +""" +Data for testing a webhook action. +""" + method: String! +""" +Data for testing a webhook action. +""" + headers: [HttpHeaderEntryInput!]! +""" +Data for testing a webhook action. +""" + bodyTemplate: String! +""" +Data for testing a webhook action. +""" + ignoreSSL: Boolean! +""" +Data for testing a webhook action. +""" + useProxy: Boolean! +""" +Data for testing a webhook action. +""" + triggerName: String! +""" +Data for testing a webhook action. +""" + eventData: String! +} + +input TimeIntervalInput { + start: String! + end: String! +} + +input TokenInput { + token: String! +} + +""" +Data for updating token security policies +""" +input TokenSecurityPoliciesInput { +""" +Data for updating token security policies +""" + personalUserTokensEnabled: Boolean! +""" +Data for updating token security policies +""" + personalUserTokensEnforceExpirationAfterMs: Long +""" +Data for updating token security policies +""" + personalUserTokensEnforceIpFilterId: String +""" +Data for updating token security policies +""" + viewPermissionTokensEnabled: Boolean! +""" +Data for updating token security policies +""" + viewPermissionTokensEnforceExpirationAfterMs: Long +""" +Data for updating token security policies +""" + viewPermissionTokensEnforceIpFilterId: String +""" +Data for updating token security policies +""" + viewPermissionTokensAllowPermissionUpdates: Boolean! +""" +Data for updating token security policies +""" + organizationPermissionTokensEnabled: Boolean! +""" +Data for updating token security policies +""" + organizationPermissionTokensEnforceExpirationAfterMs: Long +""" +Data for updating token security policies +""" + organizationPermissionTokensEnforceIpFilterId: String +""" +Data for updating token security policies +""" + organizationPermissionTokensAllowPermissionUpdates: Boolean! +""" +Data for updating token security policies +""" + systemPermissionTokensEnabled: Boolean +""" +Data for updating token security policies +""" + systemPermissionTokensEnforceExpirationAfterMs: Long +""" +Data for updating token security policies +""" + systemPermissionTokensEnforceIpFilterId: String +""" +Data for updating token security policies +""" + systemPermissionTokensAllowPermissionUpdates: Boolean +} + +""" +Represents information about an on-going trial of LogScale. +""" +type TrialLicense implements License{ +""" +The time at which the trial ends. +""" + expiresAt: DateTime! +""" +The time at which the trial started. +""" + issuedAt: DateTime! +} + +""" +Data for trigger polling an ingest feed +""" +input TriggerPollIngestFeed { +""" +Data for trigger polling an ingest feed +""" + repositoryName: RepoOrViewName! +""" +Data for trigger polling an ingest feed +""" + id: String! +} + +type UnassignIngestTokenMutation { + repository: Repository! +} + +input UnassignOrganizationManagementRoleFromGroupInput { + groupId: String! + roleId: String! + organizationIds: [String!]! +} + +type UnassignOrganizationRoleFromGroup { + group: Group! +} + +type UnassignRoleFromGroup { + group: Group! +} + +type UnassignSystemRoleFromGroup { + group: Group! +} + +type UnblockIngestMutation { + repository: Repository! +} + +""" +A widget that represents an unknown widget type. +""" +type UnknownWidget implements Widget{ + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! +} + +type Unlimited implements contractual{ + includeUsage: Boolean! +} + +type UnregisterNodeMutation { + cluster: Cluster! +} + +input UnsetDynamicConfigInputObject { + config: DynamicConfig! +} + +""" +Data for updating an aggregate alert. +""" +input UpdateAggregateAlert { +""" +Data for updating an aggregate alert. +""" + viewName: RepoOrViewName! +""" +Data for updating an aggregate alert. +""" + id: String! +""" +Data for updating an aggregate alert. +""" + name: String! +""" +Data for updating an aggregate alert. +""" + description: String +""" +Data for updating an aggregate alert. +""" + queryString: String! +""" +Data for updating an aggregate alert. +""" + actionIdsOrNames: [String!]! +""" +Data for updating an aggregate alert. +""" + labels: [String!]! +""" +Data for updating an aggregate alert. +""" + enabled: Boolean! +""" +Data for updating an aggregate alert. +""" + throttleTimeSeconds: Long! +""" +Data for updating an aggregate alert. +""" + throttleField: String +""" +Data for updating an aggregate alert. +""" + searchIntervalSeconds: Long! +""" +Data for updating an aggregate alert. +""" + queryTimestampType: QueryTimestampType! +""" +Data for updating an aggregate alert. +""" + triggerMode: TriggerMode! +""" +Data for updating an aggregate alert. +""" + runAsUserId: String +""" +Data for updating an aggregate alert. +""" + queryOwnershipType: QueryOwnershipType! +} + +""" +Data for updating an alert +""" +input UpdateAlert { +""" +Data for updating an alert +""" + viewName: String! +""" +Data for updating an alert +""" + id: String! +""" +Data for updating an alert +""" + name: String! +""" +Data for updating an alert +""" + description: String +""" +Data for updating an alert +""" + queryString: String! +""" +Data for updating an alert +""" + queryStart: String! +""" +Data for updating an alert +""" + throttleTimeMillis: Long! +""" +Data for updating an alert +""" + throttleField: String +""" +Data for updating an alert +""" + runAsUserId: String +""" +Data for updating an alert +""" + enabled: Boolean! +""" +Data for updating an alert +""" + actions: [String!]! +""" +Data for updating an alert +""" + labels: [String!]! +""" +Data for updating an alert +""" + queryOwnershipType: QueryOwnershipType +} + +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" +input UpdateAwsS3SqsIngestFeed { +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + repositoryName: RepoOrViewName! +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + id: String! +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + name: String +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + description: UpdateIngestFeedDescription +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + parser: String +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + authentication: IngestFeedAwsAuthenticationInput +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + sqsUrl: String +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + region: String +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + enabled: Boolean +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + preprocessing: IngestFeedPreprocessingInput +""" +Data for updating an ingest feed which uses AWS S3 with SQS. The update is a delta update. +""" + compression: IngestFeedCompression +} + +input UpdateCustomLinkInteractionInput { + path: String! + interactionId: String! + customLinkInteractionInput: CustomLinkInteractionInput! +} + +input UpdateDashboardInput { + id: String! + name: String + labels: [String!] + widgets: [WidgetInput!] + sections: [SectionInput!] + links: [LinkInput!] + defaultFilterId: String + filters: [FilterInput!] + parameters: [ParameterInput!] + description: String + timeJumpSizeInMs: Int + updateFrequency: DashboardUpdateFrequencyInput + defaultSharedTimeStart: String + defaultSharedTimeEnd: String + defaultSharedTimeEnabled: Boolean +} + +input UpdateDashboardLinkInteractionInput { + path: String! + interactionId: String! + dashboardLinkInteractionInput: DashboardLinkInteractionInput! +} + +type UpdateDashboardMutation { + dashboard: Dashboard! +} + +input UpdateDefaultQueryPrefixInput { + queryPrefix: String + groupId: String! +} + +type UpdateDefaultQueryPrefixMutation { + group: Group! +} + +input UpdateDefaultRoleInput { + roleId: String + groupId: String! +} + +""" +Type for updating the description. If the description should be cleared, supply an `UpdateDescription` object with no value or a `null` value. If the description should be changed, supply an `UpdateDescription`object with the desired value. +""" +input UpdateDescription { +""" +Type for updating the description. If the description should be cleared, supply an `UpdateDescription` object with no value or a `null` value. If the description should be changed, supply an `UpdateDescription`object with the desired value. +""" + value: String +} + +type UpdateDescriptionMutation { + description: String! +} + +""" +Data for updating an email action. +""" +input UpdateEmailAction { +""" +Data for updating an email action. +""" + viewName: String! +""" +Data for updating an email action. +""" + id: String! +""" +Data for updating an email action. +""" + name: String! +""" +Data for updating an email action. +""" + recipients: [String!]! +""" +Data for updating an email action. +""" + subjectTemplate: String +""" +Data for updating an email action. +""" + bodyTemplate: String +""" +Data for updating an email action. +""" + useProxy: Boolean! +""" +Data for updating an email action. +""" + attachCsv: Boolean +} + +""" +Data for updating an event forwarding rule +""" +input UpdateEventForwardingRule { +""" +Data for updating an event forwarding rule +""" + repoName: String! +""" +Data for updating an event forwarding rule +""" + id: String! +""" +Data for updating an event forwarding rule +""" + queryString: String! +""" +Data for updating an event forwarding rule +""" + eventForwarderId: String! +""" +Data for updating an event forwarding rule +""" + languageVersion: LanguageVersionEnum +} + +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" +input UpdateFdrFeed { +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + repositoryName: String! +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + id: String! +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + name: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + description: UpdateDescription +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + parser: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + clientId: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + clientSecret: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + sqsUrl: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + s3Identifier: String +""" +Data for updating an FDR feed. Note that the fields, apart from `id` and `repositoryName`, only need to be supplied if the field should be changed. +""" + enabled: Boolean +} + +""" +Data for updating the administrator control of an FDR feed. +""" +input UpdateFdrFeedControl { +""" +Data for updating the administrator control of an FDR feed. +""" + repositoryName: String! +""" +Data for updating the administrator control of an FDR feed. +""" + id: String! +""" +Data for updating the administrator control of an FDR feed. +""" + maxNodes: UpdateLong +""" +Data for updating the administrator control of an FDR feed. +""" + fileDownloadParallelism: UpdateLong +} + +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" +input UpdateFieldAliasMappingInput { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + schemaId: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + aliasMappingId: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + name: String +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + tags: [TagsInput!] +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + aliases: [AliasInfoInput!] +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasMapping +""" + originalFieldsToKeep: [String!] +} + +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasSchema +""" +input UpdateFieldAliasSchemaInput { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasSchema +""" + id: String! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasSchema +""" + name: String +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasSchema +""" + fields: [SchemaFieldInput!] +""" +[PREVIEW: This functionality is still under development and can change without warning.] Input object for field updateFieldAliasSchema +""" + aliasMappings: [AliasMappingInput!] +} + +""" +Data for updating a filter alert +""" +input UpdateFilterAlert { +""" +Data for updating a filter alert +""" + viewName: RepoOrViewName! +""" +Data for updating a filter alert +""" + id: String! +""" +Data for updating a filter alert +""" + name: String! +""" +Data for updating a filter alert +""" + description: String +""" +Data for updating a filter alert +""" + queryString: String! +""" +Data for updating a filter alert +""" + actionIdsOrNames: [String!]! +""" +Data for updating a filter alert +""" + labels: [String!]! +""" +Data for updating a filter alert +""" + enabled: Boolean! +""" +Data for updating a filter alert +""" + throttleTimeSeconds: Long +""" +Data for updating a filter alert +""" + throttleField: String +""" +Data for updating a filter alert +""" + runAsUserId: String +""" +Data for updating a filter alert +""" + queryOwnershipType: QueryOwnershipType! +} + +input UpdateGroupInput { + groupId: String! + displayName: String + lookupName: String +} + +type UpdateGroupMutation { + group: Group! +} + +""" +Data for updating a LogScale repository action. +""" +input UpdateHumioRepoAction { +""" +Data for updating a LogScale repository action. +""" + viewName: String! +""" +Data for updating a LogScale repository action. +""" + id: String! +""" +Data for updating a LogScale repository action. +""" + name: String! +""" +Data for updating a LogScale repository action. +""" + ingestToken: String! +} + +""" +Type for updating the description. If the description should be cleared, supply an `UpdateDescription` object with no value or a `null` value. If the description should be changed, supply an `UpdateDescription`object with the desired value. +""" +input UpdateIngestFeedDescription { +""" +Type for updating the description. If the description should be cleared, supply an `UpdateDescription` object with no value or a `null` value. If the description should be changed, supply an `UpdateDescription`object with the desired value. +""" + description: String +} + +""" +Input data to update an ingest listener +""" +input UpdateIngestListenerV3Input { +""" +Input data to update an ingest listener +""" + id: String! +""" +Input data to update an ingest listener +""" + repositoryName: String! +""" +Input data to update an ingest listener +""" + port: Int! +""" +Input data to update an ingest listener +""" + protocol: IngestListenerProtocol! +""" +Input data to update an ingest listener +""" + vHost: Int +""" +Input data to update an ingest listener +""" + name: String! +""" +Input data to update an ingest listener +""" + bindInterface: String! +""" +Input data to update an ingest listener +""" + parser: String! +""" +Input data to update an ingest listener +""" + charset: String! +} + +""" +Data for updating a Kafka event forwarder +""" +input UpdateKafkaEventForwarder { +""" +Data for updating a Kafka event forwarder +""" + id: String! +""" +Data for updating a Kafka event forwarder +""" + name: String! +""" +Data for updating a Kafka event forwarder +""" + description: String! +""" +Data for updating a Kafka event forwarder +""" + properties: String! +""" +Data for updating a Kafka event forwarder +""" + topic: String! +""" +Data for updating a Kafka event forwarder +""" + enabled: Boolean +} + +input UpdateLimitInput { + limitName: String! + allowLogin: Boolean + dailyIngest: Long + retention: Int + allowSelfService: Boolean + expiration: Long + contractVersion: Organizations__ContractVersion + userLimit: Int +} + +input UpdateLimitInputV2 { + id: String! + name: String + allowLogin: Boolean + dailyIngest: Long + dailyIngestContractualType: Organizations__ContractualType + storageContractualType: Organizations__ContractualType + dailyScanContractualType: Organizations__ContractualType + measurementType: Organizations__MeasurementType + dailyScan: Long + retention: Int + maxRetention: Int + allowSelfService: Boolean + expiration: Long + userLimit: Int + dateType: String + trial: Boolean + allowFlightControl: Boolean + repositoryLimit: Int +} + +""" +Data for updating a local cluster connection +""" +input UpdateLocalClusterConnectionInput { +""" +Data for updating a local cluster connection +""" + multiClusterViewName: String! +""" +Data for updating a local cluster connection +""" + connectionId: String! +""" +Data for updating a local cluster connection +""" + targetViewName: String +""" +Data for updating a local cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for updating a local cluster connection +""" + queryPrefix: String +} + +""" +If the value should be cleared, supply an `UpdateLong` object the with no value or a `null` value. If the setting should be changed, supply a `UpdateLong` object with the desired value. +""" +input UpdateLong { +""" +If the value should be cleared, supply an `UpdateLong` object the with no value or a `null` value. If the setting should be changed, supply a `UpdateLong` object with the desired value. +""" + value: Int +} + +input UpdateOidcConfigurationInput { + id: String! + name: String! + clientID: String! + clientSecret: String! + issuer: String! + tokenEndpointAuthMethod: String! + authorizationEndpoint: String! + tokenEndpoint: String + userInfoEndpoint: String + registrationEndpoint: String + groupsClaim: String + JWKSEndpoint: String + domains: [String!]! + scopes: [String!]! + userClaim: String! + enableDebug: Boolean! + defaultIdp: Boolean + humioOwned: Boolean + lazyCreateUsers: Boolean + federatedIdp: String + scopeClaim: String +} + +""" +Data for updating an OpsGenie action +""" +input UpdateOpsGenieAction { +""" +Data for updating an OpsGenie action +""" + viewName: String! +""" +Data for updating an OpsGenie action +""" + id: String! +""" +Data for updating an OpsGenie action +""" + name: String! +""" +Data for updating an OpsGenie action +""" + apiUrl: String! +""" +Data for updating an OpsGenie action +""" + genieKey: String! +""" +Data for updating an OpsGenie action +""" + useProxy: Boolean! +} + +input UpdateOrganizationPermissionsTokenPermissionsInput { + id: String! + permissions: [OrganizationPermission!]! +} + +input UpdatePackageFromRegistryInput { + viewName: RepoOrViewName! + packageId: VersionedPackageSpecifier! + conflictResolutions: [ConflictResolutionConfiguration!]! + queryOwnershipType: QueryOwnershipType +} + +""" +Data for updating a PagerDuty action +""" +input UpdatePagerDutyAction { +""" +Data for updating a PagerDuty action +""" + viewName: String! +""" +Data for updating a PagerDuty action +""" + id: String! +""" +Data for updating a PagerDuty action +""" + name: String! +""" +Data for updating a PagerDuty action +""" + severity: String! +""" +Data for updating a PagerDuty action +""" + routingKey: String! +""" +Data for updating a PagerDuty action +""" + useProxy: Boolean! +} + +input UpdateParametersInteractionInput { + name: String! + titleTemplate: String + arguments: [ArgumentInput!]! + useWidgetTimeWindow: Boolean! + fieldInteractionConditions: [FieldInteractionConditionInput!] +} + +""" +Input for updating a parser. +""" +input UpdateParserInput { +""" +Input for updating a parser. +""" + repositoryName: String +""" +Input for updating a parser. +""" + id: String +""" +Input for updating a parser. +""" + name: String +""" +Input for updating a parser. +""" + testData: [String!] +""" +Input for updating a parser. +""" + sourceCode: String +""" +Input for updating a parser. +""" + tagFields: [String!] +""" +Input for updating a parser. +""" + fieldsToBeRemovedBeforeParsing: [String!] +""" +Input for updating a parser. +""" + languageVersion: LanguageVersionEnum +} + +""" +Input for updating a parser. +""" +input UpdateParserInputV2 { +""" +Input for updating a parser. +""" + repositoryName: RepoOrViewName! +""" +Input for updating a parser. +""" + id: String! +""" +Input for updating a parser. +""" + name: String +""" +Input for updating a parser. +""" + script: UpdateParserScriptInput +""" +Input for updating a parser. +""" + testCases: [ParserTestCaseInput!] +""" +Input for updating a parser. +""" + fieldsToTag: [String!] +""" +Input for updating a parser. +""" + fieldsToBeRemovedBeforeParsing: [String!] +} + +type UpdateParserMutation { + parser: Parser! +} + +""" +Input for updating the parser script. +""" +input UpdateParserScriptInput { +""" +Input for updating the parser script. +""" + script: String! +""" +Input for updating the parser script. +""" + languageVersion: LanguageVersionInputType +} + +""" +Data for updating a post-message Slack action +""" +input UpdatePostMessageSlackAction { +""" +Data for updating a post-message Slack action +""" + viewName: String! +""" +Data for updating a post-message Slack action +""" + id: String! +""" +Data for updating a post-message Slack action +""" + name: String! +""" +Data for updating a post-message Slack action +""" + apiToken: String! +""" +Data for updating a post-message Slack action +""" + channels: [String!]! +""" +Data for updating a post-message Slack action +""" + fields: [SlackFieldEntryInput!]! +""" +Data for updating a post-message Slack action +""" + useProxy: Boolean! +} + +input UpdateQueryPrefixInput { + queryPrefix: String! + viewId: String! + groupId: String! +} + +type UpdateQueryPrefixMutation { + group: Group! +} + +""" +Data for updating a remote cluster connection +""" +input UpdateRemoteClusterConnectionInput { +""" +Data for updating a remote cluster connection +""" + multiClusterViewName: String! +""" +Data for updating a remote cluster connection +""" + connectionId: String! +""" +Data for updating a remote cluster connection +""" + publicUrl: String +""" +Data for updating a remote cluster connection +""" + token: String +""" +Data for updating a remote cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for updating a remote cluster connection +""" + queryPrefix: String +} + +input UpdateRepoDataTypeInputObject { + dataspaceId: String! + repoDataType: RepositoryDataType! +} + +input UpdateRepoLimitIdInputObject { + dataspaceId: String! + limitId: String! +} + +type UpdateRetentionMutation { + repository: SearchDomain! +} + +input UpdateRoleInput { + roleId: String! + displayName: String! + viewPermissions: [Permission!]! + description: String + color: String + systemPermissions: [SystemPermission!] + organizationPermissions: [OrganizationPermission!] + objectAction: ObjectAction + organizationManagementPermissions: [OrganizationManagementPermission!] +} + +type UpdateRoleMutation { + role: Role! +} + +input UpdateSavedQueryInput { + id: String! + name: String + viewName: String! + queryString: String + start: String + end: String + isLive: Boolean + widgetType: String + options: String + dashboardLinkInteractions: [DashboardLinkInteractionInput!] + customLinkInteractions: [CustomLinkInteractionInput!] + searchLinkInteractions: [SearchLinkInteractionInput!] + updateParametersInteractions: [UpdateParametersInteractionInput!] +} + +type UpdateSavedQueryPayload { + savedQuery: SavedQuery! +} + +""" +Data for updating a scheduled report. +""" +input UpdateScheduledReportInput { +""" +Data for updating a scheduled report. +""" + viewName: String! +""" +Data for updating a scheduled report. +""" + id: String! +""" +Data for updating a scheduled report. +""" + name: String +""" +Data for updating a scheduled report. +""" + password: String +""" +Data for updating a scheduled report. +""" + enabled: Boolean +""" +Data for updating a scheduled report. +""" + description: String +""" +Data for updating a scheduled report. +""" + dashboardId: String +""" +Data for updating a scheduled report. +""" + timeIntervalFrom: String +""" +Data for updating a scheduled report. +""" + schedule: UpdateScheduledReportScheduleInput +""" +Data for updating a scheduled report. +""" + labels: [String!] +""" +Data for updating a scheduled report. +""" + parameters: [UpdateScheduledReportParameterValueInput!] +""" +Data for updating a scheduled report. +""" + recipients: [String!] +""" +Data for updating a scheduled report. +""" + layout: UpdateScheduledReportLayoutInput +} + +""" +Layout of the scheduled report. +""" +input UpdateScheduledReportLayoutInput { +""" +Layout of the scheduled report. +""" + paperSize: String +""" +Layout of the scheduled report. +""" + paperOrientation: String +""" +Layout of the scheduled report. +""" + paperLayout: String +""" +Layout of the scheduled report. +""" + showDescription: Boolean +""" +Layout of the scheduled report. +""" + showTitleFrontpage: Boolean +""" +Layout of the scheduled report. +""" + showParameters: Boolean +""" +Layout of the scheduled report. +""" + maxNumberOfRows: Int +""" +Layout of the scheduled report. +""" + showTitleHeader: Boolean +""" +Layout of the scheduled report. +""" + showExportDate: Boolean +""" +Layout of the scheduled report. +""" + footerShowPageNumbers: Boolean +} + +""" +List of parameter value configurations. +""" +input UpdateScheduledReportParameterValueInput { +""" +List of parameter value configurations. +""" + id: String! +""" +List of parameter value configurations. +""" + value: String! +} + +""" +The schedule to run the report by. +""" +input UpdateScheduledReportScheduleInput { +""" +The schedule to run the report by. +""" + cronExpression: String! +""" +The schedule to run the report by. +""" + timeZone: String! +""" +The schedule to run the report by. +""" + startDate: Long! +""" +The schedule to run the report by. +""" + endDate: Long +} + +""" +Data for updating a scheduled search +""" +input UpdateScheduledSearch { +""" +Data for updating a scheduled search +""" + viewName: String! +""" +Data for updating a scheduled search +""" + id: String! +""" +Data for updating a scheduled search +""" + name: String! +""" +Data for updating a scheduled search +""" + description: String +""" +Data for updating a scheduled search +""" + queryString: String! +""" +Data for updating a scheduled search +""" + queryStart: String! +""" +Data for updating a scheduled search +""" + queryEnd: String! +""" +Data for updating a scheduled search +""" + schedule: String! +""" +Data for updating a scheduled search +""" + timeZone: String! +""" +Data for updating a scheduled search +""" + backfillLimit: Int! +""" +Data for updating a scheduled search +""" + enabled: Boolean! +""" +Data for updating a scheduled search +""" + actions: [String!]! +""" +Data for updating a scheduled search +""" + labels: [String!]! +""" +Data for updating a scheduled search +""" + runAsUserId: String +""" +Data for updating a scheduled search +""" + queryOwnershipType: QueryOwnershipType +} + +input UpdateSearchLinkInteractionInput { + path: String! + interactionId: String! + searchLinkInteractionInput: SearchLinkInteractionInput! +} + +""" +Data for updating a Slack action +""" +input UpdateSlackAction { +""" +Data for updating a Slack action +""" + viewName: String! +""" +Data for updating a Slack action +""" + id: String! +""" +Data for updating a Slack action +""" + name: String! +""" +Data for updating a Slack action +""" + url: String! +""" +Data for updating a Slack action +""" + fields: [SlackFieldEntryInput!]! +""" +Data for updating a Slack action +""" + useProxy: Boolean! +} + +input UpdateSubscriptionInputObject { + subscription: Organizations__Subscription! + trialDays: Int +} + +input UpdateSystemPermissionsTokenPermissionsInput { + id: String! + permissions: [SystemPermission!]! +} + +""" +Data for updating an upload file action. +""" +input UpdateUploadFileAction { +""" +Data for updating an upload file action. +""" + viewName: String! +""" +Data for updating an upload file action. +""" + id: String! +""" +Data for updating an upload file action. +""" + name: String! +""" +Data for updating an upload file action. +""" + fileName: String! +} + +input UpdateUserByIdInput { + userId: String! + company: String + isRoot: Boolean + username: String + firstName: String + lastName: String + fullName: String + picture: String + email: String + countryCode: String + stateCode: String +} + +type UpdateUserByIdMutation { + user: User! +} + +type UpdateUserMutation { + user: User! +} + +""" +Data for updating a VictorOps action. +""" +input UpdateVictorOpsAction { +""" +Data for updating a VictorOps action. +""" + viewName: String! +""" +Data for updating a VictorOps action. +""" + id: String! +""" +Data for updating a VictorOps action. +""" + name: String! +""" +Data for updating a VictorOps action. +""" + messageType: String! +""" +Data for updating a VictorOps action. +""" + notifyUrl: String! +""" +Data for updating a VictorOps action. +""" + useProxy: Boolean! +} + +input UpdateViewPermissionsTokenPermissionsInput { + id: String! + permissions: [Permission!]! +} + +""" +Data for updating a webhook action +""" +input UpdateWebhookAction { +""" +Data for updating a webhook action +""" + viewName: String! +""" +Data for updating a webhook action +""" + id: String! +""" +Data for updating a webhook action +""" + name: String! +""" +Data for updating a webhook action +""" + url: String! +""" +Data for updating a webhook action +""" + method: String! +""" +Data for updating a webhook action +""" + headers: [HttpHeaderEntryInput!]! +""" +Data for updating a webhook action +""" + bodyTemplate: String! +""" +Data for updating a webhook action +""" + ignoreSSL: Boolean! +""" +Data for updating a webhook action +""" + useProxy: Boolean! +} + +input UpgradeAccountData { + lastName: String! + company: String! + email: String! + firstName: String + purpose: Purposes + phoneNumber: String + countryCode: String + stateCode: String + comment: String +} + +""" +An upload file action. +""" +type UploadFileAction implements Action{ +""" +File name for the uploaded file. +""" + fileName: String! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input UserDefaultSettingsInput { + defaultTimeZone: String +} + +""" +Query running with user based ownership +""" +type UserOwnership implements QueryOwnership{ +""" +User owning and running the query. If null, then the user doesn't exist anymore. +""" + user: User +""" +Id of user owning and running the query +""" + id: String! +} + +input UserRoleAssignment { + userId: String! + roleId: String! +} + +input UserRoleAssignmentInput { + userId: String! + roleIds: [String!]! +} + +""" +Username and password authentication. The underlying authentication mechanism is configured by the server, e.g. LDAP. +""" +type UsernameAndPasswordAuthentication implements AuthenticationMethod{ + name: String! +} + +input UtmParams { + campaign: String! + content: String! + medium: String! + source: String! + term: String! +} + +""" +A VictorOps action. +""" +type VictorOpsAction implements Action{ +""" +Type of the VictorOps message to make. +""" + messageType: String! +""" +VictorOps webhook url to send the request to. +""" + notifyUrl: String! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +The repositories this view will read from. +""" +input ViewConnectionInput { +""" +The repositories this view will read from. +""" + repositoryName: String! +""" +The repositories this view will read from. +""" + filter: String! +""" +The repositories this view will read from. +""" + languageVersion: LanguageVersionEnum +} + +""" +View permissions token. The token allows the caller to work with the same set of view-level permissions across multiple views. +""" +type ViewPermissionsToken implements Token{ +""" +The set of permissions on the token +""" + permissions: [String!]! +""" +The set of views on the token. Will only list the views the user has access to. +""" + views: [SearchDomain!]! +""" +The id of the token. +""" + id: String! +""" +The name of the token. +""" + name: String! +""" +The time at which the token expires. +""" + expireAt: Long +""" +The ip filter on the token. +""" + ipFilter: String +""" +The ip filter on the token. +""" + ipFilterV2: IPFilter +""" +The date the token was created. +""" + createdAt: Long! +} + +""" +A webhook action +""" +type WebhookAction implements Action{ +""" +Method to use for the request. +""" + method: String! +""" +Url to send the http(s) request to. +""" + url: String! +""" +Headers of the http(s) request. +""" + headers: [HttpHeaderEntry!]! +""" +Body of the http(s) request. Can be templated with values from the result. +""" + bodyTemplate: String! +""" +Flag indicating whether SSL should be ignored for the request. +""" + ignoreSSL: Boolean! +""" +Defines whether the action should use the configured proxy to make web requests. +""" + useProxy: Boolean! +""" +The name of the action. +""" + name: String! +""" +The display name of the action. +""" + displayName: String! +""" +The id of the action. +""" + id: String! +""" +A template that can be used to recreate the action. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier +""" +The package if any which the action is part of. +""" + package: PackageInstallation +""" +False if this type of action is disabled because of a security policy, true otherwise +""" + isAllowedToRun: Boolean! +""" +True if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +input WidgetInput { + id: String! + title: String! + description: String + x: Int! + y: Int! + width: Int! + height: Int! + queryOptions: WidgetQueryPropertiesInput + noteOptions: WidgetNotePropertiesInput + linkOptions: WidgetLinkPropertiesInput + parameterPanelOptions: WidgetParameterPanelPropertiesInput +} + +input WidgetLinkPropertiesInput { + labels: [String!]! +} + +input WidgetNotePropertiesInput { + text: String! + backgroundColor: String + textColor: String +} + +input WidgetParameterPanelPropertiesInput { + parameterIds: [String!]! +} + +input WidgetQueryPropertiesInput { + queryString: String! + start: String! + end: String! + widgetType: String! + options: String + dashboardLinkInteractions: [DashboardLinkInteractionInput!] + customLinkInteractions: [CustomLinkInteractionInput!] + searchLinkInteractions: [SearchLinkInteractionInput!] + updateParametersInteractions: [UpdateParametersInteractionInput!] +} + +""" +The input required to delete an external function specification. +""" +input deleteExternalFunctionInput { +""" +The input required to delete an external function specification. +""" + name: String! +} + +""" +FDR test errors +""" +union error =TestFdrValidationError | TestFdrRequestError + +type setAutomaticSearching { + automaticSearch: Boolean! +} + +type updateDefaultRoleMutation { + group: Group! +} + +""" +A user or pending user, depending on whether an invitation was sent +""" +union userOrPendingUser =User | PendingUser + +type AccessTokenValidatorResultType { + sessionId: String + showTermsAndConditions: ShowTermsAndConditions +} + +""" +A user account. +""" +type Account { + id: String! + enabledFeaturesForAccount: [FeatureFlag!]! + username: String! + isRoot: Boolean! + isOrganizationRoot: Boolean! + fullName: String + firstName: String + lastName: String + phoneNumber: String + email: String + picture: String + settings: UserSettings! + createdAt: DateTime! + countryCode: String + stateCode: String + company: String + canCreateCloudTrialRepo: Boolean! + isCloudProAccount: Boolean! + canCreateRepo: Boolean! + externalPermissions: Boolean! + externalGroupSynchronization: Boolean! + currentOrganization: Organization! + announcement: Notification +""" +[PREVIEW: New sorting and filtering options might be added.] +""" + notificationsV2( + typeFilter: [NotificationTypes!] +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): NotificationsResultSet! + token: PersonalUserToken + fieldConfigurations( + viewName: String! + ): [FieldConfiguration!]! +} + +""" +An action that can be invoked from a trigger. +""" +interface Action { +""" +An action that can be invoked from a trigger. +""" + name: String! +""" +An action that can be invoked from a trigger. +""" + displayName: String! +""" +An action that can be invoked from a trigger. +""" + id: String! +""" +An action that can be invoked from a trigger. +""" + yamlTemplate: YAML! +""" +An action that can be invoked from a trigger. +""" + packageId: VersionedPackageSpecifier +""" +An action that can be invoked from a trigger. +""" + package: PackageInstallation +""" +An action that can be invoked from a trigger. +""" + isAllowedToRun: Boolean! +""" +An action that can be invoked from a trigger. +""" + requiresOrganizationOwnedQueriesPermissionToEdit: Boolean! +""" +An action that can be invoked from a trigger. +""" + allowedActions: [AssetAction!]! +} + +""" +Security policies for actions in the organization +""" +type ActionSecurityPolicies { +""" +Indicates if email actions can be configured and triggered +""" + emailActionEnabled: Boolean! +""" +Allow list of glob patterns for acceptable email action recipients. Empty means no recipients allowed whereas null means all. +""" + emailActionRecipientAllowList: [String!] +""" +Indicates if repository actions can be configured and triggered +""" + repoActionEnabled: Boolean! +""" +Indicates if OpsGenie actions can be configured and triggered +""" + opsGenieActionEnabled: Boolean! +""" +Indicates if PagerDuty actions can be configured and triggered +""" + pagerDutyActionEnabled: Boolean! +""" +Indicates if single channel Slack actions can be configured and triggered +""" + slackSingleChannelActionEnabled: Boolean! +""" +Indicates if multi channel Slack actions can be configured and triggered +""" + slackMultiChannelActionEnabled: Boolean! +""" +Indicates if upload file actions can be configured and triggered +""" + uploadFileActionEnabled: Boolean! +""" +Indicates if VictorOps actions can be configured and triggered +""" + victorOpsActionEnabled: Boolean! +""" +Indicates if Webhook actions can be configured and triggered +""" + webhookActionEnabled: Boolean! +""" +Allow list of glob patterns for acceptable webhook URLs. Empty means no recipients allowed whereas null means all. +""" + webhookActionUrlAllowList: [String!] +} + +type ActionTemplate { + name: String! + displayName: String! + yamlTemplate: String! +""" +The type of action +""" + type: ActionType! +} + +""" +The type of action this template is for +""" +enum ActionType { + Email + LogScaleRepository + OpsGenie + PagerDuty + SlackMulti + SlackSingle + UploadFile + VictorOps + Webhook +} + +type ActiveSchemaOnView { + viewName: RepoOrViewName! + schemaId: String! + is1to1Linked: Boolean! +} + +""" +An aggregate alert. +""" +type AggregateAlert { +""" +Id of the aggregate alert. +""" + id: String! +""" +Name of the aggregate alert. +""" + name: String! +""" +Description of the aggregate alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +List of actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the aggregate alert. +""" + labels: [String!]! +""" +Flag indicating whether the aggregate alert is enabled. +""" + enabled: Boolean! +""" +Throttle time in seconds. +""" + throttleTimeSeconds: Long! +""" +A field to throttle on. Can only be set if throttleTimeSeconds is set. +""" + throttleField: String +""" +Search interval in seconds. +""" + searchIntervalSeconds: Long! +""" +Timestamp type to use for a query. +""" + queryTimestampType: QueryTimestampType! +""" +Trigger mode used for triggering the alert. +""" + triggerMode: TriggerMode! +""" +Unix timestamp for last execution of trigger. +""" + lastTriggered: Long +""" +Unix timestamp for last successful poll (including action invocation if applicable) of the aggregate alert query. If this is not quite recent, then the alert might be having problems. +""" + lastSuccessfulPoll: Long +""" +Last error encountered while running the aggregate alert. +""" + lastError: String +""" +Last warnings encountered while running the aggregate alert. +""" + lastWarnings: [String!]! +""" +YAML specification of the aggregate alert. +""" + yamlTemplate: YAML! +""" +The id of the package of the aggregate alert template. +""" + packageId: VersionedPackageSpecifier +""" +The package that the aggregate alert was installed as part of. +""" + package: PackageInstallation +""" +Ownership of the query run by this alert +""" + queryOwnership: QueryOwnership! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +type AggregateAlertTemplate { + name: String! + displayName: String! + yamlTemplate: YAML! + labels: [String!]! +} + +""" +An alert. +""" +type Alert { +""" +Id of the alert. +""" + id: String! +""" +Name of the alert. +""" + name: String! + assetType: AssetType! +""" +Id of user which the alert is running as. +""" + runAsUser: User +""" +Name of the alert. +""" + displayName: String! +""" +Name of the alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +Start of the relative time interval for the query. +""" + queryStart: String! +""" +Throttle time in milliseconds. +""" + throttleTimeMillis: Long! +""" +Field to throttle on. +""" + throttleField: String +""" +Unix timestamp for when the alert was last triggered. +""" + timeOfLastTrigger: Long +""" +Flag indicating whether the alert is enabled. +""" + enabled: Boolean! +""" +List of ids for actions to fire on query result. +""" + actions: [String!]! +""" +List of ids for actions to fire on query result. +""" + actionsV2: [Action!]! +""" +Last error encountered while running the alert. +""" + lastError: String +""" +Last warnings encountered while running the alert. +""" + lastWarnings: [String!]! +""" +Labels attached to the alert. +""" + labels: [String!]! +""" +Flag indicating whether the calling user has 'starred' the alert. +""" + isStarred: Boolean! +""" +A YAML formatted string that describes the alert. +""" + yamlTemplate: String! +""" +The id of the package that the alert was installed as part of. +""" + packageId: VersionedPackageSpecifier +""" +The package that the alert was installed as part of. +""" + package: PackageInstallation +""" +Ownership of the query run by this alert +""" + queryOwnership: QueryOwnership! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +All actions, labels and packages used in alerts. +""" +type AlertFieldValues { +""" +List of names of actions attached to alerts. Sorted by action names lexicographically.. +""" + actionNames: [String!]! +""" +List of labels attached to alerts. Sorted by label names lexicographically. +""" + labels: [String!]! +""" +List of packages for installed alerts as unversioned qualified package specifiers `scope/packageName`. Sorted lexicographically. +""" + unversionedPackageSpecifiers: [String!]! +} + +""" +Arguments for alert field values query. +""" +input AlertFieldValuesInput { +""" +Arguments for alert field values query. +""" + viewName: RepoOrViewName! +} + +type AlertTemplate { + name: String! + displayName: String! + yamlTemplate: String! + labels: [String!]! +} + +""" +The different types of alerts known to the system. +""" +enum AlertType { + LegacyAlert + FilterAlert + AggregateAlert +} + +type AliasInfo { + source: String! + alias: String! +} + +type AliasMapping { + id: String! + name: String! + tags: [TagInfo!]! + aliases: [AliasInfo!]! + originalFieldsToKeep: [String!]! +} + +""" +Arguments for analyzeQuery +""" +input AnalyzeQueryArguments { +""" +Arguments for analyzeQuery +""" + queryString: String! +""" +Arguments for analyzeQuery +""" + version: LanguageVersionInputType! +""" +Arguments for analyzeQuery +""" + isLive: Boolean +""" +Arguments for analyzeQuery +""" + arguments: [QueryArgumentInputType!] +""" +Arguments for analyzeQuery +""" + viewName: RepoOrViewName +} + +""" +Result of analyzing a query. +""" +type AnalyzeQueryInfo { +""" +Check if the given query contains any errors or warnings when used in a standard search context. +""" + validateQuery: QueryValidationInfo! +""" +Suggested type of alert to use for the given query. +Returns null if no suitable alert type could be suggested. +The given query is not guaranteed to be valid for the suggested alert type. + +""" + suggestedAlertType: SuggestedAlertTypeInfo +} + +""" +Allowed asset action on asset +""" +enum AssetAction { + Read + Update + Delete +} + +""" +Asset permissions +""" +enum AssetPermissionInputEnum { + UpdateAsset + DeleteAsset +} + +""" +Asset permission +""" +enum AssetPermissionOutputEnum { + ReadAsset + UpdateAsset + DeleteAsset +} + +""" +An asset permission search result set +""" +type AssetPermissionSearchResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [SearchAssetPermissionsResultEntry!]! +} + +""" +The different types of assets. +""" +enum AssetPermissionsAssetType { + LegacyAlert + FilterAlert + AggregateAlert + ScheduledSearch + ScheduledReport + Action + Dashboard + File + SavedQuery +} + +""" +Asset permissions assigned to the group +""" +type AssetPermissionsForGroup { +""" +The unique id for the Asset +""" + assetId: String! +""" +The type of the Asset +""" + assetType: AssetPermissionsAssetType! +""" +The search domain that the asset belongs to +""" + searchDomain: SearchDomain +""" +The group role assignments +""" + roles: [GroupRole!]! +""" +The directly assigned asset permissions +""" + directlyAssigned: [AssetPermissionOutputEnum!]! +} + +""" +Asset permissions assigned to the user +""" +type AssetPermissionsForUser { +""" +The unique id for the Asset +""" + assetId: String! +""" +The type of the Asset +""" + assetType: AssetPermissionsAssetType! +""" +The search domain that the asset belongs to +""" + searchDomain: SearchDomain +""" +The group role assignments +""" + groupRoles: [GroupRole!]! +""" +The directly assigned asset permissions per group +""" + groupDirectlyAssigned: [GroupAssetPermissionAssignment!]! + userRoles: [Role!]! +""" +The directly assigned asset permissions +""" + directlyAssigned: [AssetPermissionOutputEnum!]! +} + +enum AssetType { + Interaction + ScheduledSearch + Action + File + AggregateAlert + FilterAlert + Alert + Parser + SavedQuery + Dashboard +} + +""" +Represents information about how users authenticate with LogScale. +""" +interface AuthenticationMethod { +""" +Represents information about how users authenticate with LogScale. +""" + name: String! +} + +interface AuthenticationMethodAuth { + authType: String! +} + +""" +A regex pattern used to filter queries before they are executed. +""" +type BlockedQuery { + id: String! + expiresAt: DateTime + expiresInMilliseconds: Int + pattern: String! + type: BlockedQueryMatcherType! + view: View +""" +The organization owning the pattern or view, if any. +""" + organization: Organization + limitedToOrganization: Boolean! +""" +True if the current actor is allowed the remove this pattern +""" + unblockAllowed: Boolean! +} + +enum BlockedQueryMatcherType { + EXACT + REGEX +} + +""" +Bucket storage configuration for the organization +""" +type BucketStorageConfig { +""" +The primary bucket storage of the organization +""" + targetBucketId1: String! +""" +The secondary bucket storage of the organization +""" + targetBucketId2: String +} + +""" +A policy for choosing which segments to cache on local disk when overcommiting +local storage with bucket storage. + +This can be used to protect certain repositories for local storage, such that +searching other repositories does not evict them. + +A cache policy in LogScale divides segments into prioritized and non-prioritized +segments. When segments needs to be evicted from local storage, we always try +evicting non-prioritized segments before prioritized segments. + +A cache policy can be set either on one of three levels (in order of precedence): + - Repo + - Org + - Globally + + When determining the cache policy for a repo we first check if there is a cache + policy set on the repo. If none is set on the repo, we check the the org. If none + is set there either we check the global setting. + +""" +type CachePolicy { +""" +Prioritize caching segments younger than this +""" + prioritizeMillis: Long +} + +enum Changes { + Removed + Added + NoChange +} + +""" +Data for checking a local cluster connection +""" +input CheckLocalClusterConnectionInput { +""" +Data for checking a local cluster connection +""" + connectionId: String +""" +Data for checking a local cluster connection +""" + targetViewName: String! +""" +Data for checking a local cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for checking a local cluster connection +""" + queryPrefix: String +} + +""" +Data for checking a remote cluster connection +""" +input CheckRemoteClusterConnectionInput { +""" +Data for checking a remote cluster connection +""" + connectionId: String +""" +Data for checking a remote cluster connection +""" + multiClusterViewName: String +""" +Data for checking a remote cluster connection +""" + publicUrl: String! +""" +Data for checking a remote cluster connection +""" + token: String +""" +Data for checking a remote cluster connection +""" + tags: [ClusterConnectionInputTag!] +""" +Data for checking a remote cluster connection +""" + queryPrefix: String +} + +""" +An organization search result set +""" +type ChildOrganizationsResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Organization!]! +} + +""" +Identifies a client of the query. +""" +type Client { + externalId: String! + ip: String + user: String +} + +""" +Information about the LogScale cluster. +""" +type Cluster { + nodes: [ClusterNode!]! + clusterManagementSettings: ClusterManagementSettings! + clusterInfoAgeSeconds: Float! + underReplicatedSegmentSize: Float! + overReplicatedSegmentSize: Float! + missingSegmentSize: Float! + properlyReplicatedSegmentSize: Float! + inBucketStorageSegmentSize: Float! + pendingBucketStorageSegmentSize: Float! + pendingBucketStorageRiskySegmentSize: Float! + targetUnderReplicatedSegmentSize: Float! + targetOverReplicatedSegmentSize: Float! + targetMissingSegmentSize: Float! + targetProperlyReplicatedSegmentSize: Float! + ingestPartitions: [IngestPartition!]! + ingestPartitionsWarnings: [String!]! + suggestedIngestPartitions: [IngestPartition!]! + storagePartitions: [StoragePartition!]! + storagePartitionsWarnings: [String!]! + suggestedStoragePartitions: [StoragePartition!]! + storageReplicationFactor: Int + digestReplicationFactor: Int + stats: ClusterStats! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] The default cache policy of this cluster. +""" + defaultCachePolicy: CachePolicy +} + +""" +A cluster connection. +""" +interface ClusterConnection { +""" +A cluster connection. +""" + id: String! +""" +A cluster connection. +""" + clusterId: String! +""" +A cluster connection. +""" + tags: [ClusterConnectionTag!]! +""" +A cluster connection. +""" + queryPrefix: String! +} + +input ClusterConnectionInputTag { + key: String! + value: String! +} + +""" +The status of a cluster connection. +""" +interface ClusterConnectionStatus { +""" +The status of a cluster connection. +""" + id: String +""" +The status of a cluster connection. +""" + isValid: Boolean! +""" +The status of a cluster connection. +""" + errorMessages: [ConnectionAspectErrorType!]! +} + +type ClusterConnectionTag { + key: String! + value: String! +} + +""" +Settings for the LogScale cluster. +""" +type ClusterManagementSettings { +""" +Replication factor for segments +""" + segmentReplicationFactor: Int! +""" +Replication factor for the digesters +""" + digestReplicationFactor: Int! +""" +Percentage of all hosts relevant to a particular cluster rebalance operation that need to be alive before we allow the system to automatically execute the operation. Cluster rebalance operations currently include reassigning digest work, and moving existing segments to balance disk usage. Value is between 0 and 100, both inclusive +""" + minHostAlivePercentageToEnableClusterRebalancing: Int! +""" +Whether or not desired digesters are allowed to be updated automatically +""" + allowUpdateDesiredDigesters: Boolean! +""" +true if the cluster should allow moving existing segments between nodes to achieve a better data distribution +""" + allowRebalanceExistingSegments: Boolean! +} + +""" +A node in the a LogScale Cluster. +""" +type ClusterNode { + id: Int! + name: String! + zone: String + uri: String! + uuid: String! + humioVersion: String! + supportedTasks: [NodeTaskEnum!]! + assignedTasks: [NodeTaskEnum!] + unassignedTasks: [NodeTaskEnum!] + consideredAliveUntil: DateTime + clusterInfoAgeSeconds: Float! +""" +The size in GB of data this node needs to receive. +""" + inboundSegmentSize: Float! +""" +The size in GB of data this node has that others need. +""" + outboundSegmentSize: Float! + canBeSafelyUnregistered: Boolean! + reasonsNodeCannotBeSafelyUnregistered: ReasonsNodeCannotBeSafelyUnregistered! +""" +The size in GB of data currently on this node. +""" + currentSize: Float! +""" +The size in GB of the data currently on this node that are in the primary storage location. +""" + primarySize: Float! +""" +The size in GB of the data currently on this node that are in the secondary storage location. Zero if no secondary is configured. +""" + secondarySize: Float! +""" +The total size in GB of the primary storage location on this node. +""" + totalSizeOfPrimary: Float! +""" +The total size in GB of the secondary storage location on this node. Zero if no secondary is configured. +""" + totalSizeOfSecondary: Float! +""" +The size in GB of the free space on this node of the primary storage location. +""" + freeOnPrimary: Float! +""" +The size in GB of the free space on this node of the secondary storage location. Zero if no secondary is configured. +""" + freeOnSecondary: Float! +""" +The size in GB of work-in-progress data files. +""" + wipSize: Float! +""" +The size in GB of data once the node has received the data allocated to it. +""" + targetSize: Float! +""" +The size in GB of data that only exists on this node - i.e. only one replica exists in the cluster. +""" + solitarySegmentSize: Float! +""" +A flag indicating whether the node is considered up or down by the cluster coordinated. This is based on the `lastHeartbeat` field. +""" + isAvailable: Boolean! +""" +The last time a heartbeat was received from the node. +""" + lastHeartbeat: DateTime! +""" +The time since a heartbeat was received from the node. +""" + timeSinceLastHeartbeat: Long! +""" +A flag indicating whether the node is marked for eviction. The Falcon LogScale cluster will start to move segments, digesters and queries away from any node marked for eviction +""" + isBeingEvicted: Boolean +""" +Contains data describing the status of eviction +""" + evictionStatus: EvictionStatus! +""" +True if the machine the node runs on has local segment storage +""" + hasStorageRole: Boolean! +""" +True if the machine the node runs on has the possibility to process kafka partitions +""" + hasDigestRole: Boolean! +""" +The time at which the host booted +""" + bootedAt: DateTime! +""" +The time since last boot +""" + timeSinceBooted: Long! +} + +""" +Global stats for the cluster +""" +type ClusterStats { + compressedByteSize: Long! + uncompressedByteSize: Long! + compressedByteSizeOfMerged: Long! + uncompressedByteSizeOfMerged: Long! +} + +""" +Arguments for concatenateQueries +""" +input ConcatenateQueriesArguments { +""" +Arguments for concatenateQueries +""" + queryStrings: [String!]! +""" +Arguments for concatenateQueries +""" + version: LanguageVersionInputType! +} + +""" +A value denoting some aspect of a cluster connection +""" +enum ConnectionAspect { + Tag + QueryPrefix + Other + TargetView + PublicUrl + Token +} + +""" +A key-value pair from a connection aspect to an error message pertaining to that aspect +""" +type ConnectionAspectErrorType { +""" +A connection aspect +""" + aspect: ConnectionAspect! +""" +An error message for the connection, tagged by the relevant aspect +""" + error: String! +} + +""" +Represents the connection between a view and an underlying repository in another organization. +""" +type CrossOrgViewConnection { +""" +ID of the underlying repository +""" + id: String! +""" +Name of the underlying repository +""" + name: String! +""" +The filter applied to all results from the repository. +""" + filter: String! + languageVersion: LanguageVersion! +""" +ID of the organization containing the underlying repository +""" + orgId: String! +} + +""" +The status the local database of CrowdStrike IOCs +""" +type CrowdStrikeIocStatus { + databaseTables: [IocTableInfo!]! +} + +type CurrentStats { + ingest: Ingest! + storedData: StoredData! + scannedData: ScannedData! + users: UsersLimit! +} + +""" +Query result for current usage +""" +union CurrentUsageQueryResult =QueryInProgress | CurrentStats + +type CustomLinkInteraction { + urlTemplate: String! + openInNewTab: Boolean! + urlEncodeArgs: Boolean! +} + +""" +Represents information about a dashboard. +""" +type Dashboard { + id: String! + name: String! + description: String + assetType: AssetType! +""" +A YAML formatted string that describes the dashboard. It does not contain links or permissions, and is safe to share and use for making copies of a dashboard. +""" + templateYaml: String! + displayName: String! + labels: [String!]! + widgets: [Widget!]! + sections: [Section!]! + readOnlyTokens: [DashboardLink!]! + filters: [DashboardFilter!]! + parameters: [DashboardParameter!]! + updateFrequency: DashboardUpdateFrequencyType! + isStarred: Boolean! + defaultFilter: DashboardFilter + defaultSharedTimeStart: String! + defaultSharedTimeEnd: String! + timeJumpSizeInMs: Int + defaultSharedTimeEnabled: Boolean! + searchDomain: SearchDomain! + packageId: VersionedPackageSpecifier + package: PackageInstallation +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +A dashboard +""" +type DashboardEntry { + dashboard: Dashboard! +} + +""" +A saved configuration for filtering dashboard widgets. +""" +type DashboardFilter { + id: String! + name: String! + prefixFilter: String! +} + +""" +A token that can be used to access the dashboard without logging in. Useful for e.g. wall mounted dashboards or public dashboards. +""" +type DashboardLink { + name: String! + token: String! + createdBy: String! +""" +The ip filter for the dashboard link. +""" + ipFilter: IPFilter +""" +Ownership of the queries run by this shared dashboard +""" + queryOwnership: QueryOwnership! +} + +type DashboardLinkInteraction { + arguments: [DictionaryEntryType!]! + dashboardReference: DashboardLinkInteractionDashboardReference! + openInNewTab: Boolean! + useWidgetTimeWindow: Boolean! +} + +""" +A reference to a dashboard either by id or name +""" +type DashboardLinkInteractionDashboardReference { + id: String + name: String + repoOrViewName: RepoOrViewName + packageSpecifier: UnversionedPackageSpecifier +} + +""" +A page of dashboards. +""" +type DashboardPage { + pageInfo: PageType! + page: [Dashboard!]! +} + +""" +Represents a dashboard parameter. +""" +interface DashboardParameter { +""" +Represents a dashboard parameter. +""" + id: String! +""" +Represents a dashboard parameter. +""" + label: String! +""" +Represents a dashboard parameter. +""" + defaultValueV2: String +""" +Represents a dashboard parameter. +""" + order: Int +""" +Represents a dashboard parameter. +""" + width: Int +""" +Represents a dashboard parameter. +""" + isMultiParam: Boolean +""" +Represents a dashboard parameter. +""" + defaultMultiValues: [String!] +} + +type DashboardTemplate { + name: String! + displayName: String! + yamlTemplate: String! + labels: [String!]! +} + +""" +The frequency at which a dashboard fetches new results for widgets. +""" +union DashboardUpdateFrequencyType =NeverDashboardUpdateFrequency | RealTimeDashboardUpdateFrequency + +""" +A datasource, e.g. file name or system sending data to LogScale. +""" +type Datasource { + name: String! + oldestTimestamp: DateTime! + newestTimestamp: DateTime! + tags: [Tag!]! +""" +The size in Gigabytes of the data from this data source before compression. +""" + sizeAtIngest: Float! +""" +This size in Gigabytes of the data from this data source currently on disk. +""" + sizeOnDisk: Float! +""" +The size in Gigabytes of the data from this data source before compression, but only for the parts that are now part of a merged segment file. +""" + sizeAtIngestOfMerged: Float! +""" +This size in Gigabytes of the data from this data source currently on disk, but only for the parts that are now part of a merged segment file. +""" + sizeOnDiskOfMerged: Float! +} + +""" +Date and time in the ISO-8601 instant format. Example: `2019-12-03T10:15:30.00Z` +""" +scalar DateTime + +""" +A deletion of a set of events. +""" +type DeleteEvents { + id: String! + created: DateTime! + start: DateTime! + end: DateTime! + query: String! + createdByUser: String + languageVersion: LanguageVersion! +} + +""" +Entry into a list of unordered key-value pairs with unique keys +""" +type DictionaryEntryType { + key: String! + value: String! +} + +""" +A dynamic configuration. +""" +enum DynamicConfig { + BlockSignup + DisableUserTracking + DisableAnalyticsJob + MaxAccessTokenTTL + RejectIngestOnParserExceedingFraction + QueryPartitionAutoBalance + QueryCoordinatorMaxHeapFraction + PruneCommunityLockedOrganizationsAfterHours + PruneMissingTOSAcceptanceOrganizationsAfterHours + DisableViewWithSameNameCleanup + MaxIngestRequestSize + JoinRowLimit + JoinDefaultLimit + SelfJoinLimit + StateRowLimit + AstDepthLimit + AdHocTablesLimit + QueryMemoryLimit + LiveQueryMemoryLimit + QueryCoordinatorMemoryLimit + GroupDefaultLimit + GroupMaxLimit + RdnsDefaultLimit + RdnsMaxLimit + QueryResultRowCountLimit + ParserThrottlingAllocationFactor + UndersizedMergingRetentionPercentage + StaticQueryFractionOfCores + TargetMaxRateForDatasource + DelayIngestResponseDueToIngestLagMaxFactor + DelayIngestResponseDueToIngestLagThreshold + DelayIngestResponseDueToIngestLagScale + SampleIntervalForDatasourceRates + FdrMaxNodesPerFeed + BucketStorageWriteVersion + BucketStorageKeySchemeVersion + BucketStorageUploadInfrequentThresholdDays + MinimumHumioVersion + DebugAuditRequestTrace + FlushSegmentsAndGlobalOnShutdown + GracePeriodBeforeDeletingDeadEphemeralHostsMs + FdrS3FileSizeMax + S3ArchivingClusterWideStartFrom + S3ArchivingClusterWideEndAt + S3ArchivingClusterWideDisabled + S3ArchivingClusterWideRegexForRepoName + EnableDemoData + MaxNumberOfOrganizations + NumberOfDaysToRemoveStaleOrganizationsAfter + IsAutomaticUpdateCheckingAllowed + ExternalFunctionRequestResponseSizeLimitBytes + ExternalFunctionRequestResponseEventCountLimit + ReplaceANSIEscapeCodes + DisableInconsistencyDetectionJob + DeleteDuplicatedNameViewsAfterMerging + MaxQueryPenaltyCreditForBlockedQueriesFactor + MaxConcurrentQueriesOnWorker + MaxQueryPollsForWorker + MaxOpenSegmentsOnWorker + IngestFeedAwsProcessingDownloadBufferSize + IngestFeedAwsProcessingEventBufferSize + IngestFeedAwsProcessingEventsPerBatch + IngestFeedAwsDownloadMaxObjectSize + IngestFeedGovernorGainPerCore + IngestFeedGovernorCycleDuration + IngestFeedGovernorIngestDelayLow + IngestFeedGovernorIngestDelayHigh + IngestFeedGovernorRateOverride + IngestFeedMaxConcurrentPolls + MaxCsvFileUploadSizeBytes + MaxJsonFileUploadSizeBytes + MatchFilesMaxHeapFraction + LookupTableSyncAwaitSeconds + GraphQLSelectionSizeLimit + UnauthenticatedGraphQLSelectionSizeLimit + QueryBlockMillisOnHighIngestDelay + FileReplicationFactor + QueryBacktrackingLimit + GraphQlDirectivesAmountLimit + TableCacheMemoryAllowanceFraction + TableCacheMaxStorageFraction + TableCacheMaxStorageFractionForIngestAndHttpOnly +} + +""" +A key value pair of a dynamic config and the accompanying value. +""" +type DynamicConfigKeyValueType { +""" +The dynamic config key. +""" + dynamicConfigKey: DynamicConfig! +""" +The dynamic config value. +""" + dynamicConfigValue: String! +} + +scalar Email + +""" +Scope of feature flag enablement +""" +enum EnabledInScope { + GlobalScope + OrganizationScope + UserScope + Disabled +} + +enum EntitiesPageDirection { + Previous + Next +} + +input EntitiesPageInputType { + cursor: String! + direction: EntitiesPageDirection! +} + +enum EntitySearchEntityType { + Dashboard + File + Interaction +} + +input EntitySearchInputType { + searchTerm: String + pageSize: Int + paths: [String!] + sortBy: [EntitySearchSortInfoType!] + entityTypes: [EntitySearchEntityType!]! +} + +union EntitySearchResultEntity =ViewInteractionEntry | FileEntry | DashboardEntry + +input EntitySearchSortInfoType { + name: String! + order: EntitySearchSortOrderType! +} + +enum EntitySearchSortOrderType { + Descending + Ascending +} + +enum EnvironmentType { + ON_PREM + ON_CLOUD + ON_COMMUNITY +} + +""" +Usage information +""" +type EnvironmentVariableUsage { +""" +The source for this environment variable. "Environment": the value is from the environment, "Default": variable not found in the environment, but a default value is used, "Missing": no variable or default found +""" + source: String! +""" +Value for this variable +""" + value: String! +""" +Environment variable name +""" + name: String! +} + +""" +An event forwarder +""" +interface EventForwarder { +""" +An event forwarder +""" + id: String! +""" +An event forwarder +""" + name: String! +""" +An event forwarder +""" + description: String! +""" +An event forwarder +""" + enabled: Boolean! +} + +""" +An event forwarder +""" +type EventForwarderForSelection { +""" +Id of the event forwarder +""" + id: String! +""" +Name of the event forwarder +""" + name: String! +""" +Description of the event forwarder +""" + description: String! + enabled: Boolean! +""" +The kind of event forwarder +""" + kind: EventForwarderKind! +} + +""" +The kind of an event forwarder +""" +enum EventForwarderKind { + Kafka +} + +""" +An event forwarding rule +""" +type EventForwardingRule { +""" +The unique id for the event forwarding rule +""" + id: String! +""" +The query string for filtering and mapping the events to forward +""" + queryString: String! +""" +The id of the event forwarder +""" + eventForwarderId: String! +""" +The unix timestamp the event forwarder was created +""" + createdAt: Long + languageVersion: LanguageVersion! +} + +""" +Fields that helps describe the status of eviction +""" +type EvictionStatus { + currentlyUnderReplicatedBytes: Long! + totalSegmentBytes: Long! + isDigester: Boolean! + bytesThatExistOnlyOnThisNode: Float! +} + +""" +The specification of an external function. +""" +type ExternalFunctionSpecificationOutput { +""" +The name of the external function. +""" + name: String! +""" +The URL for the external function. +""" + procedureURL: String! +""" +The parameter specifications for the external function. +""" + parameters: [ParameterSpecificationOutput!]! +""" +The description for the external function. +""" + description: String! +""" +The kind of external function. This defines how the external function is executed. +""" + kind: KindOutput! +} + +""" +Information about an FDR feed. +""" +type FdrFeed { +""" +Id of the FDR feed. +""" + id: String! +""" +Name of the FDR feed. +""" + name: String! +""" +Description of the FDR feed. +""" + description: String +""" +The id of the parser that is used to parse the FDR data. +""" + parserId: String! +""" +AWS client id of the FDR feed. +""" + clientId: String! +""" +AWS SQS queue url of the FDR feed. +""" + sqsUrl: String! +""" +AWS S3 Identifier of the FDR feed. +""" + s3Identifier: String! +""" +Is ingest from the FDR feed enabled? +""" + enabled: Boolean! +} + +""" +Administrator control for an FDR feed +""" +type FdrFeedControl { +""" +Id of the FDR feed. +""" + id: String! +""" +Maximum number of nodes to poll FDR feed with +""" + maxNodes: Int +""" +Maximum amount of files downloaded from s3 in parallel for a single node. +""" + fileDownloadParallelism: Int +} + +enum FeatureAnnouncement { + AggregateAlertSearchPage + AggregateAlertOverview + FleetRemoteUpdatesAndGroups + FilterMatchHighlighting + OrganizationOwnedQueries + Interactions + FieldInteractions + PuffinRebranding + FetchMoreOnFieldsPanel + ToolPanel +} + +""" +Represents a feature flag. +""" +enum FeatureFlag { +""" +[PREVIEW: This functionality is still under development and can change without warning.] Export data to bucket storage. +""" + ExportToBucket +""" +[PREVIEW: This functionality is still under development and can change without warning.] Enable repeating queries. Can be used instead of live queries for functions having limitations around live queries. +""" + RepeatingQueries +""" +[PREVIEW: This functionality is still under development and can change without warning.] Enable custom ingest tokens not generated by LogScale. +""" + CustomIngestTokens +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable permission tokens. +""" + PermissionTokens +""" +[PREVIEW: This functionality is still under development and can change without warning.] Assign default roles for groups. +""" + DefaultRolesForGroups +""" +[PREVIEW: This functionality is still under development and can change without warning.] Use new organization limits. +""" + NewOrganizationLimits +""" +[PREVIEW: This functionality is still under development and can change without warning.] Authenticate cookies server-side. +""" + CookieAuthServerSide +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable ArrayFunctions in query language. +""" + ArrayFunctions +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable geography functions in query language. +""" + GeographyFunctions +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Prioritize newer over older segments. +""" + CachePolicies +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable searching across LogScale clusters. +""" + MultiClusterSearch +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable subdomains for current cluster. +""" + SubdomainForOrganizations +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable Humio Managed repositories. The customer is not permitted to change certain configurations in a LogScale Managed repository. +""" + ManagedRepositories +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Allow users to configure FDR feeds for managed repositories +""" + ManagedRepositoriesAllowFDRConfig +""" +[PREVIEW: This functionality is still under development and can change without warning.] The UsagePage shows data from ingestAfterFieldRemovalSize instead of segmentWriteBytes +""" + UsagePageUsingIngestAfterFieldRemovalSize +""" +[PREVIEW: This functionality is still under development and can change without warning.] Enable falcon data connector +""" + FalconDataConnector +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Flag for testing, does nothing +""" + SleepFunction +""" +[PREVIEW: This functionality is still under development and can change without warning.] Enable login bridge +""" + LoginBridge +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables download of macos installer for logcollector through fleet management +""" + MacosInstallerForLogCollector +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables UsageJob to log average usage as part of usage log +""" + LogAverageUsage +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables ephemeral hosts support for fleet management +""" + FleetEphemeralHosts +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables fleet management collector metrics +""" + FleetCollectorMetrics +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] No currentHosts writes for segments in buckets +""" + NoCurrentsForBucketSegments +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Pre-merge mini-segments +""" + PreMergeMiniSegments +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Use a new segment file format on write - not readable by older versions +""" + WriteNewSegmentFileFormat +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables fleet management collector debug logging +""" + FleetCollectorDebugLogging +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables LogScale Collector remote updates +""" + FleetRemoteUpdates +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables alternate query merge target handling +""" + AlternateQueryMergeTargetHandling +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables query optimizations for fleet management +""" + FleetUseStaticQueries +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables labels for fleet management +""" + FleetLabels +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables Field Aliasing +""" + FieldAliasing +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] External Functions +""" + ExternalFunctions +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable the LogScale Query Assistant +""" + QueryAssistant +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable Flight Control support in cluster +""" + FlightControl +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enable organization level security policies. For instance the ability to only enable certain action types. +""" + OrganizationSecurityPolicies +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables a limit on query backtracking +""" + QueryBacktrackingLimit +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Adds a derived #repo.cid tag when searching in views or dataspaces within an organization with an associated CID +""" + DerivedCidTag +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Live tables +""" + LiveTables +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables the MITRE Detection Annotation function +""" + MitreDetectionAnnotation +""" +[PREVIEW: This functionality is still under development and can change without warning. THIS FUNCTIONALITY IS EXPERIMENTAL: Enabling experimental functionality is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] Enables having multiple role bindings for a single view in the same group. This feature flag does nothing until min version is at least 1.150.0 +""" + MultipleViewRoleBindings +} + +""" +Feature flags with details +""" +type FeatureFlagV2 { + flag: FeatureFlag! + description: String! + experimental: Boolean! +} + +type FieldAliasSchema { + id: String! + name: String! + fields: [SchemaField!]! + instances: [AliasMapping!]! + version: String! +} + +type FieldAliasSchemasInfo { + schemas: [FieldAliasSchema!]! + activeSchemaOnOrg: String + activeSchemasOnViews: [ActiveSchemaOnView!]! +} + +""" +Field condition comparison operator type +""" +enum FieldConditionOperatorType { + Equal + NotEqual + Contains + NotContains + StartsWith + EndsWith + Present + NotPresent + Unknown +} + +""" +Presentation preferences used when a field is added to table and event list widgets in the UI. +""" +type FieldConfiguration { +""" +The field the configuration is associated with. +""" + fieldName: String! +""" +A JSON object containing the column properties applied to the column when it is added to a widget. +""" + config: JSON! +} + +""" +An assertion that an event output from a parser test case has an expected value for a given field. +""" +type FieldHasValue { +""" +Field to assert on. +""" + fieldName: String! +""" +Value expected to be contained in the field. +""" + expectedValue: String! +} + +""" +A file upload to LogScale for use with the `match` query function. You can see them under the Files page in the UI. +""" +type File { + contentHash: String! + nameAndPath: FileNameAndPath! + createdAt: DateTime! + createdBy: String! + modifiedAt: DateTime! + fileSizeBytes: Long + modifiedBy: String! + packageId: VersionedPackageSpecifier + package: PackageInstallation +""" +The view or repository for the file +""" + view: PartialSearchDomain +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +A file asset +""" +type FileEntry { + view: SearchDomain + file: File! +} + +""" +A field in a file and what value the field should have for a given entry to pass the filter. +""" +input FileFieldFilterType { +""" +A field in a file and what value the field should have for a given entry to pass the filter. +""" + field: String! +""" +A field in a file and what value the field should have for a given entry to pass the filter. +""" + values: [String!]! +} + +type FileNameAndPath { + name: String! +""" +Paths for files can be one of two types: absolute or relative. +Absolute paths start with a slash, and relative paths start without a slash, like Unix paths. + +Every repository or view in the system is considered a "folder" in its own right, +meaning that every relative path is relative to the current view. +An absolute path points to something that can be addressed from any view, +and a relative path points to a file located inside the view. +If there is no path, it means the file is located at your current location. + +""" + path: String +} + +""" +The config for lookup files. +""" +type FilesConfig { + maxFileUploadSize: Int! +} + +""" +A filter alert. +""" +type FilterAlert { +""" +Id of the filter alert. +""" + id: String! +""" +Name of the filter alert. +""" + name: String! +""" +Description of the filter alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +List of ids for actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the filter alert. +""" + labels: [String!]! +""" +Flag indicating whether the filter alert is enabled. +""" + enabled: Boolean! +""" +Throttle time in seconds. +""" + throttleTimeSeconds: Long +""" +A field to throttle on. Can only be set if throttleTimeSeconds is set. +""" + throttleField: String +""" +Unix timestamp for last successful poll of the filter alert query. If this is not quite recent, then the alert might be having problems. +""" + lastSuccessfulPoll: Long +""" +Unix timestamp for last execution of trigger. +""" + lastTriggered: Long +""" +Unix timestamp for last error. +""" + lastErrorTime: Long +""" +Last error encountered while running the filter alert. +""" + lastError: String +""" +Last warnings encountered while running the filter alert. +""" + lastWarnings: [String!]! +""" +YAML specification of the filter alert. +""" + yamlTemplate: YAML! +""" +The id of the package that the alert was installed as part of. +""" + packageId: VersionedPackageSpecifier +""" +The package that the alert was installed as part of. +""" + package: PackageInstallation +""" +Ownership of the query run by this alert +""" + queryOwnership: QueryOwnership! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +The default config for filter alerts. +""" +type FilterAlertConfig { +""" +Maximum trigger limit for filter alerts with one or more email actions. +""" + filterAlertEmailTriggerLimit: Int! +""" +Maximum trigger limit for filter alerts with no email actions. +""" + filterAlertNonEmailTriggerLimit: Int! +} + +type FilterAlertTemplate { + name: String! + displayName: String! + yamlTemplate: YAML! + labels: [String!]! +} + +enum FleetConfiguration__SortBy { + Name + ModifiedBy + Instances + Size + LastModified +} + +enum FleetGroups__SortBy { + Filter + WantedVersion + Collectors + Name +} + +type FleetInstallationToken { + token: String! + name: String! + assignedConfiguration: LogCollectorConfiguration + installationCommands: LogCollectorInstallCommand! +} + +enum FleetInstallationTokens__SortBy { + Name + ConfigName +} + +enum Fleet__SortBy { + Hostname + System + Version + Ingest + LastActivity + ConfigName + CpuAverage5Min + MemoryMax5Min + DiskMax5Min + Change +} + +""" +Settings for the Java Flight Recorder. +""" +type FlightRecorderSettings { +""" +True if OldObjectSample is enabled +""" + oldObjectSampleEnabled: Boolean! +""" +The duration old object sampling will run for before dumping results and restarting +""" + oldObjectSampleDurationMinutes: Long! +} + +""" +Data for generating an unsaved aggregate alert object from a library package template +""" +input GenerateAggregateAlertFromPackageTemplateInput { +""" +Data for generating an unsaved aggregate alert object from a library package template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved aggregate alert object from a library package template +""" + packageId: VersionedPackageSpecifier! +""" +Data for generating an unsaved aggregate alert object from a library package template +""" + templateName: String! +} + +""" +Data for generating an unsaved aggregate alert object from a yaml template +""" +input GenerateAggregateAlertFromTemplateInput { +""" +Data for generating an unsaved aggregate alert object from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved aggregate alert object from a yaml template +""" + yamlTemplate: YAML! +} + +""" +Data for generating an unsaved alert object from a library package template +""" +input GenerateAlertFromPackageTemplateInput { +""" +Data for generating an unsaved alert object from a library package template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved alert object from a library package template +""" + packageId: VersionedPackageSpecifier! +""" +Data for generating an unsaved alert object from a library package template +""" + templateName: String! +} + +""" +Data for generating an unsaved alert object from a yaml template +""" +input GenerateAlertFromTemplateInput { +""" +Data for generating an unsaved alert object from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved alert object from a yaml template +""" + yamlTemplate: YAML! +} + +""" +Data for generating an unsaved filter alert object from a library package template +""" +input GenerateFilterAlertFromPackageTemplateInput { +""" +Data for generating an unsaved filter alert object from a library package template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved filter alert object from a library package template +""" + packageId: VersionedPackageSpecifier! +""" +Data for generating an unsaved filter alert object from a library package template +""" + templateName: String! +} + +""" +Data for generating an unsaved filter alert object from a yaml template +""" +input GenerateFilterAlertFromTemplateInput { +""" +Data for generating an unsaved filter alert object from a yaml template +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved filter alert object from a yaml template +""" + yamlTemplate: YAML! +} + +""" +Data for generating an unsaved parser object from a YAML template +""" +input GenerateParserFromTemplateInput { +""" +Data for generating an unsaved parser object from a YAML template +""" + yamlTemplate: YAML! +} + +""" +Data for generating an unsaved scheduled search object from a library package template. +""" +input GenerateScheduledSearchFromPackageTemplateInput { +""" +Data for generating an unsaved scheduled search object from a library package template. +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved scheduled search object from a library package template. +""" + packageId: VersionedPackageSpecifier! +""" +Data for generating an unsaved scheduled search object from a library package template. +""" + templateName: String! +} + +""" +Data for generating an unsaved scheduled search object from a yaml templat. +""" +input GenerateScheduledSearchFromTemplateInput { +""" +Data for generating an unsaved scheduled search object from a yaml templat. +""" + viewName: RepoOrViewName! +""" +Data for generating an unsaved scheduled search object from a yaml templat. +""" + yamlTemplate: YAML! +} + +""" +The input required to get an external function specification. +""" +input GetExternalFunctionInput { +""" +The input required to get an external function specification. +""" + name: String! +""" +The input required to get an external function specification. +""" + view: String! +} + +""" +A group. +""" +type Group { + id: String! + displayName: String! + defaultQueryPrefix: String + defaultRole: Role + defaultSearchDomainCount: Int! + lookupName: String + searchDomainCount: Int! + roles: [SearchDomainRole!]! + searchDomainRoles( + searchDomainId: String + ): [SearchDomainRole!]! + searchDomainRolesByName( + searchDomainName: String! + ): SearchDomainRole + searchDomainRolesBySearchDomainName( + searchDomainName: String! + ): [SearchDomainRole!]! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Get asset permissions assigned to the group for the specific asset +""" + assetPermissions( +""" +Id of the asset +""" + assetId: String! +""" +Asset type +""" + assetType: AssetPermissionsAssetType! + searchDomainId: String + ): AssetPermissionsForGroup! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Search for asset permissions for the group +""" + searchAssetPermissions( +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The sort by options for asset permissions. +""" + sortBy: SortBy +""" +Asset type +""" + assetType: AssetPermissionsAssetType! +""" +List of search domain id's to search within +""" + searchDomainIds: [String!] +""" +Include UpdateAsset and/or DeleteAsset permission assignments +""" + permissions: AssetPermissionInputEnum +""" +If this is set to true, the search will also return all assets, that the group has not been assigned any permissions for +""" + includeUnassignedAssets: Boolean + ): AssetPermissionSearchResultSet! + systemRoles: [GroupSystemRole!]! + organizationRoles: [GroupOrganizationRole!]! + queryPrefixes( + onlyIncludeRestrictiveQueryPrefixes: Boolean + onlyForRoleWithId: String + ): [QueryPrefixes!]! + userCount: Int! + users: [User!]! + searchUsers( +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +The value to sort the result set by. +""" + sortBy: OrderByUserField +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + ): UserResultSetType! +} + +""" +Group to asset permissions assignments +""" +type GroupAssetPermissionAssignment { + group: Group! + assetPermissions: [AssetPermissionOutputEnum!]! +} + +input GroupFilter { + oldQuery: String + newQuery: String! +} + +type GroupFilterInfo { + total: Int! + added: Int! + removed: Int! + noChange: Int! +} + +""" +The organization roles of the group. +""" +type GroupOrganizationRole { + role: Role! +} + +""" +A page of groups in an organization. +""" +type GroupPage { + pageInfo: PageType! + page: [Group!]! +} + +""" +The groups query result set. +""" +type GroupResultSetType { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Group!]! +} + +""" +A group to role assignment +""" +type GroupRole { + group: Group! + role: Role! +} + +""" +The role assigned to a group in a SearchDomain +""" +type GroupSearchDomainRole { + role: Role! + searchDomain: SearchDomain! + group: Group! +} + +""" +The system roles of the group. +""" +type GroupSystemRole { + role: Role! +} + +""" +Health status of the service +""" +type HealthStatus { +""" +The latest status from the service +""" + status: String! +""" +The latest health status message from the service +""" + message: String! +} + +""" +Represents information about the LogScale instance. +""" +type HumioMetadata { +""" +Returns enabled features that are likely in beta. +""" + isFeatureFlagEnabled( + feature: FeatureFlag! + ): Boolean! + externalPermissions: Boolean! + version: String! +""" +[PREVIEW: Experimental field used to improve the user experience during cluster upgrades.] An indication whether or not the cluster is being updated. This is based off of differences in the cluster node versions. +""" + isClusterBeingUpdated: Boolean! +""" +[PREVIEW: Experimental field used to improve the user experience during cluster upgrades.] The lowest detected node version in the cluster. +""" + minimumNodeVersion: String! + environment: EnvironmentType! + clusterId: String! + falconDataConnectorUrl: String + regions: [RegionSelectData!]! +""" +[PREVIEW: Experimental feature, not ready for production.] List of supported AWS regions +""" + awsRegions: [String!]! +""" +[PREVIEW: Experimental feature, not ready for production.] Cluster AWS IAM role arn (Amazon Resource Name) used to assume role for ingest feeds +""" + ingestFeedAwsRoleArn: String +""" +[PREVIEW: Experimental feature, not ready for production.] Configuration status for AWS ingest feeds. +""" + awsIngestFeedsConfigurationStatus: IngestFeedConfigurationStatus! + sharedDashboardsEnabled: Boolean! + personalUserTokensEnabled: Boolean! + globalAllowListEmailActionsEnabled: Boolean! + isAutomaticUpdateCheckingEnabled: Boolean! +""" +The authentication method used for the cluster node +""" + authenticationMethod: AuthenticationMethod! + organizationMultiMode: Boolean! + organizationMode: OrganizationMode! + sandboxesEnabled: Boolean! + externalGroupSynchronization: Boolean! + allowActionsNotUseProxy: Boolean! + isUsingSmtp: Boolean! + isPendingUsersEnabled: Boolean! + scheduledSearchMaxBackfillLimit: Int + isExternalManaged: Boolean! + isApiExplorerEnabled: Boolean! + isScheduledReportEnabled: Boolean! + eulaUrl: String! +""" +The time in ms after which a repository has been marked for deletion it will no longer be restorable. +""" + deleteBackupAfter: Long! + maxCsvFileUploadSizeBytes: Long! + maxJsonFileUploadSizeBytes: Long! +""" +The filter alert config. +""" + filterAlertConfig: FilterAlertConfig! +""" +The lookup files config. +""" + filesConfig: FilesConfig! +} + +""" +A LogScale query +""" +type HumioQuery { + languageVersion: LanguageVersion! + queryString: String! + arguments: [DictionaryEntryType!]! + start: String! + end: String! + isLive: Boolean! +} + +""" +An IP Filter +""" +type IPFilter { +""" +The unique id for the ip filter +""" + id: String! +""" +The name for the ip filter +""" + name: String! +""" +The ip filter +""" + ipFilter: String! +} + +type IdentityProviderAuth { + id: String! + name: String! + authenticationMethod: AuthenticationMethodAuth! +} + +""" +An Identity Provider +""" +interface IdentityProviderAuthentication { +""" +An Identity Provider +""" + id: String! +""" +An Identity Provider +""" + name: String! +""" +An Identity Provider +""" + defaultIdp: Boolean! +""" +An Identity Provider +""" + humioManaged: Boolean! +""" +An Identity Provider +""" + lazyCreateUsers: Boolean! +""" +An Identity Provider +""" + domains: [String!]! +""" +An Identity Provider +""" + debug: Boolean! +} + +type Ingest { + currentBytes: Long! + limit: UsageLimit! +} + +""" +An ingest feed. +""" +type IngestFeed { +""" +Id of the ingest feed. +""" + id: String! +""" +Name of the ingest feed. +""" + name: String! +""" +Description of the ingest feed. +""" + description: String +""" +Parser used to parse the ingest feed. +""" + parser: Parser +""" +Is ingest from the ingest feed enabled? +""" + enabled: Boolean! +""" +The source which this ingest feed will ingest from +""" + source: IngestFeedSource! +""" +Unix timestamp for when this feed was created +""" + createdAt: Long! +""" +Details about how the ingest feed is running +""" + executionInfo: IngestFeedExecutionInfo +} + +""" +How to authenticate to AWS. +""" +union IngestFeedAwsAuthentication =IngestFeedAwsAuthenticationIamRole + +""" +IAM role authentication +""" +type IngestFeedAwsAuthenticationIamRole { +""" +Arn of the role to be assumed +""" + roleArn: String! +""" +External Id to the role to be assumed +""" + externalId: String! +} + +""" +Compression scheme of the file. +""" +enum IngestFeedCompression { + Auto + Gzip + None +} + +""" +Represents the configuration status of the ingest feed feature on the cluster +""" +type IngestFeedConfigurationStatus { + isConfigured: Boolean! +} + +""" +Details about how the ingest feed is running +""" +type IngestFeedExecutionInfo { +""" +Unix timestamp of the latest activity for the feed +""" + latestActivity: Long +""" +Details about the status of the ingest feed +""" + statusMessage: IngestFeedStatus +} + +""" +The preprocessing to apply to an ingest feed before parsing. +""" +union IngestFeedPreprocessing =IngestFeedPreprocessingSplitNewline | IngestFeedPreprocessingSplitAwsRecords + +""" +The kind of preprocessing to do. +""" +enum IngestFeedPreprocessingKind { +""" +Interpret the input as AWS JSON record format and emit each record as an event +""" + SplitAwsRecords +""" +Interpret the input as newline-delimited and emit each line as an event +""" + SplitNewline +} + +""" +Interpret the input as AWS JSON record format and emit each record as an event +""" +type IngestFeedPreprocessingSplitAwsRecords { +""" +The kind of preprocessing to do. +""" + kind: IngestFeedPreprocessingKind! +} + +""" +Interpret the input as newline-delimited and emit each line as an event +""" +type IngestFeedPreprocessingSplitNewline { +""" +The kind of preprocessing to do. +""" + kind: IngestFeedPreprocessingKind! +} + +""" +The ingest feed query result set +""" +type IngestFeedQueryResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [IngestFeed!]! +} + +""" +An ingest feed that polls data from S3 and is notified via SQS +""" +type IngestFeedS3SqsSource { +""" +AWS SQS queue url. +""" + sqsUrl: String! +""" +The preprocessing to apply to an ingest feed before parsing. +""" + preprocessing: IngestFeedPreprocessing! +""" +How to authenticate to AWS. +""" + awsAuthentication: IngestFeedAwsAuthentication! +""" +Compression scheme of the file. +""" + compression: IngestFeedCompression! +""" +The AWS region to connect to. +""" + region: String! +} + +""" +The source from which to download from an ingest feed. +""" +union IngestFeedSource =IngestFeedS3SqsSource + +""" +Details about the status of the ingest feed +""" +type IngestFeedStatus { +""" +Description of the problem with the ingest feed +""" + problem: String! +""" +Terse description of the problem with the ingest feed +""" + terseProblem: String +""" +Timestamp, in milliseconds, of when the status message was set +""" + statusTimestamp: Long! +""" +Cause of the problem with the ingest feed +""" + cause: IngestFeedStatusCause +} + +""" +Details about the cause of the problem +""" +type IngestFeedStatusCause { +""" +Description of the cause of the problem +""" + cause: String! +""" +Terse description of the cause of the problem +""" + terseCause: String +} + +enum IngestFeeds__SortBy { + CreatedTimeStamp + Name +} + +enum IngestFeeds__Type { + AwsS3Sqs +} + +""" +Ingest Listeners listen on a port for UDP or TCP traffic, used with SysLog. +""" +type IngestListener { + id: String! + repository: Repository! +""" +The TCP/UDP port to listen to. +""" + port: Int! +""" +The network protocol data is sent through. +""" + protocol: IngestListenerProtocol! +""" +The charset used to decode the event stream. Available charsets depend on the JVM running the LogScale instance. Names and aliases can be found at http://www.iana.org/assignments/character-sets/character-sets.xhtml +""" + charset: String! +""" +Specify which host should open the socket. By default this field is empty and all hosts will open a socket. This field can be used to select only one host to open the socket. +""" + vHost: Int + name: String! +""" +The ip address this listener will bind to. By default (leaving this field empty) it will bind to 0.0.0.0 - all interfaces. Using this field it is also possible to specify the address to bind to. In a cluster setup it is also possible to specify if only one machine should open a socket - The vhost field is used for that. +""" + bindInterface: String! +""" +The parser configured to parse data for the listener. This returns null if the parser has been removed since the listener was created. +""" + parser: Parser +} + +""" +The network protocol a ingest listener uses. +""" +enum IngestListenerProtocol { +""" +UDP Protocol +""" + UDP +""" +TCP Protocol +""" + TCP +""" +Gelf over UDP Protocol +""" + GELF_UDP +""" +Gelf over TCP Protocol +""" + GELF_TCP +""" +Netflow over UDP +""" + NETFLOW_UDP +} + +""" +A cluster ingest partition. It assigns cluster nodes with the responsibility of ingesting data. +""" +type IngestPartition { + id: Int! +""" +The ids of the node responsible executing real-time queries for the partition and writing events to time series. The list is ordered so that the first node is the primary node and the rest are followers ready to take over if the primary fails. +""" + nodeIds: [Int!]! +} + +""" +An API ingest token used for sending data to LogScale. +""" +type IngestToken { + name: String! + token: String! + parser: Parser +} + +""" +The status of an IOC database table +""" +type IocTableInfo { +""" +The name of the indicator type in this table +""" + name: String! + status: IocTableStatus! +""" +The number of milliseconds since epoch that the IOC database was last updated +""" + lastUpdated: Long +""" +The number of indicators in the database +""" + count: Int! +} + +enum IocTableStatus { + Unauthorized + Unavailable + Ok +} + +""" +Represents information about the IP database used by LogScale +""" +type IpDatabaseInfo { +""" +The absolute file path of the file containing the database +""" + dbFilePath: String! +""" +The update strategy used for the IP Database +""" + updateStrategy: String! +""" +Metadata about the IP Database used by LogScale +""" + metadata: IpDatabaseMetadata +} + +""" +Represents metadata about the IP database used by LogScale +""" +type IpDatabaseMetadata { +""" +The type of database +""" + type: String! +""" +The date on which the database was build +""" + buildDate: DateTime! +""" +The description of the database +""" + description: String! +""" +The md5 hash of the file containing the database +""" + dbFileMd5: String! +} + +scalar JSON + +type KafkaClusterDescription { + clusterID: String! + nodes: [KafkaNode!]! + controller: KafkaNode! + logDirDescriptions: [KafkaLogDir!]! + globalEventsTopic: KafkaTopicDescription! + ingestTopic: KafkaTopicDescription! + chatterTopic: KafkaTopicDescription! +} + +type KafkaLogDir { + nodeID: Int! + path: String! + error: String + topicPartitions: [KafkaNodeTopicPartitionLogDescription!]! +} + +type KafkaNode { + id: Int! + host: String + port: Int! + rack: String +} + +type KafkaNodeTopicPartitionLogDescription { + topicPartition: KafkaTopicPartition! + offset: Long! + size: Long! + isFuture: Boolean! +} + +type KafkaTopicConfig { + key: String! + value: String! +} + +type KafkaTopicConfigs { + configs: [KafkaTopicConfig!]! + defaultConfigs: [KafkaTopicConfig!]! +} + +type KafkaTopicDescription { + name: String! + config: KafkaTopicConfigs! + partitions: [KafkaTopicPartitionDescription!]! +} + +type KafkaTopicPartition { + topic: String! + partition: Int! +} + +type KafkaTopicPartitionDescription { + partition: Int! + leader: Int! + replicas: [Int!]! + inSyncReplicas: [Int!]! +} + +""" +The kind of the external function +""" +enum KindEnum { + Source + General + Enrichment +} + +""" +Defines how the external function is executed. +""" +type KindOutput { +""" +The name of the kind of external function. +""" + name: KindEnum! +""" +The parameters that specify the key fields. Use for the 'Enrichment' functions. +""" + parametersDefiningKeyFields: [String!] +""" +The names of the keys when they're returned from the external function. Use for the 'Enrichment' functions. +""" + fixedKeyFields: [String!] +} + +type LanguageVersion { +""" +If non-null, this is a version known by the current version of LogScale. +""" + name: LanguageVersionEnum +""" +If non-null, this is a version stored by a future LogScale version. +""" + futureName: String +""" +The language version. +""" + version: LanguageVersionOutputType! +""" +If false, this version isn't recognized by the current version of LogScale. +It must have been stored by a future LogScale version. +This can happen if LogScale was upgraded, and subsequently downgraded (rolled back). +""" + isKnown: Boolean! +} + +""" +The version of the LogScale query language to use. +""" +enum LanguageVersionEnum { + legacy + xdr1 + xdrdetects1 + filteralert + federated1 +} + +""" +A specific language version. +""" +input LanguageVersionInputType { +""" +A specific language version. +""" + name: String! +} + +""" +A specific language version. +""" +type LanguageVersionOutputType { +""" +The name of the language version. The name is case insensitive. +""" + name: String! +} + +""" +Represents information about the LogScale instance. +""" +interface License { +""" +Represents information about the LogScale instance. +""" + expiresAt: DateTime! +""" +Represents information about the LogScale instance. +""" + issuedAt: DateTime! +} + +""" +A Limit added to the organization. +""" +type Limit { +""" +The limit name +""" + limitName: String! +""" +If the limit allows logging in +""" + allowLogin: Boolean! +""" +The daily ingest allowed for the limit +""" + dailyIngest: Long! +""" +The retention in days allowed for the limit +""" + retention: Int! +""" +If the limit allows self service +""" + allowSelfService: Boolean! +""" +The deleted date for the limit +""" + deletedDate: Long +} + +""" +A Limit added to the organization. +""" +type LimitV2 { +""" +The id +""" + id: String! +""" +The limit name +""" + limitName: String! +""" +The display name of the limit +""" + displayName: String! +""" +If the limit allows logging in +""" + allowLogin: Boolean! +""" +The daily ingest allowed for the limit +""" + dailyIngest: contractual! +""" +The amount of storage allowed for the limit +""" + storageLimit: contractual! +""" +The data scanned measurement allowed for the limit +""" + dataScannedLimit: contractual! +""" +The usage measurement type used for the limit +""" + measurementPoint: Organizations__MeasurementType! +""" +The user seats allowed for the limit +""" + userLimit: contractual! +""" +The number of repositories allowed for the limit +""" + repoLimit: Int +""" +The retention in days for the limit, that's the contracted value +""" + retention: Int! +""" +The max retention in days allowed for the limit, this can be greater than or equal to retention +""" + maxRetention: Int! +""" +If the limit allows self service +""" + allowSelfService: Boolean! +""" +The deleted date for the limit +""" + deletedDate: Long +""" +The expiration date for the limit +""" + expirationDate: Long +""" +If the limit is a trial +""" + trial: Boolean! +""" +If the customer is allowed flight control +""" + allowFlightControl: Boolean! +""" +Data type for the limit, all repositories linked to the limit will get this datatype logged in usage +""" + dataType: String! +""" +Repositories attached to the limit +""" + repositories: [Repository!]! +} + +""" +All data related to a scheduled report accessible with a readonly scheduled report access token +""" +type LimitedScheduledReport { +""" +Id of the scheduled report. +""" + id: String! +""" +Name of the scheduled report. +""" + name: String! +""" +Description of the scheduled report. +""" + description: String! +""" +Name of the dashboard referenced by the report. +""" + dashboardName: String! +""" +Display name of the dashboard referenced by the report. +""" + dashboardDisplayName: String! +""" +Shared time interval of the dashboard referenced by the report. +""" + dashboardSharedTimeInterval: SharedDashboardTimeInterval +""" +Widgets of the dashboard referenced by the report. +""" + dashboardWidgets: [Widget!]! +""" +Sections of the dashboard referenced by the report. +""" + dashboardSections: [Section!]! +""" +The name of the repository or view queries are executed against. +""" + repoOrViewName: RepoOrViewName! +""" +Layout of the scheduled report. +""" + layout: ScheduledReportLayout! +""" +Timezone of the schedule. Examples include UTC, Europe/Copenhagen. +""" + timeZone: String! +""" +List of parameter value configurations. +""" + parameters: [ParameterValue!]! +} + +""" +The status of a local cluster connection. +""" +type LocalClusterConnectionStatus implements ClusterConnectionStatus{ +""" +Name of the local view +""" + viewName: String +""" +Id of the connection +""" + id: String +""" +Whether the connection is valid +""" + isValid: Boolean! +""" +Errors if the connection is invalid +""" + errorMessages: [ConnectionAspectErrorType!]! +} + +""" +A fleet search result entry +""" +type LogCollector { +""" +If the collector is enrolled this is its id +""" + id: String +""" +The hostname +""" + hostname: String! +""" +The host system +""" + system: String! +""" +Version +""" + version: String! +""" +Last activity recorded +""" + lastActivity: String! +""" +Ingest last 24h. +""" + ingestLast24H: Long! +""" +Ip address +""" + ipAddress: String + logSources: [LogCollectorLogSource!]! +""" +Log collector machineId +""" + machineId: String! +""" +contains the name of any manually assigned config +""" + configName: String +""" +contains the id of any manually assigned config +""" + configId: String + configurations: [LogCollectorConfigInfo!]! + errors: [String!]! + cfgTestId: String + cpuAverage5Min: Float + memoryMax5Min: Long + diskMax5Min: Float + change: Changes + groups: [LogCollectorGroup!]! + wantedVersion: String + debugLogging: LogCollectorDebugLogging + timeOfUpdate: DateTime + usesRemoteUpdate: Boolean! + ephemeralTimeout: Int + status: LogCollectorStatusType + labels: [LogCollectorLabel!]! +} + +type LogCollectorConfigInfo { + id: String! + name: String! + group: LogCollectorGroup + assignment: LogCollectorConfigurationAssignmentType! +} + +""" +A configuration file for a log collector +""" +type LogCollectorConfiguration { + id: String! + name: String! + yaml: String + draft: String + version: Int! + yamlCharactersCount: Int! + modifiedAt: DateTime! + draftModifiedAt: DateTime + modifiedBy: String! + instances: Int! + description: String + isTestRunning: Boolean! +} + +enum LogCollectorConfigurationAssignmentType { + Group + Manual + Test +} + +type LogCollectorConfigurationProblemAtPath { + summary: String! + details: String + path: String! + number: Int! +} + +union LogCollectorDebugLogging =LogCollectorDebugLoggingStatic + +type LogCollectorDebugLoggingStatic { + url: String + token: String! + level: String! + repository: String +} + +""" +Details about a Log Collector +""" +type LogCollectorDetails { +""" +If the collector is enrolled this is its id +""" + id: String +""" +The hostname +""" + hostname: String! +""" +The host system +""" + system: String! +""" +Version +""" + version: String! +""" +Last activity recorded +""" + lastActivity: String! +""" +Ip address +""" + ipAddress: String + logSources: [LogCollectorLogSource!]! +""" +Log collector machineId +""" + machineId: String! + configurations: [LogCollectorConfigInfo!]! + errors: [String!]! + cpuAverage5Min: Float + memoryMax5Min: Long + diskMax5Min: Float + ephemeralTimeout: Int + status: LogCollectorStatusType +} + +type LogCollectorGroup { + id: String! + name: String! + filter: String + configurations: [LogCollectorConfiguration!]! + collectorCount: Int + wantedVersion: String + onlyUsesRemoteUpdates: Boolean! +} + +type LogCollectorInstallCommand { + windowsCommand: String! + linuxCommand: String! + macosCommand: String! +} + +""" +Provides information about an installer of the LogScale Collector. +""" +type LogCollectorInstaller { +""" +Installer file name +""" + name: String! +""" +URL to fetch installer from +""" + url: String! +""" +LogScale Collector version +""" + version: String! +""" +Installer CPU architecture +""" + architecture: String! +""" +Installer type (deb, rpm or msi) +""" + type: String! +""" +Installer file size +""" + size: Int! +""" +Config file example +""" + configExample: String +""" +Icon file name +""" + icon: String +} + +type LogCollectorLabel { + name: String! + value: String! +} + +type LogCollectorLogSource { + sourceName: String! + sourceType: String! + sinkType: String! + parser: String + repository: String +} + +type LogCollectorMergedConfiguration { + problems: [LogCollectorConfigurationProblemAtPath!]! + content: String! +} + +enum LogCollectorStatusType { + Error + OK +} + +type LoginBridge { + name: String! + issuer: String! + description: String! + remoteId: String! + loginUrl: String! + relayStateUUrl: String! + samlEntityId: String! + publicSamlCertificate: String! + groupAttribute: String! + organizationIdAttributeName: String! + organizationNameAttributeName: String + additionalAttributes: String + groups: [String!]! + allowedUsers: [User!]! + generateUserName: Boolean! + termsDescription: String! + termsLink: String! + showTermsAndConditions: Boolean! +""" +True if any user in this organization has logged in to CrowdStream via LogScale. Requires manage organizations permissions +""" + anyUserAlreadyLoggedInViaLoginBridge: Boolean! +} + +type LoginBridgeRequest { + samlResponse: String! + loginUrl: String! + relayState: String! +} + +type LookupFileTemplate { + name: String! + displayName: String! + content: String! +} + +scalar Markdown + +""" +A place for LogScale to find packages. +""" +type Marketplace { +""" +Gets all categories in the marketplace. +""" + categoryGroups: [MarketplaceCategoryGroup!]! +} + +""" +A category that can be used to filter search results in the marketplace. +""" +type MarketplaceCategory { +""" +A display string for the category. +""" + title: String! +""" +The id is used to filter the searches. +""" + id: String! +} + +""" +A grouping of categories that can be used to filter search results in the marketplace. +""" +type MarketplaceCategoryGroup { +""" +A display string for the category group. +""" + title: String! +""" +The categories that are members of the group. +""" + categories: [MarketplaceCategory!]! +} + +type MonthlyIngest { + monthly: [UsageOnDay!]! +} + +""" +Query result for monthly ingest +""" +union MonthlyIngestQueryResult =QueryInProgress | MonthlyIngest + +type MonthlyStorage { + monthly: [StorageOnDay!]! +} + +""" +Query result for monthly storage +""" +union MonthlyStorageQueryResult =QueryInProgress | MonthlyStorage + +type NeverDashboardUpdateFrequency { + name: String! +} + +""" +Assignable node task. +""" +enum NodeTaskEnum { + storage + digest + query +} + +""" +A notification +""" +type Notification { +""" +The unique id for the notification +""" + id: String! +""" +The title of the notification +""" + title: String! +""" +The message for the notification +""" + message: String! +""" +Whether the notification is dismissable +""" + dismissable: Boolean! +""" +The severity of the notification +""" + severity: NotificationSeverity! +""" +The type of the notification +""" + type: NotificationTypes! +""" +Link accompanying the notification +""" + link: String +""" +Description for the link +""" + linkDescription: String +} + +enum NotificationSeverity { + Success + Info + Warning + Error +} + +enum NotificationTypes { + Banner + Announcement + Bell +} + +""" +Paginated response for notifications. +""" +type NotificationsResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Notification!]! +} + +type OidcIdentityProvider implements IdentityProviderAuthentication{ + id: String! + name: String! + clientId: String! + clientSecret: String! + domains: [String!]! + issuer: String! + tokenEndpointAuthMethod: String! + userClaim: String! + scopes: [String!]! + userInfoEndpoint: String + registrationEndpoint: String + tokenEndpoint: String + groupsClaim: String + jwksEndpoint: String + authenticationMethod: AuthenticationMethodAuth! + authorizationEndpoint: String + debug: Boolean! + federatedIdp: String + scopeClaim: String + defaultIdp: Boolean! + humioManaged: Boolean! + lazyCreateUsers: Boolean! +} + +type OnlyTotal { + total: Int! +} + +enum OrderBy { + DESC + ASC +} + +""" +OrderByDirection +""" +enum OrderByDirection { + DESC + ASC +} + +""" +OrderByUserField +""" +enum OrderByUserField { + FULLNAME + USERNAME + DISPLAYNAME +} + +input OrderByUserFieldInput { + userField: OrderByUserField! + order: OrderByDirection! +} + +""" +An Organization +""" +type Organization { +""" +The unique id for the Organization +""" + id: String! +""" +The CID corresponding to the organization +""" + cid: String +""" +The name for the Organization +""" + name: String! +""" +The description for the Organization, can be null +""" + description: String +""" +Details about the organization +""" + details: OrganizationDetails! +""" +Stats of the organization +""" + stats: OrganizationStats! +""" +Organization configurations and settings +""" + configs: OrganizationConfigs! +""" +Search domains in the organization +""" + searchDomains: [SearchDomain!]! +""" +IP filter for readonly dashboard links +""" + readonlyDashboardIPFilter: String +""" +Created date +""" + createdAt: Long +""" +If the organization has been marked for deletion, this indicates the day it was deleted. +""" + deletedAt: Long +""" +Trial started at +""" + trialStartedAt: Long +""" +Public url for the Organization +""" + publicUrl: String +""" +Ingest url for the Organization +""" + ingestUrl: String +""" +Check if the current user has a given permission in the organization. +""" + isActionAllowed( +""" +The action to check if a user is allowed to perform on an organization. +""" + action: OrganizationAction! + ): Boolean! +""" +Limits assigned to the organization +""" + limits: [Limit!]! +""" +Limits assigned to the organizations +""" + limitsV2: [LimitV2!]! + externalPermissions: Boolean! + externalGroupSynchronization: Boolean! +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] The default cache policy of this organization. +""" + defaultCachePolicy: CachePolicy +} + +""" +Actions a user may perform on an organization. +""" +enum OrganizationAction { + AdministerPermissions + CreateRepository + CreateView + ChangeReadOnlyDashboardFilter + CreateUser + ConfigureIdp + ChangeSessions + ChangeOrganizationSettings + CreateTrialRepository + UseCustomEmailTemplate + ViewLoginBridge + ViewUsage + ConfigureIPFilters + DeleteRepositoryOrView + ChangeFleetManagement + ViewFleetManagement + UseRemoteUpdates + UseFleetRemoteDebug + UseFleetEphemeralHosts + UseFleetStaticQueries + UseFleetLabels + ChangeTriggersToRunAsOtherUsers + ChangeEventForwarders + ViewRunningQueries + BlockQueries + AdministerTokens + ManageUsers + ViewIpFilters + DownloadMacOsInstaller + SecurityPoliciesEnabled + ChangeSecurityPolicies + QueryAssistant + OrganizationQueryOwnershipEnabled + UsePersonalToken + ChangeExternalFunctions + AddFederatedView + ViewFalconDataConnectorUrl + ManageSchemas +""" +[PREVIEW: This is a temporary value that will be removed again] +""" + ExternalFunctionsEnabled + ViewOrganizationSettings + ViewSecurityPolicies + ViewSessionSettings + ViewUsers + ViewPermissions + ViewIdp + ViewOrganizationTokens + ViewDeletedRepositoriesOrViews + ViewEventForwarders + ViewSchemas +} + +""" +Configurations for the organization +""" +type OrganizationConfigs { +""" +Session settings +""" + session: OrganizationSession! +""" +Social login settings +""" + socialLogin: [SocialLoginSettings!]! +""" +Subdomain configuration for the organization +""" + subdomains: SubdomainConfig +""" +Bucket storage configuration for the organization +""" + bucketStorage: BucketStorageConfig +""" +Security policies for actions in the organization +""" + actions: ActionSecurityPolicies +""" +Security policies for tokens in the organization +""" + tokens: TokenSecurityPolicies +""" +Security policies for shared dashboard tokens in the organization +""" + sharedDashboards: SharedDashboardsSecurityPolicies +""" +Login bridge +""" + loginBridge: LoginBridge +""" +Whether the organization is currently blocking ingest +""" + blockingIngest: Boolean! +""" +Default timezone to use for users without a default timezone set. +""" + defaultTimeZone: String +} + +""" +Details about the organization +""" +type OrganizationDetails { +""" +Notes of the organization (root only) +""" + notes: String! +""" +Industry of the organization +""" + industry: String! +""" +Industry of the organization +""" + useCases: [Organizations__UseCases!]! +""" +Subscription of the organization +""" + subscription: Organizations__Subscription! +""" +Trial end date of the organization if any +""" + trialEndDate: Long +""" +Limits of the organization +""" + limits: OrganizationLimits! +""" +The country of the organization +""" + country: String! +""" +Determines whether an organization has access to IOCs (indicators of compromise) +""" + iocAccess: Boolean +} + +""" +Limits of the organization +""" +type OrganizationLimits { +""" +Daily ingest allowed +""" + dailyIngest: Long! +""" +Days of retention allowed +""" + retention: Int! +""" +Max amount of users allowed +""" + users: Int! +""" +License expiration date +""" + licenseExpirationDate: Long +""" +Whether self service is enabled for the Organization, allowing features like creating repositories and setting retention. +""" + allowSelfService: Boolean! +""" +Last contract synchronization date +""" + lastSyncDate: Long +""" +Whether the contract is missing for the organization. None for non accounts, true if account and has no contract and false if contract was found and used. +""" + missingContract: Boolean +""" +Contract version +""" + contractVersion: Organizations__ContractVersion! +} + +""" +Organization management permissions +""" +enum OrganizationManagementPermission { + ManageSpecificOrganizations +} + +enum OrganizationMode { + Single + Multi + MultiV2 +} + +""" +Organization permissions +""" +enum OrganizationPermission { + ExportOrganization + ChangeOrganizationPermissions + ChangeIdentityProviders + CreateRepository + ManageUsers + ViewUsage + ChangeOrganizationSettings + ChangeIPFilters + ChangeSessions + ChangeAllViewOrRepositoryPermissions + IngestAcrossAllReposWithinOrganization + DeleteAllRepositories + DeleteAllViews + ViewAllInternalNotifications + ChangeFleetManagement + ViewFleetManagement + ChangeTriggersToRunAsOtherUsers + MonitorQueries + BlockQueries + ChangeSecurityPolicies + ChangeExternalFunctions + ChangeFieldAliases + ManageViewConnections +} + +""" +An organization search result entry +""" +type OrganizationSearchResultEntry { +""" +The unique id for the Organization +""" + organizationId: String! +""" +The name of the Organization +""" + organizationName: String! +""" +The string matching the search +""" + searchMatch: String! +""" +The id of the entity matched +""" + entityId: String! +""" +The subscription type of the organization +""" + subscription: Organizations__Subscription! +""" +The type of the search result match +""" + type: Organizations__SearchEntryType! +""" +The amount of users in the organization +""" + userCount: Int! +""" +The amount of repositories and views in the organization +""" + viewCount: Int! +""" +The total data volume in bytes that the organization is currently using +""" + byteVolume: Long! +""" +The end date of the trial if applicable +""" + trialEndDate: Long +""" +The time when the organization was created +""" + createdAt: Long! +""" +If the organization has been marked for deletion, this indicates the time when the organization was marked. +""" + deletedAt: Long +""" +The relevant organization for the result +""" + organization: Organization! +} + +""" +An organization search result set +""" +type OrganizationSearchResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [OrganizationSearchResultEntry!]! +} + +""" +Session configuration for the organization +""" +type OrganizationSession { +""" +The maximum time in ms the user is allowed to be inactive +""" + maxInactivityPeriod: Long! +""" +The time in ms after which the user is forced to reauthenticate +""" + forceReauthenticationAfter: Long! +} + +""" +Stats of the organization +""" +type OrganizationStats { +""" +Total compressed data volume used by the organization +""" + dataVolumeCompressed: Long! +""" +Total data volume used by the organization +""" + dataVolume: Long! +""" +The total daily ingest of the organization +""" + dailyIngest: Long! +""" +The number of users in the organization +""" + userCount: Int! +} + +enum OrganizationsLinks__SortBy { + Cid + OrgId + Name +} + +enum Organizations__ContractVersion { + Unknown + Version1 + Version2 +} + +enum Organizations__MeasurementType { + SegmentWriteSize + ProcessedEventsSize +} + +enum Organizations__SearchEntryType { + Organization + Repository + View + User +} + +enum Organizations__SortBy { + UserCount + Name + Volume + ViewCount + Subscription + CreatedAt +} + +enum Organizations__Subscription { + Paying + Trial + PreTrial + PostTrial + UnlimitedPoC + ClusterOwner + Complementary + OnPremMonitor + MissingTOSAcceptance + CommunityLocked + CommunityUnlocked + Partner + Internal + Churned + Unknown +} + +enum Organizations__UseCases { + Unknown + IoT + Security + Operations + ApplicationDevelopment +} + +""" +A Humio package +""" +type Package2 { + id: VersionedPackageSpecifier! + scope: PackageScope! + name: PackageName! + version: PackageVersion! + description: String + iconUrl: UrlOrData + author: PackageAuthor! + contributors: [PackageAuthor!]! + licenseUrl: URL! + minHumioVersion: SemanticVersion! + readme: Markdown + dashboardTemplates: [DashboardTemplate!]! + savedQueryTemplates: [SavedQueryTemplate!]! + parserTemplates: [ParserTemplate!]! + alertTemplates: [AlertTemplate!]! + filterAlertTemplates: [FilterAlertTemplate!]! + aggregateAlertTemplates: [AggregateAlertTemplate!]! + lookupFileTemplates: [LookupFileTemplate!]! + actionTemplates: [ActionTemplate!]! + scheduledSearchTemplates: [ScheduledSearchTemplate!]! + viewInteractionTemplates: [ViewInteractionTemplate!]! + type: PackageType! +""" +The available versions of the package on the marketplace. +""" + versionsOnMarketplace: [RegistryPackageVersionInfo!]! +} + +""" +The author of a package. +""" +type PackageAuthor { + name: String! + email: Email +} + +""" +A package installation. +""" +type PackageInstallation { + id: VersionedPackageSpecifier! + installedBy: UserAndTimestamp! + updatedBy: UserAndTimestamp! + source: PackageInstallationSourceType! +""" +Finds updates on a package. It also looks for updates on packages that were installed manually, in case e.g. test versions of a package have been distributed prior to the full release. +""" + availableUpdate: PackageVersion + package: Package2! +} + +enum PackageInstallationSourceType { + HumioHub + ZipFile +} + +scalar PackageName + +""" +Information about a package that matches a search in a package registry. +""" +type PackageRegistrySearchResultItem { + id: VersionedPackageSpecifier! + description: String + iconUrl: UrlOrData + type: PackageType! + installedVersion: VersionedPackageSpecifier +""" +True if the current version of LogScale supports the latest version of this package. +""" + isLatestVersionSupported: Boolean! +""" +The version of LogScale required to run the latest version of this package. +""" + minHumioVersionOfLatest: SemanticVersion! +} + +scalar PackageScope + +scalar PackageTag + +enum PackageType { + application + library +} + +scalar PackageVersion + +type PageType { + number: Int! + totalNumberOfRows: Int! + total: Int! +} + +""" +The specification of a parameter +""" +type ParameterSpecificationOutput { +""" +The name of the parameter +""" + name: String! +""" +The type of the parameter" +""" + parameterType: ParameterTypeEnum! +""" +Restricts the smallest allowed value for parameters of type Long +""" + minLong: Long +""" +Restricts the largest allowed value for parameters of type Long +""" + maxLong: Long +""" + Restricts the smallest allowed value for parameters of type Double +""" + minDouble: Float +""" +Restricts the largest allowed value for parameters of type Double +""" + maxDouble: Float +""" +Restricts the minimum number of allowed elements for parameters of type Array +""" + minLength: Int +""" +Defines a default value of the parameter +""" + defaultValue: [String!] +} + +""" +The parameter types +""" +enum ParameterTypeEnum { + Field + String + Long + Double + ArrayField + ArrayString + ArrayLong + ArrayDouble +} + +""" +Parameter value configuration. +""" +type ParameterValue { +""" +Id of the parameter. +""" + id: String! +""" +Value of the parameter. +""" + value: String! +} + +""" +A configured parser for incoming data. +""" +type Parser { +""" +The id of the parser. +""" + id: String! +""" +Name of the parser. +""" + name: String! +""" +The full name of the parser including package information if part of an application. +""" + displayName: String! +""" +The description of the parser. +""" + description: String + assetType: AssetType! +""" +True if the parser is one of LogScale's built-in parsers. +""" + isBuiltIn: Boolean! +""" +The parser script that is executed for every incoming event. +""" + script: String! +""" +The source code of the parser. +""" + sourceCode: String! + languageVersion: LanguageVersion! +""" +Fields that are used as tags. +""" + fieldsToTag: [String!]! +""" +The fields to use as tags. +""" + tagFields: [String!]! +""" +A list of fields that will be removed from the event before it's parsed. These fields will not be included when calculating usage. +""" + fieldsToBeRemovedBeforeParsing: [String!]! +""" +A template that can be used to recreate the parser. +""" + yamlTemplate: YAML! +""" +Saved test data (e.g. log lines) that you can use to test the parser. +""" + testData: [String!]! +""" +Test cases that can be used to help verify that the parser works as expected. +""" + testCases: [ParserTestCase!]! + packageId: VersionedPackageSpecifier + package: PackageInstallation +} + +type ParserTemplate { + name: String! + displayName: String! + yamlTemplate: String! +} + +""" +A test case for a parser. +""" +type ParserTestCase { +""" +The event to parse and test on. +""" + event: ParserTestEvent! +""" +Assertions on the shape of the test case output events. The list consists of key-value pairs to be treated as a map-construct, where the index of the output event is the key, and the assertions are the value. +""" + outputAssertions: [ParserTestCaseAssertionsForOutput!]! +} + +""" +Assertions on the shape of the given output event. It is a key-value pair, where the index of the output event is the key, and the assertions are the value. +""" +type ParserTestCaseAssertionsForOutput { +""" +The index of the output event which the assertions should apply to. +""" + outputEventIndex: Int! +""" +Assertions on the shape of a given test case output event. +""" + assertions: ParserTestCaseOutputAssertions! +} + +""" +Assertions on the shape of a given test case output event. +""" +type ParserTestCaseOutputAssertions { +""" +Names of fields which should not be present on the output event. +""" + fieldsNotPresent: [String!]! +""" +Names of fields and their expected value on the output event. These are key-value pairs, and should be treated as a map-construct. +""" + fieldsHaveValues: [FieldHasValue!]! +} + +""" +An event for a parser to parse during testing. +""" +type ParserTestEvent { +""" +The contents of the `@rawstring` field when the event begins parsing. +""" + rawString: String! +} + +""" +A subset of a view +""" +type PartialSearchDomain { + id: String! + name: String! +""" +Check if the current user is allowed to perform the given action on the view. +""" + isActionAllowed( +""" +The action to check if a user is allowed to perform on a view. +""" + action: ViewAction! + ): Boolean! +} + +""" +A pending user. I.e. a user that was invited to join an organization. +""" +type PendingUser { +""" +The id or token for the pending user +""" + id: String! +""" +Whether IDP is enabled for the organization +""" + idp: Boolean! +""" +The time the pending user was created +""" + createdAt: Long! +""" +The email of the user that invited the pending user +""" + invitedByEmail: String! +""" +The name of the user that invited the pending user +""" + invitedByName: String! +""" +The name of the organization the the pending user is about to join +""" + orgName: String! +""" +The email of the pending user +""" + newUserEmail: String! +""" +The current organization state for the user, if any. +""" + pendingUserState: PendingUserState! +} + +""" +The current organization state for the user. +""" +enum PendingUserState { + NoOrganization + SingleUserOrganization + MultiUserOrganizationOnlyOwnerConflict + MultiUserOrganizationNoConflict + UserExistsNoOrganization + UserExistsDeletedOrganization +} + +""" +Permissions on a view +""" +enum Permission { + ChangeUserAccess +""" +Permission to administer alerts, scheduled searches and actions +""" + ChangeTriggersAndActions +""" +Permission to administer alerts and scheduled searches +""" + ChangeTriggers +""" +Permission to administer actions +""" + ChangeActions + ChangeDashboards + ChangeDashboardReadonlyToken + ChangeFiles + ChangeInteractions + ChangeParsers + ChangeSavedQueries + ConnectView + ChangeDataDeletionPermissions + ChangeRetention + ChangeDefaultSearchSettings + ChangeS3ArchivingSettings + DeleteDataSources + DeleteRepositoryOrView + DeleteEvents + ReadAccess + ChangeIngestTokens + ChangePackages + ChangeViewOrRepositoryDescription + ChangeConnections +""" +Permission to administer event forwarding rules +""" + EventForwarding + QueryDashboard + ChangeViewOrRepositoryPermissions + ChangeFdrFeeds + OrganizationOwnedQueries + ReadExternalFunctions + ChangeIngestFeeds + ChangeScheduledReports +} + +""" +The type of permission +""" +enum PermissionType { + AssetPermission + ViewPermission + OrganizationPermission + OrganizationManagementPermission + SystemPermission +} + +""" +Personal token for a user. The token will inherit the same permissions as the user. +""" +type PersonalUserToken implements Token{ +""" +The id of the token. +""" + id: String! +""" +The name of the token. +""" + name: String! +""" +The time at which the token expires. +""" + expireAt: Long +""" +The ip filter on the token. +""" + ipFilter: String +""" +The ip filter on the token. +""" + ipFilterV2: IPFilter +""" +The date the token was created. +""" + createdAt: Long! +} + +type Query { +""" +[PREVIEW: Experimental feature, not ready for production.] All actions, labels and packages used in alerts. +""" + alertFieldValues( +""" +Arguments for alert field values query. +""" + input: AlertFieldValuesInput! + ): AlertFieldValues! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Get allowed asset actions for the logged in user on a specific asset +""" + allowedAssetActions( +""" +Id of the asset +""" + assetId: String! +""" +Asset type +""" + assetType: AssetPermissionsAssetType! +""" +The name of the search domain that the asset belongs to +""" + searchDomainName: String + ): [AssetAction!]! +""" +Analyze a query for certain properties +""" + analyzeQuery( + input: AnalyzeQueryArguments! + ): AnalyzeQueryInfo! +""" +Returns information about the IP ASN database used by the LogScale instance. +""" + asnDatabaseInfo: IpDatabaseInfo! +""" +This fetches the list of blocked query patterns. +""" + blockedQueries( +""" +Whether to return all blocked queries within the cluster. Requires the ManageCluster permission. +""" + clusterWide: Boolean + ): [BlockedQuery!]! +""" +This is used to check if a given domain is valid. +""" + checkDomain( + domain: String! + ): Boolean! +""" +Validate a local cluster connection. +""" + checkLocalClusterConnection( +""" +Data for checking a local cluster connection +""" + input: CheckLocalClusterConnectionInput! + ): LocalClusterConnectionStatus! +""" +Validate a remote cluster connection. +""" + checkRemoteClusterConnection( +""" +Data for checking a remote cluster connection +""" + input: CheckRemoteClusterConnectionInput! + ): RemoteClusterConnectionStatus! +""" +[PREVIEW: Feature still in development] Get linked child organizations +""" + childOrganizations( + search: String + skip: Int! + limit: Int! +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + sortBy: OrganizationsLinks__SortBy + ): ChildOrganizationsResultSet! +""" +This is used to retrieve information about a cluster. +""" + cluster: Cluster! +""" +Return the cluster management settings for this LogScale cluster. +""" + clusterManagementSettings: ClusterManagementSettings +""" +Concatenate multiple valid queries into a combined query. +""" + concatenateQueries( + input: ConcatenateQueriesArguments! + ): QueryConcatenationInfo! +""" +This returns the current authenticated user. +""" + currentUser: User! +""" +This is used to retrieve a dashboard. +""" + dashboardsPage( + search: String + pageNumber: Int! + pageSize: Int! + ): DashboardPage! +""" +[PREVIEW: Internal debugging] For internal debugging +""" + debugCache( + searchKeys: [String!]! + ): String! +""" +This returns the current value for the dynamic configuration. +""" + dynamicConfig( + dynamicConfig: DynamicConfig! + ): String! +""" +Returns all dynamic configurations. Requires root access. +""" + dynamicConfigs: [DynamicConfigKeyValueType!]! +""" +[PREVIEW: Under development] Get next and previous pages when querying assets across LogScale views and repositories. Requires the cursor from the entitiesSearch or entitiesPage response as well as a direction +""" + entitiesPage( +""" +input parameters for the page +""" + input: EntitiesPageInputType! + ): SearchResult! +""" +[PREVIEW: Under development] Query assets across LogScale views and repositories. Will only return the first page. The response includes a cursor that can be sent to entitiesPage to get next pages with the same parameters +""" + entitiesSearch( +""" +input parameters for the search +""" + input: EntitySearchInputType! + ): SearchResult! +""" +Get usage information around non-secret environment variables +""" + environmentVariableUsage: [EnvironmentVariableUsage!]! +""" +This will list all of the event forwarders associated with an organization. +""" + eventForwarders: [EventForwarder!]! +""" +This is used to determine if a given user has exceeded their query quota. +""" + exceededQueryQuotas( +""" +Username of the user for which to retrieve exceeded Query Quotas +""" + username: String! + ): [QueryQuotaExceeded!]! +""" +[PREVIEW: All flags should be considered as beta features. Enabling features that are marked as experimental is strongly discouraged and can lead to LogScale ending up in a bad state beyond repair.] List feature flags depending on filters and context +""" + featureFlags( +""" +Include experimental features. Enabling experimental features are strongly discouraged and can lead to LogScale ending up in a bad state beyond repair. +""" + includeExperimentalFeatures: Boolean +""" +Filter defining for which scope feature flags should be returned +""" + enabledInScopeFilter: EnabledInScope + ): [FeatureFlagV2!]! +""" +This can fetch the OIDC metadata from the discovery (.well-known/openid-configuration) endpoint provided. +""" + fetchOIDCMetadataFromDiscoveryEndpoint( +""" +The .well-known OIDC endpoint. +""" + discoveryEndpoint: String! + ): WellKnownEndpointDetails! +""" +This will fetch the SAML metadata from the discovery endpoint provided. +""" + fetchSamlMetadataFromDiscoveryEndpoint( +""" +The SAML metadata endpoint. +""" + discoveryEndpoint: String! + ): SamlMetadata! +""" +[PREVIEW: This functionality is still under development and can change without warning.] Retrieve the active schema and its field aliases on the given view. +""" + fieldAliasSchemaOnView( + repoOrViewName: String! + ): FieldAliasSchema +""" +[PREVIEW: This functionality is still under development and can change without warning.] Retrieve all schemas for field aliases +""" + fieldAliasSchemas: FieldAliasSchemasInfo! +""" +This will find information on the identity provider. +""" + findIdentityProvider( + email: String! + ): IdentityProviderAuth! +""" +[PREVIEW: Under development.] +""" + fleetInstallationToken( + id: String! + ): FleetInstallationToken +""" +[PREVIEW: Under development.] +""" + fleetInstallationTokens: [FleetInstallationToken!]! +""" +Return the Java Flight Recorder settings for the specified vhost. +""" + flightRecorderSettings( +""" +The vhost to fetch settings for. +""" + vhost: Int! + ): FlightRecorderSettings +""" +Generate an unsaved aggregate alert from a package alert template. +""" + generateAggregateAlertFromPackageTemplate( +""" +Data for generating an unsaved aggregate alert object from a library package template +""" + input: GenerateAggregateAlertFromPackageTemplateInput! + ): UnsavedAggregateAlert! +""" +Generate an unsaved aggregate alert from a yaml template. +""" + generateAggregateAlertFromTemplate( +""" +Data for generating an unsaved aggregate alert object from a yaml template +""" + input: GenerateAggregateAlertFromTemplateInput! + ): UnsavedAggregateAlert! +""" +Generate an unsaved alert from a package alert template. +""" + generateAlertFromPackageTemplate( +""" +Data for generating an unsaved alert object from a library package template +""" + input: GenerateAlertFromPackageTemplateInput! + ): UnsavedAlert! +""" +Generate an unsaved alert from a yaml template. +""" + generateAlertFromTemplate( +""" +Data for generating an unsaved alert object from a yaml template +""" + input: GenerateAlertFromTemplateInput! + ): UnsavedAlert! +""" +Generate an unsaved filter alert from a package alert template. +""" + generateFilterAlertFromPackageTemplate( +""" +Data for generating an unsaved filter alert object from a library package template +""" + input: GenerateFilterAlertFromPackageTemplateInput! + ): UnsavedFilterAlert! +""" +Generate an unsaved filter alert from a yaml template. +""" + generateFilterAlertFromTemplate( +""" +Data for generating an unsaved filter alert object from a yaml template +""" + input: GenerateFilterAlertFromTemplateInput! + ): UnsavedFilterAlert! +""" +Generate an unsaved parser from a YAML template. +""" + generateParserFromTemplate( +""" +Data for generating an unsaved parser object from a YAML template +""" + input: GenerateParserFromTemplateInput! + ): UnsavedParser! +""" +Generate an unsaved scheduled search from a package scheduled search template. +""" + generateScheduledSearchFromPackageTemplate( +""" +Data for generating an unsaved scheduled search object from a library package template. +""" + input: GenerateScheduledSearchFromPackageTemplateInput! + ): UnsavedScheduledSearch! +""" +Generate an unsaved scheduled search from a yaml template. +""" + generateScheduledSearchFromTemplate( +""" +Data for generating an unsaved scheduled search object from a yaml templat. +""" + input: GenerateScheduledSearchFromTemplateInput! + ): UnsavedScheduledSearch! +""" +[PREVIEW: Experimental prototype not ready for production use] Look up an external function specification. +""" + getExternalFunction( + input: GetExternalFunctionInput! + ): ExternalFunctionSpecificationOutput +""" +This is used to get content of a file. +""" + getFileContent( + name: String! + fileName: String! + offset: Int + limit: Int + filterString: String + ): UploadedFileSnapshot! +""" +[PREVIEW: Under development.] +""" + getLogCollectorDebugLogging: LogCollectorDebugLogging +""" +[PREVIEW: Under development.] +""" + getLogCollectorDetails( + machineId: String! + ): LogCollectorDetails! +""" +[PREVIEW: Under development.] +""" + getLogCollectorInstanceDebugLogging( + id: String! + ): LogCollectorDebugLogging +""" +[PREVIEW: Under development.] +""" + getLostCollectorDays: Int! +""" +Used to get information on a specified group. +""" + group( + groupId: String! + ): Group! +""" +Used to get information on groups by a given display name. +""" + groupByDisplayName( + displayName: String! + ): Group! +""" +All defined groups in an organization. +""" + groupsPage( + search: String + pageNumber: Int! + pageSize: Int! + typeFilter: [PermissionType!] + ): GroupPage! +""" +This will check whether an organization has an organization root. +""" + hasOrgRoot( + orgId: String! + ): Boolean! +""" +This is used to get information on a specific identity provider. +""" + identityProvider( + id: String! + ): IdentityProviderAuthentication! + identityProviders: [IdentityProviderAuthentication!]! +""" +This returns information about the license for the LogScale instance, if any license installed. +""" + installedLicense: License +""" +Provides details for a specific package installed on a specific view. +""" + installedPackage( +""" +The id of the package. +""" + packageId: VersionedPackageSpecifier! +""" +The name of the view the package is installed in. +""" + viewName: String! + ): PackageInstallation +""" +Used to get information on the IOC database used by the LogScale instance. +""" + iocDatabaseInfo: CrowdStrikeIocStatus! +""" +This returns information about the IP location database used by the LogScale instance. +""" + ipDatabaseInfo: IpDatabaseInfo! +""" +Returns a list of IP filters. +""" + ipFilters: [IPFilter!]! +""" +This will return information about the Kafka cluster. +""" + kafkaCluster: KafkaClusterDescription! +""" +[PREVIEW: Internal testing.] Used to get language restrictions for language version. +""" + languageRestrictions( + version: LanguageVersionEnum! + ): QueryLanguageRestriction! +""" +Used to list all notifications currently set in the system. This requires root access. +""" + listNotifications: [Notification!]! +""" +[PREVIEW: Under development.] +""" + logCollectorConfiguration( + id: String! + ): LogCollectorConfiguration! +""" +List available Log Collector installers. +""" + logCollectorInstallers: [LogCollectorInstaller!] +""" +[PREVIEW: Under development.] +""" + logCollectorMergedConfiguration( + configIds: [String!]! + ): LogCollectorMergedConfiguration! +""" +List versions available through Remote Update for the LogScale Collector +""" + logCollectorVersionsAvailable: [String!]! + loginBridgeRequest: LoginBridgeRequest! + marketplace: Marketplace! +""" +This will return information about the LogScale instance +""" + meta( + url: String + ): HumioMetadata! + oidcIdentityProvider( + id: String! + ): OidcIdentityProvider! +""" +Get the current organization +""" + organization: Organization! +""" +Get a pending user. +""" + pendingUser( + token: String! + ): PendingUser! +""" +Get a pending user. +""" + pendingUsers( + search: String + ): [PendingUser!]! +""" +Proxy query through a specific organization. Root operation. +""" + proxyOrganization( + organizationId: String! + ): Query! +""" +[PREVIEW: Internal testing.] +""" + queryAnalysis( + queryString: String! + languageVersion: LanguageVersionEnum! + isLive: Boolean! + viewName: String + ): queryAnalysis! +""" +[PREVIEW: in development.] Return the query assistance for the given search, as well as the assistant version. +""" + queryAssistance( +""" +The search to assist with +""" + search: String! +""" +Enable to remap often used fields to their LogScale equivalents +""" + remapFields: Boolean! + ): QueryAssistantResult! + queryQuotaDefaultSettings: [QueryQuotaIntervalSetting!]! + queryQuotaUsage( +""" +Username of the user for which to retrieve status of Query Quotas +""" + username: String! + ): [QueryQuotaUsage!]! + queryQuotaUserSettings( +""" +If omitted, returns the Query Quota Settings for all users. If provided, returns the Query Quota Settings for that particular user. +""" + username: String + ): [QueryQuotaUserSettings!]! +""" +Query search domains with organization filter +""" + querySearchDomains( +""" +Filter results based on this string +""" + searchFilter: String +""" +Choose to filter based on type of search domain +""" + typeFilter: SearchDomainTypes! + sortBy: Searchdomain__SortBy! +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +Filter for deleted search domains. True will return deleted search domains and exclude regular search domains and requires that you have some permission that grants you access to delete search domains. False or nothing will return search domains that has not yet been deleted. +""" + deleted: Boolean + includeHidden: Boolean +""" +Filter results by name of connected limit. Search domains without a limit will be excluded +""" + limitName: String + ): SearchDomainSearchResultSet! +""" +Fetch the list of active event redaction jobs. +""" + redactEvents( +""" +The name of the repository to fetch pending event redactions for. +""" + repositoryName: String! + ): [DeleteEvents!]! + repositories( +""" +Include sandboxes for other users in the results set +""" + includeSandboxes: Boolean + includeHidden: Boolean + ): [Repository!]! +""" +Lookup a given repository by name. +""" + repository( +""" +The name of the repository +""" + name: String! + includeHidden: Boolean + ): Repository! +""" +A given role. +""" + role( + roleId: String! + ): Role! +""" +All defined roles. +""" + roles: [Role!]! +""" +All defined roles in org. +""" + rolesInOrgForChangingUserAccess( + searchDomainId: String! + ): [Role!]! +""" +Searchable paginated roles +""" + rolesPage( + search: String + pageNumber: Int! + pageSize: Int! + typeFilter: [PermissionType!] + includeHidden: Boolean + ): RolePage! +""" +Returns running queries. +""" + runningQueries( +""" +Search term that is used to filter running queries based on query input +""" + searchTerm: String +""" +Which field to use when sorting +""" + sortField: SortField + sortOrder: SortOrder +""" +Whether to return global results. Default=false. True requires system level access. +""" + global: Boolean + ): RunningQueries! + samlIdentityProvider( + id: String! + ): SamlIdentityProvider! + savedQuery( + id: String! + ): SavedQuery! +""" +Get scheduled report information using a scheduled report access token. +""" + scheduledReport: LimitedScheduledReport! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Search asset permissions assigned to groups and/or users +""" + searchAssetPermissions( +""" +Id of the asset +""" + assetId: String! +""" +Asset type +""" + assetType: AssetPermissionsAssetType! +""" +The name of the search domain to search within +""" + searchDomainName: String +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +List of user ids to limit the search to +""" + userIds: [String!] +""" +List of group ids to limit the search to +""" + groupIds: [String!] + ): AssetPermissionSearchResultSet! + searchDomain( + name: String! + ): SearchDomain! + searchDomains( + includeHidden: Boolean + ): [SearchDomain!]! +""" +Paged searchDomains. +""" + searchDomainsPage( + search: String + includeHidden: Boolean + pageNumber: Int! + pageSize: Int! + ): SearchDomainPage! +""" +[PREVIEW: Under development.] Get paginated search results. +""" + searchFleet( + isLiveFilter: Boolean + groupIdsFilter: [String!] + changeFilter: Changes + groupFilter: GroupFilter + queryState: String + inactiveFilter: Boolean + statusFilter: SearchFleetStatusFilter + testConfigIdFilter: String + configIdFilter: String +""" +Filter results based on this string +""" + searchFilter: String + sortBy: Fleet__SortBy +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): SearchFleetUnion! +""" +[PREVIEW: Under development.] +""" + searchFleetInstallationTokens( +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + sortBy: FleetInstallationTokens__SortBy +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + ): SearchFleetInstallationTokenResultSet! +""" +[PREVIEW: Under development.] Search log collector configurations. +""" + searchLogCollectorConfigurations( +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + sortBy: FleetConfiguration__SortBy +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + ): SearchLogCollectorConfigurationResultSet! +""" +[PREVIEW: Under development.] Search log collector configurations. +""" + searchLogCollectorGroups( +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + sortBy: FleetGroups__SortBy +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + ): SearchLogCollectorGroupsResultSet! +""" +Get paginated search results. (Root operation) +""" + searchOrganizations( +""" +Filter results based on this string +""" + searchFilter: String + sortBy: Organizations__SortBy! + typeFilter: [Organizations__SearchEntryType!] + subscriptionFilter: [Organizations__Subscription!] + includeDeletedFilter: Boolean +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): OrganizationSearchResultSet! +""" +[PREVIEW: Part of the ScheduledReports feature under development] Check the status for a specific typed service. +""" + serviceStatus( +""" +The service type name of the service to get status for. +""" + serviceType: String! + ): HealthStatus! +""" +[PREVIEW: Part of the ScheduledReports feature under development] Metadata from all registered services +""" + servicesMetadata: [ServiceMetadata!]! +""" +Paginated search results for tokens +""" + sessions( +""" +Filter results based on this string +""" + searchFilter: String + level: Sessions__Filter_Level + sortBy: Sessions__SortBy +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + onlyActiveSessions: Boolean + ): SessionQueryResultSet! +""" +Gets a shared dashboard by it's shared link token. +""" + sharedDashboards( + token: String! + ): SharedDashboard! + starredDashboards: [Dashboard!]! +""" +[PREVIEW: Under development.] Token for fleet management. +""" + tokenForFleetManagement: String! +""" +Paginated search results for tokens +""" + tokens( +""" +Filter results based on this string +""" + searchFilter: String + typeFilter: [Tokens__Type!] + parentEntityIdFilter: [String!] + sortBy: Tokens__SortBy! +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): TokenQueryResultSet! +""" +[PREVIEW: BETA feature.] +""" + usage: UsageStats! +""" +A user in the system. +""" + user( + id: String! + ): User +""" +Requires manage cluster permission; Returns all users in the system. +""" + users( + orderBy: OrderByUserFieldInput + search: String + ): [User!]! + usersAndGroupsForChangingUserAccess( + search: String + searchDomainId: String! +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): UsersAndGroupsSearchResultSet! +""" +Requires either root access, org owner access or permission to manage users in at least one repository or view. Returns a page of all users in an organization. +""" + usersPage( + orderBy: OrderByUserFieldInput + search: String + pageNumber: Int! + pageSize: Int! + ): UsersPage! +""" +Return users without organizations +""" + usersWithoutOrganizations: [User!]! +""" +Validate the Access Token +""" + validateAccessToken( + accessToken: String! + ): String! +""" +Validate the Access Token +""" + validateAccessTokenV2( + accessToken: String! + ): AccessTokenValidatorResultType! +""" +[PREVIEW: Internal testing.] Check that a query compiles. +""" + validateQuery( + queryString: String! + version: LanguageVersionEnum! + isLive: Boolean + arguments: [QueryArgument!] + ): QueryValidationResult! +""" +Validate the JWT Token +""" + validateToken( + jwtToken: String! + ): Boolean! +""" +The currently authenticated user's account. +""" + viewer: Account! +""" +The currently authenticated user's account if any. +""" + viewerOpt: Account +""" +[PREVIEW: Internal debugging tool, do not use without explicit instruction from support] Get the list of keys being used to select queries for tracing on workers. +""" + workerQueryTracingState: WorkerQueryTracingState! +} + +""" +An argument to a query +""" +input QueryArgument { +""" +An argument to a query +""" + name: String! +""" +An argument to a query +""" + value: String! +} + +""" +An argument for a query. +""" +input QueryArgumentInputType { +""" +An argument for a query. +""" + name: String! +""" +An argument for a query. +""" + value: String! +} + +""" +Either a successful assistance result, or an error +""" +union QueryAssistantAssistance =QueryAssistantSuccess | QueryAssistantError + +type QueryAssistantDiagnostic { + message: QueryAssistantDiagnosticMessage! + position: QueryAssistantDiagnosticPosition + severity: QueryAssistantDiagnosticSeverity! +} + +type QueryAssistantDiagnosticMessage { + what: String! + terse: String! + code: String! +} + +type QueryAssistantDiagnosticPosition { + column: Int! + line: Int! + beginOffset: Int! + endOffset: Int! + longString: String! +} + +enum QueryAssistantDiagnosticSeverity { + Hint + Information + Warning + Error +} + +type QueryAssistantError { + error: String! +} + +""" +An assistance result and a version of the query assistant +""" +type QueryAssistantResult { +""" +The assistant version. +""" + version: String! +""" +The query assistance for the given search. +""" + assistance: QueryAssistantAssistance! +} + +type QueryAssistantSuccess { + result: String! + diagnostics: [QueryAssistantDiagnostic!]! +} + +""" +An interaction for a query based widget +""" +type QueryBasedWidgetInteraction { + name: String! + titleTemplate: String + conditions: [WidgetInteractionCondition!]! + typeInfo: QueryBasedWidgetInteractionTypeInfo! +} + +union QueryBasedWidgetInteractionTypeInfo =DashboardLinkInteraction | CustomLinkInteraction | SearchLinkInteraction | UpdateParametersInteraction + +""" +Result of concatenating queries. +""" +type QueryConcatenationInfo { + concatenatedQuery: String! + validationResult: QueryValidationInfo! +} + +""" +A diagnostic message from query validation. +""" +type QueryDiagnostic { +""" +[PREVIEW: Internal testing.] +""" + message: String! +""" +[PREVIEW: Internal testing.] +""" + code: String! +""" +[PREVIEW: Internal testing.] +""" + severity: Severity! +} + +""" +Diagnostic information for a query. +""" +type QueryDiagnosticInfoOutputType { +""" +The diagnostic message. +""" + message: String! +""" +The code for the diagnostic. +""" + code: String! +""" +The severity of the diagnostic. +""" + severity: String! +} + +type QueryInProgress { + queryId: String! +} + +""" +Language restrictions for language version. +""" +type QueryLanguageRestriction { + version: LanguageVersion! + allowedFunctions: [String!]! + enabled: Boolean! +} + +""" +Query ownership +""" +interface QueryOwnership { +""" +Query ownership +""" + id: String! +} + +type QueryPrefixes { + viewId: String! + queryPrefix: String! +} + +type QueryQuotaExceeded { + kind: QueryQuotaMeasurementKind! + resetsAt: Long! +} + +enum QueryQuotaInterval { + PerDay + PerHour + PerTenMinutes + PerMinute +} + +type QueryQuotaIntervalSetting { + interval: QueryQuotaInterval! + measurementKind: QueryQuotaMeasurementKind! + value: Long + valueKind: QueryQuotaIntervalSettingKind! + source: QueryQuotaIntervalSettingSource! +} + +enum QueryQuotaIntervalSettingKind { + Limitless + Limited +} + +enum QueryQuotaIntervalSettingSource { + Default + UserSpecified +} + +enum QueryQuotaMeasurementKind { + StaticCost + LiveCost + QueryCount +} + +type QueryQuotaUsage { + interval: QueryQuotaInterval! + queryCount: Int! + staticCost: Long! + liveCost: Long! +} + +""" +Query Quota Settings for a particular user +""" +type QueryQuotaUserSettings { +""" +Username of the user for which these Query Quota Settings apply +""" + username: String! +""" +List of the settings that apply +""" + settings: [QueryQuotaIntervalSetting!]! +} + +""" +Timestamp type to use for a query. +""" +enum QueryTimestampType { +""" +Use @timestamp for the query. +""" + EventTimestamp +""" +Use @ingesttimestamp for the query. +""" + IngestTimestamp +} + +""" +Result of query validation. +""" +type QueryValidationInfo { + isValid: Boolean! + diagnostics: [QueryDiagnosticInfoOutputType!]! +} + +""" +Result of validating a query. +""" +type QueryValidationResult { +""" +[PREVIEW: Internal testing.] +""" + isValid: Boolean! +""" +[PREVIEW: Internal testing.] +""" + diagnostics: [QueryDiagnostic!]! +} + +type RealTimeDashboardUpdateFrequency { + name: String! +} + +""" +A map from reasons why a node might not be able to be unregistered safely, to the boolean value indicating whether a given reason applies to this node. For a node to be unregistered without any undue disruption, none of the reasons must apply. +""" +type ReasonsNodeCannotBeSafelyUnregistered { + isAlive: Boolean! + leadsDigest: Boolean! + hasUnderReplicatedData: Boolean! + hasDataThatExistsOnlyOnThisNode: Boolean! +} + +type RecentQuery { + languageVersion: LanguageVersion! + query: HumioQuery! + runAt: DateTime! + widgetType: String + widgetOptions: JSON +} + +""" +Information about regions +""" +type RegionSelectData { + name: String! + url: String! + iconUrl: String! +} + +""" +Info about a version of a LogScale Package. +""" +type RegistryPackageVersionInfo { +""" +The package version +""" + version: SemanticVersion! +""" +The minimum version of LogScale required to run the package. +""" + minHumioVersion: SemanticVersion! +} + +""" +The status of a remote cluster connection. +""" +type RemoteClusterConnectionStatus implements ClusterConnectionStatus{ +""" +Name of the remote view +""" + remoteViewName: String +""" +Software version of the remote view +""" + remoteServerVersion: String +""" +Oldest server version that is protocol compatible with the remote server +""" + remoteServerCompatVersion: String +""" +Id of the connection +""" + id: String +""" +Whether the connection is valid +""" + isValid: Boolean! +""" +Errors if the connection is invalid +""" + errorMessages: [ConnectionAspectErrorType!]! +} + +scalar RepoOrViewName + +type RepositoriesUsageQueryResult { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [RepositoryUsageValue!]! +} + +""" +Query result for repositories usage data +""" +union RepositoriesUsageQueryResultTypes =QueryInProgress | RepositoriesUsageQueryResult + +enum RepositoriesUsageQuerySortBy { + Name + UsageValue +} + +""" +A repository stores ingested data, configures parsers and data retention policies. +""" +type Repository implements SearchDomain{ +""" +Repo Types are used for tracking trial status in LogScale Cloud setups. +""" + type: RepositoryType! +""" +Repo data types are used for controlling the types of data are allowed in the repository. +""" + dataType: RepositoryDataType! +""" +The limit attached to the repository. +""" + limit: LimitV2 +""" +The date and time in the future after which ingest for this repository will be re-enabled. +""" + ingestBlock: DateTime +""" +Usage tag, used to group usage summary on repositories +""" + usageTag: String +""" +Data sources where data is ingested from. E.g. This can be specific log files or services sending data to LogScale. +""" + datasources: [Datasource!]! +""" +Total size the data. Size is measured as the size stored before compression and is thus the size of the internal format, not the data that was ingested. +""" + uncompressedByteSize: Long! +""" +Total size of data. Size is measured as the size after compression. +""" + compressedByteSize: Long! +""" +Total size the data, merged parts. Size is measured as the size stored before compression and is thus the size of the internal format, not the data that was ingested. +""" + uncompressedByteSizeOfMerged: Long! +""" +Total size of data, merged parts. Size is measured as the size after compression. +""" + compressedByteSizeOfMerged: Long! +""" +The timestamp of the latest ingested data, or null if the repository is empty. +""" + timeOfLatestIngest: DateTime +""" +The maximum time (in days) to keep data. Data old than this will be deleted. +""" + timeBasedRetention: Float +""" +Retention (in Gigabytes) based on the size of data when it arrives to LogScale, that is before parsing and compression. LogScale will keep `at most` this amount of data. +""" + ingestSizeBasedRetention: Float + ingestTokens: [IngestToken!]! +""" +Retention (in Gigabytes) based on the size of data when in storage, that is, after parsing and compression. LogScale will keep `at least` this amount of data, but as close to this number as possible. +""" + storageSizeBasedRetention: Float +""" +Sets time (in days) to keep backups before they are deleted. +""" + timeBasedBackupRetention: Float +""" +The ingest listeners configured for this repository. +""" + ingestListeners: [IngestListener!]! +""" +Maximum number of auto shards created. +""" + maxAutoShardCount: Int +""" +Configuration for S3 archiving. E.g. bucket name and region. +""" + s3ArchivingConfiguration: S3Configuration +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] The cache policy set on this repo. +""" + cachePolicy: CachePolicy +""" +[PREVIEW: Cache policies are a limited feature and is subject to change] The cache policy of this repo that as will be applied. + +This will apply the cache policy of the repo, org-wide default, or global +default. This will be (in order of precedence): + 1. The repo cache policy, if set. + 2. The organization-wide cache policy, if set. + 3. The global cache policy, if set. + 4. The default cache policy in which no segments are prioritized. + +""" + effectiveCachePolicy: CachePolicy! +""" +Tag grouping rules applied on the repository currently. Rules only apply to the tags they denote, and tags without rules do not have any grouping. +""" + currentTagGroupings: [TagGroupingRule!]! +""" +The AWS External ID used when assuming roles in AWS on behalf of this repository. +""" + awsExternalId: String! +""" +The event forwarding rules configured for the repository +""" + eventForwardingRules: [EventForwardingRule!]! +""" +List event forwarders in the organization with only basic information +""" + eventForwardersForSelection: [EventForwarderForSelection!]! +""" +A saved FDR feed. +""" + fdrFeed( +""" +The id of the FDR feed to get. +""" + id: String! + ): FdrFeed! +""" +Saved FDR Feeds +""" + fdrFeeds: [FdrFeed!]! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Administrator control for an FDR feed. +""" + fdrFeedControl( +""" +The id of the FDR feed to get administrator control for. +""" + id: String! + ): FdrFeedControl! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Administrator controls for FDR feeds +""" + fdrFeedControls: [FdrFeedControl!]! +""" +[PREVIEW: Experimental feature, not ready for production.] A saved Ingest feed. +""" + ingestFeed( +""" +The id of the IngestFeed to get. +""" + id: String! + ): IngestFeed! +""" +[PREVIEW: Experimental feature, not ready for production.] Saved ingest feeds +""" + ingestFeeds( +""" +Filter results based on this string +""" + searchFilter: String +""" +Type of ingest feed to filter +""" + typeFilter: [IngestFeeds__Type!] +""" +Field which to sort the ingest feeds by +""" + sortBy: IngestFeeds__SortBy! +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): IngestFeedQueryResultSet! +""" +A parser on the repository. +""" + parser( + id: String +""" +[DEPRECATED: Please use `id` instead. Will be removed in version 1.136] +""" + name: String + ): Parser +""" +Saved parsers. +""" + parsers: [Parser!]! + id: String! + name: RepoOrViewName! + description: String +""" +The point in time the search domain was marked for deletion. +""" + deletedDate: Long +""" +The point in time the search domain will not be restorable anymore. +""" + permanentlyDeletedAt: Long + isStarred: Boolean! +""" +Search limit in milliseconds, which searches should are limited to. +""" + searchLimitedMs: Long +""" +Repositories not part of the search limitation. +""" + reposExcludedInSearchLimit: [String!]! +""" +Returns a specific version of a package given a package version. +""" + packageV2( +""" +The package id of the package to get. +""" + packageId: VersionedPackageSpecifier! + ): Package2! +""" +[PREVIEW: This may be moved to the Package2 object.] The available versions of a package. +""" + packageVersions( + packageId: UnversionedPackageSpecifier! + ): [RegistryPackageVersionInfo!]! +""" +Returns a list of available packages that can be installed. +""" + availablePackages( +""" +Filter input to limit the returned packages +""" + filter: String +""" +Packages with any of these tags will be included. No filtering on tags. +""" + tags: [PackageTag!] +""" +Packages with any of these categories will be included. +""" + categories: [String!] + ): [PackageRegistrySearchResultItem!]! +""" +List packages installed on a specific view or repo. +""" + installedPackages: [PackageInstallation!]! + hasPackageInstalled( + packageId: VersionedPackageSpecifier! + ): Boolean! +""" +Users who has access. +""" + users: [User!]! +""" +Users or groups who has access. +""" + usersAndGroups( + search: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): UsersAndGroupsSearchResultSet! +""" +[PREVIEW] Search users with a given permission +""" + usersV2( +""" +Search for a user whose email or name matches this search string +""" + search: String +""" +Permission that the users must have on the search domain. Leave out to get users with any permission on the view +""" + permissionFilter: Permission +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): Users! +""" +Groups with assigned roles. +""" + groups: [Group!]! + starredFields: [String!]! + recentQueriesV2: [RecentQuery!]! + automaticSearch: Boolean! +""" +Check if the current user is allowed to perform the given action on the view. +""" + isActionAllowed( +""" +The action to check if a user is allowed to perform on a view. +""" + action: ViewAction! + ): Boolean! +""" +Returns the all actions the user is allowed to perform on the view. +""" + allowedViewActions: [ViewAction!]! +""" +The query prefix prepended to each search in this domain. +""" + viewerQueryPrefix: String! +""" +All tags from all datasources. +""" + tags: [String!]! +""" +All interactions defined on the view. +""" + interactions: [ViewInteraction!]! +""" +A saved alert +""" + alert( + id: String! + ): Alert! +""" +Saved alerts. +""" + alerts: [Alert!]! +""" +A saved dashboard. +""" + dashboard( + id: String! + ): Dashboard! +""" +All dashboards available on the view. +""" + dashboards: [Dashboard!]! +""" +A saved filter alert +""" + filterAlert( + id: String! + ): FilterAlert! +""" +Saved filter alerts. +""" + filterAlerts: [FilterAlert!]! +""" +A saved aggregate alert +""" + aggregateAlert( + id: String! + ): AggregateAlert! +""" +Saved aggregate alerts. +""" + aggregateAlerts: [AggregateAlert!]! +""" +A saved scheduled search. +""" + scheduledSearch( +""" +The id of the scheduled search to get. +""" + id: String! + ): ScheduledSearch! +""" +Saved scheduled searches. +""" + scheduledSearches: [ScheduledSearch!]! +""" +A saved action. +""" + action( +""" +The id of the action to get. +""" + id: String! + ): Action! +""" +A list of saved actions. +""" + actions: [Action!]! +""" +A saved query. +""" + savedQuery( + id: String! + ): SavedQuery! +""" +Saved queries. +""" + savedQueries: [SavedQuery!]! + defaultQuery: SavedQuery + files: [File!]! + fileFieldSearch( +""" +Name of the csv or json file to retrieve the field entries from. +""" + fileName: String! +""" +Name of the field in the file to return entries from. +""" + fieldName: String! +""" +Text to filter values by prefix on. +""" + prefixFilter: String +""" +The exact values that given fields should have for an entry to be part of the result. +""" + valueFilters: [FileFieldFilterType!]! +""" +Names of the fields to include in the result. +""" + fieldsToInclude: [String!]! +""" +Maximum number of values to retrieve from the file. +""" + maxEntries: Int! + ): [[DictionaryEntryType!]!]! +""" +Saved scheduled reports. +""" + scheduledReports: [ScheduledReport!]! +""" +Saved scheduled report. +""" + scheduledReport( +""" +The id of the scheduled report to get. +""" + id: String! + ): ScheduledReport +} + +""" +The data type of a repository. Indicates which type of data the repository is restricted to - e.g. 'Falcon' for repository intended for Falcon data +""" +enum RepositoryDataType { + FALCON + ANYDATA +} + +""" +The repository type of a repository +""" +enum RepositoryType { + PERSONAL + TRIAL + DEFAULT + SYSTEM + MANAGED +} + +type RepositoryUsageValue { + name: String + valueBytes: Long! + percentage: Float! + id: String! +} + +type Role { + id: String! + displayName: String! + color: String + description: String + viewPermissions: [Permission!]! + systemPermissions: [SystemPermission!]! + organizationPermissions: [OrganizationPermission!]! + organizationManagementPermissions: [OrganizationManagementPermission!]! + groupsCount: Int! + usersCount: Int! + users: [User!]! + groupsV2( + search: String + userId: String + searchInRoles: Boolean + onlyIncludeGroupsWithRestrictiveQueryPrefix: Boolean +""" +The amount of results to return. +""" + limit: Int +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int + ): GroupResultSetType! + groups: [Group!]! +} + +""" +A page of roles. +""" +type RolePage { + pageInfo: PageType! + page: [Role!]! +} + +""" +The roles query result set. +""" +type RolesResultSetType { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Role!]! +} + +""" +Queries that are currently being executed +""" +type RunningQueries { +""" +Number of milliseconds until next update is available +""" + updateAvailableIn: Long! +""" +Total number of queries being executed +""" + totalNumberOfQueries: Int! +""" +Total number of live queries being executed +""" + totalNumberOfLiveQueries: Int! +""" +Total number of clients querying +""" + totalNumberOfClients: Int! +""" +Total size of skipped bytes for all queries being executed +""" + totalSkippedBytes: Long! +""" +Total size of included bytes for all queries being executed +""" + totalIncludedBytes: Long! +""" +Total size of remaining bytes to be processed for all queries being executed +""" + totalQueuedBytes: Long! +""" +Queries being executed, at most 1000 queries are returned. +""" + queries: [RunningQuery!]! +} + +""" +A query that is currently being executed. +""" +type RunningQuery { + id: String! + clients: [Client!]! + initiatedBy: String + isLive: Boolean! + isHistoricDone: Boolean! + queryInput: String! + queryPrefix: String! + coordinatorId: String! + totalWork: Int! + workDone: Int! + view: String! +""" +The organization owning the query, if any. +""" + organization: Organization + timeInMillis: Long! + timeQueuedInMillis: Long! + isDashboard: Boolean! + estimatedTotalBytes: Long! + skippedBytes: Long! + includedBytes: Long! + processedEvents: Long! +""" +Static CPU time spent since query started +""" + mapMillis: Float! +""" +Static CPU time spent the last 30 seconds +""" + deltaMapMillis: Float! +""" +Live CPU time spent since query started +""" + liveMillis: Float! +""" +Live CPU time spent the last 30 seconds +""" + deltaLiveMillis: Float! + mapAllocations: Long! + liveAllocations: Long! + reduceAllocations: Long! + totalAllocations: Long! + deltaTotalAllocations: Long! + timeInterval: String! + timeZoneOffSetMinutes: Int! + queryArgs: String! + status: String! +""" +Total cost calculation. +""" + totalCost: Float! +""" +Live cost calculation +""" + liveCost: Float! +""" +Static cost calculation +""" + staticCost: Float! +""" +Total cost calculation last 30 seconds. +""" + deltaTotalCost: Float! +""" +Live cost calculation last 30 seconds. +""" + deltaLiveCost: Float! +""" +Static cost calculation last 30 seconds. +""" + deltaStaticCost: Float! +} + +""" +The format to store archived segments in on AWS S3. +""" +enum S3ArchivingFormat { + RAW + NDJSON +} + +""" +Configuration for S3 archiving. E.g. bucket name and region. +""" +type S3Configuration { +""" +S3 bucket name for storing archived data. Example: acme-bucket. +""" + bucket: String! +""" +The region the S3 bucket belongs to. Example: eu-central-1. +""" + region: String! +""" +Do not archive logs older than this. +""" + startFrom: DateTime +""" +Whether the archiving has been disabled. +""" + disabled: Boolean +""" +The format to store the archived data in on S3. +""" + format: S3ArchivingFormat +""" +Array of names of tag fields to use in that order in the output file names. +""" + tagOrderInName: [String!]! +} + +""" +A SAML Identity Provider +""" +type SamlIdentityProvider implements IdentityProviderAuthentication{ + id: String! + name: String! + domains: [String!]! + groupMembershipAttribute: String + idpCertificateInBase64: String! + idpEntityId: String! + signOnUrl: String! + authenticationMethod: AuthenticationMethodAuth! + userAttribute: String + adminAttribute: String + adminAttributeMatch: String + defaultIdp: Boolean! + humioManaged: Boolean! + lazyCreateUsers: Boolean! + debug: Boolean! +} + +type SamlMetadata { + entityID: String! + signOnUrl: String! + certificate: String! +} + +""" +A query saved for later use. +""" +type SavedQuery { +""" +A YAML formatted string that describes the saved query. +""" + templateYaml: String! + id: String! + name: String! + displayName: String! + description: String + assetType: AssetType! + query: HumioQuery! + isStarred: Boolean! + widgetType: String! + options: JSON! + packageId: VersionedPackageSpecifier + package: PackageInstallation +""" +[PREVIEW: Saved query interactions feature is under preview] +""" + interactions: [QueryBasedWidgetInteraction!]! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +type SavedQueryTemplate { + name: String! + displayName: String! + yamlTemplate: String! +} + +type ScannedData { + currentBytes: Long! + limit: UsageLimit! +} + +""" +A scheduled report schedule properties +""" +type Schedule { +""" +Cron pattern describing the schedule to execute the report on. +""" + cronExpression: String! +""" +Timezone of the schedule. Examples include UTC, Europe/Copenhagen. +""" + timeZone: String! +""" +Start date of the active period of the schedule. +""" + startDate: Long! +""" +Optional end date of the active period of the schedule. +""" + endDate: Long +} + +""" +Information about a scheduled report +""" +type ScheduledReport { +""" +Id of the scheduled report. +""" + id: String! +""" +Name of the scheduled report. +""" + name: String! +""" +Flag indicating whether a password is defined for the report. +""" + isPasswordDefined: Boolean! +""" +Flag indicating whether the scheduled report is enabled. +""" + enabled: Boolean! +""" +Status of the latest report execution. +""" + status: String! +""" +Description of the scheduled report. +""" + description: String! +""" +The id of the dashboard the report was created for. +""" + dashboardId: String! +""" +The dashboard the report was created for. +""" + dashboard: Dashboard! +""" +Unix timestamp for the last report execution. The timestamp only indicates an attempt, not if it was successful. +""" + timeOfLastReportExecution: Long +""" +Unix timestamp for the next planned report execution. +""" + timeOfNextPlannedReportExecution: Long +""" +Last errors encountered while generating the scheduled report. +""" + lastExecutionErrors: [String!]! +""" +Last warnings encountered while generating the scheduled report. +""" + lastExecutionWarnings: [String!]! +""" +User who created the report. +""" + createdBy: User +""" +Date when the report was created. +""" + creationDate: String! +""" +Start of the relative time interval for the dashboard. +""" + timeIntervalStart: String +""" +The schedule to run the report by. +""" + schedule: Schedule! +""" +Labels attached to the scheduled report. +""" + labels: [String!]! +""" +List of parameter value configurations. +""" + parameters: [ParameterValue!]! +""" +List of recipients who should receive an email with the generated report. +""" + recipients: [String!]! +""" +Layout of the scheduled report. +""" + layout: ScheduledReportLayout! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +""" +Information about a scheduled report layout +""" +type ScheduledReportLayout { +""" +Paper size. Supported types are A4 and Letter. +""" + paperSize: String! +""" +Paper orientation. Supported types are Landscape and Portrait. +""" + paperOrientation: String! +""" +Paper layout. Supported types are List and Grid. +""" + paperLayout: String! +""" +Flag indicating whether to show report description. +""" + showDescription: Boolean +""" +Flag indicating whether to show title on frontpage. +""" + showTitleFrontpage: Boolean! +""" +Flag indicating whether to show parameters. +""" + showParameters: Boolean! +""" +Max number of rows to display in tables. +""" + maxNumberOfRows: Int! +""" +Flag indicating whether to show title header. +""" + showTitleHeader: Boolean! +""" +Flag indicating whether to show export date. +""" + showExportDate: Boolean! +""" +Flag indicating whether to show footer page numbers. +""" + footerShowPageNumbers: Boolean! +} + +""" +Information about a scheduled search +""" +type ScheduledSearch { +""" +Id of the scheduled search. +""" + id: String! +""" +Name of the scheduled search. +""" + name: String! +""" +Description of the scheduled search. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +Start of the relative time interval for the query. +""" + start: String! +""" +End of the relative time interval for the query. +""" + end: String! +""" +Time zone of the schedule. Currently this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'. +""" + timeZone: String! +""" +Cron pattern describing the schedule to execute the query on. +""" + schedule: String! +""" +User-defined limit, which caps the number of missed searches to backfill, e.g. in the event of a shutdown. +""" + backfillLimit: Int! +""" +Flag indicating whether the scheduled search is enabled. +""" + enabled: Boolean! +""" +List of Ids for actions to fire on query result. +""" + actions: [String!]! +""" +List of actions to fire on query result. +""" + actionsV2: [Action!]! +""" +Id of user which the scheduled search is running as. +""" + runAsUser: User +""" +Unix timestamp for when last query execution finished. +""" + lastScheduledSearch: Long +""" +Unix timestamp for end of search interval for last query execution. +""" + lastExecuted: Long +""" +Unix timestamp for end of search interval for last query execution that triggered. +""" + lastTriggered: Long +""" +Unix timestamp for next planned search. +""" + timeOfNextPlannedExecution: Long +""" +Last error encountered while running the search. +""" + lastError: String +""" +Last warnings encountered while running the scheduled search. +""" + lastWarnings: [String!]! +""" +Labels added to the scheduled search. +""" + labels: [String!]! +""" +Flag indicating whether the calling user has 'starred' the scheduled search. +""" + isStarred: Boolean! +""" +A template that can be used to recreate the scheduled search. +""" + yamlTemplate: YAML! + packageId: VersionedPackageSpecifier + package: PackageInstallation +""" +Ownership of the query run by this scheduled search +""" + queryOwnership: QueryOwnership! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Allowed asset actions +""" + allowedActions: [AssetAction!]! +} + +type ScheduledSearchTemplate { + name: String! + displayName: String! + yamlTemplate: String! + labels: [String!]! +} + +type SchemaField { + name: String! + description: String +} + +""" +An asset permissions search result entry +""" +type SearchAssetPermissionsResultEntry { +""" +The unique id for the Asset +""" + assetId: String! +""" +The name of the Asset +""" + assetName: String! +""" +The type of the Asset +""" + assetType: AssetPermissionsAssetType! +""" +The search domain that the asset belongs to +""" + searchDomain: SearchDomain +""" +The asset permissions assigned to this asset +""" + permissions: [AssetPermissionOutputEnum!]! +} + +""" +Common interface for Repositories and Views. +""" +interface SearchDomain { +""" +Common interface for Repositories and Views. +""" + id: String! +""" +Common interface for Repositories and Views. +""" + name: RepoOrViewName! +""" +Common interface for Repositories and Views. +""" + description: String +""" +Common interface for Repositories and Views. +""" + deletedDate: Long +""" +Common interface for Repositories and Views. +""" + permanentlyDeletedAt: Long +""" +Common interface for Repositories and Views. +""" + isStarred: Boolean! +""" +Common interface for Repositories and Views. +""" + searchLimitedMs: Long +""" +Common interface for Repositories and Views. +""" + reposExcludedInSearchLimit: [String!]! +""" +Common interface for Repositories and Views. +""" + packageV2( + packageId: VersionedPackageSpecifier! + ): Package2! +""" +Common interface for Repositories and Views. +""" + packageVersions( + packageId: UnversionedPackageSpecifier! + ): [RegistryPackageVersionInfo!]! +""" +Common interface for Repositories and Views. +""" + availablePackages( + filter: String + tags: [PackageTag!] + categories: [String!] + ): [PackageRegistrySearchResultItem!]! +""" +Common interface for Repositories and Views. +""" + installedPackages: [PackageInstallation!]! +""" +Common interface for Repositories and Views. +""" + hasPackageInstalled( + packageId: VersionedPackageSpecifier! + ): Boolean! +""" +Common interface for Repositories and Views. +""" + users: [User!]! +""" +Common interface for Repositories and Views. +""" + usersAndGroups( + search: String + skip: Int + limit: Int + ): UsersAndGroupsSearchResultSet! +""" +Common interface for Repositories and Views. +""" + usersV2( + search: String + permissionFilter: Permission + skip: Int + limit: Int + ): Users! +""" +Common interface for Repositories and Views. +""" + groups: [Group!]! +""" +Common interface for Repositories and Views. +""" + starredFields: [String!]! +""" +Common interface for Repositories and Views. +""" + recentQueriesV2: [RecentQuery!]! +""" +Common interface for Repositories and Views. +""" + automaticSearch: Boolean! +""" +Common interface for Repositories and Views. +""" + isActionAllowed( + action: ViewAction! + ): Boolean! +""" +Common interface for Repositories and Views. +""" + allowedViewActions: [ViewAction!]! +""" +Common interface for Repositories and Views. +""" + viewerQueryPrefix: String! +""" +Common interface for Repositories and Views. +""" + tags: [String!]! +""" +Common interface for Repositories and Views. +""" + interactions: [ViewInteraction!]! +""" +Common interface for Repositories and Views. +""" + alert( + id: String! + ): Alert! +""" +Common interface for Repositories and Views. +""" + alerts: [Alert!]! +""" +Common interface for Repositories and Views. +""" + dashboard( + id: String! + ): Dashboard! +""" +Common interface for Repositories and Views. +""" + dashboards: [Dashboard!]! +""" +Common interface for Repositories and Views. +""" + filterAlert( + id: String! + ): FilterAlert! +""" +Common interface for Repositories and Views. +""" + filterAlerts: [FilterAlert!]! +""" +Common interface for Repositories and Views. +""" + aggregateAlert( + id: String! + ): AggregateAlert! +""" +Common interface for Repositories and Views. +""" + aggregateAlerts: [AggregateAlert!]! +""" +Common interface for Repositories and Views. +""" + scheduledSearch( + id: String! + ): ScheduledSearch! +""" +Common interface for Repositories and Views. +""" + scheduledSearches: [ScheduledSearch!]! +""" +Common interface for Repositories and Views. +""" + action( + id: String! + ): Action! +""" +Common interface for Repositories and Views. +""" + actions: [Action!]! +""" +Common interface for Repositories and Views. +""" + savedQuery( + id: String! + ): SavedQuery! +""" +Common interface for Repositories and Views. +""" + savedQueries: [SavedQuery!]! +""" +Common interface for Repositories and Views. +""" + defaultQuery: SavedQuery +""" +Common interface for Repositories and Views. +""" + files: [File!]! +""" +Common interface for Repositories and Views. +""" + fileFieldSearch( + fileName: String! + fieldName: String! + prefixFilter: String + valueFilters: [FileFieldFilterType!]! + fieldsToInclude: [String!]! + maxEntries: Int! + ): [[DictionaryEntryType!]!]! +""" +Common interface for Repositories and Views. +""" + scheduledReports: [ScheduledReport!]! +""" +Common interface for Repositories and Views. +""" + scheduledReport( + id: String! + ): ScheduledReport +} + +""" +A page of searchDomains. +""" +type SearchDomainPage { + pageInfo: PageType! + page: [SearchDomain!]! +} + +""" +The role assigned in a searchDomain. +""" +type SearchDomainRole { + searchDomain: SearchDomain! + role: Role! +} + +""" +The search domain search result set +""" +type SearchDomainSearchResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [SearchDomain!]! +} + +enum SearchDomainTypes { + All + Views + Repository +} + +""" +The fleet search has not finished yet +""" +type SearchFleetInProgress { + queryState: String! + totalResultsInfo: SearchFleetTotalResultInfo! +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [LogCollector!]! +} + +""" +A fleet installation token search result set +""" +type SearchFleetInstallationTokenResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [FleetInstallationToken!]! +} + +""" +A fleet search result set +""" +type SearchFleetResultSet { + queryState: String! + totalResultsInfo: SearchFleetTotalResultInfo! +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [LogCollector!]! +} + +enum SearchFleetStatusFilter { + Error + OK +} + +""" +Information about the returned result set. +""" +union SearchFleetTotalResultInfo =OnlyTotal | GroupFilterInfo + +""" +Query result for search fleet +""" +union SearchFleetUnion =SearchFleetResultSet | SearchFleetInProgress + +type SearchLinkInteraction { + repoOrViewName: RepoOrViewName + queryString: String! + arguments: [DictionaryEntryType!]! + openInNewTab: Boolean! + useWidgetTimeWindow: Boolean! +} + +""" +A log collector configuration search result set +""" +type SearchLogCollectorConfigurationResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [LogCollectorConfiguration!]! +} + +""" +A log collector group search result set +""" +type SearchLogCollectorGroupsResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [LogCollectorGroup!]! +} + +type SearchResult { +""" +The total number of results that matched the search query. Only [pageSize] elements will be returned. +""" + totalResults: Int! + data: [EntitySearchResultEntity!]! + cursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! +} + +enum Searchdomain__SortBy { + Name + Volume + DeletedAt + LimitName +} + +""" +A dashboard section. +""" +type Section { + id: String! + title: String + description: String + collapsed: Boolean! + timeSelector: TimeInterval + widgetIds: [String!]! + order: Int! +} + +scalar SemanticVersion + +""" +Metadata about a registered service +""" +type ServiceMetadata { +""" +The name of the service +""" + name: String! +""" +The type of the service +""" + serviceType: String! +""" +The endpoint of the service +""" + endpointUrl: String! +""" +The version of the service +""" + version: String! +""" +The health status of the service +""" + healthStatus: HealthStatus! +} + +""" +An active session. +""" +type Session { +""" +The id of the session +""" + id: String! +""" +Client info. +""" + clientInfo: String! +""" +Approximate city from IP +""" + city: String +""" +Country from IP +""" + country: String +""" +The IP of the client when the session was created. +""" + ip: String! +""" +The user that created the session. +""" + user: User! +""" +The time at which the session was created. +""" + createdAt: Long +""" +The time at which the session was last active. +""" + lastActivityAt: Long +""" +If the session is the current session for the user. +""" + isCurrentSession: Boolean! +} + +""" +The session query result set +""" +type SessionQueryResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Session!]! +} + +enum Sessions__Filter_Level { + Organization + User +} + +enum Sessions__SortBy { + LastActivityTime + LoginTime + IPAddress + Location + ClientInfo + User +} + +""" +Output diagnostic from query validation. +""" +enum Severity { + Error + Warning + Information + Hint +} + +""" +Represents information about a dashboard shared through a link. +""" +type SharedDashboard { + id: String! + name: String! + displayName: String! +""" +The ip filter on the shared dashboard. +""" + ipFilter: IPFilter + sharedTimeInterval: SharedDashboardTimeInterval +""" +The name of the repository or view queries are executed against. +""" + repoOrViewName: RepoOrViewName! + widgets: [Widget!]! + sections: [Section!]! +} + +""" +Time Interval that is active on all dashboard widgets +""" +type SharedDashboardTimeInterval { + isLive: Boolean! + start: String! + end: String! +} + +""" +Security policies for shared dashboards in the organization +""" +type SharedDashboardsSecurityPolicies { +""" +Whether shared dashboard tokens are enabled +""" + sharedDashboardsEnabled: Boolean! +""" +The IP filter that is enforced on all shared dashboards +""" + enforceIpFilter: IPFilter +} + +enum ShowTermsAndConditions { + StandardMandatoryDoDNoticeAndConsent + LogScaleEula + None +} + +enum SocialLoginField { + AllowAll + DenyAll + AllowSelected +} + +""" +Social login configuration for the organization +""" +type SocialLoginSettings { +""" +Social provider +""" + provider: SocialProviderProfile! +""" +Filter +""" + filter: SocialLoginField! +""" +Allowed users +""" + allowList: [User!]! +} + +enum SocialProviderProfile { + Google + Github + Bitbucket +} + +""" +The sort by options for asset permissions. +""" +enum SortBy { + Name + SearchDomain + Permission +} + +""" +Field to sort queries by +""" +enum SortField { + InitiatedBy + View + Age + Status + DeltaTotalMemoryAllocation + TotalMemoryAllocation + DeltaLiveCPU + TotalLiveCPU + DeltaStaticCPU + TotalStaticCPU + DeltaStaticCost + DeltaLiveCost + DeltaTotalCost + StaticCost + LiveCost + TotalCost +} + +""" +Order to sort queries by +""" +enum SortOrder { + Ascending + Descending +} + +""" +Returns a query that gives the underlying events for some specified fields. queryArguments are names of free variables in the query, prefixed with a ?.For example, 'foo=?bar | count()' has the queryArgument bar. +""" +type SourceEventsQueryResultType { +""" +[PREVIEW: Internal testing.] +""" + query: String +""" +[PREVIEW: Internal testing.] +""" + queryArguments: [String!]! +""" +[PREVIEW: Internal testing.] +""" + diagnostics: [QueryDiagnostic!]! +} + +type StorageOnDay { + date: DateTime! + storageBytes: Long! + limit: UsageLimit! +} + +""" +A cluster storage partition. It assigns cluster nodes with the responsibility of storing a segment data. +""" +type StoragePartition { + id: Int! +""" +A list of ids for the nodes responsible for the partition. The list is ordered so that the first node is the primary node and the rest are followers. +""" + nodeIds: [Int!]! +} + +type StoredData { + currentBytes: Long! + limit: UsageLimit! +} + +""" +Subdomain configuration for the organization +""" +type SubdomainConfig { +""" +The primary subdomain of the organization +""" + primarySubdomain: String! +""" +The secondary subdomains of the organization +""" + secondarySubdomains: [String!]! +""" +EnforceSubdomain, if set to true the organization can only be accessed by the subdomain, otherwise it can also be accessed directly at the cluster domain url. +""" + enforceSubdomains: Boolean! +} + +type SuggestedAlertTypeInfo { +""" +The suggested alert type. +""" + alertType: AlertType! +} + +""" +Actions a user may perform on the system. +""" +enum SystemAction { + ViewOrganizations + AdministerSystemPermissions + ChangeSubdomain + ViewSubdomain + DeleteOrganizations + AdministerOrganizations + AdministerCloud + AdministerTokens + AdministerCluster + ChangeSharedFiles +} + +""" +System permissions +""" +enum SystemPermission { + ReadHealthCheck + ViewOrganizations + ManageOrganizations + ImportOrganization + DeleteOrganizations + ChangeSystemPermissions + ManageCluster + IngestAcrossAllReposWithinCluster + DeleteHumioOwnedRepositoryOrView + ChangeUsername + ChangeFeatureFlags + ChangeSubdomains + ListSubdomains + PatchGlobal + ChangeBucketStorage + ManageOrganizationLinks +} + +""" +A tag on a datasource. +""" +type Tag { + key: String! + value: String! +} + +""" +Describes the number of groups that tag values get distributed into for a given tag. +""" +type TagGroupingRule { + tagName: String! + groupCount: Int! +} + +type TagInfo { + name: String! + value: String! +} + +""" +A time interval that represents either a fixed or relative time range. +""" +type TimeInterval { + start: String! + end: String! +} + +""" +A token. +""" +interface Token { +""" +A token. +""" + id: String! +""" +A token. +""" + name: String! +""" +A token. +""" + expireAt: Long +""" +A token. +""" + ipFilter: String +""" +A token. +""" + ipFilterV2: IPFilter +""" +A token. +""" + createdAt: Long! +} + +""" +The token query result set +""" +type TokenQueryResultSet { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [Token!]! +} + +""" +Security policies for tokens in the organization +""" +type TokenSecurityPolicies { +""" +Whether personal user tokens are enabled +""" + personalUserTokensEnabled: Boolean! +""" +Maximum time in ms a personal user token can be used before expiring (TTL) +""" + personalUserTokensEnforceExpirationAfterMs: Long +""" +The IP filter that is enforced on all personal user tokens +""" + personalUserTokensEnforceIpFilter: IPFilter +""" +Whether view permission tokens are enabled +""" + viewPermissionTokensEnabled: Boolean! +""" +Maximum time in ms a view permission token can be used before expiring (TTL) +""" + viewPermissionTokensEnforceExpirationAfterMs: Long +""" +The IP filter that is enforced on all view permission tokens +""" + viewPermissionTokensEnforceIpFilter: IPFilter +""" +Whether it is allowed to change permissions on existing view permission tokens +""" + viewPermissionTokensAllowPermissionUpdates: Boolean +""" +Whether organization permission tokens are enabled +""" + organizationPermissionTokensEnabled: Boolean! +""" +Maximum time in ms a organization permission token can be used before expiring (TTL) +""" + organizationPermissionTokensEnforceExpirationAfterMs: Long +""" +The IP filter that is enforced on all organization permission tokens +""" + organizationPermissionTokensEnforceIpFilter: IPFilter +""" +Whether it is allowed to change permissions on existing organization permission tokens +""" + organizationPermissionTokensAllowPermissionUpdates: Boolean +""" +Whether system permission tokens are enabled +""" + systemPermissionTokensEnabled: Boolean! +""" +Maximum time in ms a system permission token can be used before expiring (TTL) +""" + systemPermissionTokensEnforceExpirationAfterMs: Long +""" +The IP filter that is enforced on all system permission tokens +""" + systemPermissionTokensEnforceIpFilter: IPFilter +""" +Whether it is allowed to change permissions on existing system permission tokens +""" + systemPermissionTokensAllowPermissionUpdates: Boolean +} + +enum Tokens__SortBy { + ExpirationDate + Name +} + +enum Tokens__Type { + ViewPermissionToken + OrganizationPermissionToken + OrganizationManagementPermissionToken + SystemPermissionToken +} + +""" +Trigger mode for an aggregate alert. +""" +enum TriggerMode { +""" +Wait for up to 20 minutes for a complete result before triggering. +""" + CompleteMode +""" +Trigger immediately, even on incomplete results. If nothing to trigger on, wait for up to 20 minutes for there to be a result to trigger on. +""" + ImmediateMode +} + +scalar URL + +enum UiTheme { + Auto + Dark + Light +} + +type UnlimitedUsage { + unlimited: Boolean! +} + +""" +An unsaved aggregate alert. +""" +type UnsavedAggregateAlert { +""" +Name of the aggregate alert. +""" + name: String! +""" +Description of the aggregate alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +List of actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the aggregate alert. +""" + labels: [String!]! +""" +Flag indicating whether the aggregate alert is enabled. +""" + enabled: Boolean! +""" +Throttle time in seconds. +""" + throttleTimeSeconds: Long! +""" +A field to throttle on. Can only be set if throttleTimeSeconds is set. +""" + throttleField: String +""" +Timestamp type to use for a query. +""" + queryTimestampType: QueryTimestampType! +""" +Trigger mode used for triggering the alert. +""" + triggerMode: TriggerMode! +""" +Search interval in seconds. +""" + searchIntervalSeconds: Long! +} + +""" +An unsaved alert. +""" +type UnsavedAlert { +""" +Name of the alert. +""" + name: String! +""" +Description of the alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +Start of the relative time interval for the query. +""" + queryStart: String! +""" +Throttle time in milliseconds. +""" + throttleTimeMillis: Long! +""" +Field to throttle on. +""" + throttleField: String +""" +List of ids for actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the alert. +""" + labels: [String!]! +""" +Flag indicating whether the alert is enabled. +""" + enabled: Boolean! +} + +""" +An unsaved filter alert. +""" +type UnsavedFilterAlert { +""" +Name of the filter alert. +""" + name: String! +""" +Description of the filter alert. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +List of ids for actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the filter alert. +""" + labels: [String!]! +""" +Flag indicating whether the filter alert is enabled. +""" + enabled: Boolean! +""" +Throttle time in seconds. +""" + throttleTimeSeconds: Long +""" +A field to throttle on. Can only be set if throttleTimeSeconds is set. +""" + throttleField: String +} + +""" +The contents of a parser YAML template in structured form. The parser needs to be persisted before it can be deployed. +""" +type UnsavedParser { +""" +Name of the parser. +""" + name: String! +""" +The parser script that is executed for every incoming event. +""" + script: String! +""" +Fields that are used as tags. +""" + fieldsToTag: [String!]! +""" +A list of fields that will be removed from the event before it's parsed. These fields will not be included when calculating usage. +""" + fieldsToBeRemovedBeforeParsing: [String!]! +""" +Test cases that can be used to help verify that the parser works as expected. +""" + testCases: [ParserTestCase!]! +} + +""" +An unsaved scheduled search. +""" +type UnsavedScheduledSearch { +""" +Name of the scheduled search. +""" + name: String! +""" +Description of the scheduled search. +""" + description: String +""" +LogScale query to execute. +""" + queryString: String! +""" +Start of the relative time interval for the query. +""" + start: String! +""" +End of the relative time interval for the query. +""" + end: String! +""" +Cron pattern describing the schedule to execute the query on. +""" + schedule: String! +""" +Time zone of the schedule. Currently this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'. +""" + timeZone: String! +""" +User-defined limit, which caps the number of missed searches to backfill, e.g. in the event of a shutdown. +""" + backfillLimit: Int! +""" +List of Ids for actions to fire on query result. +""" + actions: [Action!]! +""" +Labels attached to the scheduled search. +""" + labels: [String!]! +""" +Flag indicating whether the scheduled search is enabled. +""" + enabled: Boolean! +} + +scalar UnversionedPackageSpecifier + +type UpdateParametersInteraction { + arguments: [DictionaryEntryType!]! + useWidgetTimeWindow: Boolean! +} + +""" +An uploaded file snapshot. +""" +type UploadedFileSnapshot { + nameAndPath: FileNameAndPath! + headers: [String!]! + lines: [[String!]!]! + totalLinesCount: Long! + limit: Int! + offset: Int! + filterString: String +} + +scalar UrlOrData + +""" +Contractual usage limit. If you are above you should renegotiate your contract. +""" +union UsageLimit =UsageLimitDefined | UnlimitedUsage + +type UsageLimitDefined { + limit: Long! +} + +type UsageOnDay { + date: DateTime! + ingestBytes: Long! + averageIngestBytes: Long + limit: UsageLimit! +} + +type UsageStats { +""" +Current usage measurements and limits for ingest, storage, scanned data and users +""" + currentStats( + queryId: String + ): CurrentUsageQueryResult! + monthlyIngest( + month: Int! + year: Int! + queryId: String + ): MonthlyIngestQueryResult! + monthlyStoredData( + month: Int! + year: Int! + queryId: String + ): MonthlyStorageQueryResult! + firstUsageTimeStamp: Long! + repositoriesIngest( + month: Int! + year: Int! + day: Int +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + sortBy: RepositoriesUsageQuerySortBy! + queryId: String + ): RepositoriesUsageQueryResultTypes! + repositoriesStorage( + month: Int! + year: Int! + day: Int +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy + sortBy: RepositoriesUsageQuerySortBy! + queryId: String + ): RepositoriesUsageQueryResultTypes! +} + +""" +A user profile. +""" +type User { + id: String! +""" +fullName if present, otherwise username. +""" + displayName: String! + username: String! + isRoot: Boolean! + isOrgRoot: Boolean! + fullName: String + firstName: String + lastName: String + phoneNumber: String + email: String + picture: String + createdAt: DateTime! + countryCode: String + stateCode: String + company: String + userOrGroupSearchDomainRoles( + search: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): UserOrGroupSearchDomainRoleResultSet! + groupSearchDomainRoles: [GroupSearchDomainRole!]! + searchDomainRoles( + searchDomainId: String + ): [SearchDomainRole!]! + searchDomainRolesByName( + searchDomainName: String! + ): SearchDomainRole + searchDomainRolesBySearchDomainName( + searchDomainName: String! + ): [SearchDomainRole!]! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Get asset permissions assigned to the user for the specific asset +""" + assetPermissions( +""" +Id of the asset +""" + assetId: String! +""" +Asset type +""" + assetType: AssetPermissionsAssetType! +""" +Search domain id +""" + searchDomainId: String + ): AssetPermissionsForUser! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] Search for asset permissions for the user +""" + searchAssetPermissions( +""" +Filter results based on this string +""" + searchFilter: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int +""" +Choose the order in which the results are returned. +""" + orderBy: OrderBy +""" +The sort by options for asset permissions. +""" + sortBy: SortBy +""" +Asset type +""" + assetType: AssetPermissionsAssetType! +""" +List of search domain id's to search within +""" + searchDomainIds: [String!] +""" +Include UpdateAsset and/or DeleteAsset permission assignments +""" + permissions: AssetPermissionInputEnum +""" +If this is set to true, the search will also return all assets, that the user has not been assigned any permissions for +""" + includeUnassignedAssets: Boolean + ): AssetPermissionSearchResultSet! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] The roles assigned to the user through a group. +""" + rolesV2( + search: String + typeFilter: [PermissionType!] +""" +The amount of results to return. +""" + limit: Int +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int + searchInGroups: Boolean + ): RolesResultSetType! +""" +[PREVIEW: Feature currently being iterated on. Changes may occur.] The groups the user is a member of. +""" + groupsV2( + search: String + typeFilter: [PermissionType!] +""" +The amount of results to return. +""" + limit: Int +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int + searchInRoles: Boolean + ): GroupResultSetType! +""" +The groups the user is a member of. +""" + groups: [Group!]! +""" +Permissions of the user. +""" + permissions( +""" +Exact name of the repo to find permissions for. +""" + viewName: String + ): [UserPermissions!]! +""" +A page of user permissions. +""" + permissionsPage( + search: String + pageNumber: Int! + pageSize: Int! + ): UserPermissionsPage! +""" +Returns the actions the user is allowed to perform in the system. +""" + allowedSystemActions: [SystemAction!]! +""" +Returns the actions the user is allowed to perform in the organization. +""" + allowedOrganizationActions: [OrganizationAction!]! +} + +type UserAndTimestamp { + username: String! + user: User + timestamp: DateTime! +} + +""" +A user or a group +""" +union UserOrGroup =Group | User + +""" +A user or a group role +""" +union UserOrGroupSearchDomainRole =GroupSearchDomainRole | SearchDomainRole + +""" +A page of users or group roles. +""" +type UserOrGroupSearchDomainRoleResultSet { +""" +The total number of matching results +""" + totalResults: Int! + results: [UserOrGroupSearchDomainRole!]! +} + +""" +Permissions of the user. +""" +type UserPermissions { + searchDomain: SearchDomain! + queryPrefix: String! + viewPermissions: [Permission!]! +} + +""" +A page of user permissions. +""" +type UserPermissionsPage { + pageInfo: PageType! + page: [UserPermissions!]! +} + +""" +The users query result set. +""" +type UserResultSetType { +""" +The total number of matching results +""" + totalResults: Int! +""" +The paginated result set +""" + results: [User!]! +} + +type UserSettings { + isCommunityMessageDismissed: Boolean! + isGettingStartedMessageDismissed: Boolean! + isWelcomeMessageDismissed: Boolean! + isEventListOrderedWithNewestAtBottom: Boolean! + isPackageDocsMessageDismissed: Boolean! + isFieldPanelOpenByDefault: Boolean! + isAutomaticSearchEnabled: Boolean! + isDarkModeMessageDismissed: Boolean! + uiTheme: UiTheme! + starredDashboards: [String!]! + starredSearchDomains: [String!]! + starredAlerts: [String!]! +""" +[PREVIEW: We are iterating on our feature announcements, and may change this again] +""" + featureAnnouncementsToShow: [FeatureAnnouncement!]! + isQuickStartCompleted: Boolean! +""" +Default timezone preference +""" + defaultTimeZone: String +""" +[PREVIEW: Experimental user setting value for a feature which allow for automatic highlighting on the search page] +""" + isAutomaticHighlightingEnabled: Boolean! + isResizableQueryFieldMessageDismissed: Boolean! +} + +""" +A paginated set of users +""" +type Users { +""" +The total number of users +""" + totalUsers: Int! +""" +The paginated set of users +""" + users: [User!]! +} + +""" +A page of users and groups. +""" +type UsersAndGroupsSearchResultSet { +""" +The total number of matching results +""" + totalResults: Int! + results: [UserOrGroup!]! +} + +type UsersLimit { + currentBytes: Int! + limit: UsageLimit! +} + +""" +A page of users. +""" +type UsersPage { + pageInfo: PageType! + page: [User!]! +} + +scalar VersionedPackageSpecifier + +""" +Represents information about a view, pulling data from one or several repositories. +""" +type View implements SearchDomain{ + connections: [ViewConnection!]! + crossOrgConnections: [CrossOrgViewConnection!]! +""" +[PREVIEW: Experimental feature, not ready for production.] Cluster connections. +""" + clusterConnections: [ClusterConnection!]! +""" +A specific connection. +""" + clusterConnection( +""" +The id of the connection to get. +""" + id: String! + ): ClusterConnection! +""" +[PREVIEW: Experimental feature, not ready for production.] Check all this search domain's cluster connections. +""" + checkClusterConnections: [ClusterConnectionStatus!]! +""" +[PREVIEW: Experimental feature, not ready for production.] True if the view is federated, false otherwise. +""" + isFederated: Boolean! + id: String! + name: RepoOrViewName! + description: String +""" +The point in time the search domain was marked for deletion. +""" + deletedDate: Long +""" +The point in time the search domain will not be restorable anymore. +""" + permanentlyDeletedAt: Long + isStarred: Boolean! +""" +Search limit in milliseconds, which searches should are limited to. +""" + searchLimitedMs: Long +""" +Repositories not part of the search limitation. +""" + reposExcludedInSearchLimit: [String!]! +""" +Returns a specific version of a package given a package version. +""" + packageV2( +""" +The package id of the package to get. +""" + packageId: VersionedPackageSpecifier! + ): Package2! +""" +[PREVIEW: This may be moved to the Package2 object.] The available versions of a package. +""" + packageVersions( + packageId: UnversionedPackageSpecifier! + ): [RegistryPackageVersionInfo!]! +""" +Returns a list of available packages that can be installed. +""" + availablePackages( +""" +Filter input to limit the returned packages +""" + filter: String +""" +Packages with any of these tags will be included. No filtering on tags. +""" + tags: [PackageTag!] +""" +Packages with any of these categories will be included. +""" + categories: [String!] + ): [PackageRegistrySearchResultItem!]! +""" +List packages installed on a specific view or repo. +""" + installedPackages: [PackageInstallation!]! + hasPackageInstalled( + packageId: VersionedPackageSpecifier! + ): Boolean! +""" +Users who has access. +""" + users: [User!]! +""" +Users or groups who has access. +""" + usersAndGroups( + search: String +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): UsersAndGroupsSearchResultSet! +""" +[PREVIEW] Search users with a given permission +""" + usersV2( +""" +Search for a user whose email or name matches this search string +""" + search: String +""" +Permission that the users must have on the search domain. Leave out to get users with any permission on the view +""" + permissionFilter: Permission +""" +The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1) +""" + skip: Int +""" +The amount of results to return. +""" + limit: Int + ): Users! +""" +Groups with assigned roles. +""" + groups: [Group!]! + starredFields: [String!]! + recentQueriesV2: [RecentQuery!]! + automaticSearch: Boolean! +""" +Check if the current user is allowed to perform the given action on the view. +""" + isActionAllowed( +""" +The action to check if a user is allowed to perform on a view. +""" + action: ViewAction! + ): Boolean! +""" +Returns the all actions the user is allowed to perform on the view. +""" + allowedViewActions: [ViewAction!]! +""" +The query prefix prepended to each search in this domain. +""" + viewerQueryPrefix: String! +""" +All tags from all datasources. +""" + tags: [String!]! +""" +All interactions defined on the view. +""" + interactions: [ViewInteraction!]! +""" +A saved alert +""" + alert( + id: String! + ): Alert! +""" +Saved alerts. +""" + alerts: [Alert!]! +""" +A saved dashboard. +""" + dashboard( + id: String! + ): Dashboard! +""" +All dashboards available on the view. +""" + dashboards: [Dashboard!]! +""" +A saved filter alert +""" + filterAlert( + id: String! + ): FilterAlert! +""" +Saved filter alerts. +""" + filterAlerts: [FilterAlert!]! +""" +A saved aggregate alert +""" + aggregateAlert( + id: String! + ): AggregateAlert! +""" +Saved aggregate alerts. +""" + aggregateAlerts: [AggregateAlert!]! +""" +A saved scheduled search. +""" + scheduledSearch( +""" +The id of the scheduled search to get. +""" + id: String! + ): ScheduledSearch! +""" +Saved scheduled searches. +""" + scheduledSearches: [ScheduledSearch!]! +""" +A saved action. +""" + action( +""" +The id of the action to get. +""" + id: String! + ): Action! +""" +A list of saved actions. +""" + actions: [Action!]! +""" +A saved query. +""" + savedQuery( + id: String! + ): SavedQuery! +""" +Saved queries. +""" + savedQueries: [SavedQuery!]! + defaultQuery: SavedQuery + files: [File!]! + fileFieldSearch( +""" +Name of the csv or json file to retrieve the field entries from. +""" + fileName: String! +""" +Name of the field in the file to return entries from. +""" + fieldName: String! +""" +Text to filter values by prefix on. +""" + prefixFilter: String +""" +The exact values that given fields should have for an entry to be part of the result. +""" + valueFilters: [FileFieldFilterType!]! +""" +Names of the fields to include in the result. +""" + fieldsToInclude: [String!]! +""" +Maximum number of values to retrieve from the file. +""" + maxEntries: Int! + ): [[DictionaryEntryType!]!]! +""" +Saved scheduled reports. +""" + scheduledReports: [ScheduledReport!]! +""" +Saved scheduled report. +""" + scheduledReport( +""" +The id of the scheduled report to get. +""" + id: String! + ): ScheduledReport +} + +""" +Actions a user may perform on a view. +""" +enum ViewAction { + ChangeConnections + ChangeUserAccess +""" +Denotes if you can administer alerts, scheduled searches and actions +""" + ChangeTriggersAndActions +""" +Denotes if you can administer alerts and scheduled searches +""" + ChangeTriggers +""" +Denotes if you can administer actions +""" + ChangeActions + ChangeInteractions + ChangeViewOrRepositoryDescription + ChangeDashboards + ChangeDashboardReadonlyToken + ChangeFdrFeeds + ChangeDataspaceKind + ChangeFdrFeedControls + ReadFdrFeeds + ChangeIngestFeeds + ChangeFiles + ChangeParsers + DeleteParsers + ChangeSavedQueries + ConnectView + ConnectMultiClusterView + ChangeDataDeletionPermissions + ChangeRetention + ChangeTimeBasedRetention + ChangeSizeBasedRetention + ChangeDefaultSearchSettings + ChangeS3ArchivingSettings + DeleteDataSources + DeleteRepositoryOrView + DeleteEvents +""" +Denotes if you can see log events +""" + ReadEvents + ChangeIngestTokens + ChangePackages +""" +Denotes if you can administer event forwarding rules +""" + EventForwarding + ChangeIngestListeners + ChangePermissionTokens + ChangeIngestBlocking + ChangeFieldsToBeRemovedBeforeParsing + ExportQueryResults + ChangeOrganizationOwnedQueries + ReadExternalFunctions + ChangeScheduledReports +} + +""" +Represents the connection between a view and an underlying repository. +""" +type ViewConnection { +""" +The underlying repository +""" + repository: Repository! +""" +The filter applied to all results from the repository. +""" + filter: String! + languageVersion: LanguageVersion! +} + +""" +An interaction available across search and dashboards +""" +type ViewInteraction { + id: String! + name: String! + displayName: String! + description: String + assetType: AssetType! + packageId: VersionedPackageSpecifier + package: PackageInstallation +} + +""" +A defined view interaction +""" +type ViewInteractionEntry { + id: String! + view: SearchDomain! + interaction: QueryBasedWidgetInteraction! + packageId: VersionedPackageSpecifier + package: PackageInstallation +} + +type ViewInteractionTemplate { + name: String! + displayName: String! + yamlTemplate: String! +} + +type WellKnownEndpointDetails { + issuer: String! + authorizationEndpoint: String + jwksEndpoint: String + registrationEndpoint: String + tokenEndpoint: String + tokenEndpointAuthMethod: String! + userInfoEndpoint: String +} + +""" +A dashboard widget. +""" +interface Widget { +""" +A dashboard widget. +""" + id: String! +""" +A dashboard widget. +""" + title: String! +""" +A dashboard widget. +""" + description: String +""" +A dashboard widget. +""" + x: Int! +""" +A dashboard widget. +""" + y: Int! +""" +A dashboard widget. +""" + width: Int! +""" +A dashboard widget. +""" + height: Int! +} + +type WidgetInteractionCondition { + fieldName: String! + operator: FieldConditionOperatorType! + argument: String! +} + +""" +A key being traced by worker query tracing. +""" +type WorkerQueryTracingItem { + key: String! + expiry: Long! +} + +""" +The state of worker query tracing. +""" +type WorkerQueryTracingState { + items: [WorkerQueryTracingItem!]! +} + +scalar YAML + +""" +Common interface for contractual parts of the limit +""" +interface contractual { +""" +Common interface for contractual parts of the limit +""" + includeUsage: Boolean! +} + +type drilldowns { +""" +[PREVIEW: Internal testing.] Get the query that returns the underlying events for the given fields. +""" + sourceEventsForFieldsQuery( + fields: [String!]! + ): SourceEventsQueryResultType! +} + +""" +A namespace for various query analyses and transformations. +""" +type queryAnalysis { + drilldowns: drilldowns! +""" +Checks if a query is fit for use for a filter alert +""" + isValidFilterAlertQuery( + viewName: String! + ): Boolean! +""" +The query contains an aggregator +""" + isAggregate: Boolean! +""" +The query does not contain a join-like function +""" + isSinglePhase: Boolean! +""" +The query string up to the first aggregator +""" + filterPart: String! +} + +""" +The `BigDecimal` scalar type represents signed fractional values with arbitrary precision. +""" +scalar BigDecimal + +""" +The `BigInt` scalar type represents non-fractional signed whole numeric values. BigInt can represent arbitrary big values. +""" +scalar BigInt + +""" +The `Boolean` scalar type represents `true` or `false`. +""" +scalar Boolean + +""" +The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). +""" +scalar Float + +""" +The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. +""" +scalar Int + +""" +The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1. +""" +scalar Long + +""" +The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. +""" +scalar String + + +# Fetched from version 1.154.0--build-1810--sha-eebd9d5d384aeb5d20f7a012d51fa7c64a07417e \ No newline at end of file diff --git a/internal/api/ingest-tokens.go b/internal/api/ingest-tokens.go new file mode 100644 index 00000000..b61b054a --- /dev/null +++ b/internal/api/ingest-tokens.go @@ -0,0 +1,101 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type IngestTokens struct { + client *Client +} + +type IngestToken struct { + Name string + Token string + AssignedParser string +} + +func (c *Client) IngestTokens() *IngestTokens { return &IngestTokens{client: c} } + +func (i *IngestTokens) List(repositoryName string) ([]IngestToken, error) { + resp, err := humiographql.ListIngestTokens(context.Background(), i.client, repositoryName) + if err != nil { + return nil, err + } + respRepo := resp.GetRepository() + respRepoTokens := respRepo.GetIngestTokens() + tokens := make([]IngestToken, len(respRepoTokens)) + for idx, token := range respRepoTokens { + respParser := token.GetParser() + assignedParser := "" + if respParser != nil { + assignedParser = respParser.GetName() + } + tokens[idx] = IngestToken{ + Name: token.GetName(), + Token: token.GetToken(), + AssignedParser: assignedParser, + } + } + return tokens, nil +} + +func (i *IngestTokens) Get(repoName, tokenName string) (*IngestToken, error) { + tokensInRepo, err := i.List(repoName) + if err != nil { + return nil, err + } + + for _, token := range tokensInRepo { + if token.Name == tokenName { + return &token, nil + } + } + + return nil, IngestTokenNotFound(tokenName) +} + +func (i *IngestTokens) Add(repositoryName string, tokenName string, parserName string) (*IngestToken, error) { + var parserNamePtr *string + if parserName != "" { + parserNamePtr = &parserName + } + resp, err := humiographql.AddIngestToken(context.Background(), i.client, repositoryName, tokenName, parserNamePtr) + if err != nil { + return nil, err + } + + respToken := resp.GetAddIngestTokenV3() + assignedParser := "" + respParser := respToken.GetParser() + if respParser != nil { + assignedParser = respParser.GetName() + } + return &IngestToken{ + Name: respToken.GetName(), + Token: respToken.GetToken(), + AssignedParser: assignedParser, + }, nil +} + +func (i *IngestTokens) Update(repositoryName string, tokenName string, parserName string) (*IngestToken, error) { + if parserName == "" { + _, err := humiographql.UnassignParserToIngestToken(context.Background(), i.client, repositoryName, tokenName) + if err != nil { + return nil, err + } + } else { + _, err := humiographql.AssignParserToIngestToken(context.Background(), i.client, repositoryName, tokenName, parserName) + if err != nil { + return nil, err + } + } + + return i.Get(repositoryName, tokenName) +} + +func (i *IngestTokens) Remove(repositoryName string, tokenName string) error { + _, err := humiographql.RemoveIngestToken(context.Background(), i.client, repositoryName, tokenName) + return err +} diff --git a/internal/api/license.go b/internal/api/license.go new file mode 100644 index 00000000..418703ba --- /dev/null +++ b/internal/api/license.go @@ -0,0 +1,64 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Licenses struct { + client *Client +} + +type License interface { + ExpiresAt() string + IssuedAt() string +} + +type OnPremLicense struct { + ID string + ExpiresAtVal string + IssuedAtVal string + IssuedTo string + NumberOfSeats *int +} + +func (l OnPremLicense) IssuedAt() string { + return l.IssuedAtVal +} + +func (l OnPremLicense) ExpiresAt() string { + return l.ExpiresAtVal +} + +func (c *Client) Licenses() *Licenses { return &Licenses{client: c} } + +func (l *Licenses) Install(license string) error { + _, err := humiographql.UpdateLicenseKey(context.Background(), l.client, license) + return err +} + +func (l *Licenses) Get() (License, error) { + resp, err := humiographql.GetLicense(context.Background(), l.client) + if err != nil { + return nil, err + } + + installedLicense := resp.GetInstalledLicense() + if installedLicense == nil { + return nil, fmt.Errorf("no license installed") + } + switch v := (*installedLicense).(type) { + case *humiographql.GetLicenseInstalledLicenseOnPremLicense: + return OnPremLicense{ + ExpiresAtVal: v.GetExpiresAt().String(), + IssuedAtVal: v.GetIssuedAt().String(), + ID: v.GetUid(), + IssuedTo: v.GetOwner(), + NumberOfSeats: v.GetMaxUsers(), + }, nil + } + + return nil, fmt.Errorf("unsupported license type") +} diff --git a/internal/api/packages.go b/internal/api/packages.go new file mode 100644 index 00000000..8730c529 --- /dev/null +++ b/internal/api/packages.go @@ -0,0 +1,332 @@ +package api + +import ( + "archive/zip" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path" + "path/filepath" + "strings" + "time" + + "github.com/humio/cli/internal/api/humiographql" +) + +// Packages is a API client for working with Humio packages. +type Packages struct { + client *Client +} + +// Packages constructs a Packages API client. +func (c *Client) Packages() *Packages { return &Packages{client: c} } + +// ValidationResponse contain the results of a package validation. +type ValidationResponse struct { + InstallationErrors []string `json:"installationErrors"` + ParseErrors []string `json:"parseErrors"` +} + +// IsValid returns true if there are no errors in the package +func (resp *ValidationResponse) IsValid() bool { + return (len(resp.InstallationErrors) == 0) && (len(resp.ParseErrors) == 0) +} + +// InstalledPackage contain the details of an installed package +type InstalledPackage struct { + ID string + InstalledBy struct { + Username string + Timestamp time.Time + } + UpdatedBy struct { + Username string + Timestamp time.Time + } + Source string + AvailableUpdate *string +} + +func isDirectory(path string) (bool, error) { + fileInfo, err := os.Stat(path) + if err != nil { + return false, err + } + return fileInfo.IsDir(), err +} + +// Validate checks a package declaration validity against a Humio +// server. +func (p *Packages) Validate(viewName string, absPath string) (*ValidationResponse, error) { + var zipFilePath string + var err error + + isDir, err := isDirectory(absPath) + if err != nil { + return nil, err + } + + if isDir { + zipFilePath, err = createTempZipFromFolder(absPath) + } else { + zipFilePath = absPath + } + if err != nil { + return nil, err + } + + urlPath := "api/v1/packages/analyze?view=" + url.QueryEscape(viewName) + + // #nosec G304 + fileReader, err := os.Open(zipFilePath) + if err != nil { + return nil, err + } + // #nosec G307 + defer fileReader.Close() + + response, err := p.client.HTTPRequestContext(context.Background(), "POST", urlPath, fileReader, ZIPContentType) + if err != nil { + return nil, err + } + if response == nil { + return nil, fmt.Errorf("failed to get response") + } + if response.StatusCode >= 400 { + return nil, fmt.Errorf("bad response. %s", response.Status) + } + + var report ValidationResponse + decoder := json.NewDecoder(response.Body) + err = decoder.Decode(&report) + if err != nil { + return nil, err + } + + return &report, nil +} + +// ListInstalled returns a list of installed packages +func (p *Packages) ListInstalled(searchDomainName string) ([]InstalledPackage, error) { + resp, err := humiographql.ListInstalledPackages(context.Background(), p.client, searchDomainName) + if err != nil { + return nil, err + } + respInstalledPackages := resp.GetSearchDomain().GetInstalledPackages() + packages := make([]InstalledPackage, len(respInstalledPackages)) + for idx, installedPackage := range respInstalledPackages { + installedBy := installedPackage.GetInstalledBy() + updatedBy := installedPackage.GetUpdatedBy() + packages[idx] = InstalledPackage{ + ID: installedPackage.GetId(), + InstalledBy: struct { + Username string + Timestamp time.Time + }{ + Username: installedBy.GetUsername(), + Timestamp: installedBy.GetTimestamp(), + }, + UpdatedBy: struct { + Username string + Timestamp time.Time + }{ + Username: updatedBy.GetUsername(), + Timestamp: updatedBy.GetTimestamp(), + }, + Source: string(installedPackage.GetSource()), + AvailableUpdate: installedPackage.GetAvailableUpdate(), + } + } + + return packages, nil +} + +// InstallArchive installs a local package (zip file). +func (p *Packages) InstallArchive(viewName string, pathToZip string) (*ValidationResponse, error) { + // #nosec G304 + fileReader, err := os.Open(pathToZip) + if err != nil { + return nil, err + } + // #nosec G307 + defer fileReader.Close() + + urlPath := "api/v1/packages/install?view=" + url.QueryEscape(viewName) + "&overwrite=true" + response, err := p.client.HTTPRequestContext(context.Background(), "POST", urlPath, fileReader, ZIPContentType) + if err != nil { + return nil, err + } + if response == nil { + return nil, fmt.Errorf("failed to get response") + } + if response.StatusCode >= 400 { + return nil, detailedInstallationError(response) + } + + var report ValidationResponse + decoder := json.NewDecoder(response.Body) + err = decoder.Decode(&report) + if err != nil { + return nil, err + } + + return &report, nil +} + +func detailedInstallationError(response *http.Response) error { + defer func(Body io.ReadCloser) { + _ = Body.Close() + }(response.Body) + + body, err := io.ReadAll(response.Body) // response body is []byte + if err != nil { + return fmt.Errorf("the package could not be installed") + } + + var result InstallationErrors + if err := json.Unmarshal(body, &result); err != nil { + return fmt.Errorf("the package could not be installed and the reason returned could not be parsed") + } + + allErrors := append(result.ParseErrors, result.InstallationErrors...) + + formattedErrors := make([]string, len(allErrors)) + for i, v := range allErrors { + formattedErrors[i] = "\n - " + v + } + + return fmt.Errorf("%s", strings.Join(formattedErrors, "")) +} + +type InstallationErrors struct { + InstallationErrors []string `json:"installationErrors"` + ParseErrors []string `json:"parseErrors"` + ResponseType string `json:"responseType"` +} + +type ( + // VersionedPackageSpecifier is the ID and version of a package, e.g foo/bar@2.0.1 + VersionedPackageSpecifier string + // UnversionedPackageSpecifier is the ID of a package, e.g foo/bar + UnversionedPackageSpecifier string +) + +// UninstallPackage uninstalls a package by name. +func (p *Packages) UninstallPackage(searchDomainName string, packageID string) error { + _, err := humiographql.UninstallPackage(context.Background(), p.client, searchDomainName, packageID) + return err +} + +// CreateArchive creates a archive by bundling the files in packageDirPath in a zip file. +func (p *Packages) CreateArchive(packageDirPath string, targetFileName string) error { + // #nosec G304 + outFile, err := os.Create(targetFileName) + if err != nil { + return err + } + // #nosec G307 + defer outFile.Close() + + return createZipFromFolder(packageDirPath, outFile) +} + +// InstallFromDirectory installs a package from a directory containing the package files. +func (p *Packages) InstallFromDirectory(packageDirPath string, targetRepoOrView string) (*ValidationResponse, error) { + zipFilePath, err := createTempZipFromFolder(packageDirPath) + if err != nil { + return nil, err + } + + // #nosec G304 + zipFile, err := os.Open(zipFilePath) + if err != nil { + return nil, err + } + + // #nosec G307 + defer zipFile.Close() + defer os.Remove(zipFile.Name()) + + return p.InstallArchive(targetRepoOrView, zipFilePath) +} + +func createTempZipFromFolder(baseFolder string) (string, error) { + tempDir := os.TempDir() + zipFile, err := os.CreateTemp(tempDir, "humio-package.*.zip") + if err != nil { + return "", err + } + // #nosec G307 + defer zipFile.Close() + + err = createZipFromFolder(baseFolder, zipFile) + if err != nil { + return "", err + } + + return zipFile.Name(), nil +} + +func createZipFromFolder(baseFolder string, outFile *os.File) error { + // Create a new zip archive. + w := zip.NewWriter(outFile) + + // Add some files to the archive. + err := addFiles(w, baseFolder, "") + if err != nil { + return err + } + + return w.Close() +} + +func isValidFolderOrFile(name string) bool { + return !strings.HasPrefix(name, "_") && !strings.HasPrefix(name, ".") +} + +func addFiles(w *zip.Writer, basePath string, baseInZip string) error { + // Open the Directory + files, err := os.ReadDir(basePath) + if err != nil { + return err + } + + for _, file := range files { + if !isValidFolderOrFile(file.Name()) { + continue + } + + if !file.IsDir() { + // #nosec G304 + src, err := os.Open(filepath.Join(basePath, file.Name())) + if err != nil { + return err + } + + // Add some files to the archive. + dst, err := w.Create(path.Join(baseInZip, file.Name())) + if err != nil { + _ = src.Close() + return err + } + _, err = io.Copy(dst, src) + _ = src.Close() + if err != nil { + return err + } + } else if file.IsDir() { + // Drill down + newBase := path.Join(basePath, file.Name()) + err := addFiles(w, newBase, path.Join(baseInZip, file.Name())) + if err != nil { + return err + } + } + } + + return nil +} diff --git a/internal/api/parsers.go b/internal/api/parsers.go new file mode 100644 index 00000000..99a93b90 --- /dev/null +++ b/internal/api/parsers.go @@ -0,0 +1,333 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +const LogScaleVersionWithParserAPIv2 = "1.129.0" + +type ParserTestEvent struct { + RawString string `yaml:"rawString"` +} + +type ParserTestCaseAssertions struct { + OutputEventIndex int `yaml:"outputEventIndex"` + FieldsNotPresent []string `yaml:"fieldsNotPresent"` + FieldsHaveValues map[string]string `yaml:"fieldsHaveValues"` +} + +type ParserTestCase struct { + Event ParserTestEvent `yaml:"event"` + Assertions []ParserTestCaseAssertions `yaml:"assertions"` +} + +type Parser struct { + ID string + Name string + Script string `yaml:",flow"` + TestCases []ParserTestCase `yaml:"testCases"` + FieldsToTag []string `yaml:"tagFields"` + FieldsToBeRemovedBeforeParsing []string `yaml:"fieldsToBeRemovedBeforeParsing"` +} + +type Parsers struct { + client *Client +} + +func (c *Client) Parsers() *Parsers { return &Parsers{client: c} } + +type ParserListItem struct { + ID string + Name string + IsBuiltIn bool +} + +func (p *Parsers) List(repositoryName string) ([]ParserListItem, error) { + resp, err := humiographql.ListParsers(context.Background(), p.client, repositoryName) + if err != nil { + return nil, err + } + + respRepo := resp.GetRepository() + respParsers := respRepo.GetParsers() + parsers := make([]ParserListItem, len(respParsers)) + for idx, parser := range respParsers { + parsers[idx] = ParserListItem{ + ID: parser.GetId(), + Name: parser.GetName(), + IsBuiltIn: parser.GetIsBuiltIn(), + } + } + return parsers, nil +} + +func (p *Parsers) Delete(repositoryName string, parserName string) error { + status, getStatusErr := p.client.Status() + if getStatusErr != nil { + return getStatusErr + } + + atLeast, versionParseErr := status.AtLeast(LogScaleVersionWithParserAPIv2) + if versionParseErr != nil { + return versionParseErr + } + parser, err := p.client.Parsers().Get(repositoryName, parserName) + if err != nil { + return err + } + if !atLeast { + _, err = humiographql.LegacyDeleteParserByID(context.Background(), p.client, repositoryName, parser.ID) + return err + } + + _, err = humiographql.DeleteParserByID(context.Background(), p.client, repositoryName, parser.ID) + return err +} + +func (p *Parsers) Add(repositoryName string, newParser *Parser, allowOverwritingExistingParser bool) (*Parser, error) { + if newParser == nil { + return nil, fmt.Errorf("newFilterAlert must not be nil") + } + status, getStatusErr := p.client.Status() + if getStatusErr != nil { + return nil, getStatusErr + } + atLeast, versionParseErr := status.AtLeast(LogScaleVersionWithParserAPIv2) + if versionParseErr != nil { + return nil, versionParseErr + } + + if !atLeast { + testData := make([]string, len(newParser.TestCases)) + for i, testCase := range newParser.TestCases { + testData[i] = testCase.Event.RawString + } + resp, err := humiographql.LegacyCreateParser( + context.Background(), + p.client, + repositoryName, + newParser.Name, + testData, + newParser.FieldsToTag, + newParser.Script, + allowOverwritingExistingParser, + ) + if err != nil { + return nil, err + } + + respCreateParser := resp.GetCreateParser() + respParser := respCreateParser.GetParser() + respTestCases := respParser.GetTestCases() + testCases := make([]ParserTestCase, len(respTestCases)) + for idx, testCase := range respTestCases { + event := testCase.GetEvent() + testCases[idx] = ParserTestCase{ + Event: ParserTestEvent{ + RawString: event.GetRawString(), + }, + Assertions: nil, + } + } + return &Parser{ + ID: respParser.GetId(), + Name: respParser.GetName(), + Script: respParser.GetScript(), + TestCases: testCases, + FieldsToTag: respParser.GetFieldsToTag(), + FieldsToBeRemovedBeforeParsing: respParser.GetFieldsToBeRemovedBeforeParsing(), + }, nil + } + + testCasesInput := make([]humiographql.ParserTestCaseInput, len(newParser.TestCases)) + for j, pa := range newParser.TestCases { + parserTestCaseAssertionsForOutputInput := make([]humiographql.ParserTestCaseAssertionsForOutputInput, len(pa.Assertions)) + for i := range pa.Assertions { + fieldsHaveValuesInput := make([]humiographql.FieldHasValueInput, len(pa.Assertions[i].FieldsHaveValues)) + for field, value := range pa.Assertions[i].FieldsHaveValues { + fieldsHaveValuesInput[i] = humiographql.FieldHasValueInput{ + FieldName: field, + ExpectedValue: value, + } + } + parserTestCaseAssertionsForOutputInput[i] = humiographql.ParserTestCaseAssertionsForOutputInput{ + OutputEventIndex: pa.Assertions[i].OutputEventIndex, + Assertions: humiographql.ParserTestCaseOutputAssertionsInput{ + FieldsNotPresent: pa.Assertions[i].FieldsNotPresent, + FieldsHaveValues: fieldsHaveValuesInput, + }, + } + } + testCasesInput[j] = humiographql.ParserTestCaseInput{ + Event: humiographql.ParserTestEventInput{RawString: pa.Event.RawString}, + OutputAssertions: parserTestCaseAssertionsForOutputInput, + } + } + resp, err := humiographql.CreateParser( + context.Background(), + p.client, + repositoryName, + newParser.Name, + newParser.Script, + testCasesInput, + newParser.FieldsToTag, + newParser.FieldsToBeRemovedBeforeParsing, + allowOverwritingExistingParser, + ) + if err != nil { + return nil, err + } + + respParser := resp.GetCreateParserV2() + respTestCases := respParser.GetTestCases() + testCases := make([]ParserTestCase, len(respTestCases)) + for idx, testCase := range respTestCases { + testEvent := testCase.GetEvent() + respOutputAssertions := testCase.GetOutputAssertions() + assertions := make([]ParserTestCaseAssertions, len(respOutputAssertions)) + for j, assertion := range respOutputAssertions { + respAssertion := assertion.GetAssertions() + fieldHaveValue := respAssertion.GetFieldsHaveValues() + fieldsHaveValues := map[string]string{} + for _, field := range fieldHaveValue { + fieldsHaveValues[field.GetFieldName()] = field.GetFieldName() + } + + assertions[j] = ParserTestCaseAssertions{ + OutputEventIndex: assertion.GetOutputEventIndex(), + FieldsNotPresent: respAssertion.FieldsNotPresent, + FieldsHaveValues: nil, + } + } + testCases[idx] = ParserTestCase{ + Event: ParserTestEvent{ + RawString: testEvent.GetRawString(), + }, + Assertions: assertions, + } + } + return &Parser{ + ID: respParser.GetId(), + Name: respParser.GetName(), + Script: respParser.GetScript(), + TestCases: testCases, + FieldsToTag: respParser.GetFieldsToTag(), + FieldsToBeRemovedBeforeParsing: respParser.GetFieldsToBeRemovedBeforeParsing(), + }, nil +} + +func (p *Parsers) Get(repositoryName string, parserName string) (*Parser, error) { + status, err := p.client.Status() + if err != nil { + return nil, err + } + atLeast, err := status.AtLeast(LogScaleVersionWithParserAPIv2) + if err != nil { + return nil, err + } + if !atLeast { + resp, err := humiographql.LegacyGetParser( + context.Background(), + p.client, + repositoryName, + parserName, + ) + if err != nil { + return nil, err + } + + respRepository := resp.GetRepository() + respParser := respRepository.GetParser() + respTestCases := respParser.GetTestData() + testCases := make([]ParserTestCase, len(respTestCases)) + for idx, testCase := range respTestCases { + testCases[idx] = ParserTestCase{ + Event: ParserTestEvent{ + RawString: testCase, + }, + } + } + return &Parser{ + ID: respParser.GetId(), + Name: respParser.GetName(), + Script: respParser.GetSourceCode(), + TestCases: testCases, + FieldsToTag: respParser.GetTagFields(), + }, nil + } + + parserList, err := p.List(repositoryName) + if err != nil { + return nil, err + } + parserID := "" + for i := range parserList { + if parserList[i].Name == parserName { + parserID = parserList[i].ID + break + } + } + if parserID == "" { + return nil, ParserNotFound(parserName) + } + + resp, err := humiographql.GetParserByID( + context.Background(), + p.client, + repositoryName, + parserID, + ) + if err != nil { + return nil, err + } + + respRepository := resp.GetRepository() + respParser := respRepository.GetParser() + respTestCases := respParser.GetTestCases() + testCases := make([]ParserTestCase, len(respTestCases)) + for idx, testCase := range respTestCases { + testEvent := testCase.GetEvent() + respOutputAssertions := testCase.GetOutputAssertions() + assertions := make([]ParserTestCaseAssertions, len(respOutputAssertions)) + for j, assertion := range respOutputAssertions { + respAssertion := assertion.GetAssertions() + fieldHaveValue := respAssertion.GetFieldsHaveValues() + fieldsHaveValues := map[string]string{} + for _, field := range fieldHaveValue { + fieldsHaveValues[field.GetFieldName()] = field.GetFieldName() + } + + assertions[j] = ParserTestCaseAssertions{ + OutputEventIndex: assertion.GetOutputEventIndex(), + FieldsNotPresent: respAssertion.FieldsNotPresent, + FieldsHaveValues: nil, + } + } + testCases[idx] = ParserTestCase{ + Event: ParserTestEvent{ + RawString: testEvent.GetRawString(), + }, + Assertions: assertions, + } + } + return &Parser{ + ID: respParser.GetId(), + Name: respParser.GetName(), + Script: respParser.GetScript(), + TestCases: testCases, + FieldsToTag: respParser.GetFieldsToTag(), + FieldsToBeRemovedBeforeParsing: respParser.GetFieldsToBeRemovedBeforeParsing(), + }, nil +} + +func (p *Parsers) Export(repositoryName string, parserName string) (string, error) { + resp, err := humiographql.GetParserYAMLByName(context.Background(), p.client, repositoryName, parserName) + if err != nil { + return "", err + } + respRepo := resp.GetRepository() + return respRepo.GetParser().GetYamlTemplate(), err +} diff --git a/internal/api/repositories.go b/internal/api/repositories.go new file mode 100644 index 00000000..c61f0543 --- /dev/null +++ b/internal/api/repositories.go @@ -0,0 +1,245 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Repositories struct { + client *Client +} + +type Repository struct { + ID string + Name string + Description *string + RetentionDays *float64 + IngestRetentionSizeGB *float64 + StorageRetentionSizeGB *float64 + SpaceUsed int64 + S3ArchivingConfiguration S3Configuration + AutomaticSearch bool +} + +func (c *Client) Repositories() *Repositories { return &Repositories{client: c} } + +func (r *Repositories) Get(name string) (Repository, error) { + getRepositoryResp, err := humiographql.GetRepository(context.Background(), r.client, name) + if err != nil { + return Repository{}, RepositoryNotFound(name) + } + + repository := getRepositoryResp.GetRepository() + configuration := repository.GetS3ArchivingConfiguration() + s3ArchivingConfiguration := S3Configuration{} + if configuration != nil { + if configuration.GetFormat() == nil { + return Repository{}, fmt.Errorf("archiving format not defined") + } + disabled := configuration.GetDisabled() + s3ArchivingConfiguration = S3Configuration{ + Bucket: configuration.GetBucket(), + Region: configuration.GetRegion(), + Disabled: disabled != nil && *disabled, + Format: string(*configuration.GetFormat()), + } + } + + return Repository{ + ID: repository.GetId(), + Name: repository.GetName(), + Description: repository.GetDescription(), + RetentionDays: repository.GetTimeBasedRetention(), + IngestRetentionSizeGB: repository.GetIngestSizeBasedRetention(), + StorageRetentionSizeGB: repository.GetStorageSizeBasedRetention(), + SpaceUsed: repository.GetCompressedByteSize(), + S3ArchivingConfiguration: s3ArchivingConfiguration, + AutomaticSearch: repository.GetAutomaticSearch(), + }, nil +} + +type RepoListItem struct { + ID string + Name string + SpaceUsed int64 `graphql:"compressedByteSize"` +} + +func (r *Repositories) List() ([]RepoListItem, error) { + listRepositories, err := humiographql.ListRepositories(context.Background(), r.client) + if err != nil { + return nil, err + } + repoList := make([]RepoListItem, len(listRepositories.GetRepositories())) + for i, x := range listRepositories.GetRepositories() { + repoList[i] = RepoListItem{ + ID: x.GetId(), + Name: x.GetName(), + SpaceUsed: x.GetCompressedByteSize(), + } + } + return repoList, nil +} + +func (r *Repositories) Create(name string) error { + _, err := humiographql.CreateRepository(context.Background(), r.client, name) + return err +} + +func (r *Repositories) Delete(name, reason string, allowDataDeletion bool) error { + _, err := r.Get(name) + if err != nil { + return err + } + + if !allowDataDeletion { + return fmt.Errorf("repository may contain data and data deletion not enabled") + } + + _, err = humiographql.DeleteSearchDomain(context.Background(), r.client, name, reason) + return err +} + +func (r *Repositories) UpdateTimeBasedRetention(name string, retentionInDays *float64, allowDataDeletion bool) error { + existingRepo, err := r.Get(name) + if err != nil { + return err + } + + if retentionInDays != nil && *retentionInDays > 0 { + if existingRepo.RetentionDays == nil || *retentionInDays < *existingRepo.RetentionDays { + if !allowDataDeletion { + return fmt.Errorf("repository may contain data and data deletion not enabled") + } + } + } + + _, err = humiographql.UpdateTimeBasedRetention(context.Background(), r.client, name, retentionInDays) + return err +} + +func (r *Repositories) UpdateStorageBasedRetention(name string, storageInGB *float64, allowDataDeletion bool) error { + existingRepo, err := r.Get(name) + if err != nil { + return err + } + + if storageInGB != nil && *storageInGB > 0 { + if existingRepo.StorageRetentionSizeGB == nil || *storageInGB < *existingRepo.StorageRetentionSizeGB { + if !allowDataDeletion { + return fmt.Errorf("repository may contain data and data deletion not enabled") + } + } + } + + _, err = humiographql.UpdateStorageBasedRetention(context.Background(), r.client, name, storageInGB) + return err +} + +func (r *Repositories) UpdateIngestBasedRetention(name string, ingestInGB *float64, allowDataDeletion bool) error { + existingRepo, err := r.Get(name) + if err != nil { + return err + } + + if ingestInGB != nil && *ingestInGB > 0 { + if existingRepo.IngestRetentionSizeGB == nil || *ingestInGB < *existingRepo.IngestRetentionSizeGB { + if !allowDataDeletion { + return fmt.Errorf("repository may contain data and data deletion not enabled") + } + } + } + + _, err = humiographql.UpdateIngestBasedRetention(context.Background(), r.client, name, ingestInGB) + return err +} + +func (r *Repositories) UpdateDescription(name, description string) error { + _, err := r.Get(name) + if err != nil { + return err + } + + _, err = humiographql.UpdateDescriptionForSearchDomain(context.Background(), r.client, name, description) + return err +} + +type S3Configuration struct { + Bucket string `graphql:"bucket"` + Region string `graphql:"region"` + Disabled bool `graphql:"disabled"` + Format string `graphql:"format"` +} + +// IsEnabled - determine if S3Configuration is enabled based on values and the Disabled field +// to avoid a bool defaulting to false +func (s *S3Configuration) IsEnabled() bool { + if !s.IsConfigured() { + return false + } + return !s.Disabled +} + +func (s *S3Configuration) IsConfigured() bool { + if s.Bucket != "" && s.Region != "" && s.Format != "" { + return true + } + return false +} + +func (r *Repositories) EnableS3Archiving(name string) error { + existingRepo, err := r.Get(name) + if err != nil { + return err + } + + if !existingRepo.S3ArchivingConfiguration.IsConfigured() { + return fmt.Errorf("repository has no configuration for S3 archiving") + } + + _, err = humiographql.EnableS3Archiving(context.Background(), r.client, name) + return err +} + +func (r *Repositories) DisableS3Archiving(name string) error { + existingRepo, err := r.Get(name) + if err != nil { + return err + } + + if !existingRepo.S3ArchivingConfiguration.IsConfigured() { + return fmt.Errorf("repository has no configuration for S3 archiving") + } + + _, err = humiographql.DisableS3Archiving(context.Background(), r.client, name) + return err +} + +func (r *Repositories) UpdateS3ArchivingConfiguration(name string, bucket string, region string, format string) error { + _, err := r.Get(name) + if err != nil { + return err + } + + if bucket == "" { + return fmt.Errorf("bucket name cannot have an empty value") + } + + if region == "" { + return fmt.Errorf("region cannot have an empty value") + } + + _, err = humiographql.UpdateS3ArchivingConfiguration(context.Background(), r.client, name, bucket, region, humiographql.S3ArchivingFormat(format)) + return err +} + +func (r *Repositories) UpdateAutomaticSearch(name string, automaticSearch bool) error { + _, err := r.Get(name) + if err != nil { + return err + } + + _, err = humiographql.SetAutomaticSearching(context.Background(), r.client, name, automaticSearch) + return err +} diff --git a/internal/api/roles.go b/internal/api/roles.go new file mode 100644 index 00000000..07c9ffcd --- /dev/null +++ b/internal/api/roles.go @@ -0,0 +1,115 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Roles struct { + client *Client +} + +type Role struct { + ID string + DisplayName string + ViewPermissions []string + SystemPermissions []string + OrgPermissions []string +} + +func (c *Client) Roles() *Roles { return &Roles{client: c} } + +func (r *Roles) List() ([]Role, error) { + resp, err := humiographql.ListRoles(context.Background(), r.client) + if err != nil { + return nil, err + } + + respRoles := resp.GetRoles() + roles := make([]Role, len(respRoles)) + for idx, role := range respRoles { + respViewPermissions := role.GetViewPermissions() + viewPermissions := make([]string, len(respViewPermissions)) + for k, perm := range respViewPermissions { + viewPermissions[k] = string(perm) + } + + respOrgPermissions := role.GetOrganizationPermissions() + orgPermissions := make([]string, len(respOrgPermissions)) + for k, perm := range respOrgPermissions { + orgPermissions[k] = string(perm) + } + + respSystemPermissions := role.GetSystemPermissions() + systemPermissions := make([]string, len(respSystemPermissions)) + for k, perm := range respSystemPermissions { + systemPermissions[k] = string(perm) + } + + roles[idx] = Role{ + ID: role.GetId(), + DisplayName: role.GetDisplayName(), + ViewPermissions: viewPermissions, + OrgPermissions: orgPermissions, + SystemPermissions: systemPermissions, + } + } + + return roles, nil +} + +func (r *Roles) Get(rolename string) (*Role, error) { + roleId, err := r.GetRoleID(rolename) + if roleId == "" || err != nil { + return nil, fmt.Errorf("unable to get role id") + } + + resp, err := humiographql.GetRoleByID(context.Background(), r.client, roleId) + if err != nil { + return nil, err + } + role := resp.GetRole() + respViewPermissions := role.GetViewPermissions() + viewPermissions := make([]string, len(respViewPermissions)) + for k, perm := range respViewPermissions { + viewPermissions[k] = string(perm) + } + + respOrgPermissions := role.GetOrganizationPermissions() + orgPermissions := make([]string, len(respOrgPermissions)) + for k, perm := range respOrgPermissions { + orgPermissions[k] = string(perm) + } + + respSystemPermissions := role.GetSystemPermissions() + systemPermissions := make([]string, len(respSystemPermissions)) + for k, perm := range respSystemPermissions { + systemPermissions[k] = string(perm) + } + + return &Role{ + ID: role.GetId(), + DisplayName: role.GetDisplayName(), + ViewPermissions: viewPermissions, + OrgPermissions: orgPermissions, + SystemPermissions: systemPermissions, + }, nil +} + +func (r *Roles) GetRoleID(rolename string) (string, error) { + roles, err := r.List() + if err != nil { + return "", fmt.Errorf("unable to list roles: %w", err) + } + var roleId string + for _, role := range roles { + if role.DisplayName == rolename { + roleId = role.ID + break + } + } + + return roleId, nil +} diff --git a/internal/api/scheduled-search.go b/internal/api/scheduled-search.go new file mode 100644 index 00000000..ef8045e8 --- /dev/null +++ b/internal/api/scheduled-search.go @@ -0,0 +1,149 @@ +package api + +import ( + "context" + "fmt" + + "github.com/humio/cli/internal/api/humiographql" +) + +type ScheduledSearch struct { + ID string `yaml:"-"` + Name string + Description *string + QueryString string `yaml:"queryString"` + QueryStart string `yaml:"queryStart"` + QueryEnd string `yaml:"queryEnd"` + TimeZone string `yaml:"timeZone"` + Schedule string + BackfillLimit int `yaml:"backfillLimit"` + Enabled bool + ActionNames []string `yaml:"actionNames"` + OwnershipRunAsID string `yaml:"ownershipRunAsID"` + Labels []string + QueryOwnershipType string `yaml:"queryOwnershipType"` +} + +type ScheduledSearches struct { + client *Client +} + +func (c *Client) ScheduledSearches() *ScheduledSearches { return &ScheduledSearches{client: c} } + +func (a *ScheduledSearches) List(searchDomainName string) ([]ScheduledSearch, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("searchDomainName must not be empty") + } + + resp, err := humiographql.ListScheduledSearches(context.Background(), a.client, searchDomainName) + if err != nil { + return nil, err + } + respSearchDomain := resp.GetSearchDomain() + respScheduledSearches := respSearchDomain.GetScheduledSearches() + scheduledSearches := make([]ScheduledSearch, len(respScheduledSearches)) + for idx, scheduledSearch := range respScheduledSearches { + actionNames := make([]string, len(scheduledSearch.GetActionsV2())) + for kdx, action := range scheduledSearch.GetActionsV2() { + actionNames[kdx] = action.GetName() + } + respQueryOwnership := scheduledSearch.GetQueryOwnership() + runAsUserID := "" + if respQueryOwnership != nil { + runAsUserID = respQueryOwnership.GetId() + } + scheduledSearches[idx] = ScheduledSearch{ + ID: scheduledSearch.GetId(), + Name: scheduledSearch.GetName(), + Description: scheduledSearch.GetDescription(), + QueryString: scheduledSearch.GetQueryString(), + QueryStart: scheduledSearch.GetStart(), + QueryEnd: scheduledSearch.GetEnd(), + Schedule: scheduledSearch.GetSchedule(), + TimeZone: scheduledSearch.GetTimeZone(), + BackfillLimit: scheduledSearch.GetBackfillLimit(), + Enabled: scheduledSearch.GetEnabled(), + ActionNames: actionNames, + Labels: scheduledSearch.GetLabels(), + OwnershipRunAsID: runAsUserID, + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(scheduledSearch.GetQueryOwnership())), + } + } + return scheduledSearches, nil +} + +func (a *ScheduledSearches) Create(searchDomainName string, newScheduledSearch *ScheduledSearch) (*ScheduledSearch, error) { + if searchDomainName == "" { + return nil, fmt.Errorf("searchDomainName must not be empty") + } + if newScheduledSearch == nil { + return nil, fmt.Errorf("newScheduledSearch must not be nil") + } + + var ownershipRunAsID *string + if humiographql.QueryOwnershipType(newScheduledSearch.QueryOwnershipType) == humiographql.QueryOwnershipTypeUser { + ownershipRunAsID = &newScheduledSearch.OwnershipRunAsID + } + + queryOwnershipType := humiographql.QueryOwnershipType(newScheduledSearch.QueryOwnershipType) + resp, err := humiographql.CreateScheduledSearch( + context.Background(), + a.client, + searchDomainName, + newScheduledSearch.Name, + newScheduledSearch.Description, + newScheduledSearch.QueryString, + newScheduledSearch.QueryStart, + newScheduledSearch.QueryEnd, + newScheduledSearch.Schedule, + newScheduledSearch.TimeZone, + newScheduledSearch.BackfillLimit, + newScheduledSearch.Enabled, + newScheduledSearch.ActionNames, + ownershipRunAsID, + newScheduledSearch.Labels, + &queryOwnershipType, + ) + if err != nil { + return nil, err + } + + respScheduledSearch := resp.GetCreateScheduledSearch() + actionNames := make([]string, len(respScheduledSearch.GetActionsV2())) + for kdx, action := range respScheduledSearch.GetActionsV2() { + actionNames[kdx] = action.GetName() + } + respQueryOwnership := respScheduledSearch.GetQueryOwnership() + runAsUserID := "" + if respQueryOwnership != nil { + runAsUserID = respQueryOwnership.GetId() + } + return &ScheduledSearch{ + ID: respScheduledSearch.GetId(), + Name: respScheduledSearch.GetName(), + Description: respScheduledSearch.GetDescription(), + QueryString: respScheduledSearch.GetQueryString(), + QueryStart: respScheduledSearch.GetStart(), + QueryEnd: respScheduledSearch.GetEnd(), + TimeZone: respScheduledSearch.GetTimeZone(), + Schedule: respScheduledSearch.GetSchedule(), + BackfillLimit: respScheduledSearch.GetBackfillLimit(), + Enabled: respScheduledSearch.GetEnabled(), + ActionNames: actionNames, + OwnershipRunAsID: runAsUserID, + Labels: respScheduledSearch.GetLabels(), + QueryOwnershipType: string(queryOwnershipToQueryOwnershipType(respScheduledSearch.GetQueryOwnership())), + }, nil +} + +func (a *ScheduledSearches) Delete(searchDomainName, scheduledSearchID string) error { + if searchDomainName == "" { + return fmt.Errorf("searchdomainName is empty") + } + if scheduledSearchID == "" { + return fmt.Errorf("scheduledSearchID is empty") + } + + _, err := humiographql.DeleteScheduledSearchByID(context.Background(), a.client, searchDomainName, scheduledSearchID) + return err +} diff --git a/internal/api/search.go b/internal/api/search.go new file mode 100644 index 00000000..e722e023 --- /dev/null +++ b/internal/api/search.go @@ -0,0 +1,128 @@ +package api + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" +) + +type QueryJobs struct { + client *Client +} + +func (c *Client) QueryJobs() *QueryJobs { return &QueryJobs{client: c} } + +type Query struct { + QueryString string `json:"queryString"` + Start string `json:"start,omitempty"` + End string `json:"end,omitempty"` + Live bool `json:"isLive,omitempty"` + TimezoneOffset *int `json:"timeZoneOffsetMinutes,omitempty"` + Arguments map[string]string `json:"arguments,omitempty"` + ShowQueryEventDistribution bool `json:"showQueryEventDistribution,omitempty"` +} + +type QueryResultMetadata struct { + EventCount uint64 `json:"eventCount"` + ExtraData map[string]interface{} `json:"extraData"` + FieldOrder []string `json:"fieldOrder"` + IsAggregate bool `json:"isAggregate"` + PollAfter int `json:"pollAfter"` + ProcessedBytes uint64 `json:"processedBytes"` + ProcessedEvents uint64 `json:"processedEvents"` + QueryStart uint64 `json:"queryStart"` + QueryEnd uint64 `json:"queryEnd"` + ResultBufferSize uint64 `json:"resultBufferSize"` + TimeMillis uint64 `json:"timeMillis"` + TotalWork uint64 `json:"totalWork"` + WorkDone uint64 `json:"workDone"` +} + +type QueryResult struct { + Cancelled bool `json:"cancelled"` + Done bool `json:"done"` + Events []map[string]interface{} `json:"events"` + Metadata QueryResultMetadata `json:"metaData"` +} + +type QueryError struct { + error string +} + +func (e QueryError) Error() string { + return e.error +} + +func (q QueryJobs) Create(repository string, query Query) (string, error) { + var buf bytes.Buffer + err := json.NewEncoder(&buf).Encode(query) + + if err != nil { + return "", err + } + + resp, err := q.client.HTTPRequest(http.MethodPost, "api/v1/repositories/"+url.QueryEscape(repository)+"/queryjobs", &buf) + + if err != nil { + return "", err + } + + if resp == nil { + return "", fmt.Errorf("failed to get response") + } + + switch resp.StatusCode { + case http.StatusBadRequest: + body, err := io.ReadAll(resp.Body) + if err != nil { + return "", err + } + return "", QueryError{string(body)} + case http.StatusOK: + default: + return "", fmt.Errorf("could not create query job, got status code %d", resp.StatusCode) + } + + var jsonResponse struct { + ID string `json:"id"` + } + + err = json.NewDecoder(resp.Body).Decode(&jsonResponse) + + if err != nil { + return "", err + } + + return jsonResponse.ID, nil +} + +func (q *QueryJobs) PollContext(ctx context.Context, repository string, id string) (QueryResult, error) { + resp, err := q.client.HTTPRequestContext(ctx, http.MethodGet, "api/v1/repositories/"+url.QueryEscape(repository)+"/queryjobs/"+id, nil, JSONContentType) + + if err != nil { + return QueryResult{}, err + } + + if resp == nil { + return QueryResult{}, fmt.Errorf("failed to get response") + } + + if resp.StatusCode != http.StatusOK { + return QueryResult{}, fmt.Errorf("error polling query job, got status code %d", resp.StatusCode) + } + + var result QueryResult + + err = json.NewDecoder(resp.Body).Decode(&result) + + return result, err +} + +func (q *QueryJobs) Delete(repository string, id string) error { + _, err := q.client.HTTPRequest(http.MethodDelete, "api/v1/repositories/"+url.QueryEscape(repository)+"/queryjobs/"+id, nil) + return err +} diff --git a/internal/api/searchdomains.go b/internal/api/searchdomains.go new file mode 100644 index 00000000..ed59922c --- /dev/null +++ b/internal/api/searchdomains.go @@ -0,0 +1,33 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type SearchDomains struct { + client *Client +} + +type SearchDomain struct { + Name string + Description *string + AutomaticSearch bool +} + +func (s *Client) SearchDomains() *SearchDomains { return &SearchDomains{client: s} } + +func (s *SearchDomains) Get(name string) (*SearchDomain, error) { + resp, err := humiographql.GetSearchDomain(context.Background(), s.client, name) + if err != nil { + return nil, SearchDomainNotFound(name) + } + + searchDomain := resp.GetSearchDomain() + return &SearchDomain{ + Name: searchDomain.GetName(), + Description: searchDomain.GetDescription(), + AutomaticSearch: searchDomain.GetAutomaticSearch(), + }, nil +} diff --git a/internal/api/status.go b/internal/api/status.go new file mode 100644 index 00000000..04b981cd --- /dev/null +++ b/internal/api/status.go @@ -0,0 +1,70 @@ +package api + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/Masterminds/semver/v3" +) + +type StatusResponse struct { + Status string + Version string +} + +func (s StatusResponse) IsDown() bool { + return s.Status != "OK" && s.Status != "WARN" +} + +func (s StatusResponse) AtLeast(ver string) (bool, error) { + assumeLatest := true + version := strings.Split(s.Version, "-") + constraint, err := semver.NewConstraint(fmt.Sprintf(">= %s", ver)) + if err != nil || len(version) == 0 { + return assumeLatest, fmt.Errorf("could not parse constraint of `%s`: %w", fmt.Sprintf(">= %s", ver), err) + } + semverVersion, err := semver.NewVersion(version[0]) + if err != nil { + return assumeLatest, fmt.Errorf("could not parse version of `%s`: %w", version[0], err) + } + + return constraint.Check(semverVersion), nil +} + +func (c *Client) Status() (*StatusResponse, error) { + resp, err := c.HTTPRequest(http.MethodGet, "api/v1/status", nil) + + if err != nil { + return nil, err + } + + if resp == nil { + return nil, fmt.Errorf("failed to get response") + } + + defer func() { + _ = resp.Body.Close() + }() + + if resp.StatusCode >= 400 { + return nil, fmt.Errorf("error getting server status: %s", resp.Status) + } + + jsonData, err := io.ReadAll(resp.Body) + + if err != nil { + return nil, err + } + + var status StatusResponse + err = json.Unmarshal(jsonData, &status) + + if err != nil { + return nil, err + } + + return &status, nil +} diff --git a/internal/api/tokens.go b/internal/api/tokens.go new file mode 100644 index 00000000..4086578d --- /dev/null +++ b/internal/api/tokens.go @@ -0,0 +1,22 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Tokens struct { + client *Client +} + +func (c *Client) Tokens() *Tokens { return &Tokens{client: c} } + +func (t *Tokens) Rotate(tokenID string) (string, error) { + resp, err := humiographql.RotateTokenByID(context.Background(), t.client, tokenID) + if err != nil { + return "", err + } + + return resp.GetRotateToken(), nil +} diff --git a/internal/api/users.go b/internal/api/users.go new file mode 100644 index 00000000..62c5ff53 --- /dev/null +++ b/internal/api/users.go @@ -0,0 +1,131 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Users struct { + client *Client +} + +type User struct { + ID string + Username string + FullName *string + Email *string + Company *string + CountryCode *string + Picture *string + IsRoot bool + CreatedAt string +} + +func (c *Client) Users() *Users { return &Users{client: c} } + +func (u *Users) List() ([]User, error) { + resp, err := humiographql.ListUsers(context.Background(), u.client) + if err != nil { + return nil, err + } + + respUsers := resp.GetUsers() + users := make([]User, len(respUsers)) + for idx, user := range respUsers { + users[idx] = User{ + ID: user.GetId(), + Username: user.GetUsername(), + FullName: user.GetFullName(), + Email: user.GetEmail(), + Company: user.GetCompany(), + CountryCode: user.GetCountryCode(), + Picture: user.GetPicture(), + IsRoot: user.GetIsRoot(), + CreatedAt: user.GetCreatedAt().String(), + } + } + + return users, nil +} + +func (u *Users) Get(username string) (User, error) { + resp, err := humiographql.GetUsersByUsername(context.Background(), u.client, username) + if err != nil { + return User{}, err + } + + respUsers := resp.GetUsers() + for _, user := range respUsers { + if user.Username == username { + return User{ + ID: user.GetId(), + Username: user.GetUsername(), + FullName: user.GetFullName(), + Email: user.GetEmail(), + Company: user.GetCompany(), + CountryCode: user.GetCountryCode(), + Picture: user.GetPicture(), + IsRoot: user.GetIsRoot(), + CreatedAt: user.GetCreatedAt().String(), + }, nil + } + } + + return User{}, UserNotFound(username) +} + +func (u *Users) Update(username string, isRoot *bool, fullName, company, countryCode, email, picture *string) (User, error) { + _, err := humiographql.UpdateUser(context.Background(), u.client, username, company, isRoot, fullName, picture, email, countryCode) + if err != nil { + return User{}, err + } + + return u.Get(username) + +} + +func (u *Users) Add(username string, isRoot *bool, fullName, company, countryCode, email, picture *string) (User, error) { + resp, err := humiographql.AddUser(context.Background(), u.client, username, company, isRoot, fullName, picture, email, countryCode) + if err != nil { + return User{}, err + } + + createdUser := resp.GetAddUserV2() + switch v := createdUser.(type) { + case *humiographql.AddUserAddUserV2User: + return User{ + ID: v.GetId(), + Username: v.GetUsername(), + FullName: v.GetFullName(), + Email: v.GetEmail(), + Company: v.GetCompany(), + CountryCode: v.GetCountryCode(), + Picture: v.GetPicture(), + IsRoot: v.GetIsRoot(), + CreatedAt: v.GetCreatedAt().String(), + }, nil + default: + panic("not implemented") + } +} + +func (u *Users) Remove(username string) (User, error) { + resp, err := humiographql.RemoveUser(context.Background(), u.client, username) + if err != nil { + return User{}, err + } + respUser := resp.GetRemoveUser() + user := respUser.GetUser() + return User{ + ID: user.GetId(), + Username: user.GetUsername(), + FullName: user.GetFullName(), + Email: user.GetEmail(), + Company: user.GetCompany(), + CountryCode: user.GetCountryCode(), + Picture: user.GetPicture(), + IsRoot: user.GetIsRoot(), + CreatedAt: user.GetCreatedAt().String(), + }, nil +} diff --git a/internal/api/viewer.go b/internal/api/viewer.go new file mode 100644 index 00000000..3e2d8334 --- /dev/null +++ b/internal/api/viewer.go @@ -0,0 +1,23 @@ +package api + +import ( + "context" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Viewer struct { + client *Client +} + +func (c *Client) Viewer() *Viewer { return &Viewer{client: c} } + +// Username fetches the username associated with the API Token in use. +func (c *Viewer) Username() (string, error) { + resp, err := humiographql.GetUsername(context.Background(), c.client) + if err != nil { + return "", err + } + viewer := resp.GetViewer() + return viewer.GetUsername(), nil +} diff --git a/internal/api/views.go b/internal/api/views.go new file mode 100644 index 00000000..67711a7a --- /dev/null +++ b/internal/api/views.go @@ -0,0 +1,159 @@ +package api + +import ( + "context" + "sort" + "strings" + + "github.com/humio/cli/internal/api/humiographql" +) + +type Views struct { + client *Client +} + +type ViewConnection struct { + RepoName string + Filter string +} + +type View struct { + Name string + Description string + Connections []ViewConnection + AutomaticSearch bool +} + +func (c *Client) Views() *Views { return &Views{client: c} } + +func (c *Views) Get(name string) (*View, error) { + resp, err := humiographql.GetSearchDomain(context.Background(), c.client, name) + if err != nil { + return nil, ViewNotFound(name) + } + + searchDomain := resp.GetSearchDomain() + + switch v := searchDomain.(type) { + case *humiographql.GetSearchDomainSearchDomainView: + connections := make([]ViewConnection, len(v.GetConnections())) + for i, data := range v.GetConnections() { + connections[i] = ViewConnection{ + RepoName: data.Repository.Name, + Filter: data.Filter, + } + } + description := "" + if searchDomain.GetDescription() != nil { + description = *searchDomain.GetDescription() + } + return &View{ + Name: searchDomain.GetName(), + Description: description, + Connections: connections, + AutomaticSearch: searchDomain.GetAutomaticSearch(), + }, nil + default: + return nil, ViewNotFound(name) + } +} + +type ViewListItem struct { + Name string + Typename string + AutomaticSearch bool +} + +func (c *Views) List() ([]ViewListItem, error) { + resp, err := humiographql.ListSearchDomains(context.Background(), c.client) + if err != nil { + return nil, err + } + + searchDomains := resp.GetSearchDomains() + viewsList := []ViewListItem{} + for _, searchDomain := range searchDomains { + switch v := searchDomain.(type) { + case *humiographql.ListSearchDomainsSearchDomainsView: + typename := "" + if v.GetTypename() != nil { + typename = *v.GetTypename() + } + viewsList = append(viewsList, ViewListItem{ + Name: v.GetName(), + Typename: typename, + AutomaticSearch: v.GetAutomaticSearch(), + }) + default: + // ignore + } + } + + sort.Slice(viewsList, func(i, j int) bool { + return strings.ToLower(viewsList[i].Name) < strings.ToLower(viewsList[j].Name) + }) + return viewsList, nil +} + +type ViewConnectionInput struct { + RepositoryName string + Filter string +} + +func (c *Views) Create(name, description string, connections []ViewConnectionInput) error { + createDescription := "" + if description != "" { + createDescription = description + } + internalConnType := make([]humiographql.ViewConnectionInput, len(connections)) + for i := range connections { + internalConnType[i] = humiographql.ViewConnectionInput{ + RepositoryName: connections[i].RepositoryName, + Filter: connections[i].Filter, + } + } + _, err := humiographql.CreateView(context.Background(), c.client, name, &createDescription, internalConnType) + return err +} + +func (c *Views) Delete(name, reason string) error { + _, err := c.Get(name) + if err != nil { + return err + } + + _, err = humiographql.DeleteSearchDomain(context.Background(), c.client, name, reason) + return err +} + +func (c *Views) UpdateConnections(name string, connections []ViewConnectionInput) error { + internalConnType := make([]humiographql.ViewConnectionInput, len(connections)) + for i := range connections { + internalConnType[i] = humiographql.ViewConnectionInput{ + RepositoryName: connections[i].RepositoryName, + Filter: connections[i].Filter, + } + } + _, err := humiographql.UpdateViewConnections(context.Background(), c.client, name, internalConnType) + return err +} + +func (c *Views) UpdateDescription(name string, description string) error { + _, err := c.Get(name) + if err != nil { + return err + } + + _, err = humiographql.UpdateDescriptionForSearchDomain(context.Background(), c.client, name, description) + return err +} + +func (c *Views) UpdateAutomaticSearch(name string, automaticSearch bool) error { + _, err := c.Get(name) + if err != nil { + return err + } + + _, err = humiographql.SetAutomaticSearching(context.Background(), c.client, name, automaticSearch) + return err +} diff --git a/cmd/internal/format/format.go b/internal/format/format.go similarity index 89% rename from cmd/internal/format/format.go rename to internal/format/format.go index 2c905c1c..8105096f 100644 --- a/cmd/internal/format/format.go +++ b/internal/format/format.go @@ -17,7 +17,13 @@ func FormatterFromCommand(cmd *cobra.Command) Formatter { } var formatter string - if value := cmd.Flags().Lookup("format").Value; value != nil { + + format := cmd.Flags().Lookup("format") + if format == nil { + panic("could not fetch format") + } + + if value := format.Value; value != nil { formatter = value.String() } factory := factories[formatter] @@ -57,11 +63,32 @@ func ToValues(strings [][]string) [][]Value { } type String string -type Int int +type Int int64 type Float float64 type Bool bool type MultiValue []Value +func StringPtr(s *string) Value { + if s == nil { + return String("-") + } + return String(*s) +} + +func IntPtr(i *int64) Value { + if i == nil { + return Int(0) + } + return Int(*i) +} + +func Float64Ptr(f *float64) Value { + if f == nil { + return Float(0) + } + return Float(*f) +} + func (m MultiValue) String() string { var s []string for _, v := range m { diff --git a/cmd/internal/format/format_test.go b/internal/format/format_test.go similarity index 100% rename from cmd/internal/format/format_test.go rename to internal/format/format_test.go diff --git a/cmd/humioctl/internal/viperkey/viperkey.go b/internal/viperkey/viperkey.go similarity index 100% rename from cmd/humioctl/internal/viperkey/viperkey.go rename to internal/viperkey/viperkey.go diff --git a/shipper/shipper.go b/shipper/shipper.go index d7617f21..cc0ead77 100644 --- a/shipper/shipper.go +++ b/shipper/shipper.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/humio/cli/api" + "github.com/humio/cli/internal/api" "golang.org/x/sync/errgroup" ) diff --git a/tools.go b/tools.go new file mode 100644 index 00000000..8a7c8ac9 --- /dev/null +++ b/tools.go @@ -0,0 +1,4 @@ +package main + +//go:generate go run github.com/Khan/genqlient internal/api/humiographql/genqlient.yaml +import _ "github.com/Khan/genqlient/generate"