Files
sdk/model_git_run_start.go

193 lines
4.6 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the GitRunStart type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitRunStart{}
// GitRunStart struct for GitRunStart
type GitRunStart struct {
// Ref is the branch to run; empty means the repository's default.
Ref *string `json:"ref,omitempty"`
// Repo is the repository to run.
Repo *string `json:"repo,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitRunStart GitRunStart
// NewGitRunStart instantiates a new GitRunStart object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewGitRunStart() *GitRunStart {
this := GitRunStart{}
return &this
}
// NewGitRunStartWithDefaults instantiates a new GitRunStart object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewGitRunStartWithDefaults() *GitRunStart {
this := GitRunStart{}
return &this
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *GitRunStart) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitRunStart) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *GitRunStart) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *GitRunStart) SetRef(v string) {
o.Ref = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *GitRunStart) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitRunStart) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *GitRunStart) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *GitRunStart) SetRepo(v string) {
o.Repo = &v
}
func (o GitRunStart) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitRunStart) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitRunStart) UnmarshalJSON(data []byte) (err error) {
varGitRunStart := _GitRunStart{}
err = json.Unmarshal(data, &varGitRunStart)
if err != nil {
return err
}
*o = GitRunStart(varGitRunStart)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ref")
delete(additionalProperties, "repo")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitRunStart struct {
value *GitRunStart
isSet bool
}
func (v NullableGitRunStart) Get() *GitRunStart {
return v.value
}
func (v *NullableGitRunStart) Set(val *GitRunStart) {
v.value = val
v.isSet = true
}
func (v NullableGitRunStart) IsSet() bool {
return v.isSet
}
func (v *NullableGitRunStart) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitRunStart(val *GitRunStart) *NullableGitRunStart {
return &NullableGitRunStart{value: val, isSet: true}
}
func (v NullableGitRunStart) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitRunStart) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}