github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_data_error.go (about)

     1  /*
     2   * Cios Openapi
     3   *
     4   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     5   *
     6   * API version: 1.0.1
     7   */
     8  
     9  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    10  
    11  package cios
    12  
    13  import (
    14  	"encoding/json"
    15  )
    16  
    17  // DataError struct for DataError
    18  type DataError struct {
    19  	ErrorCode *string `json:"error_code,omitempty"`
    20  	Id *string `json:"id,omitempty"`
    21  	Message *string `json:"message,omitempty"`
    22  }
    23  
    24  // NewDataError instantiates a new DataError object
    25  // This constructor will assign default values to properties that have it defined,
    26  // and makes sure properties required by API are set, but the set of arguments
    27  // will change when the set of required properties is changed
    28  func NewDataError() *DataError {
    29  	this := DataError{}
    30  	return &this
    31  }
    32  
    33  // NewDataErrorWithDefaults instantiates a new DataError object
    34  // This constructor will only assign default values to properties that have it defined,
    35  // but it doesn't guarantee that properties required by API are set
    36  func NewDataErrorWithDefaults() *DataError {
    37  	this := DataError{}
    38  	return &this
    39  }
    40  
    41  // GetErrorCode returns the ErrorCode field value if set, zero value otherwise.
    42  func (o *DataError) GetErrorCode() string {
    43  	if o == nil || o.ErrorCode == nil {
    44  		var ret string
    45  		return ret
    46  	}
    47  	return *o.ErrorCode
    48  }
    49  
    50  // GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise
    51  // and a boolean to check if the value has been set.
    52  func (o *DataError) GetErrorCodeOk() (*string, bool) {
    53  	if o == nil || o.ErrorCode == nil {
    54  		return nil, false
    55  	}
    56  	return o.ErrorCode, true
    57  }
    58  
    59  // HasErrorCode returns a boolean if a field has been set.
    60  func (o *DataError) HasErrorCode() bool {
    61  	if o != nil && o.ErrorCode != nil {
    62  		return true
    63  	}
    64  
    65  	return false
    66  }
    67  
    68  // SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field.
    69  func (o *DataError) SetErrorCode(v string) {
    70  	o.ErrorCode = &v
    71  }
    72  
    73  // GetId returns the Id field value if set, zero value otherwise.
    74  func (o *DataError) GetId() string {
    75  	if o == nil || o.Id == nil {
    76  		var ret string
    77  		return ret
    78  	}
    79  	return *o.Id
    80  }
    81  
    82  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    83  // and a boolean to check if the value has been set.
    84  func (o *DataError) GetIdOk() (*string, bool) {
    85  	if o == nil || o.Id == nil {
    86  		return nil, false
    87  	}
    88  	return o.Id, true
    89  }
    90  
    91  // HasId returns a boolean if a field has been set.
    92  func (o *DataError) HasId() bool {
    93  	if o != nil && o.Id != nil {
    94  		return true
    95  	}
    96  
    97  	return false
    98  }
    99  
   100  // SetId gets a reference to the given string and assigns it to the Id field.
   101  func (o *DataError) SetId(v string) {
   102  	o.Id = &v
   103  }
   104  
   105  // GetMessage returns the Message field value if set, zero value otherwise.
   106  func (o *DataError) GetMessage() string {
   107  	if o == nil || o.Message == nil {
   108  		var ret string
   109  		return ret
   110  	}
   111  	return *o.Message
   112  }
   113  
   114  // GetMessageOk returns a tuple with the Message field value if set, nil otherwise
   115  // and a boolean to check if the value has been set.
   116  func (o *DataError) GetMessageOk() (*string, bool) {
   117  	if o == nil || o.Message == nil {
   118  		return nil, false
   119  	}
   120  	return o.Message, true
   121  }
   122  
   123  // HasMessage returns a boolean if a field has been set.
   124  func (o *DataError) HasMessage() bool {
   125  	if o != nil && o.Message != nil {
   126  		return true
   127  	}
   128  
   129  	return false
   130  }
   131  
   132  // SetMessage gets a reference to the given string and assigns it to the Message field.
   133  func (o *DataError) SetMessage(v string) {
   134  	o.Message = &v
   135  }
   136  
   137  func (o DataError) MarshalJSON() ([]byte, error) {
   138  	toSerialize := map[string]interface{}{}
   139  	if o.ErrorCode != nil {
   140  		toSerialize["error_code"] = o.ErrorCode
   141  	}
   142  	if o.Id != nil {
   143  		toSerialize["id"] = o.Id
   144  	}
   145  	if o.Message != nil {
   146  		toSerialize["message"] = o.Message
   147  	}
   148  	return json.Marshal(toSerialize)
   149  }
   150  
   151  type NullableDataError struct {
   152  	value *DataError
   153  	isSet bool
   154  }
   155  
   156  func (v NullableDataError) Get() *DataError {
   157  	return v.value
   158  }
   159  
   160  func (v *NullableDataError) Set(val *DataError) {
   161  	v.value = val
   162  	v.isSet = true
   163  }
   164  
   165  func (v NullableDataError) IsSet() bool {
   166  	return v.isSet
   167  }
   168  
   169  func (v *NullableDataError) Unset() {
   170  	v.value = nil
   171  	v.isSet = false
   172  }
   173  
   174  func NewNullableDataError(val *DataError) *NullableDataError {
   175  	return &NullableDataError{value: val, isSet: true}
   176  }
   177  
   178  func (v NullableDataError) MarshalJSON() ([]byte, error) {
   179  	return json.Marshal(v.value)
   180  }
   181  
   182  func (v *NullableDataError) UnmarshalJSON(src []byte) error {
   183  	v.isSet = true
   184  	return json.Unmarshal(src, &v.value)
   185  }
   186  
   187