-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_data_lake_atlas_store_read_preference.go
154 lines (130 loc) · 5.13 KB
/
model_data_lake_atlas_store_read_preference.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
144
145
146
147
148
149
150
151
152
153
154
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// DataLakeAtlasStoreReadPreference MongoDB Cloud cluster read preference, which describes how to route read requests to the cluster.
type DataLakeAtlasStoreReadPreference struct {
// Maximum replication lag, or **staleness**, for reads from secondaries.
MaxStalenessSeconds *int `json:"maxStalenessSeconds,omitempty"`
// Read preference mode that specifies to which replica set member to route the read requests.
Mode *string `json:"mode,omitempty"`
// List that contains tag sets or tag specification documents. If specified, Atlas Data Lake routes read requests to replica set member or members that are associated with the specified tags.
TagSets *[][]DataLakeAtlasStoreReadPreferenceTag `json:"tagSets,omitempty"`
}
// NewDataLakeAtlasStoreReadPreference instantiates a new DataLakeAtlasStoreReadPreference object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDataLakeAtlasStoreReadPreference() *DataLakeAtlasStoreReadPreference {
this := DataLakeAtlasStoreReadPreference{}
return &this
}
// NewDataLakeAtlasStoreReadPreferenceWithDefaults instantiates a new DataLakeAtlasStoreReadPreference object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDataLakeAtlasStoreReadPreferenceWithDefaults() *DataLakeAtlasStoreReadPreference {
this := DataLakeAtlasStoreReadPreference{}
return &this
}
// GetMaxStalenessSeconds returns the MaxStalenessSeconds field value if set, zero value otherwise
func (o *DataLakeAtlasStoreReadPreference) GetMaxStalenessSeconds() int {
if o == nil || IsNil(o.MaxStalenessSeconds) {
var ret int
return ret
}
return *o.MaxStalenessSeconds
}
// GetMaxStalenessSecondsOk returns a tuple with the MaxStalenessSeconds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataLakeAtlasStoreReadPreference) GetMaxStalenessSecondsOk() (*int, bool) {
if o == nil || IsNil(o.MaxStalenessSeconds) {
return nil, false
}
return o.MaxStalenessSeconds, true
}
// HasMaxStalenessSeconds returns a boolean if a field has been set.
func (o *DataLakeAtlasStoreReadPreference) HasMaxStalenessSeconds() bool {
if o != nil && !IsNil(o.MaxStalenessSeconds) {
return true
}
return false
}
// SetMaxStalenessSeconds gets a reference to the given int and assigns it to the MaxStalenessSeconds field.
func (o *DataLakeAtlasStoreReadPreference) SetMaxStalenessSeconds(v int) {
o.MaxStalenessSeconds = &v
}
// GetMode returns the Mode field value if set, zero value otherwise
func (o *DataLakeAtlasStoreReadPreference) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataLakeAtlasStoreReadPreference) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *DataLakeAtlasStoreReadPreference) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *DataLakeAtlasStoreReadPreference) SetMode(v string) {
o.Mode = &v
}
// GetTagSets returns the TagSets field value if set, zero value otherwise
func (o *DataLakeAtlasStoreReadPreference) GetTagSets() [][]DataLakeAtlasStoreReadPreferenceTag {
if o == nil || IsNil(o.TagSets) {
var ret [][]DataLakeAtlasStoreReadPreferenceTag
return ret
}
return *o.TagSets
}
// GetTagSetsOk returns a tuple with the TagSets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataLakeAtlasStoreReadPreference) GetTagSetsOk() (*[][]DataLakeAtlasStoreReadPreferenceTag, bool) {
if o == nil || IsNil(o.TagSets) {
return nil, false
}
return o.TagSets, true
}
// HasTagSets returns a boolean if a field has been set.
func (o *DataLakeAtlasStoreReadPreference) HasTagSets() bool {
if o != nil && !IsNil(o.TagSets) {
return true
}
return false
}
// SetTagSets gets a reference to the given [][]DataLakeAtlasStoreReadPreferenceTag and assigns it to the TagSets field.
func (o *DataLakeAtlasStoreReadPreference) SetTagSets(v [][]DataLakeAtlasStoreReadPreferenceTag) {
o.TagSets = &v
}
func (o DataLakeAtlasStoreReadPreference) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataLakeAtlasStoreReadPreference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MaxStalenessSeconds) {
toSerialize["maxStalenessSeconds"] = o.MaxStalenessSeconds
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.TagSets) {
toSerialize["tagSets"] = o.TagSets
}
return toSerialize, nil
}