bunnyshell.com/sdk@v0.16.0/model_paginated_links.go (about) 1 /* 2 API Bunnyshell Environments 3 4 Interact with Bunnyshell Platform 5 6 API version: 1.1.0 7 Contact: osi+support@bunnyshell.com 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package sdk 13 14 import ( 15 "encoding/json" 16 ) 17 18 // checks if the PaginatedLinks type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &PaginatedLinks{} 20 21 // PaginatedLinks struct for PaginatedLinks 22 type PaginatedLinks struct { 23 Self *PaginatedLink `json:"self,omitempty"` 24 First NullablePaginatedLink `json:"first,omitempty"` 25 Prev NullablePaginatedLink `json:"prev,omitempty"` 26 Next NullablePaginatedLink `json:"next,omitempty"` 27 Last NullablePaginatedLink `json:"last,omitempty"` 28 Item []PaginatedLink `json:"item,omitempty"` 29 } 30 31 // NewPaginatedLinks instantiates a new PaginatedLinks object 32 // This constructor will assign default values to properties that have it defined, 33 // and makes sure properties required by API are set, but the set of arguments 34 // will change when the set of required properties is changed 35 func NewPaginatedLinks() *PaginatedLinks { 36 this := PaginatedLinks{} 37 return &this 38 } 39 40 // NewPaginatedLinksWithDefaults instantiates a new PaginatedLinks object 41 // This constructor will only assign default values to properties that have it defined, 42 // but it doesn't guarantee that properties required by API are set 43 func NewPaginatedLinksWithDefaults() *PaginatedLinks { 44 this := PaginatedLinks{} 45 return &this 46 } 47 48 // GetSelf returns the Self field value if set, zero value otherwise. 49 func (o *PaginatedLinks) GetSelf() PaginatedLink { 50 if o == nil || IsNil(o.Self) { 51 var ret PaginatedLink 52 return ret 53 } 54 return *o.Self 55 } 56 57 // GetSelfOk returns a tuple with the Self field value if set, nil otherwise 58 // and a boolean to check if the value has been set. 59 func (o *PaginatedLinks) GetSelfOk() (*PaginatedLink, bool) { 60 if o == nil || IsNil(o.Self) { 61 return nil, false 62 } 63 return o.Self, true 64 } 65 66 // HasSelf returns a boolean if a field has been set. 67 func (o *PaginatedLinks) HasSelf() bool { 68 if o != nil && !IsNil(o.Self) { 69 return true 70 } 71 72 return false 73 } 74 75 // SetSelf gets a reference to the given PaginatedLink and assigns it to the Self field. 76 func (o *PaginatedLinks) SetSelf(v PaginatedLink) { 77 o.Self = &v 78 } 79 80 // GetFirst returns the First field value if set, zero value otherwise (both if not set or set to explicit null). 81 func (o *PaginatedLinks) GetFirst() PaginatedLink { 82 if o == nil || IsNil(o.First.Get()) { 83 var ret PaginatedLink 84 return ret 85 } 86 return *o.First.Get() 87 } 88 89 // GetFirstOk returns a tuple with the First field value if set, nil otherwise 90 // and a boolean to check if the value has been set. 91 // NOTE: If the value is an explicit nil, `nil, true` will be returned 92 func (o *PaginatedLinks) GetFirstOk() (*PaginatedLink, bool) { 93 if o == nil { 94 return nil, false 95 } 96 return o.First.Get(), o.First.IsSet() 97 } 98 99 // HasFirst returns a boolean if a field has been set. 100 func (o *PaginatedLinks) HasFirst() bool { 101 if o != nil && o.First.IsSet() { 102 return true 103 } 104 105 return false 106 } 107 108 // SetFirst gets a reference to the given NullablePaginatedLink and assigns it to the First field. 109 func (o *PaginatedLinks) SetFirst(v PaginatedLink) { 110 o.First.Set(&v) 111 } 112 113 // SetFirstNil sets the value for First to be an explicit nil 114 func (o *PaginatedLinks) SetFirstNil() { 115 o.First.Set(nil) 116 } 117 118 // UnsetFirst ensures that no value is present for First, not even an explicit nil 119 func (o *PaginatedLinks) UnsetFirst() { 120 o.First.Unset() 121 } 122 123 // GetPrev returns the Prev field value if set, zero value otherwise (both if not set or set to explicit null). 124 func (o *PaginatedLinks) GetPrev() PaginatedLink { 125 if o == nil || IsNil(o.Prev.Get()) { 126 var ret PaginatedLink 127 return ret 128 } 129 return *o.Prev.Get() 130 } 131 132 // GetPrevOk returns a tuple with the Prev field value if set, nil otherwise 133 // and a boolean to check if the value has been set. 134 // NOTE: If the value is an explicit nil, `nil, true` will be returned 135 func (o *PaginatedLinks) GetPrevOk() (*PaginatedLink, bool) { 136 if o == nil { 137 return nil, false 138 } 139 return o.Prev.Get(), o.Prev.IsSet() 140 } 141 142 // HasPrev returns a boolean if a field has been set. 143 func (o *PaginatedLinks) HasPrev() bool { 144 if o != nil && o.Prev.IsSet() { 145 return true 146 } 147 148 return false 149 } 150 151 // SetPrev gets a reference to the given NullablePaginatedLink and assigns it to the Prev field. 152 func (o *PaginatedLinks) SetPrev(v PaginatedLink) { 153 o.Prev.Set(&v) 154 } 155 156 // SetPrevNil sets the value for Prev to be an explicit nil 157 func (o *PaginatedLinks) SetPrevNil() { 158 o.Prev.Set(nil) 159 } 160 161 // UnsetPrev ensures that no value is present for Prev, not even an explicit nil 162 func (o *PaginatedLinks) UnsetPrev() { 163 o.Prev.Unset() 164 } 165 166 // GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). 167 func (o *PaginatedLinks) GetNext() PaginatedLink { 168 if o == nil || IsNil(o.Next.Get()) { 169 var ret PaginatedLink 170 return ret 171 } 172 return *o.Next.Get() 173 } 174 175 // GetNextOk returns a tuple with the Next field value if set, nil otherwise 176 // and a boolean to check if the value has been set. 177 // NOTE: If the value is an explicit nil, `nil, true` will be returned 178 func (o *PaginatedLinks) GetNextOk() (*PaginatedLink, bool) { 179 if o == nil { 180 return nil, false 181 } 182 return o.Next.Get(), o.Next.IsSet() 183 } 184 185 // HasNext returns a boolean if a field has been set. 186 func (o *PaginatedLinks) HasNext() bool { 187 if o != nil && o.Next.IsSet() { 188 return true 189 } 190 191 return false 192 } 193 194 // SetNext gets a reference to the given NullablePaginatedLink and assigns it to the Next field. 195 func (o *PaginatedLinks) SetNext(v PaginatedLink) { 196 o.Next.Set(&v) 197 } 198 199 // SetNextNil sets the value for Next to be an explicit nil 200 func (o *PaginatedLinks) SetNextNil() { 201 o.Next.Set(nil) 202 } 203 204 // UnsetNext ensures that no value is present for Next, not even an explicit nil 205 func (o *PaginatedLinks) UnsetNext() { 206 o.Next.Unset() 207 } 208 209 // GetLast returns the Last field value if set, zero value otherwise (both if not set or set to explicit null). 210 func (o *PaginatedLinks) GetLast() PaginatedLink { 211 if o == nil || IsNil(o.Last.Get()) { 212 var ret PaginatedLink 213 return ret 214 } 215 return *o.Last.Get() 216 } 217 218 // GetLastOk returns a tuple with the Last field value if set, nil otherwise 219 // and a boolean to check if the value has been set. 220 // NOTE: If the value is an explicit nil, `nil, true` will be returned 221 func (o *PaginatedLinks) GetLastOk() (*PaginatedLink, bool) { 222 if o == nil { 223 return nil, false 224 } 225 return o.Last.Get(), o.Last.IsSet() 226 } 227 228 // HasLast returns a boolean if a field has been set. 229 func (o *PaginatedLinks) HasLast() bool { 230 if o != nil && o.Last.IsSet() { 231 return true 232 } 233 234 return false 235 } 236 237 // SetLast gets a reference to the given NullablePaginatedLink and assigns it to the Last field. 238 func (o *PaginatedLinks) SetLast(v PaginatedLink) { 239 o.Last.Set(&v) 240 } 241 242 // SetLastNil sets the value for Last to be an explicit nil 243 func (o *PaginatedLinks) SetLastNil() { 244 o.Last.Set(nil) 245 } 246 247 // UnsetLast ensures that no value is present for Last, not even an explicit nil 248 func (o *PaginatedLinks) UnsetLast() { 249 o.Last.Unset() 250 } 251 252 // GetItem returns the Item field value if set, zero value otherwise. 253 func (o *PaginatedLinks) GetItem() []PaginatedLink { 254 if o == nil || IsNil(o.Item) { 255 var ret []PaginatedLink 256 return ret 257 } 258 return o.Item 259 } 260 261 // GetItemOk returns a tuple with the Item field value if set, nil otherwise 262 // and a boolean to check if the value has been set. 263 func (o *PaginatedLinks) GetItemOk() ([]PaginatedLink, bool) { 264 if o == nil || IsNil(o.Item) { 265 return nil, false 266 } 267 return o.Item, true 268 } 269 270 // HasItem returns a boolean if a field has been set. 271 func (o *PaginatedLinks) HasItem() bool { 272 if o != nil && !IsNil(o.Item) { 273 return true 274 } 275 276 return false 277 } 278 279 // SetItem gets a reference to the given []PaginatedLink and assigns it to the Item field. 280 func (o *PaginatedLinks) SetItem(v []PaginatedLink) { 281 o.Item = v 282 } 283 284 func (o PaginatedLinks) MarshalJSON() ([]byte, error) { 285 toSerialize, err := o.ToMap() 286 if err != nil { 287 return []byte{}, err 288 } 289 return json.Marshal(toSerialize) 290 } 291 292 func (o PaginatedLinks) ToMap() (map[string]interface{}, error) { 293 toSerialize := map[string]interface{}{} 294 if !IsNil(o.Self) { 295 toSerialize["self"] = o.Self 296 } 297 if o.First.IsSet() { 298 toSerialize["first"] = o.First.Get() 299 } 300 if o.Prev.IsSet() { 301 toSerialize["prev"] = o.Prev.Get() 302 } 303 if o.Next.IsSet() { 304 toSerialize["next"] = o.Next.Get() 305 } 306 if o.Last.IsSet() { 307 toSerialize["last"] = o.Last.Get() 308 } 309 if !IsNil(o.Item) { 310 toSerialize["item"] = o.Item 311 } 312 return toSerialize, nil 313 } 314 315 type NullablePaginatedLinks struct { 316 value *PaginatedLinks 317 isSet bool 318 } 319 320 func (v NullablePaginatedLinks) Get() *PaginatedLinks { 321 return v.value 322 } 323 324 func (v *NullablePaginatedLinks) Set(val *PaginatedLinks) { 325 v.value = val 326 v.isSet = true 327 } 328 329 func (v NullablePaginatedLinks) IsSet() bool { 330 return v.isSet 331 } 332 333 func (v *NullablePaginatedLinks) Unset() { 334 v.value = nil 335 v.isSet = false 336 } 337 338 func NewNullablePaginatedLinks(val *PaginatedLinks) *NullablePaginatedLinks { 339 return &NullablePaginatedLinks{value: val, isSet: true} 340 } 341 342 func (v NullablePaginatedLinks) MarshalJSON() ([]byte, error) { 343 return json.Marshal(v.value) 344 } 345 346 func (v *NullablePaginatedLinks) UnmarshalJSON(src []byte) error { 347 v.isSet = true 348 return json.Unmarshal(src, &v.value) 349 }