Files
sdk/model_provider_github_branch.go

231 lines
6.2 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 ProviderGithubBranch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubBranch{}
// ProviderGithubBranch struct for ProviderGithubBranch
type ProviderGithubBranch struct {
// Commit is the sha the branch points at.
Commit *string `json:"commit,omitempty"`
// Default is whether it is the repository's default branch, which always leads the first page when it matches.
Default *bool `json:"default,omitempty"`
// Name is the branch's short name (\"main\", \"feat/login\").
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubBranch ProviderGithubBranch
// NewProviderGithubBranch instantiates a new ProviderGithubBranch 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 NewProviderGithubBranch() *ProviderGithubBranch {
this := ProviderGithubBranch{}
return &this
}
// NewProviderGithubBranchWithDefaults instantiates a new ProviderGithubBranch 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 NewProviderGithubBranchWithDefaults() *ProviderGithubBranch {
this := ProviderGithubBranch{}
return &this
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *ProviderGithubBranch) GetCommit() string {
if o == nil || IsNil(o.Commit) {
var ret string
return ret
}
return *o.Commit
}
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubBranch) GetCommitOk() (*string, bool) {
if o == nil || IsNil(o.Commit) {
return nil, false
}
return o.Commit, true
}
// HasCommit returns a boolean if a field has been set.
func (o *ProviderGithubBranch) HasCommit() bool {
if o != nil && !IsNil(o.Commit) {
return true
}
return false
}
// SetCommit gets a reference to the given string and assigns it to the Commit field.
func (o *ProviderGithubBranch) SetCommit(v string) {
o.Commit = &v
}
// GetDefault returns the Default field value if set, zero value otherwise.
func (o *ProviderGithubBranch) GetDefault() bool {
if o == nil || IsNil(o.Default) {
var ret bool
return ret
}
return *o.Default
}
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubBranch) GetDefaultOk() (*bool, bool) {
if o == nil || IsNil(o.Default) {
return nil, false
}
return o.Default, true
}
// HasDefault returns a boolean if a field has been set.
func (o *ProviderGithubBranch) HasDefault() bool {
if o != nil && !IsNil(o.Default) {
return true
}
return false
}
// SetDefault gets a reference to the given bool and assigns it to the Default field.
func (o *ProviderGithubBranch) SetDefault(v bool) {
o.Default = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ProviderGithubBranch) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubBranch) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ProviderGithubBranch) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ProviderGithubBranch) SetName(v string) {
o.Name = &v
}
func (o ProviderGithubBranch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubBranch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.Default) {
toSerialize["default"] = o.Default
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubBranch) UnmarshalJSON(data []byte) (err error) {
varProviderGithubBranch := _ProviderGithubBranch{}
err = json.Unmarshal(data, &varProviderGithubBranch)
if err != nil {
return err
}
*o = ProviderGithubBranch(varProviderGithubBranch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commit")
delete(additionalProperties, "default")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubBranch struct {
value *ProviderGithubBranch
isSet bool
}
func (v NullableProviderGithubBranch) Get() *ProviderGithubBranch {
return v.value
}
func (v *NullableProviderGithubBranch) Set(val *ProviderGithubBranch) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubBranch) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubBranch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubBranch(val *ProviderGithubBranch) *NullableProviderGithubBranch {
return &NullableProviderGithubBranch{value: val, isSet: true}
}
func (v NullableProviderGithubBranch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubBranch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}