|
| 1 | +// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// Code generated. DO NOT EDIT. |
| 3 | + |
| 4 | +// Budgets API |
| 5 | +// |
| 6 | +// Use the Budgets API to manage budgets and budget alerts. |
| 7 | +// |
| 8 | + |
| 9 | +package budget |
| 10 | + |
| 11 | +import ( |
| 12 | + "github.com/oracle/oci-go-sdk/common" |
| 13 | +) |
| 14 | + |
| 15 | +// AlertRule The alert rule. |
| 16 | +type AlertRule struct { |
| 17 | + |
| 18 | + // The OCID of the alert rule |
| 19 | + Id *string `mandatory:"true" json:"id"` |
| 20 | + |
| 21 | + // The OCID of the budget |
| 22 | + BudgetId *string `mandatory:"true" json:"budgetId"` |
| 23 | + |
| 24 | + // The name of the alert rule. |
| 25 | + DisplayName *string `mandatory:"true" json:"displayName"` |
| 26 | + |
| 27 | + // The type of alert. Valid values are ACTUAL (the alert will trigger based on actual usage) or |
| 28 | + // FORECAST (the alert will trigger based on predicted usage). |
| 29 | + Type AlertRuleTypeEnum `mandatory:"true" json:"type"` |
| 30 | + |
| 31 | + // The threshold for triggering the alert. If thresholdType is PERCENTAGE, the maximum value is 10000. |
| 32 | + Threshold *float32 `mandatory:"true" json:"threshold"` |
| 33 | + |
| 34 | + // The type of threshold. |
| 35 | + ThresholdType AlertRuleThresholdTypeEnum `mandatory:"true" json:"thresholdType"` |
| 36 | + |
| 37 | + // The current state of the alert rule. |
| 38 | + LifecycleState AlertRuleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` |
| 39 | + |
| 40 | + // Delimited list of email addresses to receive the alert when it triggers. |
| 41 | + // Delimiter character can be comma, space, TAB, or semicolon. |
| 42 | + Recipients *string `mandatory:"true" json:"recipients"` |
| 43 | + |
| 44 | + // Time budget was created |
| 45 | + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` |
| 46 | + |
| 47 | + // Time budget was updated |
| 48 | + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` |
| 49 | + |
| 50 | + // Custom message sent when alert is triggered |
| 51 | + Message *string `mandatory:"false" json:"message"` |
| 52 | + |
| 53 | + // The description of the alert rule. |
| 54 | + Description *string `mandatory:"false" json:"description"` |
| 55 | + |
| 56 | + // Version of the alert rule. Starts from 1 and increments by 1. |
| 57 | + Version *int `mandatory:"false" json:"version"` |
| 58 | + |
| 59 | + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. |
| 60 | + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). |
| 61 | + // Example: `{"Department": "Finance"}` |
| 62 | + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` |
| 63 | + |
| 64 | + // Defined tags for this resource. Each key is predefined and scoped to a namespace. |
| 65 | + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). |
| 66 | + // Example: `{"Operations": {"CostCenter": "42"}}` |
| 67 | + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` |
| 68 | +} |
| 69 | + |
| 70 | +func (m AlertRule) String() string { |
| 71 | + return common.PointerString(m) |
| 72 | +} |
| 73 | + |
| 74 | +// AlertRuleTypeEnum Enum with underlying type: string |
| 75 | +type AlertRuleTypeEnum string |
| 76 | + |
| 77 | +// Set of constants representing the allowable values for AlertRuleTypeEnum |
| 78 | +const ( |
| 79 | + AlertRuleTypeActual AlertRuleTypeEnum = "ACTUAL" |
| 80 | + AlertRuleTypeForecast AlertRuleTypeEnum = "FORECAST" |
| 81 | +) |
| 82 | + |
| 83 | +var mappingAlertRuleType = map[string]AlertRuleTypeEnum{ |
| 84 | + "ACTUAL": AlertRuleTypeActual, |
| 85 | + "FORECAST": AlertRuleTypeForecast, |
| 86 | +} |
| 87 | + |
| 88 | +// GetAlertRuleTypeEnumValues Enumerates the set of values for AlertRuleTypeEnum |
| 89 | +func GetAlertRuleTypeEnumValues() []AlertRuleTypeEnum { |
| 90 | + values := make([]AlertRuleTypeEnum, 0) |
| 91 | + for _, v := range mappingAlertRuleType { |
| 92 | + values = append(values, v) |
| 93 | + } |
| 94 | + return values |
| 95 | +} |
| 96 | + |
| 97 | +// AlertRuleThresholdTypeEnum Enum with underlying type: string |
| 98 | +type AlertRuleThresholdTypeEnum string |
| 99 | + |
| 100 | +// Set of constants representing the allowable values for AlertRuleThresholdTypeEnum |
| 101 | +const ( |
| 102 | + AlertRuleThresholdTypePercentage AlertRuleThresholdTypeEnum = "PERCENTAGE" |
| 103 | + AlertRuleThresholdTypeAbsolute AlertRuleThresholdTypeEnum = "ABSOLUTE" |
| 104 | +) |
| 105 | + |
| 106 | +var mappingAlertRuleThresholdType = map[string]AlertRuleThresholdTypeEnum{ |
| 107 | + "PERCENTAGE": AlertRuleThresholdTypePercentage, |
| 108 | + "ABSOLUTE": AlertRuleThresholdTypeAbsolute, |
| 109 | +} |
| 110 | + |
| 111 | +// GetAlertRuleThresholdTypeEnumValues Enumerates the set of values for AlertRuleThresholdTypeEnum |
| 112 | +func GetAlertRuleThresholdTypeEnumValues() []AlertRuleThresholdTypeEnum { |
| 113 | + values := make([]AlertRuleThresholdTypeEnum, 0) |
| 114 | + for _, v := range mappingAlertRuleThresholdType { |
| 115 | + values = append(values, v) |
| 116 | + } |
| 117 | + return values |
| 118 | +} |
| 119 | + |
| 120 | +// AlertRuleLifecycleStateEnum Enum with underlying type: string |
| 121 | +type AlertRuleLifecycleStateEnum string |
| 122 | + |
| 123 | +// Set of constants representing the allowable values for AlertRuleLifecycleStateEnum |
| 124 | +const ( |
| 125 | + AlertRuleLifecycleStateActive AlertRuleLifecycleStateEnum = "ACTIVE" |
| 126 | + AlertRuleLifecycleStateInactive AlertRuleLifecycleStateEnum = "INACTIVE" |
| 127 | +) |
| 128 | + |
| 129 | +var mappingAlertRuleLifecycleState = map[string]AlertRuleLifecycleStateEnum{ |
| 130 | + "ACTIVE": AlertRuleLifecycleStateActive, |
| 131 | + "INACTIVE": AlertRuleLifecycleStateInactive, |
| 132 | +} |
| 133 | + |
| 134 | +// GetAlertRuleLifecycleStateEnumValues Enumerates the set of values for AlertRuleLifecycleStateEnum |
| 135 | +func GetAlertRuleLifecycleStateEnumValues() []AlertRuleLifecycleStateEnum { |
| 136 | + values := make([]AlertRuleLifecycleStateEnum, 0) |
| 137 | + for _, v := range mappingAlertRuleLifecycleState { |
| 138 | + values = append(values, v) |
| 139 | + } |
| 140 | + return values |
| 141 | +} |
0 commit comments