github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_packer_format_json.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  // PackerFormatJson struct for PackerFormatJson
    18  type PackerFormatJson struct {
    19  	Header PackerFormatJsonHeader `json:"header"`
    20  	Payload interface{} `json:"payload"`
    21  }
    22  
    23  // NewPackerFormatJson instantiates a new PackerFormatJson object
    24  // This constructor will assign default values to properties that have it defined,
    25  // and makes sure properties required by API are set, but the set of arguments
    26  // will change when the set of required properties is changed
    27  func NewPackerFormatJson(header PackerFormatJsonHeader, payload interface{}, ) *PackerFormatJson {
    28  	this := PackerFormatJson{}
    29  	this.Header = header
    30  	this.Payload = payload
    31  	return &this
    32  }
    33  
    34  // NewPackerFormatJsonWithDefaults instantiates a new PackerFormatJson 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 NewPackerFormatJsonWithDefaults() *PackerFormatJson {
    38  	this := PackerFormatJson{}
    39  	return &this
    40  }
    41  
    42  // GetHeader returns the Header field value
    43  func (o *PackerFormatJson) GetHeader() PackerFormatJsonHeader {
    44  	if o == nil  {
    45  		var ret PackerFormatJsonHeader
    46  		return ret
    47  	}
    48  
    49  	return o.Header
    50  }
    51  
    52  // GetHeaderOk returns a tuple with the Header field value
    53  // and a boolean to check if the value has been set.
    54  func (o *PackerFormatJson) GetHeaderOk() (*PackerFormatJsonHeader, bool) {
    55  	if o == nil  {
    56  		return nil, false
    57  	}
    58  	return &o.Header, true
    59  }
    60  
    61  // SetHeader sets field value
    62  func (o *PackerFormatJson) SetHeader(v PackerFormatJsonHeader) {
    63  	o.Header = v
    64  }
    65  
    66  // GetPayload returns the Payload field value
    67  // If the value is explicit nil, the zero value for interface{} will be returned
    68  func (o *PackerFormatJson) GetPayload() interface{} {
    69  	if o == nil  {
    70  		var ret interface{}
    71  		return ret
    72  	}
    73  
    74  	return o.Payload
    75  }
    76  
    77  // GetPayloadOk returns a tuple with the Payload field value
    78  // and a boolean to check if the value has been set.
    79  // NOTE: If the value is an explicit nil, `nil, true` will be returned
    80  func (o *PackerFormatJson) GetPayloadOk() (*interface{}, bool) {
    81  	if o == nil || o.Payload == nil {
    82  		return nil, false
    83  	}
    84  	return &o.Payload, true
    85  }
    86  
    87  // SetPayload sets field value
    88  func (o *PackerFormatJson) SetPayload(v interface{}) {
    89  	o.Payload = v
    90  }
    91  
    92  func (o PackerFormatJson) MarshalJSON() ([]byte, error) {
    93  	toSerialize := map[string]interface{}{}
    94  	if true {
    95  		toSerialize["header"] = o.Header
    96  	}
    97  	if o.Payload != nil {
    98  		toSerialize["payload"] = o.Payload
    99  	}
   100  	return json.Marshal(toSerialize)
   101  }
   102  
   103  type NullablePackerFormatJson struct {
   104  	value *PackerFormatJson
   105  	isSet bool
   106  }
   107  
   108  func (v NullablePackerFormatJson) Get() *PackerFormatJson {
   109  	return v.value
   110  }
   111  
   112  func (v *NullablePackerFormatJson) Set(val *PackerFormatJson) {
   113  	v.value = val
   114  	v.isSet = true
   115  }
   116  
   117  func (v NullablePackerFormatJson) IsSet() bool {
   118  	return v.isSet
   119  }
   120  
   121  func (v *NullablePackerFormatJson) Unset() {
   122  	v.value = nil
   123  	v.isSet = false
   124  }
   125  
   126  func NewNullablePackerFormatJson(val *PackerFormatJson) *NullablePackerFormatJson {
   127  	return &NullablePackerFormatJson{value: val, isSet: true}
   128  }
   129  
   130  func (v NullablePackerFormatJson) MarshalJSON() ([]byte, error) {
   131  	return json.Marshal(v.value)
   132  }
   133  
   134  func (v *NullablePackerFormatJson) UnmarshalJSON(src []byte) error {
   135  	v.isSet = true
   136  	return json.Unmarshal(src, &v.value)
   137  }
   138  
   139