-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_retention_policies.go
142 lines (117 loc) · 3.54 KB
/
data_retention_policies.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
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/FlatFilers/flatfile-go/core"
)
type ListDataRetentionPoliciesRequest struct {
// The associated Environment ID of the policy.
EnvironmentId *EnvironmentId `json:"-" url:"environmentId,omitempty"`
}
// Data Retention Policy ID
type DataRetentionPolicyId = string
type DataRetentionPolicyConfig struct {
Type DataRetentionPolicyEnum `json:"type" url:"type"`
Period int `json:"period" url:"period"`
EnvironmentId EnvironmentId `json:"environmentId" url:"environmentId"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (d *DataRetentionPolicyConfig) GetExtraProperties() map[string]interface{} {
return d.extraProperties
}
func (d *DataRetentionPolicyConfig) UnmarshalJSON(data []byte) error {
type unmarshaler DataRetentionPolicyConfig
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DataRetentionPolicyConfig(value)
extraProperties, err := core.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DataRetentionPolicyConfig) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type DataRetentionPolicyResponse struct {
Data *DataRetentionPolicy `json:"data,omitempty" url:"data,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (d *DataRetentionPolicyResponse) GetExtraProperties() map[string]interface{} {
return d.extraProperties
}
func (d *DataRetentionPolicyResponse) UnmarshalJSON(data []byte) error {
type unmarshaler DataRetentionPolicyResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*d = DataRetentionPolicyResponse(value)
extraProperties, err := core.ExtractExtraProperties(data, *d)
if err != nil {
return err
}
d.extraProperties = extraProperties
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DataRetentionPolicyResponse) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type ListDataRetentionPoliciesResponse struct {
Data []*DataRetentionPolicy `json:"data,omitempty" url:"data,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (l *ListDataRetentionPoliciesResponse) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *ListDataRetentionPoliciesResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ListDataRetentionPoliciesResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = ListDataRetentionPoliciesResponse(value)
extraProperties, err := core.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l._rawJSON = json.RawMessage(data)
return nil
}
func (l *ListDataRetentionPoliciesResponse) String() string {
if len(l._rawJSON) > 0 {
if value, err := core.StringifyJSON(l._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}