github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_label.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 // Label struct for Label 18 type Label struct { 19 Key string `json:"key"` 20 Value string `json:"value"` 21 } 22 23 // NewLabel instantiates a new Label 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 NewLabel(key string, value string, ) *Label { 28 this := Label{} 29 this.Key = key 30 this.Value = value 31 return &this 32 } 33 34 // NewLabelWithDefaults instantiates a new Label 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 NewLabelWithDefaults() *Label { 38 this := Label{} 39 return &this 40 } 41 42 // GetKey returns the Key field value 43 func (o *Label) GetKey() string { 44 if o == nil { 45 var ret string 46 return ret 47 } 48 49 return o.Key 50 } 51 52 // GetKeyOk returns a tuple with the Key field value 53 // and a boolean to check if the value has been set. 54 func (o *Label) GetKeyOk() (*string, bool) { 55 if o == nil { 56 return nil, false 57 } 58 return &o.Key, true 59 } 60 61 // SetKey sets field value 62 func (o *Label) SetKey(v string) { 63 o.Key = v 64 } 65 66 // GetValue returns the Value field value 67 func (o *Label) GetValue() string { 68 if o == nil { 69 var ret string 70 return ret 71 } 72 73 return o.Value 74 } 75 76 // GetValueOk returns a tuple with the Value field value 77 // and a boolean to check if the value has been set. 78 func (o *Label) GetValueOk() (*string, bool) { 79 if o == nil { 80 return nil, false 81 } 82 return &o.Value, true 83 } 84 85 // SetValue sets field value 86 func (o *Label) SetValue(v string) { 87 o.Value = v 88 } 89 90 func (o Label) MarshalJSON() ([]byte, error) { 91 toSerialize := map[string]interface{}{} 92 if true { 93 toSerialize["key"] = o.Key 94 } 95 if true { 96 toSerialize["value"] = o.Value 97 } 98 return json.Marshal(toSerialize) 99 } 100 101 type NullableLabel struct { 102 value *Label 103 isSet bool 104 } 105 106 func (v NullableLabel) Get() *Label { 107 return v.value 108 } 109 110 func (v *NullableLabel) Set(val *Label) { 111 v.value = val 112 v.isSet = true 113 } 114 115 func (v NullableLabel) IsSet() bool { 116 return v.isSet 117 } 118 119 func (v *NullableLabel) Unset() { 120 v.value = nil 121 v.isSet = false 122 } 123 124 func NewNullableLabel(val *Label) *NullableLabel { 125 return &NullableLabel{value: val, isSet: true} 126 } 127 128 func (v NullableLabel) MarshalJSON() ([]byte, error) { 129 return json.Marshal(v.value) 130 } 131 132 func (v *NullableLabel) UnmarshalJSON(src []byte) error { 133 v.isSet = true 134 return json.Unmarshal(src, &v.value) 135 } 136 137