-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_create_atlas_project_api_key.go
96 lines (82 loc) · 2.68 KB
/
model_create_atlas_project_api_key.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// CreateAtlasProjectApiKey struct for CreateAtlasProjectApiKey
type CreateAtlasProjectApiKey struct {
// Purpose or explanation provided when someone created this project API key.
Desc string `json:"desc"`
// List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this project.
Roles []string `json:"roles"`
}
// NewCreateAtlasProjectApiKey instantiates a new CreateAtlasProjectApiKey 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 NewCreateAtlasProjectApiKey(desc string, roles []string) *CreateAtlasProjectApiKey {
this := CreateAtlasProjectApiKey{}
this.Desc = desc
this.Roles = roles
return &this
}
// NewCreateAtlasProjectApiKeyWithDefaults instantiates a new CreateAtlasProjectApiKey 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 NewCreateAtlasProjectApiKeyWithDefaults() *CreateAtlasProjectApiKey {
this := CreateAtlasProjectApiKey{}
return &this
}
// GetDesc returns the Desc field value
func (o *CreateAtlasProjectApiKey) GetDesc() string {
if o == nil {
var ret string
return ret
}
return o.Desc
}
// GetDescOk returns a tuple with the Desc field value
// and a boolean to check if the value has been set.
func (o *CreateAtlasProjectApiKey) GetDescOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Desc, true
}
// SetDesc sets field value
func (o *CreateAtlasProjectApiKey) SetDesc(v string) {
o.Desc = v
}
// GetRoles returns the Roles field value
func (o *CreateAtlasProjectApiKey) GetRoles() []string {
if o == nil {
var ret []string
return ret
}
return o.Roles
}
// GetRolesOk returns a tuple with the Roles field value
// and a boolean to check if the value has been set.
func (o *CreateAtlasProjectApiKey) GetRolesOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.Roles, true
}
// SetRoles sets field value
func (o *CreateAtlasProjectApiKey) SetRoles(v []string) {
o.Roles = v
}
func (o CreateAtlasProjectApiKey) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateAtlasProjectApiKey) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["desc"] = o.Desc
toSerialize["roles"] = o.Roles
return toSerialize, nil
}