-
Notifications
You must be signed in to change notification settings - Fork 821
/
models.go
281 lines (250 loc) · 9.38 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
package powerbiembedded
// 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 (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/powerbiembedded/mgmt/2016-01-29/powerbiembedded"
// AccessKeyName enumerates the values for access key name.
type AccessKeyName string
const (
// Key1 ...
Key1 AccessKeyName = "key1"
// Key2 ...
Key2 AccessKeyName = "key2"
)
// PossibleAccessKeyNameValues returns an array of possible values for the AccessKeyName const type.
func PossibleAccessKeyNameValues() []AccessKeyName {
return []AccessKeyName{Key1, Key2}
}
// CheckNameReason enumerates the values for check name reason.
type CheckNameReason string
const (
// Invalid ...
Invalid CheckNameReason = "Invalid"
// Unavailable ...
Unavailable CheckNameReason = "Unavailable"
)
// PossibleCheckNameReasonValues returns an array of possible values for the CheckNameReason const type.
func PossibleCheckNameReasonValues() []CheckNameReason {
return []CheckNameReason{Invalid, Unavailable}
}
// AzureSku ...
type AzureSku struct {
// Name - SKU name
Name *string `json:"name,omitempty"`
// Tier - SKU tier
Tier *string `json:"tier,omitempty"`
}
// CheckNameRequest ...
type CheckNameRequest struct {
// Name - Workspace collection name
Name *string `json:"name,omitempty"`
// Type - Resource type
Type *string `json:"type,omitempty"`
}
// CheckNameResponse ...
type CheckNameResponse struct {
autorest.Response `json:"-"`
// NameAvailable - Specifies a Boolean value that indicates whether the specified Power BI Workspace Collection name is available to use.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - Reason why the workspace collection name cannot be used. Possible values include: 'Unavailable', 'Invalid'
Reason CheckNameReason `json:"reason,omitempty"`
// Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated.
Message *string `json:"message,omitempty"`
}
// CreateWorkspaceCollectionRequest ...
type CreateWorkspaceCollectionRequest struct {
// Location - Azure location
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
Sku *AzureSku `json:"sku,omitempty"`
}
// MarshalJSON is the custom marshaler for CreateWorkspaceCollectionRequest.
func (cwcr CreateWorkspaceCollectionRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cwcr.Location != nil {
objectMap["location"] = cwcr.Location
}
if cwcr.Tags != nil {
objectMap["tags"] = cwcr.Tags
}
if cwcr.Sku != nil {
objectMap["sku"] = cwcr.Sku
}
return json.Marshal(objectMap)
}
// Display ...
type Display struct {
// Provider - The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services.
Provider *string `json:"provider,omitempty"`
// Resource - The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the "name" section.
Resource *string `json:"resource,omitempty"`
// Operation - The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies.
Operation *string `json:"operation,omitempty"`
// Description - The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views.
Description *string `json:"description,omitempty"`
// Origin - The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'
Origin *string `json:"origin,omitempty"`
}
// Error ...
type Error struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]ErrorDetail `json:"details,omitempty"`
}
// ErrorDetail ...
type ErrorDetail struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
}
// MigrateWorkspaceCollectionRequest ...
type MigrateWorkspaceCollectionRequest struct {
// TargetResourceGroup - Name of the resource group the Power BI workspace collections will be migrated to.
TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
Resources *[]string `json:"resources,omitempty"`
}
// Operation ...
type Operation struct {
// Name - The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.
Name *string `json:"name,omitempty"`
Display *Display `json:"display,omitempty"`
}
// OperationList ...
type OperationList struct {
autorest.Response `json:"-"`
Value *[]Operation `json:"value,omitempty"`
}
// UpdateWorkspaceCollectionRequest ...
type UpdateWorkspaceCollectionRequest struct {
Tags map[string]*string `json:"tags"`
Sku *AzureSku `json:"sku,omitempty"`
}
// MarshalJSON is the custom marshaler for UpdateWorkspaceCollectionRequest.
func (uwcr UpdateWorkspaceCollectionRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if uwcr.Tags != nil {
objectMap["tags"] = uwcr.Tags
}
if uwcr.Sku != nil {
objectMap["sku"] = uwcr.Sku
}
return json.Marshal(objectMap)
}
// Workspace ...
type Workspace struct {
// ID - Workspace id
ID *string `json:"id,omitempty"`
// Name - Workspace name
Name *string `json:"name,omitempty"`
// Type - Resource type
Type *string `json:"type,omitempty"`
// Properties - Property bag
Properties interface{} `json:"properties,omitempty"`
}
// WorkspaceCollection ...
type WorkspaceCollection struct {
autorest.Response `json:"-"`
// ID - Resource id
ID *string `json:"id,omitempty"`
// Name - Workspace collection name
Name *string `json:"name,omitempty"`
// Type - Resource type
Type *string `json:"type,omitempty"`
// Location - Azure location
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
Sku *AzureSku `json:"sku,omitempty"`
// Properties - Properties
Properties interface{} `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for WorkspaceCollection.
func (wc WorkspaceCollection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if wc.ID != nil {
objectMap["id"] = wc.ID
}
if wc.Name != nil {
objectMap["name"] = wc.Name
}
if wc.Type != nil {
objectMap["type"] = wc.Type
}
if wc.Location != nil {
objectMap["location"] = wc.Location
}
if wc.Tags != nil {
objectMap["tags"] = wc.Tags
}
if wc.Sku != nil {
objectMap["sku"] = wc.Sku
}
if wc.Properties != nil {
objectMap["properties"] = wc.Properties
}
return json.Marshal(objectMap)
}
// WorkspaceCollectionAccessKey ...
type WorkspaceCollectionAccessKey struct {
// KeyName - Key name. Possible values include: 'Key1', 'Key2'
KeyName AccessKeyName `json:"keyName,omitempty"`
}
// WorkspaceCollectionAccessKeys ...
type WorkspaceCollectionAccessKeys struct {
autorest.Response `json:"-"`
// Key1 - Access key 1
Key1 *string `json:"key1,omitempty"`
// Key2 - Access key 2
Key2 *string `json:"key2,omitempty"`
}
// WorkspaceCollectionList ...
type WorkspaceCollectionList struct {
autorest.Response `json:"-"`
Value *[]WorkspaceCollection `json:"value,omitempty"`
}
// WorkspaceCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type WorkspaceCollectionsDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *WorkspaceCollectionsDeleteFuture) Result(client WorkspaceCollectionsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("powerbiembedded.WorkspaceCollectionsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// WorkspaceList ...
type WorkspaceList struct {
autorest.Response `json:"-"`
Value *[]Workspace `json:"value,omitempty"`
}