/
alertPolicyChannel.go
113 lines (100 loc) · 4.27 KB
/
alertPolicyChannel.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
// *** 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 newrelic
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this resource to map alert policies to alert channels in New Relic.
type AlertPolicyChannel struct {
pulumi.CustomResourceState
// Deprecated. The ID of the channel. Please use the channel_ids argument instead.
//
// Deprecated: use `channel_ids` argument instead
ChannelId pulumi.IntPtrOutput `pulumi:"channelId"`
// Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid
// drift your Terraform state.
ChannelIds pulumi.IntArrayOutput `pulumi:"channelIds"`
// The ID of the policy.
PolicyId pulumi.IntOutput `pulumi:"policyId"`
}
// NewAlertPolicyChannel registers a new resource with the given unique name, arguments, and options.
func NewAlertPolicyChannel(ctx *pulumi.Context,
name string, args *AlertPolicyChannelArgs, opts ...pulumi.ResourceOption) (*AlertPolicyChannel, error) {
if args == nil || args.PolicyId == nil {
return nil, errors.New("missing required argument 'PolicyId'")
}
if args == nil {
args = &AlertPolicyChannelArgs{}
}
var resource AlertPolicyChannel
err := ctx.RegisterResource("newrelic:index/alertPolicyChannel:AlertPolicyChannel", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAlertPolicyChannel gets an existing AlertPolicyChannel 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 GetAlertPolicyChannel(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AlertPolicyChannelState, opts ...pulumi.ResourceOption) (*AlertPolicyChannel, error) {
var resource AlertPolicyChannel
err := ctx.ReadResource("newrelic:index/alertPolicyChannel:AlertPolicyChannel", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AlertPolicyChannel resources.
type alertPolicyChannelState struct {
// Deprecated. The ID of the channel. Please use the channel_ids argument instead.
//
// Deprecated: use `channel_ids` argument instead
ChannelId *int `pulumi:"channelId"`
// Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid
// drift your Terraform state.
ChannelIds []int `pulumi:"channelIds"`
// The ID of the policy.
PolicyId *int `pulumi:"policyId"`
}
type AlertPolicyChannelState struct {
// Deprecated. The ID of the channel. Please use the channel_ids argument instead.
//
// Deprecated: use `channel_ids` argument instead
ChannelId pulumi.IntPtrInput
// Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid
// drift your Terraform state.
ChannelIds pulumi.IntArrayInput
// The ID of the policy.
PolicyId pulumi.IntPtrInput
}
func (AlertPolicyChannelState) ElementType() reflect.Type {
return reflect.TypeOf((*alertPolicyChannelState)(nil)).Elem()
}
type alertPolicyChannelArgs struct {
// Deprecated. The ID of the channel. Please use the channel_ids argument instead.
//
// Deprecated: use `channel_ids` argument instead
ChannelId *int `pulumi:"channelId"`
// Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid
// drift your Terraform state.
ChannelIds []int `pulumi:"channelIds"`
// The ID of the policy.
PolicyId int `pulumi:"policyId"`
}
// The set of arguments for constructing a AlertPolicyChannel resource.
type AlertPolicyChannelArgs struct {
// Deprecated. The ID of the channel. Please use the channel_ids argument instead.
//
// Deprecated: use `channel_ids` argument instead
ChannelId pulumi.IntPtrInput
// Array of channel IDs to apply to the specified policy. We recommended sorting channel IDs in ascending order to avoid
// drift your Terraform state.
ChannelIds pulumi.IntArrayInput
// The ID of the policy.
PolicyId pulumi.IntInput
}
func (AlertPolicyChannelArgs) ElementType() reflect.Type {
return reflect.TypeOf((*alertPolicyChannelArgs)(nil)).Elem()
}