mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.8 KiB
Go
231 lines
5.8 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 GitRefsJSON type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitRefsJSON{}
|
|
|
|
// GitRefsJSON struct for GitRefsJSON
|
|
type GitRefsJSON struct {
|
|
// Branches are the repo's heads; empty on a repo with no commits.
|
|
Branches []GitRefJSON `json:"branches,omitempty"`
|
|
// Default is the branch name a caller gets when it asks for no ref.
|
|
Default *string `json:"default,omitempty"`
|
|
// Tags are the repo's tags; empty when there are none.
|
|
Tags []GitRefJSON `json:"tags,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitRefsJSON GitRefsJSON
|
|
|
|
// NewGitRefsJSON instantiates a new GitRefsJSON 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 NewGitRefsJSON() *GitRefsJSON {
|
|
this := GitRefsJSON{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitRefsJSONWithDefaults instantiates a new GitRefsJSON 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 NewGitRefsJSONWithDefaults() *GitRefsJSON {
|
|
this := GitRefsJSON{}
|
|
return &this
|
|
}
|
|
|
|
// GetBranches returns the Branches field value if set, zero value otherwise.
|
|
func (o *GitRefsJSON) GetBranches() []GitRefJSON {
|
|
if o == nil || IsNil(o.Branches) {
|
|
var ret []GitRefJSON
|
|
return ret
|
|
}
|
|
return o.Branches
|
|
}
|
|
|
|
// GetBranchesOk returns a tuple with the Branches field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitRefsJSON) GetBranchesOk() ([]GitRefJSON, bool) {
|
|
if o == nil || IsNil(o.Branches) {
|
|
return nil, false
|
|
}
|
|
return o.Branches, true
|
|
}
|
|
|
|
// HasBranches returns a boolean if a field has been set.
|
|
func (o *GitRefsJSON) HasBranches() bool {
|
|
if o != nil && !IsNil(o.Branches) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBranches gets a reference to the given []GitRefJSON and assigns it to the Branches field.
|
|
func (o *GitRefsJSON) SetBranches(v []GitRefJSON) {
|
|
o.Branches = v
|
|
}
|
|
|
|
// GetDefault returns the Default field value if set, zero value otherwise.
|
|
func (o *GitRefsJSON) GetDefault() string {
|
|
if o == nil || IsNil(o.Default) {
|
|
var ret string
|
|
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 *GitRefsJSON) GetDefaultOk() (*string, 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 *GitRefsJSON) HasDefault() bool {
|
|
if o != nil && !IsNil(o.Default) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDefault gets a reference to the given string and assigns it to the Default field.
|
|
func (o *GitRefsJSON) SetDefault(v string) {
|
|
o.Default = &v
|
|
}
|
|
|
|
// GetTags returns the Tags field value if set, zero value otherwise.
|
|
func (o *GitRefsJSON) GetTags() []GitRefJSON {
|
|
if o == nil || IsNil(o.Tags) {
|
|
var ret []GitRefJSON
|
|
return ret
|
|
}
|
|
return o.Tags
|
|
}
|
|
|
|
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitRefsJSON) GetTagsOk() ([]GitRefJSON, bool) {
|
|
if o == nil || IsNil(o.Tags) {
|
|
return nil, false
|
|
}
|
|
return o.Tags, true
|
|
}
|
|
|
|
// HasTags returns a boolean if a field has been set.
|
|
func (o *GitRefsJSON) HasTags() bool {
|
|
if o != nil && !IsNil(o.Tags) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTags gets a reference to the given []GitRefJSON and assigns it to the Tags field.
|
|
func (o *GitRefsJSON) SetTags(v []GitRefJSON) {
|
|
o.Tags = v
|
|
}
|
|
|
|
func (o GitRefsJSON) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitRefsJSON) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Branches) {
|
|
toSerialize["branches"] = o.Branches
|
|
}
|
|
if !IsNil(o.Default) {
|
|
toSerialize["default"] = o.Default
|
|
}
|
|
if !IsNil(o.Tags) {
|
|
toSerialize["tags"] = o.Tags
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitRefsJSON) UnmarshalJSON(data []byte) (err error) {
|
|
varGitRefsJSON := _GitRefsJSON{}
|
|
|
|
err = json.Unmarshal(data, &varGitRefsJSON)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitRefsJSON(varGitRefsJSON)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "branches")
|
|
delete(additionalProperties, "default")
|
|
delete(additionalProperties, "tags")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitRefsJSON struct {
|
|
value *GitRefsJSON
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitRefsJSON) Get() *GitRefsJSON {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitRefsJSON) Set(val *GitRefsJSON) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitRefsJSON) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitRefsJSON) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitRefsJSON(val *GitRefsJSON) *NullableGitRefsJSON {
|
|
return &NullableGitRefsJSON{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitRefsJSON) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitRefsJSON) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|