-
Notifications
You must be signed in to change notification settings - Fork 38
/
model_a2acreateprotectionintentinput.go
143 lines (123 loc) · 7.24 KB
/
model_a2acreateprotectionintentinput.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
package replicationprotectionintents
import (
"encoding/json"
"fmt"
)
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
var _ CreateProtectionIntentProviderSpecificDetails = A2ACreateProtectionIntentInput{}
type A2ACreateProtectionIntentInput struct {
AgentAutoUpdateStatus *AgentAutoUpdateStatus `json:"agentAutoUpdateStatus,omitempty"`
AutoProtectionOfDataDisk *AutoProtectionOfDataDisk `json:"autoProtectionOfDataDisk,omitempty"`
AutomationAccountArmId *string `json:"automationAccountArmId,omitempty"`
AutomationAccountAuthenticationType *AutomationAccountAuthenticationType `json:"automationAccountAuthenticationType,omitempty"`
DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"`
FabricObjectId string `json:"fabricObjectId"`
MultiVMGroupId *string `json:"multiVmGroupId,omitempty"`
MultiVMGroupName *string `json:"multiVmGroupName,omitempty"`
PrimaryLocation string `json:"primaryLocation"`
PrimaryStagingStorageAccountCustomInput StorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput"`
ProtectionProfileCustomInput ProtectionProfileCustomDetails `json:"protectionProfileCustomInput"`
RecoveryAvailabilitySetCustomInput RecoveryAvailabilitySetCustomDetails `json:"recoveryAvailabilitySetCustomInput"`
RecoveryAvailabilityType A2ARecoveryAvailabilityType `json:"recoveryAvailabilityType"`
RecoveryAvailabilityZone *string `json:"recoveryAvailabilityZone,omitempty"`
RecoveryBootDiagStorageAccount StorageAccountCustomDetails `json:"recoveryBootDiagStorageAccount"`
RecoveryLocation string `json:"recoveryLocation"`
RecoveryProximityPlacementGroupCustomInput RecoveryProximityPlacementGroupCustomDetails `json:"recoveryProximityPlacementGroupCustomInput"`
RecoveryResourceGroupId string `json:"recoveryResourceGroupId"`
RecoverySubscriptionId string `json:"recoverySubscriptionId"`
RecoveryVirtualNetworkCustomInput RecoveryVirtualNetworkCustomDetails `json:"recoveryVirtualNetworkCustomInput"`
VMDisks *[]A2AProtectionIntentDiskInputDetails `json:"vmDisks,omitempty"`
VMManagedDisks *[]A2AProtectionIntentManagedDiskInputDetails `json:"vmManagedDisks,omitempty"`
// Fields inherited from CreateProtectionIntentProviderSpecificDetails
}
var _ json.Marshaler = A2ACreateProtectionIntentInput{}
func (s A2ACreateProtectionIntentInput) MarshalJSON() ([]byte, error) {
type wrapper A2ACreateProtectionIntentInput
wrapped := wrapper(s)
encoded, err := json.Marshal(wrapped)
if err != nil {
return nil, fmt.Errorf("marshaling A2ACreateProtectionIntentInput: %+v", err)
}
var decoded map[string]interface{}
if err := json.Unmarshal(encoded, &decoded); err != nil {
return nil, fmt.Errorf("unmarshaling A2ACreateProtectionIntentInput: %+v", err)
}
decoded["instanceType"] = "A2A"
encoded, err = json.Marshal(decoded)
if err != nil {
return nil, fmt.Errorf("re-marshaling A2ACreateProtectionIntentInput: %+v", err)
}
return encoded, nil
}
var _ json.Unmarshaler = &A2ACreateProtectionIntentInput{}
func (s *A2ACreateProtectionIntentInput) UnmarshalJSON(bytes []byte) error {
type alias A2ACreateProtectionIntentInput
var decoded alias
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling into A2ACreateProtectionIntentInput: %+v", err)
}
s.AgentAutoUpdateStatus = decoded.AgentAutoUpdateStatus
s.AutoProtectionOfDataDisk = decoded.AutoProtectionOfDataDisk
s.AutomationAccountArmId = decoded.AutomationAccountArmId
s.AutomationAccountAuthenticationType = decoded.AutomationAccountAuthenticationType
s.DiskEncryptionInfo = decoded.DiskEncryptionInfo
s.FabricObjectId = decoded.FabricObjectId
s.MultiVMGroupId = decoded.MultiVMGroupId
s.MultiVMGroupName = decoded.MultiVMGroupName
s.PrimaryLocation = decoded.PrimaryLocation
s.RecoveryAvailabilityType = decoded.RecoveryAvailabilityType
s.RecoveryAvailabilityZone = decoded.RecoveryAvailabilityZone
s.RecoveryLocation = decoded.RecoveryLocation
s.RecoveryResourceGroupId = decoded.RecoveryResourceGroupId
s.RecoverySubscriptionId = decoded.RecoverySubscriptionId
s.VMDisks = decoded.VMDisks
s.VMManagedDisks = decoded.VMManagedDisks
var temp map[string]json.RawMessage
if err := json.Unmarshal(bytes, &temp); err != nil {
return fmt.Errorf("unmarshaling A2ACreateProtectionIntentInput into map[string]json.RawMessage: %+v", err)
}
if v, ok := temp["primaryStagingStorageAccountCustomInput"]; ok {
impl, err := unmarshalStorageAccountCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'PrimaryStagingStorageAccountCustomInput' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.PrimaryStagingStorageAccountCustomInput = impl
}
if v, ok := temp["protectionProfileCustomInput"]; ok {
impl, err := unmarshalProtectionProfileCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'ProtectionProfileCustomInput' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.ProtectionProfileCustomInput = impl
}
if v, ok := temp["recoveryAvailabilitySetCustomInput"]; ok {
impl, err := unmarshalRecoveryAvailabilitySetCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'RecoveryAvailabilitySetCustomInput' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.RecoveryAvailabilitySetCustomInput = impl
}
if v, ok := temp["recoveryBootDiagStorageAccount"]; ok {
impl, err := unmarshalStorageAccountCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'RecoveryBootDiagStorageAccount' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.RecoveryBootDiagStorageAccount = impl
}
if v, ok := temp["recoveryProximityPlacementGroupCustomInput"]; ok {
impl, err := unmarshalRecoveryProximityPlacementGroupCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'RecoveryProximityPlacementGroupCustomInput' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.RecoveryProximityPlacementGroupCustomInput = impl
}
if v, ok := temp["recoveryVirtualNetworkCustomInput"]; ok {
impl, err := unmarshalRecoveryVirtualNetworkCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'RecoveryVirtualNetworkCustomInput' for 'A2ACreateProtectionIntentInput': %+v", err)
}
s.RecoveryVirtualNetworkCustomInput = impl
}
return nil
}