This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
api.go
344 lines (320 loc) · 14.7 KB
/
api.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
// *** 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 v20180101
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// API details.
type Api struct {
pulumi.CustomResourceState
// Describes the Revision of the Api. If no value is provided, default revision 1 is created
ApiRevision pulumi.StringPtrOutput `pulumi:"apiRevision"`
// Description of the Api Revision.
ApiRevisionDescription pulumi.StringPtrOutput `pulumi:"apiRevisionDescription"`
// Type of API.
ApiType pulumi.StringPtrOutput `pulumi:"apiType"`
// Indicates the Version identifier of the API if the API is versioned
ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
// Description of the Api Version.
ApiVersionDescription pulumi.StringPtrOutput `pulumi:"apiVersionDescription"`
// An API Version Set contains the common configuration for a set of API Versions relating
ApiVersionSet ApiVersionSetContractDetailsResponsePtrOutput `pulumi:"apiVersionSet"`
// A resource identifier for the related ApiVersionSet.
ApiVersionSetId pulumi.StringPtrOutput `pulumi:"apiVersionSetId"`
// Collection of authentication settings included into this API.
AuthenticationSettings AuthenticationSettingsContractResponsePtrOutput `pulumi:"authenticationSettings"`
// Description of the API. May include HTML formatting tags.
Description pulumi.StringPtrOutput `pulumi:"description"`
// API name.
DisplayName pulumi.StringPtrOutput `pulumi:"displayName"`
// Indicates if API revision is current api revision.
IsCurrent pulumi.BoolOutput `pulumi:"isCurrent"`
// Indicates if API revision is accessible via the gateway.
IsOnline pulumi.BoolOutput `pulumi:"isOnline"`
// Resource name.
Name pulumi.StringOutput `pulumi:"name"`
// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
Path pulumi.StringOutput `pulumi:"path"`
// Describes on which protocols the operations in this API can be invoked.
Protocols pulumi.StringArrayOutput `pulumi:"protocols"`
// Absolute URL of the backend service implementing this API.
ServiceUrl pulumi.StringPtrOutput `pulumi:"serviceUrl"`
// Protocols over which API is made available.
SubscriptionKeyParameterNames SubscriptionKeyParameterNamesContractResponsePtrOutput `pulumi:"subscriptionKeyParameterNames"`
// Resource type for API Management resource.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewApi registers a new resource with the given unique name, arguments, and options.
func NewApi(ctx *pulumi.Context,
name string, args *ApiArgs, opts ...pulumi.ResourceOption) (*Api, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiId == nil {
return nil, errors.New("invalid value for required argument 'ApiId'")
}
if args.Path == nil {
return nil, errors.New("invalid value for required argument 'Path'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.ServiceName == nil {
return nil, errors.New("invalid value for required argument 'ServiceName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:apimanagement/latest:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20160707:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20161010:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20170301:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20180601preview:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20190101:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20191201:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20191201preview:Api"),
},
{
Type: pulumi.String("azure-nextgen:apimanagement/v20200601preview:Api"),
},
})
opts = append(opts, aliases)
var resource Api
err := ctx.RegisterResource("azure-nextgen:apimanagement/v20180101:Api", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApi gets an existing Api 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 GetApi(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiState, opts ...pulumi.ResourceOption) (*Api, error) {
var resource Api
err := ctx.ReadResource("azure-nextgen:apimanagement/v20180101:Api", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Api resources.
type apiState struct {
// Describes the Revision of the Api. If no value is provided, default revision 1 is created
ApiRevision *string `pulumi:"apiRevision"`
// Description of the Api Revision.
ApiRevisionDescription *string `pulumi:"apiRevisionDescription"`
// Type of API.
ApiType *string `pulumi:"apiType"`
// Indicates the Version identifier of the API if the API is versioned
ApiVersion *string `pulumi:"apiVersion"`
// Description of the Api Version.
ApiVersionDescription *string `pulumi:"apiVersionDescription"`
// An API Version Set contains the common configuration for a set of API Versions relating
ApiVersionSet *ApiVersionSetContractDetailsResponse `pulumi:"apiVersionSet"`
// A resource identifier for the related ApiVersionSet.
ApiVersionSetId *string `pulumi:"apiVersionSetId"`
// Collection of authentication settings included into this API.
AuthenticationSettings *AuthenticationSettingsContractResponse `pulumi:"authenticationSettings"`
// Description of the API. May include HTML formatting tags.
Description *string `pulumi:"description"`
// API name.
DisplayName *string `pulumi:"displayName"`
// Indicates if API revision is current api revision.
IsCurrent *bool `pulumi:"isCurrent"`
// Indicates if API revision is accessible via the gateway.
IsOnline *bool `pulumi:"isOnline"`
// Resource name.
Name *string `pulumi:"name"`
// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
Path *string `pulumi:"path"`
// Describes on which protocols the operations in this API can be invoked.
Protocols []string `pulumi:"protocols"`
// Absolute URL of the backend service implementing this API.
ServiceUrl *string `pulumi:"serviceUrl"`
// Protocols over which API is made available.
SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContractResponse `pulumi:"subscriptionKeyParameterNames"`
// Resource type for API Management resource.
Type *string `pulumi:"type"`
}
type ApiState struct {
// Describes the Revision of the Api. If no value is provided, default revision 1 is created
ApiRevision pulumi.StringPtrInput
// Description of the Api Revision.
ApiRevisionDescription pulumi.StringPtrInput
// Type of API.
ApiType pulumi.StringPtrInput
// Indicates the Version identifier of the API if the API is versioned
ApiVersion pulumi.StringPtrInput
// Description of the Api Version.
ApiVersionDescription pulumi.StringPtrInput
// An API Version Set contains the common configuration for a set of API Versions relating
ApiVersionSet ApiVersionSetContractDetailsResponsePtrInput
// A resource identifier for the related ApiVersionSet.
ApiVersionSetId pulumi.StringPtrInput
// Collection of authentication settings included into this API.
AuthenticationSettings AuthenticationSettingsContractResponsePtrInput
// Description of the API. May include HTML formatting tags.
Description pulumi.StringPtrInput
// API name.
DisplayName pulumi.StringPtrInput
// Indicates if API revision is current api revision.
IsCurrent pulumi.BoolPtrInput
// Indicates if API revision is accessible via the gateway.
IsOnline pulumi.BoolPtrInput
// Resource name.
Name pulumi.StringPtrInput
// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
Path pulumi.StringPtrInput
// Describes on which protocols the operations in this API can be invoked.
Protocols pulumi.StringArrayInput
// Absolute URL of the backend service implementing this API.
ServiceUrl pulumi.StringPtrInput
// Protocols over which API is made available.
SubscriptionKeyParameterNames SubscriptionKeyParameterNamesContractResponsePtrInput
// Resource type for API Management resource.
Type pulumi.StringPtrInput
}
func (ApiState) ElementType() reflect.Type {
return reflect.TypeOf((*apiState)(nil)).Elem()
}
type apiArgs struct {
// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
ApiId string `pulumi:"apiId"`
// Describes the Revision of the Api. If no value is provided, default revision 1 is created
ApiRevision *string `pulumi:"apiRevision"`
// Description of the Api Revision.
ApiRevisionDescription *string `pulumi:"apiRevisionDescription"`
// Type of API.
ApiType *string `pulumi:"apiType"`
// Indicates the Version identifier of the API if the API is versioned
ApiVersion *string `pulumi:"apiVersion"`
// Description of the Api Version.
ApiVersionDescription *string `pulumi:"apiVersionDescription"`
// An API Version Set contains the common configuration for a set of API Versions relating
ApiVersionSet *ApiVersionSetContractDetails `pulumi:"apiVersionSet"`
// A resource identifier for the related ApiVersionSet.
ApiVersionSetId *string `pulumi:"apiVersionSetId"`
// Collection of authentication settings included into this API.
AuthenticationSettings *AuthenticationSettingsContract `pulumi:"authenticationSettings"`
// Format of the Content in which the API is getting imported.
ContentFormat *string `pulumi:"contentFormat"`
// Content value when Importing an API.
ContentValue *string `pulumi:"contentValue"`
// Description of the API. May include HTML formatting tags.
Description *string `pulumi:"description"`
// API name.
DisplayName *string `pulumi:"displayName"`
// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
Path string `pulumi:"path"`
// Describes on which protocols the operations in this API can be invoked.
Protocols []string `pulumi:"protocols"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the API Management service.
ServiceName string `pulumi:"serviceName"`
// Absolute URL of the backend service implementing this API.
ServiceUrl *string `pulumi:"serviceUrl"`
// Type of Api to create.
// * `http` creates a SOAP to REST API
// * `soap` creates a SOAP pass-through API .
SoapApiType *string `pulumi:"soapApiType"`
// Protocols over which API is made available.
SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `pulumi:"subscriptionKeyParameterNames"`
// Criteria to limit import of WSDL to a subset of the document.
WsdlSelector *ApiCreateOrUpdatePropertiesWsdlSelector `pulumi:"wsdlSelector"`
}
// The set of arguments for constructing a Api resource.
type ApiArgs struct {
// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
ApiId pulumi.StringInput
// Describes the Revision of the Api. If no value is provided, default revision 1 is created
ApiRevision pulumi.StringPtrInput
// Description of the Api Revision.
ApiRevisionDescription pulumi.StringPtrInput
// Type of API.
ApiType pulumi.StringPtrInput
// Indicates the Version identifier of the API if the API is versioned
ApiVersion pulumi.StringPtrInput
// Description of the Api Version.
ApiVersionDescription pulumi.StringPtrInput
// An API Version Set contains the common configuration for a set of API Versions relating
ApiVersionSet ApiVersionSetContractDetailsPtrInput
// A resource identifier for the related ApiVersionSet.
ApiVersionSetId pulumi.StringPtrInput
// Collection of authentication settings included into this API.
AuthenticationSettings AuthenticationSettingsContractPtrInput
// Format of the Content in which the API is getting imported.
ContentFormat pulumi.StringPtrInput
// Content value when Importing an API.
ContentValue pulumi.StringPtrInput
// Description of the API. May include HTML formatting tags.
Description pulumi.StringPtrInput
// API name.
DisplayName pulumi.StringPtrInput
// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
Path pulumi.StringInput
// Describes on which protocols the operations in this API can be invoked.
Protocols ProtocolArrayInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The name of the API Management service.
ServiceName pulumi.StringInput
// Absolute URL of the backend service implementing this API.
ServiceUrl pulumi.StringPtrInput
// Type of Api to create.
// * `http` creates a SOAP to REST API
// * `soap` creates a SOAP pass-through API .
SoapApiType pulumi.StringPtrInput
// Protocols over which API is made available.
SubscriptionKeyParameterNames SubscriptionKeyParameterNamesContractPtrInput
// Criteria to limit import of WSDL to a subset of the document.
WsdlSelector ApiCreateOrUpdatePropertiesWsdlSelectorPtrInput
}
func (ApiArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiArgs)(nil)).Elem()
}
type ApiInput interface {
pulumi.Input
ToApiOutput() ApiOutput
ToApiOutputWithContext(ctx context.Context) ApiOutput
}
func (*Api) ElementType() reflect.Type {
return reflect.TypeOf((*Api)(nil))
}
func (i *Api) ToApiOutput() ApiOutput {
return i.ToApiOutputWithContext(context.Background())
}
func (i *Api) ToApiOutputWithContext(ctx context.Context) ApiOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiOutput)
}
type ApiOutput struct {
*pulumi.OutputState
}
func (ApiOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Api)(nil))
}
func (o ApiOutput) ToApiOutput() ApiOutput {
return o
}
func (o ApiOutput) ToApiOutputWithContext(ctx context.Context) ApiOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ApiOutput{})
}