/
model_source.go
268 lines (228 loc) · 7.07 KB
/
model_source.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// Source Document that describes the source of the migration.
type Source struct {
// Path to the CA certificate that signed SSL certificates use to authenticate to the source cluster.
CaCertificatePath *string `json:"caCertificatePath,omitempty"`
// Label that identifies the source cluster name.
ClusterName string `json:"clusterName"`
// Unique 24-hexadecimal digit string that identifies the source project.
GroupId string `json:"groupId"`
// Flag that indicates whether MongoDB Automation manages authentication to the source cluster. If true, do not provide values for username and password.
ManagedAuthentication bool `json:"managedAuthentication"`
// Password that authenticates the username to the source cluster.
// Write only field.
Password *string `json:"password,omitempty"`
// Flag that indicates whether you have SSL enabled.
Ssl bool `json:"ssl"`
// Label that identifies the SCRAM-SHA user that connects to the source cluster.
// Write only field.
Username *string `json:"username,omitempty"`
}
// NewSource instantiates a new Source 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 NewSource(clusterName string, groupId string, managedAuthentication bool, ssl bool) *Source {
this := Source{}
this.ClusterName = clusterName
this.GroupId = groupId
this.ManagedAuthentication = managedAuthentication
this.Ssl = ssl
return &this
}
// NewSourceWithDefaults instantiates a new Source 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 NewSourceWithDefaults() *Source {
this := Source{}
return &this
}
// GetCaCertificatePath returns the CaCertificatePath field value if set, zero value otherwise
func (o *Source) GetCaCertificatePath() string {
if o == nil || IsNil(o.CaCertificatePath) {
var ret string
return ret
}
return *o.CaCertificatePath
}
// GetCaCertificatePathOk returns a tuple with the CaCertificatePath field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Source) GetCaCertificatePathOk() (*string, bool) {
if o == nil || IsNil(o.CaCertificatePath) {
return nil, false
}
return o.CaCertificatePath, true
}
// HasCaCertificatePath returns a boolean if a field has been set.
func (o *Source) HasCaCertificatePath() bool {
if o != nil && !IsNil(o.CaCertificatePath) {
return true
}
return false
}
// SetCaCertificatePath gets a reference to the given string and assigns it to the CaCertificatePath field.
func (o *Source) SetCaCertificatePath(v string) {
o.CaCertificatePath = &v
}
// GetClusterName returns the ClusterName field value
func (o *Source) GetClusterName() string {
if o == nil {
var ret string
return ret
}
return o.ClusterName
}
// GetClusterNameOk returns a tuple with the ClusterName field value
// and a boolean to check if the value has been set.
func (o *Source) GetClusterNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ClusterName, true
}
// SetClusterName sets field value
func (o *Source) SetClusterName(v string) {
o.ClusterName = v
}
// GetGroupId returns the GroupId field value
func (o *Source) GetGroupId() string {
if o == nil {
var ret string
return ret
}
return o.GroupId
}
// GetGroupIdOk returns a tuple with the GroupId field value
// and a boolean to check if the value has been set.
func (o *Source) GetGroupIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.GroupId, true
}
// SetGroupId sets field value
func (o *Source) SetGroupId(v string) {
o.GroupId = v
}
// GetManagedAuthentication returns the ManagedAuthentication field value
func (o *Source) GetManagedAuthentication() bool {
if o == nil {
var ret bool
return ret
}
return o.ManagedAuthentication
}
// GetManagedAuthenticationOk returns a tuple with the ManagedAuthentication field value
// and a boolean to check if the value has been set.
func (o *Source) GetManagedAuthenticationOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.ManagedAuthentication, true
}
// SetManagedAuthentication sets field value
func (o *Source) SetManagedAuthentication(v bool) {
o.ManagedAuthentication = v
}
// GetPassword returns the Password field value if set, zero value otherwise
func (o *Source) GetPassword() string {
if o == nil || IsNil(o.Password) {
var ret string
return ret
}
return *o.Password
}
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Source) GetPasswordOk() (*string, bool) {
if o == nil || IsNil(o.Password) {
return nil, false
}
return o.Password, true
}
// HasPassword returns a boolean if a field has been set.
func (o *Source) HasPassword() bool {
if o != nil && !IsNil(o.Password) {
return true
}
return false
}
// SetPassword gets a reference to the given string and assigns it to the Password field.
func (o *Source) SetPassword(v string) {
o.Password = &v
}
// GetSsl returns the Ssl field value
func (o *Source) GetSsl() bool {
if o == nil {
var ret bool
return ret
}
return o.Ssl
}
// GetSslOk returns a tuple with the Ssl field value
// and a boolean to check if the value has been set.
func (o *Source) GetSslOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Ssl, true
}
// SetSsl sets field value
func (o *Source) SetSsl(v bool) {
o.Ssl = v
}
// GetUsername returns the Username field value if set, zero value otherwise
func (o *Source) GetUsername() string {
if o == nil || IsNil(o.Username) {
var ret string
return ret
}
return *o.Username
}
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Source) GetUsernameOk() (*string, bool) {
if o == nil || IsNil(o.Username) {
return nil, false
}
return o.Username, true
}
// HasUsername returns a boolean if a field has been set.
func (o *Source) HasUsername() bool {
if o != nil && !IsNil(o.Username) {
return true
}
return false
}
// SetUsername gets a reference to the given string and assigns it to the Username field.
func (o *Source) SetUsername(v string) {
o.Username = &v
}
func (o Source) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Source) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CaCertificatePath) {
toSerialize["caCertificatePath"] = o.CaCertificatePath
}
toSerialize["clusterName"] = o.ClusterName
toSerialize["groupId"] = o.GroupId
toSerialize["managedAuthentication"] = o.ManagedAuthentication
if !IsNil(o.Password) {
toSerialize["password"] = o.Password
}
toSerialize["ssl"] = o.Ssl
if !IsNil(o.Username) {
toSerialize["username"] = o.Username
}
return toSerialize, nil
}