1 package media
2
3
4
5
6
7
8
9 import (
10 "encoding/json"
11 "github.com/Azure/go-autorest/autorest"
12 )
13
14
15 const fqdn = "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2015-10-01/media"
16
17
18 type APIEndpoint struct {
19
20 Endpoint *string `json:"endpoint,omitempty"`
21
22 MajorVersion *string `json:"majorVersion,omitempty"`
23 }
24
25
26 type APIError struct {
27
28 Code *string `json:"code,omitempty"`
29
30 Message *string `json:"message,omitempty"`
31 }
32
33
34 type CheckNameAvailabilityInput struct {
35
36 Name *string `json:"name,omitempty"`
37
38 Type *string `json:"type,omitempty"`
39 }
40
41
42 type CheckNameAvailabilityOutput struct {
43 autorest.Response `json:"-"`
44
45 NameAvailable *bool `json:"nameAvailable,omitempty"`
46
47 Reason EntityNameUnavailabilityReason `json:"reason,omitempty"`
48
49 Message *string `json:"message,omitempty"`
50 }
51
52
53 type Operation struct {
54
55 Name *string `json:"name,omitempty"`
56
57 Display *OperationDisplay `json:"display,omitempty"`
58 }
59
60
61 func (o Operation) MarshalJSON() ([]byte, error) {
62 objectMap := make(map[string]interface{})
63 if o.Display != nil {
64 objectMap["display"] = o.Display
65 }
66 return json.Marshal(objectMap)
67 }
68
69
70 type OperationDisplay struct {
71
72 Provider *string `json:"provider,omitempty"`
73
74 Resource *string `json:"resource,omitempty"`
75
76 Operation *string `json:"operation,omitempty"`
77 }
78
79
80 func (o OperationDisplay) MarshalJSON() ([]byte, error) {
81 objectMap := make(map[string]interface{})
82 return json.Marshal(objectMap)
83 }
84
85
86 type OperationListResult struct {
87 autorest.Response `json:"-"`
88
89 Value *[]Operation `json:"value,omitempty"`
90
91 NextLink *string `json:"nextLink,omitempty"`
92 }
93
94
95 func (olr OperationListResult) MarshalJSON() ([]byte, error) {
96 objectMap := make(map[string]interface{})
97 return json.Marshal(objectMap)
98 }
99
100
101 type RegenerateKeyInput struct {
102
103 KeyType KeyType `json:"keyType,omitempty"`
104 }
105
106
107 type RegenerateKeyOutput struct {
108 autorest.Response `json:"-"`
109
110 Key *string `json:"key,omitempty"`
111 }
112
113
114 type Resource struct {
115
116 ID *string `json:"id,omitempty"`
117
118 Name *string `json:"name,omitempty"`
119
120 Type *string `json:"type,omitempty"`
121
122 Location *string `json:"location,omitempty"`
123
124 Tags map[string]*string `json:"tags"`
125 }
126
127
128 func (r Resource) MarshalJSON() ([]byte, error) {
129 objectMap := make(map[string]interface{})
130 if r.Location != nil {
131 objectMap["location"] = r.Location
132 }
133 if r.Tags != nil {
134 objectMap["tags"] = r.Tags
135 }
136 return json.Marshal(objectMap)
137 }
138
139
140 type Service struct {
141 autorest.Response `json:"-"`
142
143 *ServiceProperties `json:"properties,omitempty"`
144
145 ID *string `json:"id,omitempty"`
146
147 Name *string `json:"name,omitempty"`
148
149 Type *string `json:"type,omitempty"`
150
151 Location *string `json:"location,omitempty"`
152
153 Tags map[string]*string `json:"tags"`
154 }
155
156
157 func (s Service) MarshalJSON() ([]byte, error) {
158 objectMap := make(map[string]interface{})
159 if s.ServiceProperties != nil {
160 objectMap["properties"] = s.ServiceProperties
161 }
162 if s.Location != nil {
163 objectMap["location"] = s.Location
164 }
165 if s.Tags != nil {
166 objectMap["tags"] = s.Tags
167 }
168 return json.Marshal(objectMap)
169 }
170
171
172 func (s *Service) UnmarshalJSON(body []byte) error {
173 var m map[string]*json.RawMessage
174 err := json.Unmarshal(body, &m)
175 if err != nil {
176 return err
177 }
178 for k, v := range m {
179 switch k {
180 case "properties":
181 if v != nil {
182 var serviceProperties ServiceProperties
183 err = json.Unmarshal(*v, &serviceProperties)
184 if err != nil {
185 return err
186 }
187 s.ServiceProperties = &serviceProperties
188 }
189 case "id":
190 if v != nil {
191 var ID string
192 err = json.Unmarshal(*v, &ID)
193 if err != nil {
194 return err
195 }
196 s.ID = &ID
197 }
198 case "name":
199 if v != nil {
200 var name string
201 err = json.Unmarshal(*v, &name)
202 if err != nil {
203 return err
204 }
205 s.Name = &name
206 }
207 case "type":
208 if v != nil {
209 var typeVar string
210 err = json.Unmarshal(*v, &typeVar)
211 if err != nil {
212 return err
213 }
214 s.Type = &typeVar
215 }
216 case "location":
217 if v != nil {
218 var location string
219 err = json.Unmarshal(*v, &location)
220 if err != nil {
221 return err
222 }
223 s.Location = &location
224 }
225 case "tags":
226 if v != nil {
227 var tags map[string]*string
228 err = json.Unmarshal(*v, &tags)
229 if err != nil {
230 return err
231 }
232 s.Tags = tags
233 }
234 }
235 }
236
237 return nil
238 }
239
240
241 type ServiceCollection struct {
242 autorest.Response `json:"-"`
243
244 Value *[]Service `json:"value,omitempty"`
245 }
246
247
248 type ServiceKeys struct {
249 autorest.Response `json:"-"`
250
251 PrimaryAuthEndpoint *string `json:"primaryAuthEndpoint,omitempty"`
252
253 SecondaryAuthEndpoint *string `json:"secondaryAuthEndpoint,omitempty"`
254
255 PrimaryKey *string `json:"primaryKey,omitempty"`
256
257 SecondaryKey *string `json:"secondaryKey,omitempty"`
258
259 Scope *string `json:"scope,omitempty"`
260 }
261
262
263 type ServiceProperties struct {
264
265 APIEndpoints *[]APIEndpoint `json:"apiEndpoints,omitempty"`
266
267 StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
268 }
269
270
271 func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
272 objectMap := make(map[string]interface{})
273 if sp.StorageAccounts != nil {
274 objectMap["storageAccounts"] = sp.StorageAccounts
275 }
276 return json.Marshal(objectMap)
277 }
278
279
280 type StorageAccount struct {
281
282 ID *string `json:"id,omitempty"`
283
284 IsPrimary *bool `json:"isPrimary,omitempty"`
285 }
286
287
288 type SyncStorageKeysInput struct {
289
290 ID *string `json:"id,omitempty"`
291 }
292
View as plain text