forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
291 lines (264 loc) · 10.1 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
package media
// 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/mediaservices/mgmt/2015-10-01/media"
// APIEndpoint the properties for a Media Services REST API endpoint.
type APIEndpoint struct {
// Endpoint - The Media Services REST endpoint.
Endpoint *string `json:"endpoint,omitempty"`
// MajorVersion - The version of Media Services REST API.
MajorVersion *string `json:"majorVersion,omitempty"`
}
// APIError the error returned from a failed Media Services REST API call.
type APIError struct {
// Code - Error code.
Code *string `json:"code,omitempty"`
// Message - Error message.
Message *string `json:"message,omitempty"`
}
// CheckNameAvailabilityInput the request body for CheckNameAvailability API.
type CheckNameAvailabilityInput struct {
// Name - The name of the resource. A name must be globally unique.
Name *string `json:"name,omitempty"`
// Type - The type of the resource - mediaservices.
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityOutput the response body for CheckNameAvailability API.
type CheckNameAvailabilityOutput struct {
autorest.Response `json:"-"`
// NameAvailable - Specifies if the name is available.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - Specifies the reason if the name is not available. Possible values include: 'None', 'Invalid', 'AlreadyExists'
Reason EntityNameUnavailabilityReason `json:"reason,omitempty"`
// Message - Specifies the detailed reason if the name is not available.
Message *string `json:"message,omitempty"`
}
// Operation a Media Services 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.Media
Provider *string `json:"provider,omitempty"`
// Resource - READ-ONLY; Resource on which the operation is performed: Invoice, etc.
Resource *string `json:"resource,omitempty"`
// Operation - READ-ONLY; Operation type: Read, write, delete, etc.
Operation *string `json:"operation,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationDisplay.
func (o OperationDisplay) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// OperationListResult result of the request to list Media Services operations.
type OperationListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; List of Media Services operations supported by the Microsoft.Media resource provider.
Value *[]Operation `json:"value,omitempty"`
// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationListResult.
func (olr OperationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// RegenerateKeyInput the request body for a RegenerateKey API.
type RegenerateKeyInput struct {
// KeyType - The keyType indicating which key you want to regenerate, Primary or Secondary. Possible values include: 'Primary', 'Secondary'
KeyType KeyType `json:"keyType,omitempty"`
}
// RegenerateKeyOutput the response body for a RegenerateKey API.
type RegenerateKeyOutput struct {
autorest.Response `json:"-"`
// Key - The new value of either the primary or secondary key.
Key *string `json:"key,omitempty"`
}
// Resource the Azure Resource Manager 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 type of the resource
Type *string `json:"type,omitempty"`
// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth).
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the resource in the Azure portal.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.Location != nil {
objectMap["location"] = r.Location
}
if r.Tags != nil {
objectMap["tags"] = r.Tags
}
return json.Marshal(objectMap)
}
// Service the properties of a Media Service resource.
type Service struct {
autorest.Response `json:"-"`
// ServiceProperties - The additional properties of a Media Service resource.
*ServiceProperties `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 type of the resource
Type *string `json:"type,omitempty"`
// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth).
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the resource in the Azure portal.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Service.
func (s Service) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if s.ServiceProperties != nil {
objectMap["properties"] = s.ServiceProperties
}
if s.Location != nil {
objectMap["location"] = s.Location
}
if s.Tags != nil {
objectMap["tags"] = s.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Service struct.
func (s *Service) 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 serviceProperties ServiceProperties
err = json.Unmarshal(*v, &serviceProperties)
if err != nil {
return err
}
s.ServiceProperties = &serviceProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
s.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
s.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
s.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
s.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
s.Tags = tags
}
}
}
return nil
}
// ServiceCollection the collection of Media Service resources.
type ServiceCollection struct {
autorest.Response `json:"-"`
// Value - The collection of Media Service resources.
Value *[]Service `json:"value,omitempty"`
}
// ServiceKeys the response body for a ListKeys API.
type ServiceKeys struct {
autorest.Response `json:"-"`
// PrimaryAuthEndpoint - The primary authorization endpoint.
PrimaryAuthEndpoint *string `json:"primaryAuthEndpoint,omitempty"`
// SecondaryAuthEndpoint - The secondary authorization endpoint.
SecondaryAuthEndpoint *string `json:"secondaryAuthEndpoint,omitempty"`
// PrimaryKey - The primary key for the Media Service resource.
PrimaryKey *string `json:"primaryKey,omitempty"`
// SecondaryKey - The secondary key for the Media Service resource.
SecondaryKey *string `json:"secondaryKey,omitempty"`
// Scope - The authorization scope.
Scope *string `json:"scope,omitempty"`
}
// ServiceProperties the additional properties of a Media Service resource.
type ServiceProperties struct {
// APIEndpoints - READ-ONLY; Read-only property that lists the Media Services REST API endpoints for this resource. If supplied on a PUT or PATCH, the value will be ignored.
APIEndpoints *[]APIEndpoint `json:"apiEndpoints,omitempty"`
// StorageAccounts - The storage accounts for this resource.
StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceProperties.
func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sp.StorageAccounts != nil {
objectMap["storageAccounts"] = sp.StorageAccounts
}
return json.Marshal(objectMap)
}
// StorageAccount the properties of a storage account associated with this resource.
type StorageAccount struct {
// ID - The id of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts (isPrimary false).
ID *string `json:"id,omitempty"`
// IsPrimary - Is this storage account resource the primary storage account for the Media Service resource. Blob only storage must set this to false.
IsPrimary *bool `json:"isPrimary,omitempty"`
}
// SyncStorageKeysInput the request body for a SyncStorageKeys API.
type SyncStorageKeysInput struct {
// ID - The id of the storage account resource.
ID *string `json:"id,omitempty"`
}