generated from pulumi/pulumi-tf-provider-boilerplate
/
getTriggers.go
176 lines (155 loc) · 6.14 KB
/
getTriggers.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devops
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Triggers in Oracle Cloud Infrastructure Devops service.
//
// Returns a list of triggers.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/DevOps"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := DevOps.GetTriggers(ctx, &devops.GetTriggersArgs{
// CompartmentId: pulumi.StringRef(compartmentId),
// DisplayName: pulumi.StringRef(triggerDisplayName),
// Id: pulumi.StringRef(triggerId),
// ProjectId: pulumi.StringRef(testProject.Id),
// State: pulumi.StringRef(triggerState),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetTriggers(ctx *pulumi.Context, args *GetTriggersArgs, opts ...pulumi.InvokeOption) (*GetTriggersResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetTriggersResult
err := ctx.Invoke("oci:DevOps/getTriggers:getTriggers", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getTriggers.
type GetTriggersArgs struct {
// The OCID of the compartment in which to list resources.
CompartmentId *string `pulumi:"compartmentId"`
// A filter to return only resources that match the entire display name given.
DisplayName *string `pulumi:"displayName"`
// The filters for the trigger.
Filters []GetTriggersFilter `pulumi:"filters"`
// Unique trigger identifier.
Id *string `pulumi:"id"`
// unique project identifier
ProjectId *string `pulumi:"projectId"`
// A filter to return only triggers that matches the given lifecycle state.
State *string `pulumi:"state"`
}
// A collection of values returned by getTriggers.
type GetTriggersResult struct {
// The OCID of the compartment that contains the trigger.
CompartmentId *string `pulumi:"compartmentId"`
// Trigger display name. Avoid entering confidential information.
DisplayName *string `pulumi:"displayName"`
// The filters for the trigger.
Filters []GetTriggersFilter `pulumi:"filters"`
// Unique identifier that is immutable on creation.
Id *string `pulumi:"id"`
// The OCID of the DevOps project to which the trigger belongs to.
ProjectId *string `pulumi:"projectId"`
// The current state of the trigger.
State *string `pulumi:"state"`
// The list of trigger_collection.
TriggerCollections []GetTriggersTriggerCollection `pulumi:"triggerCollections"`
}
func GetTriggersOutput(ctx *pulumi.Context, args GetTriggersOutputArgs, opts ...pulumi.InvokeOption) GetTriggersResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetTriggersResult, error) {
args := v.(GetTriggersArgs)
r, err := GetTriggers(ctx, &args, opts...)
var s GetTriggersResult
if r != nil {
s = *r
}
return s, err
}).(GetTriggersResultOutput)
}
// A collection of arguments for invoking getTriggers.
type GetTriggersOutputArgs struct {
// The OCID of the compartment in which to list resources.
CompartmentId pulumi.StringPtrInput `pulumi:"compartmentId"`
// A filter to return only resources that match the entire display name given.
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
// The filters for the trigger.
Filters GetTriggersFilterArrayInput `pulumi:"filters"`
// Unique trigger identifier.
Id pulumi.StringPtrInput `pulumi:"id"`
// unique project identifier
ProjectId pulumi.StringPtrInput `pulumi:"projectId"`
// A filter to return only triggers that matches the given lifecycle state.
State pulumi.StringPtrInput `pulumi:"state"`
}
func (GetTriggersOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetTriggersArgs)(nil)).Elem()
}
// A collection of values returned by getTriggers.
type GetTriggersResultOutput struct{ *pulumi.OutputState }
func (GetTriggersResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetTriggersResult)(nil)).Elem()
}
func (o GetTriggersResultOutput) ToGetTriggersResultOutput() GetTriggersResultOutput {
return o
}
func (o GetTriggersResultOutput) ToGetTriggersResultOutputWithContext(ctx context.Context) GetTriggersResultOutput {
return o
}
// The OCID of the compartment that contains the trigger.
func (o GetTriggersResultOutput) CompartmentId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTriggersResult) *string { return v.CompartmentId }).(pulumi.StringPtrOutput)
}
// Trigger display name. Avoid entering confidential information.
func (o GetTriggersResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTriggersResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
// The filters for the trigger.
func (o GetTriggersResultOutput) Filters() GetTriggersFilterArrayOutput {
return o.ApplyT(func(v GetTriggersResult) []GetTriggersFilter { return v.Filters }).(GetTriggersFilterArrayOutput)
}
// Unique identifier that is immutable on creation.
func (o GetTriggersResultOutput) Id() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTriggersResult) *string { return v.Id }).(pulumi.StringPtrOutput)
}
// The OCID of the DevOps project to which the trigger belongs to.
func (o GetTriggersResultOutput) ProjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTriggersResult) *string { return v.ProjectId }).(pulumi.StringPtrOutput)
}
// The current state of the trigger.
func (o GetTriggersResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTriggersResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
// The list of trigger_collection.
func (o GetTriggersResultOutput) TriggerCollections() GetTriggersTriggerCollectionArrayOutput {
return o.ApplyT(func(v GetTriggersResult) []GetTriggersTriggerCollection { return v.TriggerCollections }).(GetTriggersTriggerCollectionArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetTriggersResultOutput{})
}