/
serviceDictionaryItemsv1.go
253 lines (207 loc) · 10.5 KB
/
serviceDictionaryItemsv1.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// *** 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 fastly
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Defines a map of Fastly dictionary items that can be used to populate a service dictionary. This resource will populate a dictionary with the items and will track their state.
//
// > **Warning:** This provider will take precedence over any changes you make in the UI or API. Such changes are likely to be reversed if you run the provider again.
//
// If this provider is being used to populate the initial content of a dictionary which you intend to manage via API or UI, then the lifecycle `ignoreChanges` field can be used with the resource. An example of this configuration is provided below.
//
// ## Limitations
//
// - `writeOnly` dictionaries are not supported
//
// ## Example Usage
//
// ## Import
//
// This is an example of the import command being applied to the resource named `fastly_service_dictionary_items_v1.items` The resource ID is a combined value of the `service_id` and `dictionary_id` separated by a forward slash.
//
// ```sh
// $ pulumi import fastly:index/serviceDictionaryItemsv1:ServiceDictionaryItemsv1 items xxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxx
// ```
type ServiceDictionaryItemsv1 struct {
pulumi.CustomResourceState
// The ID of the dictionary that the items belong to
DictionaryId pulumi.StringOutput `pulumi:"dictionaryId"`
// A map representing an entry in the dictionary, (key/value)
Items pulumi.MapOutput `pulumi:"items"`
// The ID of the service that the dictionary belongs to
ServiceId pulumi.StringOutput `pulumi:"serviceId"`
}
// NewServiceDictionaryItemsv1 registers a new resource with the given unique name, arguments, and options.
func NewServiceDictionaryItemsv1(ctx *pulumi.Context,
name string, args *ServiceDictionaryItemsv1Args, opts ...pulumi.ResourceOption) (*ServiceDictionaryItemsv1, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DictionaryId == nil {
return nil, errors.New("invalid value for required argument 'DictionaryId'")
}
if args.ServiceId == nil {
return nil, errors.New("invalid value for required argument 'ServiceId'")
}
var resource ServiceDictionaryItemsv1
err := ctx.RegisterResource("fastly:index/serviceDictionaryItemsv1:ServiceDictionaryItemsv1", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServiceDictionaryItemsv1 gets an existing ServiceDictionaryItemsv1 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 GetServiceDictionaryItemsv1(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceDictionaryItemsv1State, opts ...pulumi.ResourceOption) (*ServiceDictionaryItemsv1, error) {
var resource ServiceDictionaryItemsv1
err := ctx.ReadResource("fastly:index/serviceDictionaryItemsv1:ServiceDictionaryItemsv1", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ServiceDictionaryItemsv1 resources.
type serviceDictionaryItemsv1State struct {
// The ID of the dictionary that the items belong to
DictionaryId *string `pulumi:"dictionaryId"`
// A map representing an entry in the dictionary, (key/value)
Items map[string]interface{} `pulumi:"items"`
// The ID of the service that the dictionary belongs to
ServiceId *string `pulumi:"serviceId"`
}
type ServiceDictionaryItemsv1State struct {
// The ID of the dictionary that the items belong to
DictionaryId pulumi.StringPtrInput
// A map representing an entry in the dictionary, (key/value)
Items pulumi.MapInput
// The ID of the service that the dictionary belongs to
ServiceId pulumi.StringPtrInput
}
func (ServiceDictionaryItemsv1State) ElementType() reflect.Type {
return reflect.TypeOf((*serviceDictionaryItemsv1State)(nil)).Elem()
}
type serviceDictionaryItemsv1Args struct {
// The ID of the dictionary that the items belong to
DictionaryId string `pulumi:"dictionaryId"`
// A map representing an entry in the dictionary, (key/value)
Items map[string]interface{} `pulumi:"items"`
// The ID of the service that the dictionary belongs to
ServiceId string `pulumi:"serviceId"`
}
// The set of arguments for constructing a ServiceDictionaryItemsv1 resource.
type ServiceDictionaryItemsv1Args struct {
// The ID of the dictionary that the items belong to
DictionaryId pulumi.StringInput
// A map representing an entry in the dictionary, (key/value)
Items pulumi.MapInput
// The ID of the service that the dictionary belongs to
ServiceId pulumi.StringInput
}
func (ServiceDictionaryItemsv1Args) ElementType() reflect.Type {
return reflect.TypeOf((*serviceDictionaryItemsv1Args)(nil)).Elem()
}
type ServiceDictionaryItemsv1Input interface {
pulumi.Input
ToServiceDictionaryItemsv1Output() ServiceDictionaryItemsv1Output
ToServiceDictionaryItemsv1OutputWithContext(ctx context.Context) ServiceDictionaryItemsv1Output
}
func (*ServiceDictionaryItemsv1) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceDictionaryItemsv1)(nil)).Elem()
}
func (i *ServiceDictionaryItemsv1) ToServiceDictionaryItemsv1Output() ServiceDictionaryItemsv1Output {
return i.ToServiceDictionaryItemsv1OutputWithContext(context.Background())
}
func (i *ServiceDictionaryItemsv1) ToServiceDictionaryItemsv1OutputWithContext(ctx context.Context) ServiceDictionaryItemsv1Output {
return pulumi.ToOutputWithContext(ctx, i).(ServiceDictionaryItemsv1Output)
}
// ServiceDictionaryItemsv1ArrayInput is an input type that accepts ServiceDictionaryItemsv1Array and ServiceDictionaryItemsv1ArrayOutput values.
// You can construct a concrete instance of `ServiceDictionaryItemsv1ArrayInput` via:
//
// ServiceDictionaryItemsv1Array{ ServiceDictionaryItemsv1Args{...} }
type ServiceDictionaryItemsv1ArrayInput interface {
pulumi.Input
ToServiceDictionaryItemsv1ArrayOutput() ServiceDictionaryItemsv1ArrayOutput
ToServiceDictionaryItemsv1ArrayOutputWithContext(context.Context) ServiceDictionaryItemsv1ArrayOutput
}
type ServiceDictionaryItemsv1Array []ServiceDictionaryItemsv1Input
func (ServiceDictionaryItemsv1Array) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceDictionaryItemsv1)(nil)).Elem()
}
func (i ServiceDictionaryItemsv1Array) ToServiceDictionaryItemsv1ArrayOutput() ServiceDictionaryItemsv1ArrayOutput {
return i.ToServiceDictionaryItemsv1ArrayOutputWithContext(context.Background())
}
func (i ServiceDictionaryItemsv1Array) ToServiceDictionaryItemsv1ArrayOutputWithContext(ctx context.Context) ServiceDictionaryItemsv1ArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceDictionaryItemsv1ArrayOutput)
}
// ServiceDictionaryItemsv1MapInput is an input type that accepts ServiceDictionaryItemsv1Map and ServiceDictionaryItemsv1MapOutput values.
// You can construct a concrete instance of `ServiceDictionaryItemsv1MapInput` via:
//
// ServiceDictionaryItemsv1Map{ "key": ServiceDictionaryItemsv1Args{...} }
type ServiceDictionaryItemsv1MapInput interface {
pulumi.Input
ToServiceDictionaryItemsv1MapOutput() ServiceDictionaryItemsv1MapOutput
ToServiceDictionaryItemsv1MapOutputWithContext(context.Context) ServiceDictionaryItemsv1MapOutput
}
type ServiceDictionaryItemsv1Map map[string]ServiceDictionaryItemsv1Input
func (ServiceDictionaryItemsv1Map) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceDictionaryItemsv1)(nil)).Elem()
}
func (i ServiceDictionaryItemsv1Map) ToServiceDictionaryItemsv1MapOutput() ServiceDictionaryItemsv1MapOutput {
return i.ToServiceDictionaryItemsv1MapOutputWithContext(context.Background())
}
func (i ServiceDictionaryItemsv1Map) ToServiceDictionaryItemsv1MapOutputWithContext(ctx context.Context) ServiceDictionaryItemsv1MapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceDictionaryItemsv1MapOutput)
}
type ServiceDictionaryItemsv1Output struct{ *pulumi.OutputState }
func (ServiceDictionaryItemsv1Output) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceDictionaryItemsv1)(nil)).Elem()
}
func (o ServiceDictionaryItemsv1Output) ToServiceDictionaryItemsv1Output() ServiceDictionaryItemsv1Output {
return o
}
func (o ServiceDictionaryItemsv1Output) ToServiceDictionaryItemsv1OutputWithContext(ctx context.Context) ServiceDictionaryItemsv1Output {
return o
}
type ServiceDictionaryItemsv1ArrayOutput struct{ *pulumi.OutputState }
func (ServiceDictionaryItemsv1ArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceDictionaryItemsv1)(nil)).Elem()
}
func (o ServiceDictionaryItemsv1ArrayOutput) ToServiceDictionaryItemsv1ArrayOutput() ServiceDictionaryItemsv1ArrayOutput {
return o
}
func (o ServiceDictionaryItemsv1ArrayOutput) ToServiceDictionaryItemsv1ArrayOutputWithContext(ctx context.Context) ServiceDictionaryItemsv1ArrayOutput {
return o
}
func (o ServiceDictionaryItemsv1ArrayOutput) Index(i pulumi.IntInput) ServiceDictionaryItemsv1Output {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceDictionaryItemsv1 {
return vs[0].([]*ServiceDictionaryItemsv1)[vs[1].(int)]
}).(ServiceDictionaryItemsv1Output)
}
type ServiceDictionaryItemsv1MapOutput struct{ *pulumi.OutputState }
func (ServiceDictionaryItemsv1MapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceDictionaryItemsv1)(nil)).Elem()
}
func (o ServiceDictionaryItemsv1MapOutput) ToServiceDictionaryItemsv1MapOutput() ServiceDictionaryItemsv1MapOutput {
return o
}
func (o ServiceDictionaryItemsv1MapOutput) ToServiceDictionaryItemsv1MapOutputWithContext(ctx context.Context) ServiceDictionaryItemsv1MapOutput {
return o
}
func (o ServiceDictionaryItemsv1MapOutput) MapIndex(k pulumi.StringInput) ServiceDictionaryItemsv1Output {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceDictionaryItemsv1 {
return vs[0].(map[string]*ServiceDictionaryItemsv1)[vs[1].(string)]
}).(ServiceDictionaryItemsv1Output)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceDictionaryItemsv1Input)(nil)).Elem(), &ServiceDictionaryItemsv1{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceDictionaryItemsv1ArrayInput)(nil)).Elem(), ServiceDictionaryItemsv1Array{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceDictionaryItemsv1MapInput)(nil)).Elem(), ServiceDictionaryItemsv1Map{})
pulumi.RegisterOutputType(ServiceDictionaryItemsv1Output{})
pulumi.RegisterOutputType(ServiceDictionaryItemsv1ArrayOutput{})
pulumi.RegisterOutputType(ServiceDictionaryItemsv1MapOutput{})
}