forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
226 lines (198 loc) · 8.93 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
package management
// 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 (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/satori/go.uuid"
"net/http"
)
// ChildType enumerates the values for child type.
type ChildType string
const (
// Account specifies the account state for child type.
Account ChildType = "Account"
// Department specifies the department state for child type.
Department ChildType = "Department"
// Enrollment specifies the enrollment state for child type.
Enrollment ChildType = "Enrollment"
// Subscription specifies the subscription state for child type.
Subscription ChildType = "Subscription"
)
// ChildType1 enumerates the values for child type 1.
type ChildType1 string
const (
// ChildType1Account specifies the child type 1 account state for child type 1.
ChildType1Account ChildType1 = "Account"
// ChildType1Department specifies the child type 1 department state for child type 1.
ChildType1Department ChildType1 = "Department"
// ChildType1Enrollment specifies the child type 1 enrollment state for child type 1.
ChildType1Enrollment ChildType1 = "Enrollment"
// ChildType1Subscription specifies the child type 1 subscription state for child type 1.
ChildType1Subscription ChildType1 = "Subscription"
)
// ManagementGroupType enumerates the values for management group type.
type ManagementGroupType string
const (
// ManagementGroupTypeAccount specifies the management group type account state for management group type.
ManagementGroupTypeAccount ManagementGroupType = "Account"
// ManagementGroupTypeDepartment specifies the management group type department state for management group type.
ManagementGroupTypeDepartment ManagementGroupType = "Department"
// ManagementGroupTypeEnrollment specifies the management group type enrollment state for management group type.
ManagementGroupTypeEnrollment ManagementGroupType = "Enrollment"
// ManagementGroupTypeSubscription specifies the management group type subscription state for management group type.
ManagementGroupTypeSubscription ManagementGroupType = "Subscription"
)
// ErrorDetails is the details of the error.
type ErrorDetails struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
}
// ErrorResponse is the error object.
type ErrorResponse struct {
Error *ErrorDetails `json:"error,omitempty"`
}
// Group is the management group details.
type Group struct {
ID *string `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Name *uuid.UUID `json:"name,omitempty"`
*GroupProperties `json:"properties,omitempty"`
}
// GroupChildInfo is the unique identifier (ID) of a management group.
type GroupChildInfo struct {
ChildType ChildType `json:"childType,omitempty"`
ChildID *string `json:"childId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
TenantID *uuid.UUID `json:"tenantId,omitempty"`
}
// GroupDetailsProperties is the details properties of a management group.
type GroupDetailsProperties struct {
Version *float64 `json:"version,omitempty"`
UpdatedTime *date.Time `json:"updatedTime,omitempty"`
UpdatedBy *string `json:"updatedBy,omitempty"`
Parent *ParentGroupInfo `json:"parent,omitempty"`
ManagementGroupType ManagementGroupType `json:"managementGroupType,omitempty"`
}
// GroupInfo is the management group.
type GroupInfo struct {
ID *string `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Name *uuid.UUID `json:"name,omitempty"`
*GroupInfoProperties `json:"properties,omitempty"`
}
// GroupInfoProperties is the generic properties of a management group.
type GroupInfoProperties struct {
TenantID *uuid.UUID `json:"tenantId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}
// GroupListResult is the result of listing management groups.
type GroupListResult struct {
autorest.Response `json:"-"`
Value *[]GroupInfo `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// GroupListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client GroupListResult) GroupListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// GroupProperties is the generic properties of a management group.
type GroupProperties struct {
TenantID *uuid.UUID `json:"tenantId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Details *GroupDetailsProperties `json:"details,omitempty"`
}
// GroupPropertiesWithChildren is the generic properties of a management group.
type GroupPropertiesWithChildren struct {
TenantID *uuid.UUID `json:"tenantId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Details *GroupDetailsProperties `json:"details,omitempty"`
Children *[]GroupChildInfo `json:"children,omitempty"`
}
// GroupPropertiesWithHierarchy is the generic properties of a management group.
type GroupPropertiesWithHierarchy struct {
TenantID *uuid.UUID `json:"tenantId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Details *GroupDetailsProperties `json:"details,omitempty"`
Children *[]GroupRecursiveChildInfo `json:"children,omitempty"`
}
// GroupRecursiveChildInfo is the unique identifier (ID) of a management group.
type GroupRecursiveChildInfo struct {
ChildType ChildType `json:"childType,omitempty"`
ChildID *string `json:"childId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
TenantID *uuid.UUID `json:"tenantId,omitempty"`
Children *[]GroupRecursiveChildInfo `json:"children,omitempty"`
}
// GroupWithChildren is the management group details.
type GroupWithChildren struct {
ID *string `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Name *uuid.UUID `json:"name,omitempty"`
*GroupPropertiesWithChildren `json:"properties,omitempty"`
}
// GroupWithHierarchy is the management group details.
type GroupWithHierarchy struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Name *uuid.UUID `json:"name,omitempty"`
*GroupPropertiesWithHierarchy `json:"properties,omitempty"`
}
// Operation is a Management REST API operation.
type Operation struct {
Name *string `json:"name,omitempty"`
Display *OperationDisplay `json:"display,omitempty"`
}
// OperationDisplay is the object that represents the operation.
type OperationDisplay struct {
Provider *string `json:"provider,omitempty"`
Resource *string `json:"resource,omitempty"`
Operation *string `json:"operation,omitempty"`
}
// OperationListResult is result listing operations. It contains a list of operations and a URL link to get the next
// set of results.
type OperationListResult struct {
autorest.Response `json:"-"`
Value *[]Operation `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// OperationListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client OperationListResult) OperationListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// ParentGroupInfo is (Optional) The ID of the parent management group.
type ParentGroupInfo struct {
ParentID *string `json:"parentId,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}