1 package migrate
2
3
4
5
6
7
8
9 import (
10 "encoding/json"
11 "github.com/Azure/go-autorest/autorest"
12 "github.com/Azure/go-autorest/autorest/date"
13 )
14
15
16 const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/migrate/mgmt/2018-09-01-preview/migrate"
17
18
19 type ApplyClause struct {
20
21 Transformations *[]TransformationNode `json:"transformations,omitempty"`
22 }
23
24
25 func (ac ApplyClause) MarshalJSON() ([]byte, error) {
26 objectMap := make(map[string]interface{})
27 return json.Marshal(objectMap)
28 }
29
30
31 type AssessmentDetails struct {
32
33 AssessmentID *string `json:"assessmentId,omitempty"`
34
35 TargetVMSize *string `json:"targetVMSize,omitempty"`
36
37 TargetVMLocation *string `json:"targetVMLocation,omitempty"`
38
39 TargetStorageType map[string]*string `json:"targetStorageType"`
40
41 EnqueueTime *string `json:"enqueueTime,omitempty"`
42
43 SolutionName *string `json:"solutionName,omitempty"`
44
45 MachineID *string `json:"machineId,omitempty"`
46
47 MachineManagerID *string `json:"machineManagerId,omitempty"`
48
49 FabricType *string `json:"fabricType,omitempty"`
50
51 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
52
53 MachineName *string `json:"machineName,omitempty"`
54
55 IPAddresses *[]string `json:"ipAddresses,omitempty"`
56
57 Fqdn *string `json:"fqdn,omitempty"`
58
59 BiosID *string `json:"biosId,omitempty"`
60
61 MacAddresses *[]string `json:"macAddresses,omitempty"`
62
63 ExtendedInfo map[string]*string `json:"extendedInfo"`
64 }
65
66
67 func (ad AssessmentDetails) MarshalJSON() ([]byte, error) {
68 objectMap := make(map[string]interface{})
69 if ad.AssessmentID != nil {
70 objectMap["assessmentId"] = ad.AssessmentID
71 }
72 if ad.TargetVMSize != nil {
73 objectMap["targetVMSize"] = ad.TargetVMSize
74 }
75 if ad.TargetVMLocation != nil {
76 objectMap["targetVMLocation"] = ad.TargetVMLocation
77 }
78 if ad.TargetStorageType != nil {
79 objectMap["targetStorageType"] = ad.TargetStorageType
80 }
81 if ad.EnqueueTime != nil {
82 objectMap["enqueueTime"] = ad.EnqueueTime
83 }
84 if ad.SolutionName != nil {
85 objectMap["solutionName"] = ad.SolutionName
86 }
87 if ad.MachineID != nil {
88 objectMap["machineId"] = ad.MachineID
89 }
90 if ad.MachineManagerID != nil {
91 objectMap["machineManagerId"] = ad.MachineManagerID
92 }
93 if ad.FabricType != nil {
94 objectMap["fabricType"] = ad.FabricType
95 }
96 if ad.LastUpdatedTime != nil {
97 objectMap["lastUpdatedTime"] = ad.LastUpdatedTime
98 }
99 if ad.MachineName != nil {
100 objectMap["machineName"] = ad.MachineName
101 }
102 if ad.IPAddresses != nil {
103 objectMap["ipAddresses"] = ad.IPAddresses
104 }
105 if ad.Fqdn != nil {
106 objectMap["fqdn"] = ad.Fqdn
107 }
108 if ad.BiosID != nil {
109 objectMap["biosId"] = ad.BiosID
110 }
111 if ad.MacAddresses != nil {
112 objectMap["macAddresses"] = ad.MacAddresses
113 }
114 if ad.ExtendedInfo != nil {
115 objectMap["extendedInfo"] = ad.ExtendedInfo
116 }
117 return json.Marshal(objectMap)
118 }
119
120
121 type Database struct {
122 autorest.Response `json:"-"`
123
124 ID *string `json:"id,omitempty"`
125
126 Name *string `json:"name,omitempty"`
127
128 Type *string `json:"type,omitempty"`
129
130 Properties *DatabaseProperties `json:"properties,omitempty"`
131 }
132
133
134 func (d Database) MarshalJSON() ([]byte, error) {
135 objectMap := make(map[string]interface{})
136 if d.ID != nil {
137 objectMap["id"] = d.ID
138 }
139 if d.Name != nil {
140 objectMap["name"] = d.Name
141 }
142 if d.Properties != nil {
143 objectMap["properties"] = d.Properties
144 }
145 return json.Marshal(objectMap)
146 }
147
148
149 type DatabaseAssessmentDetails struct {
150
151 AssessmentID *string `json:"assessmentId,omitempty"`
152
153 MigrationBlockersCount *int32 `json:"migrationBlockersCount,omitempty"`
154
155 BreakingChangesCount *int32 `json:"breakingChangesCount,omitempty"`
156
157 IsReadyForMigration *bool `json:"isReadyForMigration,omitempty"`
158
159 AssessmentTargetType *string `json:"assessmentTargetType,omitempty"`
160
161 LastAssessedTime *date.Time `json:"lastAssessedTime,omitempty"`
162
163 CompatibilityLevel *string `json:"compatibilityLevel,omitempty"`
164
165 DatabaseSizeInMB *string `json:"databaseSizeInMB,omitempty"`
166
167 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
168
169 EnqueueTime *string `json:"enqueueTime,omitempty"`
170
171 SolutionName *string `json:"solutionName,omitempty"`
172
173 InstanceID *string `json:"instanceId,omitempty"`
174
175 DatabaseName *string `json:"databaseName,omitempty"`
176
177 ExtendedInfo map[string]*string `json:"extendedInfo"`
178 }
179
180
181 func (dad DatabaseAssessmentDetails) MarshalJSON() ([]byte, error) {
182 objectMap := make(map[string]interface{})
183 if dad.AssessmentID != nil {
184 objectMap["assessmentId"] = dad.AssessmentID
185 }
186 if dad.MigrationBlockersCount != nil {
187 objectMap["migrationBlockersCount"] = dad.MigrationBlockersCount
188 }
189 if dad.BreakingChangesCount != nil {
190 objectMap["breakingChangesCount"] = dad.BreakingChangesCount
191 }
192 if dad.IsReadyForMigration != nil {
193 objectMap["isReadyForMigration"] = dad.IsReadyForMigration
194 }
195 if dad.AssessmentTargetType != nil {
196 objectMap["assessmentTargetType"] = dad.AssessmentTargetType
197 }
198 if dad.LastAssessedTime != nil {
199 objectMap["lastAssessedTime"] = dad.LastAssessedTime
200 }
201 if dad.CompatibilityLevel != nil {
202 objectMap["compatibilityLevel"] = dad.CompatibilityLevel
203 }
204 if dad.DatabaseSizeInMB != nil {
205 objectMap["databaseSizeInMB"] = dad.DatabaseSizeInMB
206 }
207 if dad.LastUpdatedTime != nil {
208 objectMap["lastUpdatedTime"] = dad.LastUpdatedTime
209 }
210 if dad.EnqueueTime != nil {
211 objectMap["enqueueTime"] = dad.EnqueueTime
212 }
213 if dad.SolutionName != nil {
214 objectMap["solutionName"] = dad.SolutionName
215 }
216 if dad.InstanceID != nil {
217 objectMap["instanceId"] = dad.InstanceID
218 }
219 if dad.DatabaseName != nil {
220 objectMap["databaseName"] = dad.DatabaseName
221 }
222 if dad.ExtendedInfo != nil {
223 objectMap["extendedInfo"] = dad.ExtendedInfo
224 }
225 return json.Marshal(objectMap)
226 }
227
228
229 type DatabaseCollection struct {
230 autorest.Response `json:"-"`
231
232 Value *[]Database `json:"value,omitempty"`
233
234 NextLink *string `json:"nextLink,omitempty"`
235 }
236
237
238 type DatabaseInstance struct {
239 autorest.Response `json:"-"`
240
241 ID *string `json:"id,omitempty"`
242
243 Name *string `json:"name,omitempty"`
244
245 Type *string `json:"type,omitempty"`
246
247 Properties *DatabaseInstanceProperties `json:"properties,omitempty"`
248 }
249
250
251 func (di DatabaseInstance) MarshalJSON() ([]byte, error) {
252 objectMap := make(map[string]interface{})
253 if di.ID != nil {
254 objectMap["id"] = di.ID
255 }
256 if di.Name != nil {
257 objectMap["name"] = di.Name
258 }
259 if di.Properties != nil {
260 objectMap["properties"] = di.Properties
261 }
262 return json.Marshal(objectMap)
263 }
264
265
266 type DatabaseInstanceCollection struct {
267 autorest.Response `json:"-"`
268
269 Value *[]DatabaseInstance `json:"value,omitempty"`
270
271 NextLink *string `json:"nextLink,omitempty"`
272 }
273
274
275 type DatabaseInstanceDiscoveryDetails struct {
276
277 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
278
279 InstanceID *string `json:"instanceId,omitempty"`
280
281 EnqueueTime *string `json:"enqueueTime,omitempty"`
282
283 SolutionName *string `json:"solutionName,omitempty"`
284
285 InstanceName *string `json:"instanceName,omitempty"`
286
287 InstanceVersion *string `json:"instanceVersion,omitempty"`
288
289 InstanceType *string `json:"instanceType,omitempty"`
290
291 HostName *string `json:"hostName,omitempty"`
292
293 IPAddress *string `json:"ipAddress,omitempty"`
294
295 PortNumber *int32 `json:"portNumber,omitempty"`
296
297 ExtendedInfo map[string]*string `json:"extendedInfo"`
298 }
299
300
301 func (didd DatabaseInstanceDiscoveryDetails) MarshalJSON() ([]byte, error) {
302 objectMap := make(map[string]interface{})
303 if didd.LastUpdatedTime != nil {
304 objectMap["lastUpdatedTime"] = didd.LastUpdatedTime
305 }
306 if didd.InstanceID != nil {
307 objectMap["instanceId"] = didd.InstanceID
308 }
309 if didd.EnqueueTime != nil {
310 objectMap["enqueueTime"] = didd.EnqueueTime
311 }
312 if didd.SolutionName != nil {
313 objectMap["solutionName"] = didd.SolutionName
314 }
315 if didd.InstanceName != nil {
316 objectMap["instanceName"] = didd.InstanceName
317 }
318 if didd.InstanceVersion != nil {
319 objectMap["instanceVersion"] = didd.InstanceVersion
320 }
321 if didd.InstanceType != nil {
322 objectMap["instanceType"] = didd.InstanceType
323 }
324 if didd.HostName != nil {
325 objectMap["hostName"] = didd.HostName
326 }
327 if didd.IPAddress != nil {
328 objectMap["ipAddress"] = didd.IPAddress
329 }
330 if didd.PortNumber != nil {
331 objectMap["portNumber"] = didd.PortNumber
332 }
333 if didd.ExtendedInfo != nil {
334 objectMap["extendedInfo"] = didd.ExtendedInfo
335 }
336 return json.Marshal(objectMap)
337 }
338
339
340 type DatabaseInstanceProperties struct {
341
342 DiscoveryData *[]DatabaseInstanceDiscoveryDetails `json:"discoveryData,omitempty"`
343
344 Summary map[string]*DatabaseInstanceSummary `json:"summary"`
345
346 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
347 }
348
349
350 func (dip DatabaseInstanceProperties) MarshalJSON() ([]byte, error) {
351 objectMap := make(map[string]interface{})
352 if dip.DiscoveryData != nil {
353 objectMap["discoveryData"] = dip.DiscoveryData
354 }
355 if dip.Summary != nil {
356 objectMap["summary"] = dip.Summary
357 }
358 if dip.LastUpdatedTime != nil {
359 objectMap["lastUpdatedTime"] = dip.LastUpdatedTime
360 }
361 return json.Marshal(objectMap)
362 }
363
364
365 type DatabaseInstanceSummary struct {
366
367 DatabasesAssessedCount *int32 `json:"databasesAssessedCount,omitempty"`
368
369 MigrationReadyCount *int32 `json:"migrationReadyCount,omitempty"`
370 }
371
372
373 type DatabaseMigrateEventProperties struct {
374
375 Database *string `json:"database,omitempty"`
376
377 DatabaseInstanceID *string `json:"databaseInstanceId,omitempty"`
378
379 ErrorCode *string `json:"errorCode,omitempty"`
380
381 ErrorMessage *string `json:"errorMessage,omitempty"`
382
383 Recommendation *string `json:"recommendation,omitempty"`
384
385 PossibleCauses *string `json:"possibleCauses,omitempty"`
386
387 Solution *string `json:"solution,omitempty"`
388
389 ClientRequestID *string `json:"clientRequestId,omitempty"`
390
391 InstanceType InstanceType `json:"instanceType,omitempty"`
392 }
393
394
395 func (dmep DatabaseMigrateEventProperties) MarshalJSON() ([]byte, error) {
396 dmep.InstanceType = InstanceTypeDatabases
397 objectMap := make(map[string]interface{})
398 if dmep.Database != nil {
399 objectMap["database"] = dmep.Database
400 }
401 if dmep.DatabaseInstanceID != nil {
402 objectMap["databaseInstanceId"] = dmep.DatabaseInstanceID
403 }
404 if dmep.ErrorCode != nil {
405 objectMap["errorCode"] = dmep.ErrorCode
406 }
407 if dmep.ErrorMessage != nil {
408 objectMap["errorMessage"] = dmep.ErrorMessage
409 }
410 if dmep.Recommendation != nil {
411 objectMap["recommendation"] = dmep.Recommendation
412 }
413 if dmep.PossibleCauses != nil {
414 objectMap["possibleCauses"] = dmep.PossibleCauses
415 }
416 if dmep.Solution != nil {
417 objectMap["solution"] = dmep.Solution
418 }
419 if dmep.ClientRequestID != nil {
420 objectMap["clientRequestId"] = dmep.ClientRequestID
421 }
422 if dmep.InstanceType != "" {
423 objectMap["instanceType"] = dmep.InstanceType
424 }
425 return json.Marshal(objectMap)
426 }
427
428
429 func (dmep DatabaseMigrateEventProperties) AsMachineMigrateEventProperties() (*MachineMigrateEventProperties, bool) {
430 return nil, false
431 }
432
433
434 func (dmep DatabaseMigrateEventProperties) AsDatabaseMigrateEventProperties() (*DatabaseMigrateEventProperties, bool) {
435 return &dmep, true
436 }
437
438
439 func (dmep DatabaseMigrateEventProperties) AsEventProperties() (*EventProperties, bool) {
440 return nil, false
441 }
442
443
444 func (dmep DatabaseMigrateEventProperties) AsBasicEventProperties() (BasicEventProperties, bool) {
445 return &dmep, true
446 }
447
448
449 type DatabaseProjectSummary struct {
450
451 RefreshSummaryState RefreshSummaryState `json:"refreshSummaryState,omitempty"`
452
453 LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"`
454
455 ExtendedSummary map[string]*string `json:"extendedSummary"`
456
457 InstanceType InstanceTypeBasicProjectSummary `json:"instanceType,omitempty"`
458 }
459
460
461 func (dps DatabaseProjectSummary) MarshalJSON() ([]byte, error) {
462 dps.InstanceType = InstanceTypeBasicProjectSummaryInstanceTypeDatabases
463 objectMap := make(map[string]interface{})
464 if dps.RefreshSummaryState != "" {
465 objectMap["refreshSummaryState"] = dps.RefreshSummaryState
466 }
467 if dps.LastSummaryRefreshedTime != nil {
468 objectMap["lastSummaryRefreshedTime"] = dps.LastSummaryRefreshedTime
469 }
470 if dps.ExtendedSummary != nil {
471 objectMap["extendedSummary"] = dps.ExtendedSummary
472 }
473 if dps.InstanceType != "" {
474 objectMap["instanceType"] = dps.InstanceType
475 }
476 return json.Marshal(objectMap)
477 }
478
479
480 func (dps DatabaseProjectSummary) AsServersProjectSummary() (*ServersProjectSummary, bool) {
481 return nil, false
482 }
483
484
485 func (dps DatabaseProjectSummary) AsDatabaseProjectSummary() (*DatabaseProjectSummary, bool) {
486 return &dps, true
487 }
488
489
490 func (dps DatabaseProjectSummary) AsProjectSummary() (*ProjectSummary, bool) {
491 return nil, false
492 }
493
494
495 func (dps DatabaseProjectSummary) AsBasicProjectSummary() (BasicProjectSummary, bool) {
496 return &dps, true
497 }
498
499
500 type DatabaseProperties struct {
501
502 AssessmentData *[]DatabaseAssessmentDetails `json:"assessmentData,omitempty"`
503
504 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
505 }
506
507
508 type DatabasesSolutionSummary struct {
509
510 DatabasesAssessedCount *int32 `json:"databasesAssessedCount,omitempty"`
511
512 DatabaseInstancesAssessedCount *int32 `json:"databaseInstancesAssessedCount,omitempty"`
513
514 MigrationReadyCount *int32 `json:"migrationReadyCount,omitempty"`
515
516 InstanceType InstanceTypeBasicSolutionSummary `json:"instanceType,omitempty"`
517 }
518
519
520 func (dss DatabasesSolutionSummary) MarshalJSON() ([]byte, error) {
521 dss.InstanceType = InstanceTypeBasicSolutionSummaryInstanceTypeDatabases
522 objectMap := make(map[string]interface{})
523 if dss.DatabasesAssessedCount != nil {
524 objectMap["databasesAssessedCount"] = dss.DatabasesAssessedCount
525 }
526 if dss.DatabaseInstancesAssessedCount != nil {
527 objectMap["databaseInstancesAssessedCount"] = dss.DatabaseInstancesAssessedCount
528 }
529 if dss.MigrationReadyCount != nil {
530 objectMap["migrationReadyCount"] = dss.MigrationReadyCount
531 }
532 if dss.InstanceType != "" {
533 objectMap["instanceType"] = dss.InstanceType
534 }
535 return json.Marshal(objectMap)
536 }
537
538
539 func (dss DatabasesSolutionSummary) AsServersSolutionSummary() (*ServersSolutionSummary, bool) {
540 return nil, false
541 }
542
543
544 func (dss DatabasesSolutionSummary) AsDatabasesSolutionSummary() (*DatabasesSolutionSummary, bool) {
545 return &dss, true
546 }
547
548
549 func (dss DatabasesSolutionSummary) AsSolutionSummary() (*SolutionSummary, bool) {
550 return nil, false
551 }
552
553
554 func (dss DatabasesSolutionSummary) AsBasicSolutionSummary() (BasicSolutionSummary, bool) {
555 return &dss, true
556 }
557
558
559 type DefaultQuerySettings struct {
560 EnableExpand *bool `json:"enableExpand,omitempty"`
561 EnableSelect *bool `json:"enableSelect,omitempty"`
562 EnableCount *bool `json:"enableCount,omitempty"`
563 EnableOrderBy *bool `json:"enableOrderBy,omitempty"`
564 EnableFilter *bool `json:"enableFilter,omitempty"`
565 MaxTop *int32 `json:"maxTop,omitempty"`
566 }
567
568
569 type DiscoveryDetails struct {
570
571 OsType *string `json:"osType,omitempty"`
572
573 OsName *string `json:"osName,omitempty"`
574
575 OsVersion *string `json:"osVersion,omitempty"`
576
577 EnqueueTime *string `json:"enqueueTime,omitempty"`
578
579 SolutionName *string `json:"solutionName,omitempty"`
580
581 MachineID *string `json:"machineId,omitempty"`
582
583 MachineManagerID *string `json:"machineManagerId,omitempty"`
584
585 FabricType *string `json:"fabricType,omitempty"`
586
587 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
588
589 MachineName *string `json:"machineName,omitempty"`
590
591 IPAddresses *[]string `json:"ipAddresses,omitempty"`
592
593 Fqdn *string `json:"fqdn,omitempty"`
594
595 BiosID *string `json:"biosId,omitempty"`
596
597 MacAddresses *[]string `json:"macAddresses,omitempty"`
598
599 ExtendedInfo map[string]*string `json:"extendedInfo"`
600 }
601
602
603 func (dd DiscoveryDetails) MarshalJSON() ([]byte, error) {
604 objectMap := make(map[string]interface{})
605 if dd.OsType != nil {
606 objectMap["osType"] = dd.OsType
607 }
608 if dd.OsName != nil {
609 objectMap["osName"] = dd.OsName
610 }
611 if dd.OsVersion != nil {
612 objectMap["osVersion"] = dd.OsVersion
613 }
614 if dd.EnqueueTime != nil {
615 objectMap["enqueueTime"] = dd.EnqueueTime
616 }
617 if dd.SolutionName != nil {
618 objectMap["solutionName"] = dd.SolutionName
619 }
620 if dd.MachineID != nil {
621 objectMap["machineId"] = dd.MachineID
622 }
623 if dd.MachineManagerID != nil {
624 objectMap["machineManagerId"] = dd.MachineManagerID
625 }
626 if dd.FabricType != nil {
627 objectMap["fabricType"] = dd.FabricType
628 }
629 if dd.LastUpdatedTime != nil {
630 objectMap["lastUpdatedTime"] = dd.LastUpdatedTime
631 }
632 if dd.MachineName != nil {
633 objectMap["machineName"] = dd.MachineName
634 }
635 if dd.IPAddresses != nil {
636 objectMap["ipAddresses"] = dd.IPAddresses
637 }
638 if dd.Fqdn != nil {
639 objectMap["fqdn"] = dd.Fqdn
640 }
641 if dd.BiosID != nil {
642 objectMap["biosId"] = dd.BiosID
643 }
644 if dd.MacAddresses != nil {
645 objectMap["macAddresses"] = dd.MacAddresses
646 }
647 if dd.ExtendedInfo != nil {
648 objectMap["extendedInfo"] = dd.ExtendedInfo
649 }
650 return json.Marshal(objectMap)
651 }
652
653
654 type EdmReferentialConstraintPropertyPair struct {
655
656 DependentProperty *IEdmStructuralProperty `json:"dependentProperty,omitempty"`
657
658 PrincipalProperty *IEdmStructuralProperty `json:"principalProperty,omitempty"`
659 }
660
661
662 func (ercpp EdmReferentialConstraintPropertyPair) MarshalJSON() ([]byte, error) {
663 objectMap := make(map[string]interface{})
664 return json.Marshal(objectMap)
665 }
666
667
668 type Event struct {
669 autorest.Response `json:"-"`
670
671 ID *string `json:"id,omitempty"`
672
673 Name *string `json:"name,omitempty"`
674
675 Type *string `json:"type,omitempty"`
676
677 Properties BasicEventProperties `json:"properties,omitempty"`
678 }
679
680
681 func (e Event) MarshalJSON() ([]byte, error) {
682 objectMap := make(map[string]interface{})
683 if e.ID != nil {
684 objectMap["id"] = e.ID
685 }
686 if e.Name != nil {
687 objectMap["name"] = e.Name
688 }
689 objectMap["properties"] = e.Properties
690 return json.Marshal(objectMap)
691 }
692
693
694 func (e *Event) UnmarshalJSON(body []byte) error {
695 var m map[string]*json.RawMessage
696 err := json.Unmarshal(body, &m)
697 if err != nil {
698 return err
699 }
700 for k, v := range m {
701 switch k {
702 case "id":
703 if v != nil {
704 var ID string
705 err = json.Unmarshal(*v, &ID)
706 if err != nil {
707 return err
708 }
709 e.ID = &ID
710 }
711 case "name":
712 if v != nil {
713 var name string
714 err = json.Unmarshal(*v, &name)
715 if err != nil {
716 return err
717 }
718 e.Name = &name
719 }
720 case "type":
721 if v != nil {
722 var typeVar string
723 err = json.Unmarshal(*v, &typeVar)
724 if err != nil {
725 return err
726 }
727 e.Type = &typeVar
728 }
729 case "properties":
730 if v != nil {
731 properties, err := unmarshalBasicEventProperties(*v)
732 if err != nil {
733 return err
734 }
735 e.Properties = properties
736 }
737 }
738 }
739
740 return nil
741 }
742
743
744 type EventCollection struct {
745 autorest.Response `json:"-"`
746
747 Value *[]Event `json:"value,omitempty"`
748
749 NextLink *string `json:"nextLink,omitempty"`
750 }
751
752
753 type BasicEventProperties interface {
754 AsMachineMigrateEventProperties() (*MachineMigrateEventProperties, bool)
755 AsDatabaseMigrateEventProperties() (*DatabaseMigrateEventProperties, bool)
756 AsEventProperties() (*EventProperties, bool)
757 }
758
759
760 type EventProperties struct {
761
762 ErrorCode *string `json:"errorCode,omitempty"`
763
764 ErrorMessage *string `json:"errorMessage,omitempty"`
765
766 Recommendation *string `json:"recommendation,omitempty"`
767
768 PossibleCauses *string `json:"possibleCauses,omitempty"`
769
770 Solution *string `json:"solution,omitempty"`
771
772 ClientRequestID *string `json:"clientRequestId,omitempty"`
773
774 InstanceType InstanceType `json:"instanceType,omitempty"`
775 }
776
777 func unmarshalBasicEventProperties(body []byte) (BasicEventProperties, error) {
778 var m map[string]interface{}
779 err := json.Unmarshal(body, &m)
780 if err != nil {
781 return nil, err
782 }
783
784 switch m["instanceType"] {
785 case string(InstanceTypeServers):
786 var mmep MachineMigrateEventProperties
787 err := json.Unmarshal(body, &mmep)
788 return mmep, err
789 case string(InstanceTypeDatabases):
790 var dmep DatabaseMigrateEventProperties
791 err := json.Unmarshal(body, &dmep)
792 return dmep, err
793 default:
794 var ep EventProperties
795 err := json.Unmarshal(body, &ep)
796 return ep, err
797 }
798 }
799 func unmarshalBasicEventPropertiesArray(body []byte) ([]BasicEventProperties, error) {
800 var rawMessages []*json.RawMessage
801 err := json.Unmarshal(body, &rawMessages)
802 if err != nil {
803 return nil, err
804 }
805
806 epArray := make([]BasicEventProperties, len(rawMessages))
807
808 for index, rawMessage := range rawMessages {
809 ep, err := unmarshalBasicEventProperties(*rawMessage)
810 if err != nil {
811 return nil, err
812 }
813 epArray[index] = ep
814 }
815 return epArray, nil
816 }
817
818
819 func (ep EventProperties) MarshalJSON() ([]byte, error) {
820 ep.InstanceType = InstanceTypeMigrateEventProperties
821 objectMap := make(map[string]interface{})
822 if ep.ErrorCode != nil {
823 objectMap["errorCode"] = ep.ErrorCode
824 }
825 if ep.ErrorMessage != nil {
826 objectMap["errorMessage"] = ep.ErrorMessage
827 }
828 if ep.Recommendation != nil {
829 objectMap["recommendation"] = ep.Recommendation
830 }
831 if ep.PossibleCauses != nil {
832 objectMap["possibleCauses"] = ep.PossibleCauses
833 }
834 if ep.Solution != nil {
835 objectMap["solution"] = ep.Solution
836 }
837 if ep.ClientRequestID != nil {
838 objectMap["clientRequestId"] = ep.ClientRequestID
839 }
840 if ep.InstanceType != "" {
841 objectMap["instanceType"] = ep.InstanceType
842 }
843 return json.Marshal(objectMap)
844 }
845
846
847 func (ep EventProperties) AsMachineMigrateEventProperties() (*MachineMigrateEventProperties, bool) {
848 return nil, false
849 }
850
851
852 func (ep EventProperties) AsDatabaseMigrateEventProperties() (*DatabaseMigrateEventProperties, bool) {
853 return nil, false
854 }
855
856
857 func (ep EventProperties) AsEventProperties() (*EventProperties, bool) {
858 return &ep, true
859 }
860
861
862 func (ep EventProperties) AsBasicEventProperties() (BasicEventProperties, bool) {
863 return &ep, true
864 }
865
866
867 type FilterClause struct {
868
869 Expression *SingleValueNode `json:"expression,omitempty"`
870
871 RangeVariable *RangeVariable `json:"rangeVariable,omitempty"`
872
873 ItemType *IEdmTypeReference `json:"itemType,omitempty"`
874 }
875
876
877 func (fc FilterClause) MarshalJSON() ([]byte, error) {
878 objectMap := make(map[string]interface{})
879 return json.Marshal(objectMap)
880 }
881
882
883 type FilterQueryOption struct {
884
885 Context *ODataQueryContext `json:"context,omitempty"`
886 Validator interface{} `json:"validator,omitempty"`
887
888 FilterClause *FilterClause `json:"filterClause,omitempty"`
889
890 RawValue *string `json:"rawValue,omitempty"`
891 }
892
893
894 func (fqo FilterQueryOption) MarshalJSON() ([]byte, error) {
895 objectMap := make(map[string]interface{})
896 if fqo.Validator != nil {
897 objectMap["validator"] = fqo.Validator
898 }
899 return json.Marshal(objectMap)
900 }
901
902
903 type IEdmEntityContainer struct {
904
905 Elements *[]IEdmEntityContainerElement `json:"elements,omitempty"`
906
907 SchemaElementKind SchemaElementKind2 `json:"schemaElementKind,omitempty"`
908
909 Namespace *string `json:"namespace,omitempty"`
910
911 Name *string `json:"name,omitempty"`
912 }
913
914
915 func (ieec IEdmEntityContainer) MarshalJSON() ([]byte, error) {
916 objectMap := make(map[string]interface{})
917 return json.Marshal(objectMap)
918 }
919
920
921 type IEdmEntityContainerElement struct {
922
923 ContainerElementKind ContainerElementKind `json:"containerElementKind,omitempty"`
924
925 Container *IEdmEntityContainer `json:"container,omitempty"`
926
927 Name *string `json:"name,omitempty"`
928 }
929
930
931 func (ieece IEdmEntityContainerElement) MarshalJSON() ([]byte, error) {
932 objectMap := make(map[string]interface{})
933 return json.Marshal(objectMap)
934 }
935
936
937 type IEdmExpression struct {
938
939 ExpressionKind ExpressionKind `json:"expressionKind,omitempty"`
940 }
941
942
943 func (iee IEdmExpression) MarshalJSON() ([]byte, error) {
944 objectMap := make(map[string]interface{})
945 return json.Marshal(objectMap)
946 }
947
948
949 type IEdmModel struct {
950
951 SchemaElements *[]IEdmSchemaElement `json:"schemaElements,omitempty"`
952
953 VocabularyAnnotations *[]IEdmVocabularyAnnotation `json:"vocabularyAnnotations,omitempty"`
954
955 ReferencedModels *[]IEdmModel `json:"referencedModels,omitempty"`
956
957 DeclaredNamespaces *[]string `json:"declaredNamespaces,omitempty"`
958
959 DirectValueAnnotationsManager interface{} `json:"directValueAnnotationsManager,omitempty"`
960
961 EntityContainer *IEdmEntityContainer `json:"entityContainer,omitempty"`
962 }
963
964
965 func (iem IEdmModel) MarshalJSON() ([]byte, error) {
966 objectMap := make(map[string]interface{})
967 return json.Marshal(objectMap)
968 }
969
970
971 type IEdmNavigationProperty struct {
972
973 Partner *IEdmNavigationProperty `json:"partner,omitempty"`
974
975 OnDelete OnDelete `json:"onDelete,omitempty"`
976
977 ContainsTarget *bool `json:"containsTarget,omitempty"`
978
979 ReferentialConstraint *IEdmReferentialConstraint `json:"referentialConstraint,omitempty"`
980
981 PropertyKind PropertyKind2 `json:"propertyKind,omitempty"`
982
983 Type *IEdmTypeReference `json:"type,omitempty"`
984
985 DeclaringType *IEdmStructuredType `json:"declaringType,omitempty"`
986
987 Name *string `json:"name,omitempty"`
988 }
989
990
991 func (ienp IEdmNavigationProperty) MarshalJSON() ([]byte, error) {
992 objectMap := make(map[string]interface{})
993 return json.Marshal(objectMap)
994 }
995
996
997 type IEdmNavigationPropertyBinding struct {
998
999 NavigationProperty *IEdmNavigationProperty `json:"navigationProperty,omitempty"`
1000
1001 Target *IEdmNavigationSource `json:"target,omitempty"`
1002
1003 Path *IEdmPathExpression `json:"path,omitempty"`
1004 }
1005
1006
1007 func (ienpb IEdmNavigationPropertyBinding) MarshalJSON() ([]byte, error) {
1008 objectMap := make(map[string]interface{})
1009 return json.Marshal(objectMap)
1010 }
1011
1012
1013 type IEdmNavigationSource struct {
1014
1015 NavigationPropertyBindings *[]IEdmNavigationPropertyBinding `json:"navigationPropertyBindings,omitempty"`
1016
1017 Path *IEdmPathExpression `json:"path,omitempty"`
1018
1019 Type *IEdmType `json:"type,omitempty"`
1020
1021 Name *string `json:"name,omitempty"`
1022 }
1023
1024
1025 func (iens IEdmNavigationSource) MarshalJSON() ([]byte, error) {
1026 objectMap := make(map[string]interface{})
1027 return json.Marshal(objectMap)
1028 }
1029
1030
1031 type IEdmPathExpression struct {
1032
1033 PathSegments *[]string `json:"pathSegments,omitempty"`
1034
1035 Path *string `json:"path,omitempty"`
1036
1037 ExpressionKind ExpressionKind1 `json:"expressionKind,omitempty"`
1038 }
1039
1040
1041 func (iepe IEdmPathExpression) MarshalJSON() ([]byte, error) {
1042 objectMap := make(map[string]interface{})
1043 return json.Marshal(objectMap)
1044 }
1045
1046
1047 type IEdmProperty struct {
1048
1049 PropertyKind PropertyKind `json:"propertyKind,omitempty"`
1050
1051 Type *IEdmTypeReference `json:"type,omitempty"`
1052
1053 DeclaringType *IEdmStructuredType `json:"declaringType,omitempty"`
1054
1055 Name *string `json:"name,omitempty"`
1056 }
1057
1058
1059 func (iep IEdmProperty) MarshalJSON() ([]byte, error) {
1060 objectMap := make(map[string]interface{})
1061 return json.Marshal(objectMap)
1062 }
1063
1064
1065 type IEdmReferentialConstraint struct {
1066
1067 PropertyPairs *[]EdmReferentialConstraintPropertyPair `json:"propertyPairs,omitempty"`
1068 }
1069
1070
1071 func (ierc IEdmReferentialConstraint) MarshalJSON() ([]byte, error) {
1072 objectMap := make(map[string]interface{})
1073 return json.Marshal(objectMap)
1074 }
1075
1076
1077 type IEdmSchemaElement struct {
1078
1079 SchemaElementKind SchemaElementKind `json:"schemaElementKind,omitempty"`
1080
1081 Namespace *string `json:"namespace,omitempty"`
1082
1083 Name *string `json:"name,omitempty"`
1084 }
1085
1086
1087 func (iese IEdmSchemaElement) MarshalJSON() ([]byte, error) {
1088 objectMap := make(map[string]interface{})
1089 return json.Marshal(objectMap)
1090 }
1091
1092
1093 type IEdmStructuralProperty struct {
1094
1095 DefaultValueString *string `json:"defaultValueString,omitempty"`
1096
1097 PropertyKind PropertyKind1 `json:"propertyKind,omitempty"`
1098
1099 Type *IEdmTypeReference `json:"type,omitempty"`
1100
1101 DeclaringType *IEdmStructuredType `json:"declaringType,omitempty"`
1102
1103 Name *string `json:"name,omitempty"`
1104 }
1105
1106
1107 func (iesp IEdmStructuralProperty) MarshalJSON() ([]byte, error) {
1108 objectMap := make(map[string]interface{})
1109 return json.Marshal(objectMap)
1110 }
1111
1112
1113 type IEdmStructuredType struct {
1114
1115 IsAbstract *bool `json:"isAbstract,omitempty"`
1116
1117 IsOpen *bool `json:"isOpen,omitempty"`
1118
1119 BaseType *IEdmStructuredType `json:"baseType,omitempty"`
1120
1121 DeclaredProperties *[]IEdmProperty `json:"declaredProperties,omitempty"`
1122
1123 TypeKind TypeKind1 `json:"typeKind,omitempty"`
1124 }
1125
1126
1127 func (iest IEdmStructuredType) MarshalJSON() ([]byte, error) {
1128 objectMap := make(map[string]interface{})
1129 return json.Marshal(objectMap)
1130 }
1131
1132
1133 type IEdmTerm struct {
1134
1135 Type *IEdmTypeReference `json:"type,omitempty"`
1136
1137 AppliesTo *string `json:"appliesTo,omitempty"`
1138
1139 DefaultValue *string `json:"defaultValue,omitempty"`
1140
1141 SchemaElementKind SchemaElementKind1 `json:"schemaElementKind,omitempty"`
1142
1143 Namespace *string `json:"namespace,omitempty"`
1144
1145 Name *string `json:"name,omitempty"`
1146 }
1147
1148
1149 func (iet IEdmTerm) MarshalJSON() ([]byte, error) {
1150 objectMap := make(map[string]interface{})
1151 return json.Marshal(objectMap)
1152 }
1153
1154
1155 type IEdmType struct {
1156
1157 TypeKind TypeKind `json:"typeKind,omitempty"`
1158 }
1159
1160
1161 func (iet IEdmType) MarshalJSON() ([]byte, error) {
1162 objectMap := make(map[string]interface{})
1163 return json.Marshal(objectMap)
1164 }
1165
1166
1167 type IEdmTypeReference struct {
1168
1169 IsNullable *bool `json:"isNullable,omitempty"`
1170
1171 Definition *IEdmType `json:"definition,omitempty"`
1172 }
1173
1174
1175 func (ietr IEdmTypeReference) MarshalJSON() ([]byte, error) {
1176 objectMap := make(map[string]interface{})
1177 return json.Marshal(objectMap)
1178 }
1179
1180
1181 type IEdmVocabularyAnnotation struct {
1182
1183 Qualifier *string `json:"qualifier,omitempty"`
1184
1185 Term *IEdmTerm `json:"term,omitempty"`
1186
1187 Target interface{} `json:"target,omitempty"`
1188
1189 Value *IEdmExpression `json:"value,omitempty"`
1190 }
1191
1192
1193 func (ieva IEdmVocabularyAnnotation) MarshalJSON() ([]byte, error) {
1194 objectMap := make(map[string]interface{})
1195 return json.Marshal(objectMap)
1196 }
1197
1198
1199 type Machine struct {
1200 autorest.Response `json:"-"`
1201
1202 ID *string `json:"id,omitempty"`
1203
1204 Name *string `json:"name,omitempty"`
1205
1206 Type *string `json:"type,omitempty"`
1207
1208 Properties *MachineProperties `json:"properties,omitempty"`
1209 }
1210
1211
1212 func (mVar Machine) MarshalJSON() ([]byte, error) {
1213 objectMap := make(map[string]interface{})
1214 if mVar.ID != nil {
1215 objectMap["id"] = mVar.ID
1216 }
1217 if mVar.Name != nil {
1218 objectMap["name"] = mVar.Name
1219 }
1220 if mVar.Properties != nil {
1221 objectMap["properties"] = mVar.Properties
1222 }
1223 return json.Marshal(objectMap)
1224 }
1225
1226
1227 type MachineCollection struct {
1228 autorest.Response `json:"-"`
1229
1230 Value *[]Machine `json:"value,omitempty"`
1231
1232 NextLink *string `json:"nextLink,omitempty"`
1233 }
1234
1235
1236 type MachineMigrateEventProperties struct {
1237
1238 Machine *string `json:"machine,omitempty"`
1239
1240 ErrorCode *string `json:"errorCode,omitempty"`
1241
1242 ErrorMessage *string `json:"errorMessage,omitempty"`
1243
1244 Recommendation *string `json:"recommendation,omitempty"`
1245
1246 PossibleCauses *string `json:"possibleCauses,omitempty"`
1247
1248 Solution *string `json:"solution,omitempty"`
1249
1250 ClientRequestID *string `json:"clientRequestId,omitempty"`
1251
1252 InstanceType InstanceType `json:"instanceType,omitempty"`
1253 }
1254
1255
1256 func (mmep MachineMigrateEventProperties) MarshalJSON() ([]byte, error) {
1257 mmep.InstanceType = InstanceTypeServers
1258 objectMap := make(map[string]interface{})
1259 if mmep.Machine != nil {
1260 objectMap["machine"] = mmep.Machine
1261 }
1262 if mmep.ErrorCode != nil {
1263 objectMap["errorCode"] = mmep.ErrorCode
1264 }
1265 if mmep.ErrorMessage != nil {
1266 objectMap["errorMessage"] = mmep.ErrorMessage
1267 }
1268 if mmep.Recommendation != nil {
1269 objectMap["recommendation"] = mmep.Recommendation
1270 }
1271 if mmep.PossibleCauses != nil {
1272 objectMap["possibleCauses"] = mmep.PossibleCauses
1273 }
1274 if mmep.Solution != nil {
1275 objectMap["solution"] = mmep.Solution
1276 }
1277 if mmep.ClientRequestID != nil {
1278 objectMap["clientRequestId"] = mmep.ClientRequestID
1279 }
1280 if mmep.InstanceType != "" {
1281 objectMap["instanceType"] = mmep.InstanceType
1282 }
1283 return json.Marshal(objectMap)
1284 }
1285
1286
1287 func (mmep MachineMigrateEventProperties) AsMachineMigrateEventProperties() (*MachineMigrateEventProperties, bool) {
1288 return &mmep, true
1289 }
1290
1291
1292 func (mmep MachineMigrateEventProperties) AsDatabaseMigrateEventProperties() (*DatabaseMigrateEventProperties, bool) {
1293 return nil, false
1294 }
1295
1296
1297 func (mmep MachineMigrateEventProperties) AsEventProperties() (*EventProperties, bool) {
1298 return nil, false
1299 }
1300
1301
1302 func (mmep MachineMigrateEventProperties) AsBasicEventProperties() (BasicEventProperties, bool) {
1303 return &mmep, true
1304 }
1305
1306
1307 type MachineProperties struct {
1308
1309 DiscoveryData *[]DiscoveryDetails `json:"discoveryData,omitempty"`
1310
1311 AssessmentData *[]AssessmentDetails `json:"assessmentData,omitempty"`
1312
1313 MigrationData *[]MigrationDetails `json:"migrationData,omitempty"`
1314
1315 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
1316 }
1317
1318
1319 type MigrationDetails struct {
1320
1321 MigrationPhase *string `json:"migrationPhase,omitempty"`
1322
1323 MigrationTested *bool `json:"migrationTested,omitempty"`
1324
1325 ReplicationProgressPercentage *int32 `json:"replicationProgressPercentage,omitempty"`
1326
1327 TargetVMArmID *string `json:"targetVMArmId,omitempty"`
1328
1329 EnqueueTime *string `json:"enqueueTime,omitempty"`
1330
1331 SolutionName *string `json:"solutionName,omitempty"`
1332
1333 MachineID *string `json:"machineId,omitempty"`
1334
1335 MachineManagerID *string `json:"machineManagerId,omitempty"`
1336
1337 FabricType *string `json:"fabricType,omitempty"`
1338
1339 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
1340
1341 MachineName *string `json:"machineName,omitempty"`
1342
1343 IPAddresses *[]string `json:"ipAddresses,omitempty"`
1344
1345 Fqdn *string `json:"fqdn,omitempty"`
1346
1347 BiosID *string `json:"biosId,omitempty"`
1348
1349 MacAddresses *[]string `json:"macAddresses,omitempty"`
1350
1351 ExtendedInfo map[string]*string `json:"extendedInfo"`
1352 }
1353
1354
1355 func (md MigrationDetails) MarshalJSON() ([]byte, error) {
1356 objectMap := make(map[string]interface{})
1357 if md.MigrationPhase != nil {
1358 objectMap["migrationPhase"] = md.MigrationPhase
1359 }
1360 if md.MigrationTested != nil {
1361 objectMap["migrationTested"] = md.MigrationTested
1362 }
1363 if md.ReplicationProgressPercentage != nil {
1364 objectMap["replicationProgressPercentage"] = md.ReplicationProgressPercentage
1365 }
1366 if md.TargetVMArmID != nil {
1367 objectMap["targetVMArmId"] = md.TargetVMArmID
1368 }
1369 if md.EnqueueTime != nil {
1370 objectMap["enqueueTime"] = md.EnqueueTime
1371 }
1372 if md.SolutionName != nil {
1373 objectMap["solutionName"] = md.SolutionName
1374 }
1375 if md.MachineID != nil {
1376 objectMap["machineId"] = md.MachineID
1377 }
1378 if md.MachineManagerID != nil {
1379 objectMap["machineManagerId"] = md.MachineManagerID
1380 }
1381 if md.FabricType != nil {
1382 objectMap["fabricType"] = md.FabricType
1383 }
1384 if md.LastUpdatedTime != nil {
1385 objectMap["lastUpdatedTime"] = md.LastUpdatedTime
1386 }
1387 if md.MachineName != nil {
1388 objectMap["machineName"] = md.MachineName
1389 }
1390 if md.IPAddresses != nil {
1391 objectMap["ipAddresses"] = md.IPAddresses
1392 }
1393 if md.Fqdn != nil {
1394 objectMap["fqdn"] = md.Fqdn
1395 }
1396 if md.BiosID != nil {
1397 objectMap["biosId"] = md.BiosID
1398 }
1399 if md.MacAddresses != nil {
1400 objectMap["macAddresses"] = md.MacAddresses
1401 }
1402 if md.ExtendedInfo != nil {
1403 objectMap["extendedInfo"] = md.ExtendedInfo
1404 }
1405 return json.Marshal(objectMap)
1406 }
1407
1408
1409 type ODataPath struct {
1410
1411 EdmType *IEdmType `json:"edmType,omitempty"`
1412
1413 NavigationSource *IEdmNavigationSource `json:"navigationSource,omitempty"`
1414
1415 Segments *[]ODataPathSegment `json:"segments,omitempty"`
1416
1417 PathTemplate *string `json:"pathTemplate,omitempty"`
1418
1419 Path *[]ODataPathSegment `json:"path,omitempty"`
1420 }
1421
1422
1423 func (odp ODataPath) MarshalJSON() ([]byte, error) {
1424 objectMap := make(map[string]interface{})
1425 return json.Marshal(objectMap)
1426 }
1427
1428
1429 type ODataPathSegment struct {
1430
1431 EdmType *IEdmType `json:"edmType,omitempty"`
1432 Identifier *string `json:"identifier,omitempty"`
1433 }
1434
1435
1436 func (odps ODataPathSegment) MarshalJSON() ([]byte, error) {
1437 objectMap := make(map[string]interface{})
1438 if odps.Identifier != nil {
1439 objectMap["identifier"] = odps.Identifier
1440 }
1441 return json.Marshal(objectMap)
1442 }
1443
1444
1445 type ODataQueryContext struct {
1446
1447 DefaultQuerySettings *DefaultQuerySettings `json:"defaultQuerySettings,omitempty"`
1448
1449 Model *IEdmModel `json:"model,omitempty"`
1450
1451 ElementType *IEdmType `json:"elementType,omitempty"`
1452
1453 NavigationSource *IEdmNavigationSource `json:"navigationSource,omitempty"`
1454
1455 ElementClrType *string `json:"elementClrType,omitempty"`
1456
1457 Path *ODataPath `json:"path,omitempty"`
1458
1459 RequestContainer interface{} `json:"requestContainer,omitempty"`
1460 }
1461
1462
1463 func (odqc ODataQueryContext) MarshalJSON() ([]byte, error) {
1464 objectMap := make(map[string]interface{})
1465 return json.Marshal(objectMap)
1466 }
1467
1468
1469 type ODataQueryOptions1 struct {
1470
1471 Filter *FilterQueryOption `json:"filter,omitempty"`
1472 }
1473
1474
1475 func (odqo ODataQueryOptions1) MarshalJSON() ([]byte, error) {
1476 objectMap := make(map[string]interface{})
1477 return json.Marshal(objectMap)
1478 }
1479
1480
1481 type ODataRawQueryOptions struct {
1482
1483 Filter *string `json:"filter,omitempty"`
1484 }
1485
1486
1487 func (odrqo ODataRawQueryOptions) MarshalJSON() ([]byte, error) {
1488 objectMap := make(map[string]interface{})
1489 return json.Marshal(objectMap)
1490 }
1491
1492
1493 type Operation struct {
1494
1495 Name *string `json:"name,omitempty"`
1496
1497 Display *OperationDisplay `json:"display,omitempty"`
1498
1499 Origin *string `json:"origin,omitempty"`
1500 }
1501
1502
1503 func (o Operation) MarshalJSON() ([]byte, error) {
1504 objectMap := make(map[string]interface{})
1505 if o.Display != nil {
1506 objectMap["display"] = o.Display
1507 }
1508 return json.Marshal(objectMap)
1509 }
1510
1511
1512 type OperationDisplay struct {
1513
1514 Provider *string `json:"provider,omitempty"`
1515
1516 Resource *string `json:"resource,omitempty"`
1517
1518 Operation *string `json:"operation,omitempty"`
1519
1520 Description *string `json:"description,omitempty"`
1521 }
1522
1523
1524 func (od OperationDisplay) MarshalJSON() ([]byte, error) {
1525 objectMap := make(map[string]interface{})
1526 return json.Marshal(objectMap)
1527 }
1528
1529
1530 type OperationResultList struct {
1531 autorest.Response `json:"-"`
1532
1533 Value *[]Operation `json:"value,omitempty"`
1534 }
1535
1536
1537 type Project struct {
1538 autorest.Response `json:"-"`
1539
1540 ETag *string `json:"eTag,omitempty"`
1541
1542 Location *string `json:"location,omitempty"`
1543
1544 Properties *ProjectProperties `json:"properties,omitempty"`
1545
1546 ID *string `json:"id,omitempty"`
1547
1548 Name *string `json:"name,omitempty"`
1549
1550 Type *string `json:"type,omitempty"`
1551
1552 Tags *ProjectTags `json:"tags,omitempty"`
1553 }
1554
1555
1556 func (p Project) MarshalJSON() ([]byte, error) {
1557 objectMap := make(map[string]interface{})
1558 if p.ETag != nil {
1559 objectMap["eTag"] = p.ETag
1560 }
1561 if p.Location != nil {
1562 objectMap["location"] = p.Location
1563 }
1564 if p.Properties != nil {
1565 objectMap["properties"] = p.Properties
1566 }
1567 if p.Tags != nil {
1568 objectMap["tags"] = p.Tags
1569 }
1570 return json.Marshal(objectMap)
1571 }
1572
1573
1574 type ProjectProperties struct {
1575
1576 RegisteredTools *[]string `json:"registeredTools,omitempty"`
1577
1578 Summary map[string]BasicProjectSummary `json:"summary"`
1579
1580 LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"`
1581
1582 RefreshSummaryState RefreshSummaryState1 `json:"refreshSummaryState,omitempty"`
1583
1584 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1585 }
1586
1587
1588 func (pp ProjectProperties) MarshalJSON() ([]byte, error) {
1589 objectMap := make(map[string]interface{})
1590 if pp.RegisteredTools != nil {
1591 objectMap["registeredTools"] = pp.RegisteredTools
1592 }
1593 if pp.ProvisioningState != "" {
1594 objectMap["provisioningState"] = pp.ProvisioningState
1595 }
1596 return json.Marshal(objectMap)
1597 }
1598
1599
1600 type BasicProjectSummary interface {
1601 AsServersProjectSummary() (*ServersProjectSummary, bool)
1602 AsDatabaseProjectSummary() (*DatabaseProjectSummary, bool)
1603 AsProjectSummary() (*ProjectSummary, bool)
1604 }
1605
1606
1607 type ProjectSummary struct {
1608
1609 RefreshSummaryState RefreshSummaryState `json:"refreshSummaryState,omitempty"`
1610
1611 LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"`
1612
1613 ExtendedSummary map[string]*string `json:"extendedSummary"`
1614
1615 InstanceType InstanceTypeBasicProjectSummary `json:"instanceType,omitempty"`
1616 }
1617
1618 func unmarshalBasicProjectSummary(body []byte) (BasicProjectSummary, error) {
1619 var m map[string]interface{}
1620 err := json.Unmarshal(body, &m)
1621 if err != nil {
1622 return nil, err
1623 }
1624
1625 switch m["instanceType"] {
1626 case string(InstanceTypeBasicProjectSummaryInstanceTypeServers):
1627 var sps ServersProjectSummary
1628 err := json.Unmarshal(body, &sps)
1629 return sps, err
1630 case string(InstanceTypeBasicProjectSummaryInstanceTypeDatabases):
1631 var dps DatabaseProjectSummary
1632 err := json.Unmarshal(body, &dps)
1633 return dps, err
1634 default:
1635 var ps ProjectSummary
1636 err := json.Unmarshal(body, &ps)
1637 return ps, err
1638 }
1639 }
1640 func unmarshalBasicProjectSummaryArray(body []byte) ([]BasicProjectSummary, error) {
1641 var rawMessages []*json.RawMessage
1642 err := json.Unmarshal(body, &rawMessages)
1643 if err != nil {
1644 return nil, err
1645 }
1646
1647 psArray := make([]BasicProjectSummary, len(rawMessages))
1648
1649 for index, rawMessage := range rawMessages {
1650 ps, err := unmarshalBasicProjectSummary(*rawMessage)
1651 if err != nil {
1652 return nil, err
1653 }
1654 psArray[index] = ps
1655 }
1656 return psArray, nil
1657 }
1658
1659
1660 func (ps ProjectSummary) MarshalJSON() ([]byte, error) {
1661 ps.InstanceType = InstanceTypeBasicProjectSummaryInstanceTypeProjectSummary
1662 objectMap := make(map[string]interface{})
1663 if ps.RefreshSummaryState != "" {
1664 objectMap["refreshSummaryState"] = ps.RefreshSummaryState
1665 }
1666 if ps.LastSummaryRefreshedTime != nil {
1667 objectMap["lastSummaryRefreshedTime"] = ps.LastSummaryRefreshedTime
1668 }
1669 if ps.ExtendedSummary != nil {
1670 objectMap["extendedSummary"] = ps.ExtendedSummary
1671 }
1672 if ps.InstanceType != "" {
1673 objectMap["instanceType"] = ps.InstanceType
1674 }
1675 return json.Marshal(objectMap)
1676 }
1677
1678
1679 func (ps ProjectSummary) AsServersProjectSummary() (*ServersProjectSummary, bool) {
1680 return nil, false
1681 }
1682
1683
1684 func (ps ProjectSummary) AsDatabaseProjectSummary() (*DatabaseProjectSummary, bool) {
1685 return nil, false
1686 }
1687
1688
1689 func (ps ProjectSummary) AsProjectSummary() (*ProjectSummary, bool) {
1690 return &ps, true
1691 }
1692
1693
1694 func (ps ProjectSummary) AsBasicProjectSummary() (BasicProjectSummary, bool) {
1695 return &ps, true
1696 }
1697
1698
1699 type ProjectTags struct {
1700 AdditionalProperties *string `json:"additionalProperties,omitempty"`
1701 }
1702
1703
1704 type RangeVariable struct {
1705
1706 Name *string `json:"name,omitempty"`
1707
1708 TypeReference *IEdmTypeReference `json:"typeReference,omitempty"`
1709
1710 Kind *int32 `json:"kind,omitempty"`
1711 }
1712
1713
1714 func (rv RangeVariable) MarshalJSON() ([]byte, error) {
1715 objectMap := make(map[string]interface{})
1716 return json.Marshal(objectMap)
1717 }
1718
1719
1720 type RefreshSummaryInput struct {
1721
1722 Goal Goal `json:"goal,omitempty"`
1723 }
1724
1725
1726 type RefreshSummaryResult struct {
1727 autorest.Response `json:"-"`
1728
1729 IsRefreshed *bool `json:"isRefreshed,omitempty"`
1730 }
1731
1732
1733 type RegisterToolInput struct {
1734
1735 Tool Tool `json:"tool,omitempty"`
1736 }
1737
1738
1739 type RegistrationResult struct {
1740 autorest.Response `json:"-"`
1741
1742 IsRegistered *bool `json:"isRegistered,omitempty"`
1743 }
1744
1745
1746 type SelectExpandClause struct {
1747
1748 SelectedItems *[]interface{} `json:"selectedItems,omitempty"`
1749
1750 AllSelected *bool `json:"allSelected,omitempty"`
1751 }
1752
1753
1754 func (sec SelectExpandClause) MarshalJSON() ([]byte, error) {
1755 objectMap := make(map[string]interface{})
1756 return json.Marshal(objectMap)
1757 }
1758
1759
1760 type ServersProjectSummary struct {
1761
1762 DiscoveredCount *int32 `json:"discoveredCount,omitempty"`
1763
1764 AssessedCount *int32 `json:"assessedCount,omitempty"`
1765
1766 ReplicatingCount *int32 `json:"replicatingCount,omitempty"`
1767
1768 TestMigratedCount *int32 `json:"testMigratedCount,omitempty"`
1769
1770 MigratedCount *int32 `json:"migratedCount,omitempty"`
1771
1772 RefreshSummaryState RefreshSummaryState `json:"refreshSummaryState,omitempty"`
1773
1774 LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"`
1775
1776 ExtendedSummary map[string]*string `json:"extendedSummary"`
1777
1778 InstanceType InstanceTypeBasicProjectSummary `json:"instanceType,omitempty"`
1779 }
1780
1781
1782 func (sps ServersProjectSummary) MarshalJSON() ([]byte, error) {
1783 sps.InstanceType = InstanceTypeBasicProjectSummaryInstanceTypeServers
1784 objectMap := make(map[string]interface{})
1785 if sps.DiscoveredCount != nil {
1786 objectMap["discoveredCount"] = sps.DiscoveredCount
1787 }
1788 if sps.AssessedCount != nil {
1789 objectMap["assessedCount"] = sps.AssessedCount
1790 }
1791 if sps.ReplicatingCount != nil {
1792 objectMap["replicatingCount"] = sps.ReplicatingCount
1793 }
1794 if sps.TestMigratedCount != nil {
1795 objectMap["testMigratedCount"] = sps.TestMigratedCount
1796 }
1797 if sps.MigratedCount != nil {
1798 objectMap["migratedCount"] = sps.MigratedCount
1799 }
1800 if sps.RefreshSummaryState != "" {
1801 objectMap["refreshSummaryState"] = sps.RefreshSummaryState
1802 }
1803 if sps.LastSummaryRefreshedTime != nil {
1804 objectMap["lastSummaryRefreshedTime"] = sps.LastSummaryRefreshedTime
1805 }
1806 if sps.ExtendedSummary != nil {
1807 objectMap["extendedSummary"] = sps.ExtendedSummary
1808 }
1809 if sps.InstanceType != "" {
1810 objectMap["instanceType"] = sps.InstanceType
1811 }
1812 return json.Marshal(objectMap)
1813 }
1814
1815
1816 func (sps ServersProjectSummary) AsServersProjectSummary() (*ServersProjectSummary, bool) {
1817 return &sps, true
1818 }
1819
1820
1821 func (sps ServersProjectSummary) AsDatabaseProjectSummary() (*DatabaseProjectSummary, bool) {
1822 return nil, false
1823 }
1824
1825
1826 func (sps ServersProjectSummary) AsProjectSummary() (*ProjectSummary, bool) {
1827 return nil, false
1828 }
1829
1830
1831 func (sps ServersProjectSummary) AsBasicProjectSummary() (BasicProjectSummary, bool) {
1832 return &sps, true
1833 }
1834
1835
1836 type ServersSolutionSummary struct {
1837
1838 DiscoveredCount *int32 `json:"discoveredCount,omitempty"`
1839
1840 AssessedCount *int32 `json:"assessedCount,omitempty"`
1841
1842 ReplicatingCount *int32 `json:"replicatingCount,omitempty"`
1843
1844 TestMigratedCount *int32 `json:"testMigratedCount,omitempty"`
1845
1846 MigratedCount *int32 `json:"migratedCount,omitempty"`
1847
1848 InstanceType InstanceTypeBasicSolutionSummary `json:"instanceType,omitempty"`
1849 }
1850
1851
1852 func (sss ServersSolutionSummary) MarshalJSON() ([]byte, error) {
1853 sss.InstanceType = InstanceTypeBasicSolutionSummaryInstanceTypeServers
1854 objectMap := make(map[string]interface{})
1855 if sss.DiscoveredCount != nil {
1856 objectMap["discoveredCount"] = sss.DiscoveredCount
1857 }
1858 if sss.AssessedCount != nil {
1859 objectMap["assessedCount"] = sss.AssessedCount
1860 }
1861 if sss.ReplicatingCount != nil {
1862 objectMap["replicatingCount"] = sss.ReplicatingCount
1863 }
1864 if sss.TestMigratedCount != nil {
1865 objectMap["testMigratedCount"] = sss.TestMigratedCount
1866 }
1867 if sss.MigratedCount != nil {
1868 objectMap["migratedCount"] = sss.MigratedCount
1869 }
1870 if sss.InstanceType != "" {
1871 objectMap["instanceType"] = sss.InstanceType
1872 }
1873 return json.Marshal(objectMap)
1874 }
1875
1876
1877 func (sss ServersSolutionSummary) AsServersSolutionSummary() (*ServersSolutionSummary, bool) {
1878 return &sss, true
1879 }
1880
1881
1882 func (sss ServersSolutionSummary) AsDatabasesSolutionSummary() (*DatabasesSolutionSummary, bool) {
1883 return nil, false
1884 }
1885
1886
1887 func (sss ServersSolutionSummary) AsSolutionSummary() (*SolutionSummary, bool) {
1888 return nil, false
1889 }
1890
1891
1892 func (sss ServersSolutionSummary) AsBasicSolutionSummary() (BasicSolutionSummary, bool) {
1893 return &sss, true
1894 }
1895
1896
1897 type SingleValueNode struct {
1898
1899 TypeReference *IEdmTypeReference `json:"typeReference,omitempty"`
1900
1901 Kind Kind `json:"kind,omitempty"`
1902 }
1903
1904
1905 func (svn SingleValueNode) MarshalJSON() ([]byte, error) {
1906 objectMap := make(map[string]interface{})
1907 return json.Marshal(objectMap)
1908 }
1909
1910
1911 type Solution struct {
1912 autorest.Response `json:"-"`
1913
1914 ID *string `json:"id,omitempty"`
1915
1916 Name *string `json:"name,omitempty"`
1917
1918 Type *string `json:"type,omitempty"`
1919
1920 Etag *string `json:"etag,omitempty"`
1921
1922 Properties *SolutionProperties `json:"properties,omitempty"`
1923 }
1924
1925
1926 func (s Solution) MarshalJSON() ([]byte, error) {
1927 objectMap := make(map[string]interface{})
1928 if s.Etag != nil {
1929 objectMap["etag"] = s.Etag
1930 }
1931 if s.Properties != nil {
1932 objectMap["properties"] = s.Properties
1933 }
1934 return json.Marshal(objectMap)
1935 }
1936
1937
1938 type SolutionConfig struct {
1939 autorest.Response `json:"-"`
1940
1941 PublisherSasURI *string `json:"publisherSasUri,omitempty"`
1942 }
1943
1944
1945 type SolutionDetails struct {
1946
1947 GroupCount *int32 `json:"groupCount,omitempty"`
1948
1949 AssessmentCount *int32 `json:"assessmentCount,omitempty"`
1950
1951 ExtendedDetails map[string]*string `json:"extendedDetails"`
1952 }
1953
1954
1955 func (sd SolutionDetails) MarshalJSON() ([]byte, error) {
1956 objectMap := make(map[string]interface{})
1957 if sd.GroupCount != nil {
1958 objectMap["groupCount"] = sd.GroupCount
1959 }
1960 if sd.AssessmentCount != nil {
1961 objectMap["assessmentCount"] = sd.AssessmentCount
1962 }
1963 if sd.ExtendedDetails != nil {
1964 objectMap["extendedDetails"] = sd.ExtendedDetails
1965 }
1966 return json.Marshal(objectMap)
1967 }
1968
1969
1970 type SolutionProperties struct {
1971
1972 Tool Tool1 `json:"tool,omitempty"`
1973
1974 Purpose Purpose `json:"purpose,omitempty"`
1975
1976 Goal Goal1 `json:"goal,omitempty"`
1977
1978 Status Status `json:"status,omitempty"`
1979
1980 CleanupState CleanupState `json:"cleanupState,omitempty"`
1981
1982 Summary BasicSolutionSummary `json:"summary,omitempty"`
1983
1984 Details *SolutionDetails `json:"details,omitempty"`
1985 }
1986
1987
1988 func (sp *SolutionProperties) UnmarshalJSON(body []byte) error {
1989 var m map[string]*json.RawMessage
1990 err := json.Unmarshal(body, &m)
1991 if err != nil {
1992 return err
1993 }
1994 for k, v := range m {
1995 switch k {
1996 case "tool":
1997 if v != nil {
1998 var tool Tool1
1999 err = json.Unmarshal(*v, &tool)
2000 if err != nil {
2001 return err
2002 }
2003 sp.Tool = tool
2004 }
2005 case "purpose":
2006 if v != nil {
2007 var purpose Purpose
2008 err = json.Unmarshal(*v, &purpose)
2009 if err != nil {
2010 return err
2011 }
2012 sp.Purpose = purpose
2013 }
2014 case "goal":
2015 if v != nil {
2016 var goal Goal1
2017 err = json.Unmarshal(*v, &goal)
2018 if err != nil {
2019 return err
2020 }
2021 sp.Goal = goal
2022 }
2023 case "status":
2024 if v != nil {
2025 var status Status
2026 err = json.Unmarshal(*v, &status)
2027 if err != nil {
2028 return err
2029 }
2030 sp.Status = status
2031 }
2032 case "cleanupState":
2033 if v != nil {
2034 var cleanupState CleanupState
2035 err = json.Unmarshal(*v, &cleanupState)
2036 if err != nil {
2037 return err
2038 }
2039 sp.CleanupState = cleanupState
2040 }
2041 case "summary":
2042 if v != nil {
2043 summary, err := unmarshalBasicSolutionSummary(*v)
2044 if err != nil {
2045 return err
2046 }
2047 sp.Summary = summary
2048 }
2049 case "details":
2050 if v != nil {
2051 var details SolutionDetails
2052 err = json.Unmarshal(*v, &details)
2053 if err != nil {
2054 return err
2055 }
2056 sp.Details = &details
2057 }
2058 }
2059 }
2060
2061 return nil
2062 }
2063
2064
2065 type SolutionsCollection struct {
2066 autorest.Response `json:"-"`
2067
2068 Value *[]Solution `json:"value,omitempty"`
2069
2070 NextLink *string `json:"nextLink,omitempty"`
2071 }
2072
2073
2074 type BasicSolutionSummary interface {
2075 AsServersSolutionSummary() (*ServersSolutionSummary, bool)
2076 AsDatabasesSolutionSummary() (*DatabasesSolutionSummary, bool)
2077 AsSolutionSummary() (*SolutionSummary, bool)
2078 }
2079
2080
2081 type SolutionSummary struct {
2082
2083 InstanceType InstanceTypeBasicSolutionSummary `json:"instanceType,omitempty"`
2084 }
2085
2086 func unmarshalBasicSolutionSummary(body []byte) (BasicSolutionSummary, error) {
2087 var m map[string]interface{}
2088 err := json.Unmarshal(body, &m)
2089 if err != nil {
2090 return nil, err
2091 }
2092
2093 switch m["instanceType"] {
2094 case string(InstanceTypeBasicSolutionSummaryInstanceTypeServers):
2095 var sss ServersSolutionSummary
2096 err := json.Unmarshal(body, &sss)
2097 return sss, err
2098 case string(InstanceTypeBasicSolutionSummaryInstanceTypeDatabases):
2099 var dss DatabasesSolutionSummary
2100 err := json.Unmarshal(body, &dss)
2101 return dss, err
2102 default:
2103 var ss SolutionSummary
2104 err := json.Unmarshal(body, &ss)
2105 return ss, err
2106 }
2107 }
2108 func unmarshalBasicSolutionSummaryArray(body []byte) ([]BasicSolutionSummary, error) {
2109 var rawMessages []*json.RawMessage
2110 err := json.Unmarshal(body, &rawMessages)
2111 if err != nil {
2112 return nil, err
2113 }
2114
2115 ssArray := make([]BasicSolutionSummary, len(rawMessages))
2116
2117 for index, rawMessage := range rawMessages {
2118 ss, err := unmarshalBasicSolutionSummary(*rawMessage)
2119 if err != nil {
2120 return nil, err
2121 }
2122 ssArray[index] = ss
2123 }
2124 return ssArray, nil
2125 }
2126
2127
2128 func (ss SolutionSummary) MarshalJSON() ([]byte, error) {
2129 ss.InstanceType = InstanceTypeBasicSolutionSummaryInstanceTypeSolutionSummary
2130 objectMap := make(map[string]interface{})
2131 if ss.InstanceType != "" {
2132 objectMap["instanceType"] = ss.InstanceType
2133 }
2134 return json.Marshal(objectMap)
2135 }
2136
2137
2138 func (ss SolutionSummary) AsServersSolutionSummary() (*ServersSolutionSummary, bool) {
2139 return nil, false
2140 }
2141
2142
2143 func (ss SolutionSummary) AsDatabasesSolutionSummary() (*DatabasesSolutionSummary, bool) {
2144 return nil, false
2145 }
2146
2147
2148 func (ss SolutionSummary) AsSolutionSummary() (*SolutionSummary, bool) {
2149 return &ss, true
2150 }
2151
2152
2153 func (ss SolutionSummary) AsBasicSolutionSummary() (BasicSolutionSummary, bool) {
2154 return &ss, true
2155 }
2156
2157
2158 type TransformationNode struct {
2159
2160 Kind Kind1 `json:"kind,omitempty"`
2161 }
2162
2163
2164 func (tn TransformationNode) MarshalJSON() ([]byte, error) {
2165 objectMap := make(map[string]interface{})
2166 return json.Marshal(objectMap)
2167 }
2168
View as plain text