/
models.go
382 lines (347 loc) · 12.4 KB
/
models.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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
package engagementfabric
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric"
// Account the EngagementFabric account
type Account struct {
autorest.Response `json:"-"`
// Location - The location of the resource
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource
Tags map[string]*string `json:"tags"`
// Sku - The SKU of the resource
Sku *SKU `json:"sku,omitempty"`
// ID - READ-ONLY; The ID of the resource
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The fully qualified type of the resource
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Account.
func (a Account) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if a.Location != nil {
objectMap["location"] = a.Location
}
if a.Tags != nil {
objectMap["tags"] = a.Tags
}
if a.Sku != nil {
objectMap["sku"] = a.Sku
}
return json.Marshal(objectMap)
}
// AccountList the list of the EngagementFabric accounts
type AccountList struct {
autorest.Response `json:"-"`
// Value - EngagementFabric accounts
Value *[]Account `json:"value,omitempty"`
}
// AccountPatch the patch of EngagementFabric account
type AccountPatch struct {
// Tags - The tags of the resource
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for AccountPatch.
func (ap AccountPatch) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ap.Tags != nil {
objectMap["tags"] = ap.Tags
}
return json.Marshal(objectMap)
}
// Channel the EngagementFabric channel
type Channel struct {
autorest.Response `json:"-"`
// ChannelProperties - The properties of the channel
*ChannelProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The ID of the resource
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The fully qualified type of the resource
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Channel.
func (c Channel) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if c.ChannelProperties != nil {
objectMap["properties"] = c.ChannelProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Channel struct.
func (c *Channel) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var channelProperties ChannelProperties
err = json.Unmarshal(*v, &channelProperties)
if err != nil {
return err
}
c.ChannelProperties = &channelProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
c.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
c.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
c.Type = &typeVar
}
}
}
return nil
}
// ChannelList the list of the EngagementFabric channels
type ChannelList struct {
autorest.Response `json:"-"`
// Value - EngagementFabric channels
Value *[]Channel `json:"value,omitempty"`
}
// ChannelProperties the EngagementFabric channel properties
type ChannelProperties struct {
// ChannelType - The channel type
ChannelType *string `json:"channelType,omitempty"`
// ChannelFunctions - The functions to be enabled for the channel
ChannelFunctions *[]string `json:"channelFunctions,omitempty"`
// Credentials - The channel credentials
Credentials map[string]*string `json:"credentials"`
}
// MarshalJSON is the custom marshaler for ChannelProperties.
func (cp ChannelProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cp.ChannelType != nil {
objectMap["channelType"] = cp.ChannelType
}
if cp.ChannelFunctions != nil {
objectMap["channelFunctions"] = cp.ChannelFunctions
}
if cp.Credentials != nil {
objectMap["credentials"] = cp.Credentials
}
return json.Marshal(objectMap)
}
// ChannelTypeDescription engagementFabric channel description
type ChannelTypeDescription struct {
// ChannelType - Channel type
ChannelType *string `json:"channelType,omitempty"`
// ChannelDescription - Text description for the channel
ChannelDescription *string `json:"channelDescription,omitempty"`
// ChannelFunctions - All the available functions for the channel
ChannelFunctions *[]string `json:"channelFunctions,omitempty"`
}
// ChannelTypeDescriptionList list of the EngagementFabric channel descriptions
type ChannelTypeDescriptionList struct {
autorest.Response `json:"-"`
// Value - Channel descriptions
Value *[]ChannelTypeDescription `json:"value,omitempty"`
}
// CheckNameAvailabilityParameter the parameter for name availability check
type CheckNameAvailabilityParameter struct {
// Name - The name to be checked
Name *string `json:"name,omitempty"`
// Type - The fully qualified resource type for the name to be checked
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityResult the result of name availability check
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
// NameAvailable - READ-ONLY; The name to be checked
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - READ-ONLY; The reason if name is unavailable. Possible values include: 'Invalid', 'AlreadyExists'
Reason CheckNameUnavailableReason `json:"reason,omitempty"`
// Message - READ-ONLY; The message if name is unavailable
Message *string `json:"message,omitempty"`
}
// CloudError the default error response
type CloudError struct {
// Error - Content of the error
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody content of the default error response
type CloudErrorBody struct {
// Code - The error code
Code *string `json:"code,omitempty"`
// Message - The error message
Message *string `json:"message,omitempty"`
// Target - The target of the particular error
Target *string `json:"target,omitempty"`
// Details - The list of additional details
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// KeyDescription the description of the EngagementFabric account key
type KeyDescription struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; The name of the key
Name *string `json:"name,omitempty"`
// Rank - READ-ONLY; The rank of the key. Possible values include: 'PrimaryKey', 'SecondaryKey'
Rank KeyRank `json:"rank,omitempty"`
// Value - READ-ONLY; The value of the key
Value *string `json:"value,omitempty"`
}
// KeyDescriptionList the list of the EngagementFabric account keys
type KeyDescriptionList struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; Account keys
Value *[]KeyDescription `json:"value,omitempty"`
}
// Operation the EngagementFabric operation
type Operation struct {
// Name - READ-ONLY; The name of the EngagementFabric operation
Name *string `json:"name,omitempty"`
// Display - READ-ONLY; The display content of the EngagementFabric operation
Display *OperationDisplay `json:"display,omitempty"`
}
// OperationDisplay the display information of the EngagementFabric operation
type OperationDisplay struct {
// Provider - READ-ONLY; The resource provider namespace of the EngagementFabric operation
Provider *string `json:"provider,omitempty"`
// Resource - READ-ONLY; The resource type of the EngagementFabric operation
Resource *string `json:"resource,omitempty"`
// Operation - READ-ONLY; The name of the EngagementFabric operation
Operation *string `json:"operation,omitempty"`
// Description - READ-ONLY; The description of the EngagementFabric operation
Description *string `json:"description,omitempty"`
}
// OperationList the list of the EngagementFabric operations
type OperationList struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The EngagementFabric operations
Value *[]Operation `json:"value,omitempty"`
}
// ProxyOnlyResource the base model for the proxy-only Azure resource
type ProxyOnlyResource struct {
// ID - READ-ONLY; The ID of the resource
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The fully qualified type of the resource
Type *string `json:"type,omitempty"`
}
// RegenerateKeyParameter the parameter to regenerate single EngagementFabric account key
type RegenerateKeyParameter struct {
// Name - The name of key to be regenerated
Name *string `json:"name,omitempty"`
// Rank - The rank of the key to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
Rank KeyRank `json:"rank,omitempty"`
}
// Resource the base model for Azure resource
type Resource struct {
// ID - READ-ONLY; The ID of the resource
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The fully qualified type of the resource
Type *string `json:"type,omitempty"`
}
// SKU the EngagementFabric SKU
type SKU struct {
// Name - The name of the SKU
Name *string `json:"name,omitempty"`
// Tier - The price tier of the SKU
Tier *string `json:"tier,omitempty"`
}
// SkuDescription the EngagementFabric SKU description of given resource type
type SkuDescription struct {
// ResourceType - READ-ONLY; The fully qualified resource type
ResourceType *string `json:"resourceType,omitempty"`
// Name - READ-ONLY; The name of the SKU
Name *string `json:"name,omitempty"`
// Tier - READ-ONLY; The price tier of the SKU
Tier *string `json:"tier,omitempty"`
// Locations - READ-ONLY; The set of locations that the SKU is available
Locations *[]string `json:"locations,omitempty"`
// LocationInfo - READ-ONLY; Locations and zones
LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"`
// Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used
Restrictions *[]interface{} `json:"restrictions,omitempty"`
}
// SkuDescriptionList the list of the EngagementFabric SKU descriptions
type SkuDescriptionList struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; SKU descriptions
Value *[]SkuDescription `json:"value,omitempty"`
}
// SkuLocationInfoItem the Locations and zones info for SKU
type SkuLocationInfoItem struct {
// Location - The available location of the SKU
Location *string `json:"location,omitempty"`
// Zones - The available zone of the SKU
Zones *[]string `json:"zones,omitempty"`
}
// TrackedResource the base model for the tracked Azure resource
type TrackedResource struct {
// Location - The location of the resource
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource
Tags map[string]*string `json:"tags"`
// Sku - The SKU of the resource
Sku *SKU `json:"sku,omitempty"`
// ID - READ-ONLY; The ID of the resource
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The fully qualified type of the resource
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for TrackedResource.
func (tr TrackedResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if tr.Location != nil {
objectMap["location"] = tr.Location
}
if tr.Tags != nil {
objectMap["tags"] = tr.Tags
}
if tr.Sku != nil {
objectMap["sku"] = tr.Sku
}
return json.Marshal(objectMap)
}