model_errors_response.go raw

   1  /*
   2  Intelligent DNS API
   3  
   4  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   5  
   6  API version: 1.0.0
   7  */
   8  
   9  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
  10  
  11  package idns
  12  
  13  import (
  14  	"encoding/json"
  15  )
  16  
  17  // checks if the ErrorsResponse type satisfies the MappedNullable interface at compile time
  18  var _ MappedNullable = &ErrorsResponse{}
  19  
  20  // ErrorsResponse struct for ErrorsResponse
  21  type ErrorsResponse struct {
  22  	Errors []string `json:"errors,omitempty"`
  23  }
  24  
  25  // NewErrorsResponse instantiates a new ErrorsResponse object
  26  // This constructor will assign default values to properties that have it defined,
  27  // and makes sure properties required by API are set, but the set of arguments
  28  // will change when the set of required properties is changed
  29  func NewErrorsResponse() *ErrorsResponse {
  30  	this := ErrorsResponse{}
  31  	return &this
  32  }
  33  
  34  // NewErrorsResponseWithDefaults instantiates a new ErrorsResponse object
  35  // This constructor will only assign default values to properties that have it defined,
  36  // but it doesn't guarantee that properties required by API are set
  37  func NewErrorsResponseWithDefaults() *ErrorsResponse {
  38  	this := ErrorsResponse{}
  39  	return &this
  40  }
  41  
  42  // GetErrors returns the Errors field value if set, zero value otherwise.
  43  func (o *ErrorsResponse) GetErrors() []string {
  44  	if o == nil || IsNil(o.Errors) {
  45  		var ret []string
  46  		return ret
  47  	}
  48  	return o.Errors
  49  }
  50  
  51  // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise
  52  // and a boolean to check if the value has been set.
  53  func (o *ErrorsResponse) GetErrorsOk() ([]string, bool) {
  54  	if o == nil || IsNil(o.Errors) {
  55  		return nil, false
  56  	}
  57  	return o.Errors, true
  58  }
  59  
  60  // HasErrors returns a boolean if a field has been set.
  61  func (o *ErrorsResponse) HasErrors() bool {
  62  	if o != nil && !IsNil(o.Errors) {
  63  		return true
  64  	}
  65  
  66  	return false
  67  }
  68  
  69  // SetErrors gets a reference to the given []string and assigns it to the Errors field.
  70  func (o *ErrorsResponse) SetErrors(v []string) {
  71  	o.Errors = v
  72  }
  73  
  74  func (o ErrorsResponse) MarshalJSON() ([]byte, error) {
  75  	toSerialize,err := o.ToMap()
  76  	if err != nil {
  77  		return []byte{}, err
  78  	}
  79  	return json.Marshal(toSerialize)
  80  }
  81  
  82  func (o ErrorsResponse) ToMap() (map[string]interface{}, error) {
  83  	toSerialize := map[string]interface{}{}
  84  	if !IsNil(o.Errors) {
  85  		toSerialize["errors"] = o.Errors
  86  	}
  87  	return toSerialize, nil
  88  }
  89  
  90  type NullableErrorsResponse struct {
  91  	value *ErrorsResponse
  92  	isSet bool
  93  }
  94  
  95  func (v NullableErrorsResponse) Get() *ErrorsResponse {
  96  	return v.value
  97  }
  98  
  99  func (v *NullableErrorsResponse) Set(val *ErrorsResponse) {
 100  	v.value = val
 101  	v.isSet = true
 102  }
 103  
 104  func (v NullableErrorsResponse) IsSet() bool {
 105  	return v.isSet
 106  }
 107  
 108  func (v *NullableErrorsResponse) Unset() {
 109  	v.value = nil
 110  	v.isSet = false
 111  }
 112  
 113  func NewNullableErrorsResponse(val *ErrorsResponse) *NullableErrorsResponse {
 114  	return &NullableErrorsResponse{value: val, isSet: true}
 115  }
 116  
 117  func (v NullableErrorsResponse) MarshalJSON() ([]byte, error) {
 118  	return json.Marshal(v.value)
 119  }
 120  
 121  func (v *NullableErrorsResponse) UnmarshalJSON(src []byte) error {
 122  	v.isSet = true
 123  	return json.Unmarshal(src, &v.value)
 124  }
 125  
 126  
 127