bunnyshell.com/sdk@v0.16.0/model_from_git_spec.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 FromGitSpec type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &FromGitSpec{} 20 21 // FromGitSpec struct for FromGitSpec 22 type FromGitSpec struct { 23 Type *string `json:"type,omitempty"` 24 Spec *string `json:"spec,omitempty"` 25 } 26 27 // NewFromGitSpec instantiates a new FromGitSpec object 28 // This constructor will assign default values to properties that have it defined, 29 // and makes sure properties required by API are set, but the set of arguments 30 // will change when the set of required properties is changed 31 func NewFromGitSpec() *FromGitSpec { 32 this := FromGitSpec{} 33 var type_ string = "git-spec" 34 this.Type = &type_ 35 return &this 36 } 37 38 // NewFromGitSpecWithDefaults instantiates a new FromGitSpec object 39 // This constructor will only assign default values to properties that have it defined, 40 // but it doesn't guarantee that properties required by API are set 41 func NewFromGitSpecWithDefaults() *FromGitSpec { 42 this := FromGitSpec{} 43 var type_ string = "git-spec" 44 this.Type = &type_ 45 return &this 46 } 47 48 // GetType returns the Type field value if set, zero value otherwise. 49 func (o *FromGitSpec) GetType() string { 50 if o == nil || IsNil(o.Type) { 51 var ret string 52 return ret 53 } 54 return *o.Type 55 } 56 57 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 58 // and a boolean to check if the value has been set. 59 func (o *FromGitSpec) GetTypeOk() (*string, bool) { 60 if o == nil || IsNil(o.Type) { 61 return nil, false 62 } 63 return o.Type, true 64 } 65 66 // HasType returns a boolean if a field has been set. 67 func (o *FromGitSpec) HasType() bool { 68 if o != nil && !IsNil(o.Type) { 69 return true 70 } 71 72 return false 73 } 74 75 // SetType gets a reference to the given string and assigns it to the Type field. 76 func (o *FromGitSpec) SetType(v string) { 77 o.Type = &v 78 } 79 80 // GetSpec returns the Spec field value if set, zero value otherwise. 81 func (o *FromGitSpec) GetSpec() string { 82 if o == nil || IsNil(o.Spec) { 83 var ret string 84 return ret 85 } 86 return *o.Spec 87 } 88 89 // GetSpecOk returns a tuple with the Spec field value if set, nil otherwise 90 // and a boolean to check if the value has been set. 91 func (o *FromGitSpec) GetSpecOk() (*string, bool) { 92 if o == nil || IsNil(o.Spec) { 93 return nil, false 94 } 95 return o.Spec, true 96 } 97 98 // HasSpec returns a boolean if a field has been set. 99 func (o *FromGitSpec) HasSpec() bool { 100 if o != nil && !IsNil(o.Spec) { 101 return true 102 } 103 104 return false 105 } 106 107 // SetSpec gets a reference to the given string and assigns it to the Spec field. 108 func (o *FromGitSpec) SetSpec(v string) { 109 o.Spec = &v 110 } 111 112 func (o FromGitSpec) MarshalJSON() ([]byte, error) { 113 toSerialize, err := o.ToMap() 114 if err != nil { 115 return []byte{}, err 116 } 117 return json.Marshal(toSerialize) 118 } 119 120 func (o FromGitSpec) ToMap() (map[string]interface{}, error) { 121 toSerialize := map[string]interface{}{} 122 if !IsNil(o.Type) { 123 toSerialize["type"] = o.Type 124 } 125 if !IsNil(o.Spec) { 126 toSerialize["spec"] = o.Spec 127 } 128 return toSerialize, nil 129 } 130 131 type NullableFromGitSpec struct { 132 value *FromGitSpec 133 isSet bool 134 } 135 136 func (v NullableFromGitSpec) Get() *FromGitSpec { 137 return v.value 138 } 139 140 func (v *NullableFromGitSpec) Set(val *FromGitSpec) { 141 v.value = val 142 v.isSet = true 143 } 144 145 func (v NullableFromGitSpec) IsSet() bool { 146 return v.isSet 147 } 148 149 func (v *NullableFromGitSpec) Unset() { 150 v.value = nil 151 v.isSet = false 152 } 153 154 func NewNullableFromGitSpec(val *FromGitSpec) *NullableFromGitSpec { 155 return &NullableFromGitSpec{value: val, isSet: true} 156 } 157 158 func (v NullableFromGitSpec) MarshalJSON() ([]byte, error) { 159 return json.Marshal(v.value) 160 } 161 162 func (v *NullableFromGitSpec) UnmarshalJSON(src []byte) error { 163 v.isSet = true 164 return json.Unmarshal(src, &v.value) 165 }