-
Notifications
You must be signed in to change notification settings - Fork 2
/
rulesetRule.go
128 lines (115 loc) · 5.67 KB
/
rulesetRule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package pagerduty
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// An [event rule](https://support.pagerduty.com/docs/rulesets#section-create-event-rules) allows you to set actions that should be taken on events that meet your designated rule criteria.
type RulesetRule struct {
pulumi.CustomResourceState
// Actions to apply to an event if the conditions match.
Actions RulesetRuleActionsPtrOutput `pulumi:"actions"`
// Conditions evaluated to check if an event matches this event rule. Is always empty for the catch all rule, though.
Conditions RulesetRuleConditionsPtrOutput `pulumi:"conditions"`
// Indicates whether the rule is disabled and would therefore not be evaluated.
Disabled pulumi.BoolPtrOutput `pulumi:"disabled"`
// Position/index of the rule within the ruleset.
Position pulumi.IntPtrOutput `pulumi:"position"`
// The ID of the ruleset that the rule belongs to.
Ruleset pulumi.StringOutput `pulumi:"ruleset"`
// Settings for [scheduling the rule](https://support.pagerduty.com/docs/rulesets#section-scheduled-event-rules).
TimeFrame RulesetRuleTimeFramePtrOutput `pulumi:"timeFrame"`
}
// NewRulesetRule registers a new resource with the given unique name, arguments, and options.
func NewRulesetRule(ctx *pulumi.Context,
name string, args *RulesetRuleArgs, opts ...pulumi.ResourceOption) (*RulesetRule, error) {
if args == nil || args.Ruleset == nil {
return nil, errors.New("missing required argument 'Ruleset'")
}
if args == nil {
args = &RulesetRuleArgs{}
}
var resource RulesetRule
err := ctx.RegisterResource("pagerduty:index/rulesetRule:RulesetRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRulesetRule gets an existing RulesetRule resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetRulesetRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RulesetRuleState, opts ...pulumi.ResourceOption) (*RulesetRule, error) {
var resource RulesetRule
err := ctx.ReadResource("pagerduty:index/rulesetRule:RulesetRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RulesetRule resources.
type rulesetRuleState struct {
// Actions to apply to an event if the conditions match.
Actions *RulesetRuleActions `pulumi:"actions"`
// Conditions evaluated to check if an event matches this event rule. Is always empty for the catch all rule, though.
Conditions *RulesetRuleConditions `pulumi:"conditions"`
// Indicates whether the rule is disabled and would therefore not be evaluated.
Disabled *bool `pulumi:"disabled"`
// Position/index of the rule within the ruleset.
Position *int `pulumi:"position"`
// The ID of the ruleset that the rule belongs to.
Ruleset *string `pulumi:"ruleset"`
// Settings for [scheduling the rule](https://support.pagerduty.com/docs/rulesets#section-scheduled-event-rules).
TimeFrame *RulesetRuleTimeFrame `pulumi:"timeFrame"`
}
type RulesetRuleState struct {
// Actions to apply to an event if the conditions match.
Actions RulesetRuleActionsPtrInput
// Conditions evaluated to check if an event matches this event rule. Is always empty for the catch all rule, though.
Conditions RulesetRuleConditionsPtrInput
// Indicates whether the rule is disabled and would therefore not be evaluated.
Disabled pulumi.BoolPtrInput
// Position/index of the rule within the ruleset.
Position pulumi.IntPtrInput
// The ID of the ruleset that the rule belongs to.
Ruleset pulumi.StringPtrInput
// Settings for [scheduling the rule](https://support.pagerduty.com/docs/rulesets#section-scheduled-event-rules).
TimeFrame RulesetRuleTimeFramePtrInput
}
func (RulesetRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*rulesetRuleState)(nil)).Elem()
}
type rulesetRuleArgs struct {
// Actions to apply to an event if the conditions match.
Actions *RulesetRuleActions `pulumi:"actions"`
// Conditions evaluated to check if an event matches this event rule. Is always empty for the catch all rule, though.
Conditions *RulesetRuleConditions `pulumi:"conditions"`
// Indicates whether the rule is disabled and would therefore not be evaluated.
Disabled *bool `pulumi:"disabled"`
// Position/index of the rule within the ruleset.
Position *int `pulumi:"position"`
// The ID of the ruleset that the rule belongs to.
Ruleset string `pulumi:"ruleset"`
// Settings for [scheduling the rule](https://support.pagerduty.com/docs/rulesets#section-scheduled-event-rules).
TimeFrame *RulesetRuleTimeFrame `pulumi:"timeFrame"`
}
// The set of arguments for constructing a RulesetRule resource.
type RulesetRuleArgs struct {
// Actions to apply to an event if the conditions match.
Actions RulesetRuleActionsPtrInput
// Conditions evaluated to check if an event matches this event rule. Is always empty for the catch all rule, though.
Conditions RulesetRuleConditionsPtrInput
// Indicates whether the rule is disabled and would therefore not be evaluated.
Disabled pulumi.BoolPtrInput
// Position/index of the rule within the ruleset.
Position pulumi.IntPtrInput
// The ID of the ruleset that the rule belongs to.
Ruleset pulumi.StringInput
// Settings for [scheduling the rule](https://support.pagerduty.com/docs/rulesets#section-scheduled-event-rules).
TimeFrame RulesetRuleTimeFramePtrInput
}
func (RulesetRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*rulesetRuleArgs)(nil)).Elem()
}