-
Notifications
You must be signed in to change notification settings - Fork 40
/
model_a2aprotectionintentmanageddiskinputdetails.go
57 lines (48 loc) · 2.67 KB
/
model_a2aprotectionintentmanageddiskinputdetails.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
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.
type A2AProtectionIntentManagedDiskInputDetails struct {
DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"`
DiskId string `json:"diskId"`
PrimaryStagingStorageAccountCustomInput StorageAccountCustomDetails `json:"primaryStagingStorageAccountCustomInput"`
RecoveryDiskEncryptionSetId *string `json:"recoveryDiskEncryptionSetId,omitempty"`
RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"`
RecoveryResourceGroupCustomInput RecoveryResourceGroupCustomDetails `json:"recoveryResourceGroupCustomInput"`
RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"`
}
var _ json.Unmarshaler = &A2AProtectionIntentManagedDiskInputDetails{}
func (s *A2AProtectionIntentManagedDiskInputDetails) UnmarshalJSON(bytes []byte) error {
type alias A2AProtectionIntentManagedDiskInputDetails
var decoded alias
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling into A2AProtectionIntentManagedDiskInputDetails: %+v", err)
}
s.DiskEncryptionInfo = decoded.DiskEncryptionInfo
s.DiskId = decoded.DiskId
s.RecoveryDiskEncryptionSetId = decoded.RecoveryDiskEncryptionSetId
s.RecoveryReplicaDiskAccountType = decoded.RecoveryReplicaDiskAccountType
s.RecoveryTargetDiskAccountType = decoded.RecoveryTargetDiskAccountType
var temp map[string]json.RawMessage
if err := json.Unmarshal(bytes, &temp); err != nil {
return fmt.Errorf("unmarshaling A2AProtectionIntentManagedDiskInputDetails 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 'A2AProtectionIntentManagedDiskInputDetails': %+v", err)
}
s.PrimaryStagingStorageAccountCustomInput = impl
}
if v, ok := temp["recoveryResourceGroupCustomInput"]; ok {
impl, err := unmarshalRecoveryResourceGroupCustomDetailsImplementation(v)
if err != nil {
return fmt.Errorf("unmarshaling field 'RecoveryResourceGroupCustomInput' for 'A2AProtectionIntentManagedDiskInputDetails': %+v", err)
}
s.RecoveryResourceGroupCustomInput = impl
}
return nil
}