-
Notifications
You must be signed in to change notification settings - Fork 51
/
property.go
158 lines (142 loc) · 6.18 KB
/
property.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
// *** 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 apimanagement
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an API Management Property.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/api_management_property.html.markdown.
type Property struct {
s *pulumi.ResourceState
}
// NewProperty registers a new resource with the given unique name, arguments, and options.
func NewProperty(ctx *pulumi.Context,
name string, args *PropertyArgs, opts ...pulumi.ResourceOpt) (*Property, error) {
if args == nil || args.ApiManagementName == nil {
return nil, errors.New("missing required argument 'ApiManagementName'")
}
if args == nil || args.DisplayName == nil {
return nil, errors.New("missing required argument 'DisplayName'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Value == nil {
return nil, errors.New("missing required argument 'Value'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["apiManagementName"] = nil
inputs["displayName"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["secret"] = nil
inputs["tags"] = nil
inputs["value"] = nil
} else {
inputs["apiManagementName"] = args.ApiManagementName
inputs["displayName"] = args.DisplayName
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["secret"] = args.Secret
inputs["tags"] = args.Tags
inputs["value"] = args.Value
}
s, err := ctx.RegisterResource("azure:apimanagement/property:Property", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Property{s: s}, nil
}
// GetProperty gets an existing Property 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 GetProperty(ctx *pulumi.Context,
name string, id pulumi.ID, state *PropertyState, opts ...pulumi.ResourceOpt) (*Property, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["apiManagementName"] = state.ApiManagementName
inputs["displayName"] = state.DisplayName
inputs["name"] = state.Name
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["secret"] = state.Secret
inputs["tags"] = state.Tags
inputs["value"] = state.Value
}
s, err := ctx.ReadResource("azure:apimanagement/property:Property", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Property{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Property) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Property) ID() *pulumi.IDOutput {
return r.s.ID()
}
// The name of the API Management Service in which the API Management Property should exist. Changing this forces a new resource to be created.
func (r *Property) ApiManagementName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["apiManagementName"])
}
// The display name of this API Management Property.
func (r *Property) DisplayName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["displayName"])
}
// The name of the API Management Property. Changing this forces a new resource to be created.
func (r *Property) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The name of the Resource Group in which the API Management Property should exist. Changing this forces a new resource to be created.
func (r *Property) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// Specifies whether the API Management Property is secret. Valid values are `true` or `false`. The default value is `false`.
func (r *Property) Secret() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["secret"])
}
// A list of tags to be applied to the API Management Property.
func (r *Property) Tags() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["tags"])
}
// The value of this API Management Property.
func (r *Property) Value() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["value"])
}
// Input properties used for looking up and filtering Property resources.
type PropertyState struct {
// The name of the API Management Service in which the API Management Property should exist. Changing this forces a new resource to be created.
ApiManagementName interface{}
// The display name of this API Management Property.
DisplayName interface{}
// The name of the API Management Property. Changing this forces a new resource to be created.
Name interface{}
// The name of the Resource Group in which the API Management Property should exist. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// Specifies whether the API Management Property is secret. Valid values are `true` or `false`. The default value is `false`.
Secret interface{}
// A list of tags to be applied to the API Management Property.
Tags interface{}
// The value of this API Management Property.
Value interface{}
}
// The set of arguments for constructing a Property resource.
type PropertyArgs struct {
// The name of the API Management Service in which the API Management Property should exist. Changing this forces a new resource to be created.
ApiManagementName interface{}
// The display name of this API Management Property.
DisplayName interface{}
// The name of the API Management Property. Changing this forces a new resource to be created.
Name interface{}
// The name of the Resource Group in which the API Management Property should exist. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// Specifies whether the API Management Property is secret. Valid values are `true` or `false`. The default value is `false`.
Secret interface{}
// A list of tags to be applied to the API Management Property.
Tags interface{}
// The value of this API Management Property.
Value interface{}
}