forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
241 lines (218 loc) · 7.58 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
package azureadb2c
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// 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/azureadb2c/mgmt/2020-05-01-preview/azureadb2c"
// CloudError an error response for a resource management request.
type CloudError struct {
Error *ErrorResponse `json:"error,omitempty"`
}
// ErrorAdditionalInfo the resource management error additional info.
type ErrorAdditionalInfo struct {
// Type - READ-ONLY; The additional info type.
Type *string `json:"type,omitempty"`
// Info - READ-ONLY; The additional info.
Info interface{} `json:"info,omitempty"`
}
// MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
// failed operations. (This also follows the OData error response format.)
type ErrorResponse struct {
// Code - READ-ONLY; The error code.
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; The error message.
Message *string `json:"message,omitempty"`
// Target - READ-ONLY; The error target.
Target *string `json:"target,omitempty"`
// Details - READ-ONLY; The error details.
Details *[]ErrorResponse `json:"details,omitempty"`
// AdditionalInfo - READ-ONLY; The error additional info.
AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
}
// MarshalJSON is the custom marshaler for ErrorResponse.
func (er ErrorResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// GuestUsagesResource guest Usages Resource
type GuestUsagesResource struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; An identifier that represents the Guest Usages resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the Guest Usages resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the Guest Usages resource.
Type *string `json:"type,omitempty"`
// Location - Location of the Guest Usages resource.
Location *string `json:"location,omitempty"`
// Tags - Key-value pairs of additional resource provisioning properties.
Tags map[string]*string `json:"tags"`
// GuestUsagesResourceProperties - The Guest Usages Resource Properties
*GuestUsagesResourceProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for GuestUsagesResource.
func (gur GuestUsagesResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gur.Location != nil {
objectMap["location"] = gur.Location
}
if gur.Tags != nil {
objectMap["tags"] = gur.Tags
}
if gur.GuestUsagesResourceProperties != nil {
objectMap["properties"] = gur.GuestUsagesResourceProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for GuestUsagesResource struct.
func (gur *GuestUsagesResource) 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 "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
gur.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
gur.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
gur.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
gur.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
gur.Tags = tags
}
case "properties":
if v != nil {
var guestUsagesResourceProperties GuestUsagesResourceProperties
err = json.Unmarshal(*v, &guestUsagesResourceProperties)
if err != nil {
return err
}
gur.GuestUsagesResourceProperties = &guestUsagesResourceProperties
}
}
}
return nil
}
// GuestUsagesResourceList the collection of guest usages resources
type GuestUsagesResourceList struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; List of guest usages resources
Value *[]GuestUsagesResource `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for GuestUsagesResourceList.
func (gurl GuestUsagesResourceList) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// GuestUsagesResourcePatch guest Usages Resource for Patch
type GuestUsagesResourcePatch struct {
// Tags - Key-value pairs of additional resource provisioning properties.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for GuestUsagesResourcePatch.
func (gurp GuestUsagesResourcePatch) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gurp.Tags != nil {
objectMap["tags"] = gurp.Tags
}
return json.Marshal(objectMap)
}
// GuestUsagesResourceProperties guest Usages Resource Properties
type GuestUsagesResourceProperties struct {
// TenantID - An identifier for the tenant for which the resource is being created
TenantID *string `json:"tenantId,omitempty"`
}
// Operation microsoft.AzureActiveDirectory REST API operation.
type Operation struct {
// Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}.
Name *string `json:"name,omitempty"`
// Display - The object that represents the operation.
Display *OperationDisplay `json:"display,omitempty"`
}
// MarshalJSON is the custom marshaler for Operation.
func (o Operation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if o.Display != nil {
objectMap["display"] = o.Display
}
return json.Marshal(objectMap)
}
// OperationDisplay the object that represents the operation.
type OperationDisplay struct {
// Provider - READ-ONLY; Service provider: Microsoft.AzureActiveDirectory.
Provider *string `json:"provider,omitempty"`
// Resource - READ-ONLY; Resource on which the operation is performed: GuestUsages, etc.
Resource *string `json:"resource,omitempty"`
// Operation - READ-ONLY; Operation type: Read, write, delete, etc.
Operation *string `json:"operation,omitempty"`
// Description - Friendly name of the operation
Description *string `json:"description,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationDisplay.
func (o OperationDisplay) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if o.Description != nil {
objectMap["description"] = o.Description
}
return json.Marshal(objectMap)
}
// OperationListResult result of listing operations for the resourceProvider
type OperationListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; List of cpim service operations supported by the Microsoft.AzureActiveDirectory resource provider.
Value *[]Operation `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationListResult.
func (olr OperationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}