bunnyshell.com/sdk@v0.16.0/model_from_git.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 FromGit type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &FromGit{} 20 21 // FromGit struct for FromGit 22 type FromGit struct { 23 Type *string `json:"type,omitempty"` 24 Url *string `json:"url,omitempty"` 25 Branch *string `json:"branch,omitempty"` 26 YamlPath *string `json:"yamlPath,omitempty"` 27 } 28 29 // NewFromGit instantiates a new FromGit object 30 // This constructor will assign default values to properties that have it defined, 31 // and makes sure properties required by API are set, but the set of arguments 32 // will change when the set of required properties is changed 33 func NewFromGit() *FromGit { 34 this := FromGit{} 35 var type_ string = "git" 36 this.Type = &type_ 37 return &this 38 } 39 40 // NewFromGitWithDefaults instantiates a new FromGit object 41 // This constructor will only assign default values to properties that have it defined, 42 // but it doesn't guarantee that properties required by API are set 43 func NewFromGitWithDefaults() *FromGit { 44 this := FromGit{} 45 var type_ string = "git" 46 this.Type = &type_ 47 return &this 48 } 49 50 // GetType returns the Type field value if set, zero value otherwise. 51 func (o *FromGit) GetType() string { 52 if o == nil || IsNil(o.Type) { 53 var ret string 54 return ret 55 } 56 return *o.Type 57 } 58 59 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 60 // and a boolean to check if the value has been set. 61 func (o *FromGit) GetTypeOk() (*string, bool) { 62 if o == nil || IsNil(o.Type) { 63 return nil, false 64 } 65 return o.Type, true 66 } 67 68 // HasType returns a boolean if a field has been set. 69 func (o *FromGit) HasType() bool { 70 if o != nil && !IsNil(o.Type) { 71 return true 72 } 73 74 return false 75 } 76 77 // SetType gets a reference to the given string and assigns it to the Type field. 78 func (o *FromGit) SetType(v string) { 79 o.Type = &v 80 } 81 82 // GetUrl returns the Url field value if set, zero value otherwise. 83 func (o *FromGit) GetUrl() string { 84 if o == nil || IsNil(o.Url) { 85 var ret string 86 return ret 87 } 88 return *o.Url 89 } 90 91 // GetUrlOk returns a tuple with the Url field value if set, nil otherwise 92 // and a boolean to check if the value has been set. 93 func (o *FromGit) GetUrlOk() (*string, bool) { 94 if o == nil || IsNil(o.Url) { 95 return nil, false 96 } 97 return o.Url, true 98 } 99 100 // HasUrl returns a boolean if a field has been set. 101 func (o *FromGit) HasUrl() bool { 102 if o != nil && !IsNil(o.Url) { 103 return true 104 } 105 106 return false 107 } 108 109 // SetUrl gets a reference to the given string and assigns it to the Url field. 110 func (o *FromGit) SetUrl(v string) { 111 o.Url = &v 112 } 113 114 // GetBranch returns the Branch field value if set, zero value otherwise. 115 func (o *FromGit) GetBranch() string { 116 if o == nil || IsNil(o.Branch) { 117 var ret string 118 return ret 119 } 120 return *o.Branch 121 } 122 123 // GetBranchOk returns a tuple with the Branch field value if set, nil otherwise 124 // and a boolean to check if the value has been set. 125 func (o *FromGit) GetBranchOk() (*string, bool) { 126 if o == nil || IsNil(o.Branch) { 127 return nil, false 128 } 129 return o.Branch, true 130 } 131 132 // HasBranch returns a boolean if a field has been set. 133 func (o *FromGit) HasBranch() bool { 134 if o != nil && !IsNil(o.Branch) { 135 return true 136 } 137 138 return false 139 } 140 141 // SetBranch gets a reference to the given string and assigns it to the Branch field. 142 func (o *FromGit) SetBranch(v string) { 143 o.Branch = &v 144 } 145 146 // GetYamlPath returns the YamlPath field value if set, zero value otherwise. 147 func (o *FromGit) GetYamlPath() string { 148 if o == nil || IsNil(o.YamlPath) { 149 var ret string 150 return ret 151 } 152 return *o.YamlPath 153 } 154 155 // GetYamlPathOk returns a tuple with the YamlPath field value if set, nil otherwise 156 // and a boolean to check if the value has been set. 157 func (o *FromGit) GetYamlPathOk() (*string, bool) { 158 if o == nil || IsNil(o.YamlPath) { 159 return nil, false 160 } 161 return o.YamlPath, true 162 } 163 164 // HasYamlPath returns a boolean if a field has been set. 165 func (o *FromGit) HasYamlPath() bool { 166 if o != nil && !IsNil(o.YamlPath) { 167 return true 168 } 169 170 return false 171 } 172 173 // SetYamlPath gets a reference to the given string and assigns it to the YamlPath field. 174 func (o *FromGit) SetYamlPath(v string) { 175 o.YamlPath = &v 176 } 177 178 func (o FromGit) MarshalJSON() ([]byte, error) { 179 toSerialize, err := o.ToMap() 180 if err != nil { 181 return []byte{}, err 182 } 183 return json.Marshal(toSerialize) 184 } 185 186 func (o FromGit) ToMap() (map[string]interface{}, error) { 187 toSerialize := map[string]interface{}{} 188 if !IsNil(o.Type) { 189 toSerialize["type"] = o.Type 190 } 191 if !IsNil(o.Url) { 192 toSerialize["url"] = o.Url 193 } 194 if !IsNil(o.Branch) { 195 toSerialize["branch"] = o.Branch 196 } 197 if !IsNil(o.YamlPath) { 198 toSerialize["yamlPath"] = o.YamlPath 199 } 200 return toSerialize, nil 201 } 202 203 type NullableFromGit struct { 204 value *FromGit 205 isSet bool 206 } 207 208 func (v NullableFromGit) Get() *FromGit { 209 return v.value 210 } 211 212 func (v *NullableFromGit) Set(val *FromGit) { 213 v.value = val 214 v.isSet = true 215 } 216 217 func (v NullableFromGit) IsSet() bool { 218 return v.isSet 219 } 220 221 func (v *NullableFromGit) Unset() { 222 v.value = nil 223 v.isSet = false 224 } 225 226 func NewNullableFromGit(val *FromGit) *NullableFromGit { 227 return &NullableFromGit{value: val, isSet: true} 228 } 229 230 func (v NullableFromGit) MarshalJSON() ([]byte, error) { 231 return json.Marshal(v.value) 232 } 233 234 func (v *NullableFromGit) UnmarshalJSON(src []byte) error { 235 v.isSet = true 236 return json.Unmarshal(src, &v.value) 237 }