github.com/newrelic/newrelic-client-go@v1.1.0/pkg/nrqldroprules/types.go (about) 1 // Code generated by tutone: DO NOT EDIT 2 package nrqldroprules 3 4 import ( 5 "github.com/newrelic/newrelic-client-go/pkg/nrtime" 6 ) 7 8 // NRQLDropRulesAction - Specifies how data matching the drop rule's NRQL string should be processed. 9 type NRQLDropRulesAction string 10 11 var NRQLDropRulesActionTypes = struct { 12 // This action will strip the attributes specified in the SELECT clause of the NRQL string for all events that match the associated NRQL string. 13 DROP_ATTRIBUTES NRQLDropRulesAction 14 // This action will drop all data that match the associated NRQL string. That string MUST be a `SELECT *`. 15 DROP_DATA NRQLDropRulesAction 16 }{ 17 // This action will strip the attributes specified in the SELECT clause of the NRQL string for all events that match the associated NRQL string. 18 DROP_ATTRIBUTES: "DROP_ATTRIBUTES", 19 // This action will drop all data that match the associated NRQL string. That string MUST be a `SELECT *`. 20 DROP_DATA: "DROP_DATA", 21 } 22 23 // NRQLDropRulesErrorReason - General error categories. 24 type NRQLDropRulesErrorReason string 25 26 var NRQLDropRulesErrorReasonTypes = struct { 27 // Targeted account does not have access to this feature. 28 FEATURE_FLAG_DISABLED NRQLDropRulesErrorReason 29 // Other errors. 30 GENERAL NRQLDropRulesErrorReason 31 // Something about the request was invalid. 32 INVALID_INPUT NRQLDropRulesErrorReason 33 // The provided NRQL string was ill formed or used invalid features. 34 INVALID_QUERY NRQLDropRulesErrorReason 35 // The drop rule being acted upon did not exist. 36 RULE_NOT_FOUND NRQLDropRulesErrorReason 37 // The current user does not have authority to perform the given action. 38 USER_NOT_AUTHORIZED NRQLDropRulesErrorReason 39 }{ 40 // Targeted account does not have access to this feature. 41 FEATURE_FLAG_DISABLED: "FEATURE_FLAG_DISABLED", 42 // Other errors. 43 GENERAL: "GENERAL", 44 // Something about the request was invalid. 45 INVALID_INPUT: "INVALID_INPUT", 46 // The provided NRQL string was ill formed or used invalid features. 47 INVALID_QUERY: "INVALID_QUERY", 48 // The drop rule being acted upon did not exist. 49 RULE_NOT_FOUND: "RULE_NOT_FOUND", 50 // The current user does not have authority to perform the given action. 51 USER_NOT_AUTHORIZED: "USER_NOT_AUTHORIZED", 52 } 53 54 // Account - The `Account` object provides general data about the account, as well as 55 // being the entry point into more detailed data about a single account. 56 // 57 // Account configuration data is queried through this object, as well as 58 // telemetry data that is specific to a single account. 59 type Account struct { 60 // 61 ID int `json:"id,omitempty"` 62 // 63 LicenseKey string `json:"licenseKey,omitempty"` 64 // 65 Name string `json:"name,omitempty"` 66 // This field provides access to NrqlDropRules data. 67 NRQLDropRules NRQLDropRulesAccountStitchedFields `json:"nrqlDropRules,omitempty"` 68 } 69 70 // Actor - The `Actor` object contains fields that are scoped to the API user's access level. 71 type Actor struct { 72 // The `account` field is the entry point into data that is scoped to a single account. 73 Account Account `json:"account,omitempty"` 74 } 75 76 // NRQLDropRulesAccountStitchedFields - 77 type NRQLDropRulesAccountStitchedFields struct { 78 // List the drop rules for the given account 79 List NRQLDropRulesListDropRulesResult `json:"list,omitempty"` 80 } 81 82 // NRQLDropRulesCreateDropRuleFailure - Error details about the rule that failed to be created and why. 83 type NRQLDropRulesCreateDropRuleFailure struct { 84 // Information about why the create failed. 85 Error NRQLDropRulesError `json:"error"` 86 // Input information about a submitted rule that was unable to be created. 87 Submitted NRQLDropRulesCreateDropRuleSubmission `json:"submitted"` 88 } 89 90 // NRQLDropRulesCreateDropRuleInput - Details needed to create a NRQL drop rule. 91 type NRQLDropRulesCreateDropRuleInput struct { 92 // The type of drop rule you want. This changes the way your NRQL string is interpreted. 93 Action NRQLDropRulesAction `json:"action"` 94 // Additional information about the rule. 95 Description string `json:"description,omitempty"` 96 // The NRQL string used to match data you want to take the specified action on. 97 NRQL string `json:"nrql"` 98 } 99 100 // NRQLDropRulesCreateDropRuleResult - The result of which submitted drop rules were successfully and unsuccessfully created. 101 type NRQLDropRulesCreateDropRuleResult struct { 102 // Rules that were not created and why. 103 Failures []NRQLDropRulesCreateDropRuleFailure `json:"failures,omitempty"` 104 // Rules that were successfully created. 105 Successes []NRQLDropRulesDropRule `json:"successes,omitempty"` 106 } 107 108 // NRQLDropRulesCreateDropRuleSubmission - The details that were submitted when creating a drop rule. 109 type NRQLDropRulesCreateDropRuleSubmission struct { 110 // The account the targeted data report to. 111 AccountID int `json:"accountId"` 112 // The type of drop rule you want. This changes the way your NRQL string is interpreted. 113 Action NRQLDropRulesAction `json:"action"` 114 // Additional information about the rule. 115 Description string `json:"description,omitempty"` 116 // The NRQL string used to match data you want to take the specified action on. 117 NRQL string `json:"nrql"` 118 } 119 120 // NRQLDropRulesDeleteDropRuleFailure - Error details about the rule that failed to be deleted and why. 121 type NRQLDropRulesDeleteDropRuleFailure struct { 122 // Information about why the delete failed. 123 Error NRQLDropRulesError `json:"error"` 124 // Input information about on what was unable to be deleted. 125 Submitted NRQLDropRulesDeleteDropRuleSubmission `json:"submitted"` 126 } 127 128 // NRQLDropRulesDeleteDropRuleResult - The result of which drop rules were successfully and unsuccessfully deleted. 129 type NRQLDropRulesDeleteDropRuleResult struct { 130 // Rules that were not deleted and why. 131 Failures []NRQLDropRulesDeleteDropRuleFailure `json:"failures,omitempty"` 132 // Rules that were successfully deleted. 133 Successes []NRQLDropRulesDropRule `json:"successes,omitempty"` 134 } 135 136 // NRQLDropRulesDeleteDropRuleSubmission - The rules that were attempted to be deleted. 137 type NRQLDropRulesDeleteDropRuleSubmission struct { 138 // Account the rule was created on. 139 AccountID int `json:"accountId"` 140 // Id of the rule you want to delete. 141 RuleId string `json:"ruleId"` 142 } 143 144 // NRQLDropRulesDropRule - Details of a drop rule. 145 type NRQLDropRulesDropRule struct { 146 // The account this drop rule targets. 147 AccountID int `json:"accountId"` 148 // The behavior of the drop rule. 149 Action NRQLDropRulesAction `json:"action"` 150 // The time this drop rule was created. 151 CreatedAt nrtime.DateTime `json:"createdAt"` 152 // The id of the user that created the drop rule. 153 CreatedBy int `json:"createdBy"` 154 // Additional information about the rule. 155 Description string `json:"description,omitempty"` 156 // The unique id for the drop rule. 157 ID string `json:"id"` 158 // The NRQL used to match data that will receive the `action`. 159 NRQL string `json:"nrql"` 160 } 161 162 // NRQLDropRulesError - Error details when processing drop rule requests. 163 type NRQLDropRulesError struct { 164 // A detailed error message. 165 Description string `json:"description"` 166 // The category of error that occurred. 167 Reason NRQLDropRulesErrorReason `json:"reason"` 168 } 169 170 // NRQLDropRulesListDropRulesResult - The result of the request to list drop rules for an account. 171 type NRQLDropRulesListDropRulesResult struct { 172 // Information about why we could not list rules. 173 Error NRQLDropRulesError `json:"error,omitempty"` 174 // The list of drop rules queried on the targeted account. 175 Rules []NRQLDropRulesDropRule `json:"rules,omitempty"` 176 } 177 178 type listResponse struct { 179 Actor Actor `json:"actor"` 180 }