|
| 1 | +// Code based on the AtlasAPI V2 OpenAPI file |
| 2 | + |
| 3 | +package admin |
| 4 | + |
| 5 | +import ( |
| 6 | + "encoding/json" |
| 7 | +) |
| 8 | + |
| 9 | +// PaginatedRoleMapping List role mappings from the specified organization in the specified federation. |
| 10 | +type PaginatedRoleMapping struct { |
| 11 | + // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. |
| 12 | + Links []Link `json:"links,omitempty"` |
| 13 | + // List of returned documents that MongoDB Cloud providers when completing this request. |
| 14 | + Results []AuthFederationRoleMapping `json:"results,omitempty"` |
| 15 | + // Number of documents returned in this response. |
| 16 | + TotalCount *int `json:"totalCount,omitempty"` |
| 17 | +} |
| 18 | + |
| 19 | +// NewPaginatedRoleMapping instantiates a new PaginatedRoleMapping object |
| 20 | +// This constructor will assign default values to properties that have it defined, |
| 21 | +// and makes sure properties required by API are set, but the set of arguments |
| 22 | +// will change when the set of required properties is changed |
| 23 | +func NewPaginatedRoleMapping() *PaginatedRoleMapping { |
| 24 | + this := PaginatedRoleMapping{} |
| 25 | + return &this |
| 26 | +} |
| 27 | + |
| 28 | +// NewPaginatedRoleMappingWithDefaults instantiates a new PaginatedRoleMapping object |
| 29 | +// This constructor will only assign default values to properties that have it defined, |
| 30 | +// but it doesn't guarantee that properties required by API are set |
| 31 | +func NewPaginatedRoleMappingWithDefaults() *PaginatedRoleMapping { |
| 32 | + this := PaginatedRoleMapping{} |
| 33 | + return &this |
| 34 | +} |
| 35 | + |
| 36 | +// GetLinks returns the Links field value if set, zero value otherwise |
| 37 | +func (o *PaginatedRoleMapping) GetLinks() []Link { |
| 38 | + if o == nil || IsNil(o.Links) { |
| 39 | + var ret []Link |
| 40 | + return ret |
| 41 | + } |
| 42 | + return o.Links |
| 43 | +} |
| 44 | + |
| 45 | +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise |
| 46 | +// and a boolean to check if the value has been set. |
| 47 | +func (o *PaginatedRoleMapping) GetLinksOk() ([]Link, bool) { |
| 48 | + if o == nil || IsNil(o.Links) { |
| 49 | + return nil, false |
| 50 | + } |
| 51 | + |
| 52 | + return o.Links, true |
| 53 | +} |
| 54 | + |
| 55 | +// HasLinks returns a boolean if a field has been set. |
| 56 | +func (o *PaginatedRoleMapping) HasLinks() bool { |
| 57 | + if o != nil && !IsNil(o.Links) { |
| 58 | + return true |
| 59 | + } |
| 60 | + |
| 61 | + return false |
| 62 | +} |
| 63 | + |
| 64 | +// SetLinks gets a reference to the given []Link and assigns it to the Links field. |
| 65 | +func (o *PaginatedRoleMapping) SetLinks(v []Link) { |
| 66 | + o.Links = v |
| 67 | +} |
| 68 | + |
| 69 | +// GetResults returns the Results field value if set, zero value otherwise |
| 70 | +func (o *PaginatedRoleMapping) GetResults() []AuthFederationRoleMapping { |
| 71 | + if o == nil || IsNil(o.Results) { |
| 72 | + var ret []AuthFederationRoleMapping |
| 73 | + return ret |
| 74 | + } |
| 75 | + return o.Results |
| 76 | +} |
| 77 | + |
| 78 | +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise |
| 79 | +// and a boolean to check if the value has been set. |
| 80 | +func (o *PaginatedRoleMapping) GetResultsOk() ([]AuthFederationRoleMapping, bool) { |
| 81 | + if o == nil || IsNil(o.Results) { |
| 82 | + return nil, false |
| 83 | + } |
| 84 | + |
| 85 | + return o.Results, true |
| 86 | +} |
| 87 | + |
| 88 | +// HasResults returns a boolean if a field has been set. |
| 89 | +func (o *PaginatedRoleMapping) HasResults() bool { |
| 90 | + if o != nil && !IsNil(o.Results) { |
| 91 | + return true |
| 92 | + } |
| 93 | + |
| 94 | + return false |
| 95 | +} |
| 96 | + |
| 97 | +// SetResults gets a reference to the given []AuthFederationRoleMapping and assigns it to the Results field. |
| 98 | +func (o *PaginatedRoleMapping) SetResults(v []AuthFederationRoleMapping) { |
| 99 | + o.Results = v |
| 100 | +} |
| 101 | + |
| 102 | +// GetTotalCount returns the TotalCount field value if set, zero value otherwise |
| 103 | +func (o *PaginatedRoleMapping) GetTotalCount() int { |
| 104 | + if o == nil || IsNil(o.TotalCount) { |
| 105 | + var ret int |
| 106 | + return ret |
| 107 | + } |
| 108 | + return *o.TotalCount |
| 109 | +} |
| 110 | + |
| 111 | +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise |
| 112 | +// and a boolean to check if the value has been set. |
| 113 | +func (o *PaginatedRoleMapping) GetTotalCountOk() (*int, bool) { |
| 114 | + if o == nil || IsNil(o.TotalCount) { |
| 115 | + return nil, false |
| 116 | + } |
| 117 | + |
| 118 | + return o.TotalCount, true |
| 119 | +} |
| 120 | + |
| 121 | +// HasTotalCount returns a boolean if a field has been set. |
| 122 | +func (o *PaginatedRoleMapping) HasTotalCount() bool { |
| 123 | + if o != nil && !IsNil(o.TotalCount) { |
| 124 | + return true |
| 125 | + } |
| 126 | + |
| 127 | + return false |
| 128 | +} |
| 129 | + |
| 130 | +// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field. |
| 131 | +func (o *PaginatedRoleMapping) SetTotalCount(v int) { |
| 132 | + o.TotalCount = &v |
| 133 | +} |
| 134 | + |
| 135 | +func (o PaginatedRoleMapping) MarshalJSONWithoutReadOnly() ([]byte, error) { |
| 136 | + toSerialize, err := o.ToMap() |
| 137 | + if err != nil { |
| 138 | + return []byte{}, err |
| 139 | + } |
| 140 | + return json.Marshal(toSerialize) |
| 141 | +} |
| 142 | +func (o PaginatedRoleMapping) ToMap() (map[string]interface{}, error) { |
| 143 | + toSerialize := map[string]interface{}{} |
| 144 | + return toSerialize, nil |
| 145 | +} |
0 commit comments