This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
action.go
185 lines (161 loc) · 5.96 KB
/
action.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20200101
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Action for alert rule.
type Action struct {
pulumi.CustomResourceState
// Etag of the action.
Etag pulumi.StringPtrOutput `pulumi:"etag"`
// Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
LogicAppResourceId pulumi.StringOutput `pulumi:"logicAppResourceId"`
// Azure resource name
Name pulumi.StringOutput `pulumi:"name"`
// Azure resource type
Type pulumi.StringOutput `pulumi:"type"`
// The name of the logic app's workflow.
WorkflowId pulumi.StringPtrOutput `pulumi:"workflowId"`
}
// NewAction registers a new resource with the given unique name, arguments, and options.
func NewAction(ctx *pulumi.Context,
name string, args *ActionArgs, opts ...pulumi.ResourceOption) (*Action, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ActionId == nil {
return nil, errors.New("invalid value for required argument 'ActionId'")
}
if args.LogicAppResourceId == nil {
return nil, errors.New("invalid value for required argument 'LogicAppResourceId'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.RuleId == nil {
return nil, errors.New("invalid value for required argument 'RuleId'")
}
if args.WorkspaceName == nil {
return nil, errors.New("invalid value for required argument 'WorkspaceName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:securityinsights/latest:Action"),
},
})
opts = append(opts, aliases)
var resource Action
err := ctx.RegisterResource("azure-nextgen:securityinsights/v20200101:Action", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAction gets an existing Action 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 GetAction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ActionState, opts ...pulumi.ResourceOption) (*Action, error) {
var resource Action
err := ctx.ReadResource("azure-nextgen:securityinsights/v20200101:Action", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Action resources.
type actionState struct {
// Etag of the action.
Etag *string `pulumi:"etag"`
// Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
LogicAppResourceId *string `pulumi:"logicAppResourceId"`
// Azure resource name
Name *string `pulumi:"name"`
// Azure resource type
Type *string `pulumi:"type"`
// The name of the logic app's workflow.
WorkflowId *string `pulumi:"workflowId"`
}
type ActionState struct {
// Etag of the action.
Etag pulumi.StringPtrInput
// Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
LogicAppResourceId pulumi.StringPtrInput
// Azure resource name
Name pulumi.StringPtrInput
// Azure resource type
Type pulumi.StringPtrInput
// The name of the logic app's workflow.
WorkflowId pulumi.StringPtrInput
}
func (ActionState) ElementType() reflect.Type {
return reflect.TypeOf((*actionState)(nil)).Elem()
}
type actionArgs struct {
// Action ID
ActionId string `pulumi:"actionId"`
// Etag of the azure resource
Etag *string `pulumi:"etag"`
// Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
LogicAppResourceId string `pulumi:"logicAppResourceId"`
// The name of the resource group within the user's subscription. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Alert rule ID
RuleId string `pulumi:"ruleId"`
// Logic App Callback URL for this specific workflow.
TriggerUri *string `pulumi:"triggerUri"`
// The name of the workspace.
WorkspaceName string `pulumi:"workspaceName"`
}
// The set of arguments for constructing a Action resource.
type ActionArgs struct {
// Action ID
ActionId pulumi.StringInput
// Etag of the azure resource
Etag pulumi.StringPtrInput
// Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
LogicAppResourceId pulumi.StringInput
// The name of the resource group within the user's subscription. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// Alert rule ID
RuleId pulumi.StringInput
// Logic App Callback URL for this specific workflow.
TriggerUri pulumi.StringPtrInput
// The name of the workspace.
WorkspaceName pulumi.StringInput
}
func (ActionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*actionArgs)(nil)).Elem()
}
type ActionInput interface {
pulumi.Input
ToActionOutput() ActionOutput
ToActionOutputWithContext(ctx context.Context) ActionOutput
}
func (*Action) ElementType() reflect.Type {
return reflect.TypeOf((*Action)(nil))
}
func (i *Action) ToActionOutput() ActionOutput {
return i.ToActionOutputWithContext(context.Background())
}
func (i *Action) ToActionOutputWithContext(ctx context.Context) ActionOutput {
return pulumi.ToOutputWithContext(ctx, i).(ActionOutput)
}
type ActionOutput struct {
*pulumi.OutputState
}
func (ActionOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Action)(nil))
}
func (o ActionOutput) ToActionOutput() ActionOutput {
return o
}
func (o ActionOutput) ToActionOutputWithContext(ctx context.Context) ActionOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ActionOutput{})
}