bunnyshell.com/sdk@v0.16.0/model_embedded_organization_collection.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 EmbeddedOrganizationCollection type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &EmbeddedOrganizationCollection{}
    20  
    21  // EmbeddedOrganizationCollection struct for EmbeddedOrganizationCollection
    22  type EmbeddedOrganizationCollection struct {
    23  	Item []OrganizationCollection `json:"item,omitempty"`
    24  }
    25  
    26  // NewEmbeddedOrganizationCollection instantiates a new EmbeddedOrganizationCollection object
    27  // This constructor will assign default values to properties that have it defined,
    28  // and makes sure properties required by API are set, but the set of arguments
    29  // will change when the set of required properties is changed
    30  func NewEmbeddedOrganizationCollection() *EmbeddedOrganizationCollection {
    31  	this := EmbeddedOrganizationCollection{}
    32  	return &this
    33  }
    34  
    35  // NewEmbeddedOrganizationCollectionWithDefaults instantiates a new EmbeddedOrganizationCollection object
    36  // This constructor will only assign default values to properties that have it defined,
    37  // but it doesn't guarantee that properties required by API are set
    38  func NewEmbeddedOrganizationCollectionWithDefaults() *EmbeddedOrganizationCollection {
    39  	this := EmbeddedOrganizationCollection{}
    40  	return &this
    41  }
    42  
    43  // GetItem returns the Item field value if set, zero value otherwise.
    44  func (o *EmbeddedOrganizationCollection) GetItem() []OrganizationCollection {
    45  	if o == nil || IsNil(o.Item) {
    46  		var ret []OrganizationCollection
    47  		return ret
    48  	}
    49  	return o.Item
    50  }
    51  
    52  // GetItemOk returns a tuple with the Item field value if set, nil otherwise
    53  // and a boolean to check if the value has been set.
    54  func (o *EmbeddedOrganizationCollection) GetItemOk() ([]OrganizationCollection, bool) {
    55  	if o == nil || IsNil(o.Item) {
    56  		return nil, false
    57  	}
    58  	return o.Item, true
    59  }
    60  
    61  // HasItem returns a boolean if a field has been set.
    62  func (o *EmbeddedOrganizationCollection) HasItem() bool {
    63  	if o != nil && !IsNil(o.Item) {
    64  		return true
    65  	}
    66  
    67  	return false
    68  }
    69  
    70  // SetItem gets a reference to the given []OrganizationCollection and assigns it to the Item field.
    71  func (o *EmbeddedOrganizationCollection) SetItem(v []OrganizationCollection) {
    72  	o.Item = v
    73  }
    74  
    75  func (o EmbeddedOrganizationCollection) MarshalJSON() ([]byte, error) {
    76  	toSerialize, err := o.ToMap()
    77  	if err != nil {
    78  		return []byte{}, err
    79  	}
    80  	return json.Marshal(toSerialize)
    81  }
    82  
    83  func (o EmbeddedOrganizationCollection) ToMap() (map[string]interface{}, error) {
    84  	toSerialize := map[string]interface{}{}
    85  	if !IsNil(o.Item) {
    86  		toSerialize["item"] = o.Item
    87  	}
    88  	return toSerialize, nil
    89  }
    90  
    91  type NullableEmbeddedOrganizationCollection struct {
    92  	value *EmbeddedOrganizationCollection
    93  	isSet bool
    94  }
    95  
    96  func (v NullableEmbeddedOrganizationCollection) Get() *EmbeddedOrganizationCollection {
    97  	return v.value
    98  }
    99  
   100  func (v *NullableEmbeddedOrganizationCollection) Set(val *EmbeddedOrganizationCollection) {
   101  	v.value = val
   102  	v.isSet = true
   103  }
   104  
   105  func (v NullableEmbeddedOrganizationCollection) IsSet() bool {
   106  	return v.isSet
   107  }
   108  
   109  func (v *NullableEmbeddedOrganizationCollection) Unset() {
   110  	v.value = nil
   111  	v.isSet = false
   112  }
   113  
   114  func NewNullableEmbeddedOrganizationCollection(val *EmbeddedOrganizationCollection) *NullableEmbeddedOrganizationCollection {
   115  	return &NullableEmbeddedOrganizationCollection{value: val, isSet: true}
   116  }
   117  
   118  func (v NullableEmbeddedOrganizationCollection) MarshalJSON() ([]byte, error) {
   119  	return json.Marshal(v.value)
   120  }
   121  
   122  func (v *NullableEmbeddedOrganizationCollection) UnmarshalJSON(src []byte) error {
   123  	v.isSet = true
   124  	return json.Unmarshal(src, &v.value)
   125  }