-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel__v2_comments_post_request_data.go
More file actions
122 lines (100 loc) · 3.78 KB
/
model__v2_comments_post_request_data.go
File metadata and controls
122 lines (100 loc) · 3.78 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
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
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"
)
// V2CommentsPostRequestData struct for V2CommentsPostRequestData
type V2CommentsPostRequestData struct {
V2CommentsPostRequestDataAnyOf *V2CommentsPostRequestDataAnyOf
V2CommentsPostRequestDataAnyOf1 *V2CommentsPostRequestDataAnyOf1
V2CommentsPostRequestDataAnyOf2 *V2CommentsPostRequestDataAnyOf2
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *V2CommentsPostRequestData) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into V2CommentsPostRequestDataAnyOf
err = json.Unmarshal(data, &dst.V2CommentsPostRequestDataAnyOf)
if err == nil {
jsonV2CommentsPostRequestDataAnyOf, _ := json.Marshal(dst.V2CommentsPostRequestDataAnyOf)
if string(jsonV2CommentsPostRequestDataAnyOf) == "{}" { // empty struct
dst.V2CommentsPostRequestDataAnyOf = nil
} else {
return nil // data stored in dst.V2CommentsPostRequestDataAnyOf, return on the first match
}
} else {
dst.V2CommentsPostRequestDataAnyOf = nil
}
// try to unmarshal JSON data into V2CommentsPostRequestDataAnyOf1
err = json.Unmarshal(data, &dst.V2CommentsPostRequestDataAnyOf1)
if err == nil {
jsonV2CommentsPostRequestDataAnyOf1, _ := json.Marshal(dst.V2CommentsPostRequestDataAnyOf1)
if string(jsonV2CommentsPostRequestDataAnyOf1) == "{}" { // empty struct
dst.V2CommentsPostRequestDataAnyOf1 = nil
} else {
return nil // data stored in dst.V2CommentsPostRequestDataAnyOf1, return on the first match
}
} else {
dst.V2CommentsPostRequestDataAnyOf1 = nil
}
// try to unmarshal JSON data into V2CommentsPostRequestDataAnyOf2
err = json.Unmarshal(data, &dst.V2CommentsPostRequestDataAnyOf2)
if err == nil {
jsonV2CommentsPostRequestDataAnyOf2, _ := json.Marshal(dst.V2CommentsPostRequestDataAnyOf2)
if string(jsonV2CommentsPostRequestDataAnyOf2) == "{}" { // empty struct
dst.V2CommentsPostRequestDataAnyOf2 = nil
} else {
return nil // data stored in dst.V2CommentsPostRequestDataAnyOf2, return on the first match
}
} else {
dst.V2CommentsPostRequestDataAnyOf2 = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(V2CommentsPostRequestData)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src V2CommentsPostRequestData) MarshalJSON() ([]byte, error) {
if src.V2CommentsPostRequestDataAnyOf != nil {
return json.Marshal(&src.V2CommentsPostRequestDataAnyOf)
}
if src.V2CommentsPostRequestDataAnyOf1 != nil {
return json.Marshal(&src.V2CommentsPostRequestDataAnyOf1)
}
if src.V2CommentsPostRequestDataAnyOf2 != nil {
return json.Marshal(&src.V2CommentsPostRequestDataAnyOf2)
}
return nil, nil // no data in anyOf schemas
}
type NullableV2CommentsPostRequestData struct {
value *V2CommentsPostRequestData
isSet bool
}
func (v NullableV2CommentsPostRequestData) Get() *V2CommentsPostRequestData {
return v.value
}
func (v *NullableV2CommentsPostRequestData) Set(val *V2CommentsPostRequestData) {
v.value = val
v.isSet = true
}
func (v NullableV2CommentsPostRequestData) IsSet() bool {
return v.isSet
}
func (v *NullableV2CommentsPostRequestData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV2CommentsPostRequestData(val *V2CommentsPostRequestData) *NullableV2CommentsPostRequestData {
return &NullableV2CommentsPostRequestData{value: val, isSet: true}
}
func (v NullableV2CommentsPostRequestData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV2CommentsPostRequestData) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}