bunnyshell.com/sdk@v0.16.0/model_component_endpoint_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 ComponentEndpointCollection type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ComponentEndpointCollection{}
    20  
    21  // ComponentEndpointCollection Endpoint
    22  type ComponentEndpointCollection struct {
    23  	// Service component identifier
    24  	Id *string `json:"id,omitempty"`
    25  	// Service component name
    26  	Name *string `json:"name,omitempty"`
    27  	// Service component URLs
    28  	Endpoints []string `json:"endpoints,omitempty"`
    29  	// Environment identifier.
    30  	Environment *string `json:"environment,omitempty"`
    31  }
    32  
    33  // NewComponentEndpointCollection instantiates a new ComponentEndpointCollection object
    34  // This constructor will assign default values to properties that have it defined,
    35  // and makes sure properties required by API are set, but the set of arguments
    36  // will change when the set of required properties is changed
    37  func NewComponentEndpointCollection() *ComponentEndpointCollection {
    38  	this := ComponentEndpointCollection{}
    39  	return &this
    40  }
    41  
    42  // NewComponentEndpointCollectionWithDefaults instantiates a new ComponentEndpointCollection object
    43  // This constructor will only assign default values to properties that have it defined,
    44  // but it doesn't guarantee that properties required by API are set
    45  func NewComponentEndpointCollectionWithDefaults() *ComponentEndpointCollection {
    46  	this := ComponentEndpointCollection{}
    47  	return &this
    48  }
    49  
    50  // GetId returns the Id field value if set, zero value otherwise.
    51  func (o *ComponentEndpointCollection) GetId() string {
    52  	if o == nil || IsNil(o.Id) {
    53  		var ret string
    54  		return ret
    55  	}
    56  	return *o.Id
    57  }
    58  
    59  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    60  // and a boolean to check if the value has been set.
    61  func (o *ComponentEndpointCollection) GetIdOk() (*string, bool) {
    62  	if o == nil || IsNil(o.Id) {
    63  		return nil, false
    64  	}
    65  	return o.Id, true
    66  }
    67  
    68  // HasId returns a boolean if a field has been set.
    69  func (o *ComponentEndpointCollection) HasId() bool {
    70  	if o != nil && !IsNil(o.Id) {
    71  		return true
    72  	}
    73  
    74  	return false
    75  }
    76  
    77  // SetId gets a reference to the given string and assigns it to the Id field.
    78  func (o *ComponentEndpointCollection) SetId(v string) {
    79  	o.Id = &v
    80  }
    81  
    82  // GetName returns the Name field value if set, zero value otherwise.
    83  func (o *ComponentEndpointCollection) GetName() string {
    84  	if o == nil || IsNil(o.Name) {
    85  		var ret string
    86  		return ret
    87  	}
    88  	return *o.Name
    89  }
    90  
    91  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
    92  // and a boolean to check if the value has been set.
    93  func (o *ComponentEndpointCollection) GetNameOk() (*string, bool) {
    94  	if o == nil || IsNil(o.Name) {
    95  		return nil, false
    96  	}
    97  	return o.Name, true
    98  }
    99  
   100  // HasName returns a boolean if a field has been set.
   101  func (o *ComponentEndpointCollection) HasName() bool {
   102  	if o != nil && !IsNil(o.Name) {
   103  		return true
   104  	}
   105  
   106  	return false
   107  }
   108  
   109  // SetName gets a reference to the given string and assigns it to the Name field.
   110  func (o *ComponentEndpointCollection) SetName(v string) {
   111  	o.Name = &v
   112  }
   113  
   114  // GetEndpoints returns the Endpoints field value if set, zero value otherwise.
   115  func (o *ComponentEndpointCollection) GetEndpoints() []string {
   116  	if o == nil || IsNil(o.Endpoints) {
   117  		var ret []string
   118  		return ret
   119  	}
   120  	return o.Endpoints
   121  }
   122  
   123  // GetEndpointsOk returns a tuple with the Endpoints field value if set, nil otherwise
   124  // and a boolean to check if the value has been set.
   125  func (o *ComponentEndpointCollection) GetEndpointsOk() ([]string, bool) {
   126  	if o == nil || IsNil(o.Endpoints) {
   127  		return nil, false
   128  	}
   129  	return o.Endpoints, true
   130  }
   131  
   132  // HasEndpoints returns a boolean if a field has been set.
   133  func (o *ComponentEndpointCollection) HasEndpoints() bool {
   134  	if o != nil && !IsNil(o.Endpoints) {
   135  		return true
   136  	}
   137  
   138  	return false
   139  }
   140  
   141  // SetEndpoints gets a reference to the given []string and assigns it to the Endpoints field.
   142  func (o *ComponentEndpointCollection) SetEndpoints(v []string) {
   143  	o.Endpoints = v
   144  }
   145  
   146  // GetEnvironment returns the Environment field value if set, zero value otherwise.
   147  func (o *ComponentEndpointCollection) GetEnvironment() string {
   148  	if o == nil || IsNil(o.Environment) {
   149  		var ret string
   150  		return ret
   151  	}
   152  	return *o.Environment
   153  }
   154  
   155  // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise
   156  // and a boolean to check if the value has been set.
   157  func (o *ComponentEndpointCollection) GetEnvironmentOk() (*string, bool) {
   158  	if o == nil || IsNil(o.Environment) {
   159  		return nil, false
   160  	}
   161  	return o.Environment, true
   162  }
   163  
   164  // HasEnvironment returns a boolean if a field has been set.
   165  func (o *ComponentEndpointCollection) HasEnvironment() bool {
   166  	if o != nil && !IsNil(o.Environment) {
   167  		return true
   168  	}
   169  
   170  	return false
   171  }
   172  
   173  // SetEnvironment gets a reference to the given string and assigns it to the Environment field.
   174  func (o *ComponentEndpointCollection) SetEnvironment(v string) {
   175  	o.Environment = &v
   176  }
   177  
   178  func (o ComponentEndpointCollection) MarshalJSON() ([]byte, error) {
   179  	toSerialize, err := o.ToMap()
   180  	if err != nil {
   181  		return []byte{}, err
   182  	}
   183  	return json.Marshal(toSerialize)
   184  }
   185  
   186  func (o ComponentEndpointCollection) ToMap() (map[string]interface{}, error) {
   187  	toSerialize := map[string]interface{}{}
   188  	if !IsNil(o.Id) {
   189  		toSerialize["id"] = o.Id
   190  	}
   191  	if !IsNil(o.Name) {
   192  		toSerialize["name"] = o.Name
   193  	}
   194  	if !IsNil(o.Endpoints) {
   195  		toSerialize["endpoints"] = o.Endpoints
   196  	}
   197  	if !IsNil(o.Environment) {
   198  		toSerialize["environment"] = o.Environment
   199  	}
   200  	return toSerialize, nil
   201  }
   202  
   203  type NullableComponentEndpointCollection struct {
   204  	value *ComponentEndpointCollection
   205  	isSet bool
   206  }
   207  
   208  func (v NullableComponentEndpointCollection) Get() *ComponentEndpointCollection {
   209  	return v.value
   210  }
   211  
   212  func (v *NullableComponentEndpointCollection) Set(val *ComponentEndpointCollection) {
   213  	v.value = val
   214  	v.isSet = true
   215  }
   216  
   217  func (v NullableComponentEndpointCollection) IsSet() bool {
   218  	return v.isSet
   219  }
   220  
   221  func (v *NullableComponentEndpointCollection) Unset() {
   222  	v.value = nil
   223  	v.isSet = false
   224  }
   225  
   226  func NewNullableComponentEndpointCollection(val *ComponentEndpointCollection) *NullableComponentEndpointCollection {
   227  	return &NullableComponentEndpointCollection{value: val, isSet: true}
   228  }
   229  
   230  func (v NullableComponentEndpointCollection) MarshalJSON() ([]byte, error) {
   231  	return json.Marshal(v.value)
   232  }
   233  
   234  func (v *NullableComponentEndpointCollection) UnmarshalJSON(src []byte) error {
   235  	v.isSet = true
   236  	return json.Unmarshal(src, &v.value)
   237  }