-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel__v2__target___identifier__attributes_post_request_data_default_value.go
More file actions
109 lines (88 loc) · 4.86 KB
/
model__v2__target___identifier__attributes_post_request_data_default_value.go
File metadata and controls
109 lines (88 loc) · 4.86 KB
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
/*
Attio API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 2.0.0
Contact: support@attio.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libattio
import (
"encoding/json"
"fmt"
)
// V2TargetIdentifierAttributesPostRequestDataDefaultValue The default value for this attribute. Static values are used to directly populate values using their contents. Dynamic values are used to lookup data at the point of creation. For example, you could use a dynamic value to insert a value for the currently logged in user. Which default values are available is dependent on the type of the attribute. Default values are not currently supported on people or company objects.
type V2TargetIdentifierAttributesPostRequestDataDefaultValue struct {
V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf *V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf
V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1 *V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *V2TargetIdentifierAttributesPostRequestDataDefaultValue) UnmarshalJSON(data []byte) error {
var err error
// this object is nullable so check if the payload is null or empty string
if string(data) == "" || string(data) == "{}" {
return nil
}
// try to unmarshal JSON data into V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf
err = json.Unmarshal(data, &dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf)
if err == nil {
jsonV2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf, _ := json.Marshal(dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf)
if string(jsonV2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf) == "{}" { // empty struct
dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf = nil
} else {
return nil // data stored in dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf, return on the first match
}
} else {
dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf = nil
}
// try to unmarshal JSON data into V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1
err = json.Unmarshal(data, &dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1)
if err == nil {
jsonV2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1, _ := json.Marshal(dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1)
if string(jsonV2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1) == "{}" { // empty struct
dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1 = nil
} else {
return nil // data stored in dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1, return on the first match
}
} else {
dst.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1 = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(V2TargetIdentifierAttributesPostRequestDataDefaultValue)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src V2TargetIdentifierAttributesPostRequestDataDefaultValue) MarshalJSON() ([]byte, error) {
if src.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf != nil {
return json.Marshal(&src.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf)
}
if src.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1 != nil {
return json.Marshal(&src.V2TargetIdentifierAttributesPostRequestDataDefaultValueAnyOf1)
}
return nil, nil // no data in anyOf schemas
}
type NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue struct {
value *V2TargetIdentifierAttributesPostRequestDataDefaultValue
isSet bool
}
func (v NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) Get() *V2TargetIdentifierAttributesPostRequestDataDefaultValue {
return v.value
}
func (v *NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) Set(val *V2TargetIdentifierAttributesPostRequestDataDefaultValue) {
v.value = val
v.isSet = true
}
func (v NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) IsSet() bool {
return v.isSet
}
func (v *NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV2TargetIdentifierAttributesPostRequestDataDefaultValue(val *V2TargetIdentifierAttributesPostRequestDataDefaultValue) *NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue {
return &NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue{value: val, isSet: true}
}
func (v NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV2TargetIdentifierAttributesPostRequestDataDefaultValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}