Files
sdk/model_git_commits_json.go

155 lines
3.9 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 GitCommitsJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitCommitsJSON{}
// GitCommitsJSON struct for GitCommitsJSON
type GitCommitsJSON struct {
// Commits are newest first.
Commits []GitCommitJSON `json:"commits,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitCommitsJSON GitCommitsJSON
// NewGitCommitsJSON instantiates a new GitCommitsJSON 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 NewGitCommitsJSON() *GitCommitsJSON {
this := GitCommitsJSON{}
return &this
}
// NewGitCommitsJSONWithDefaults instantiates a new GitCommitsJSON 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 NewGitCommitsJSONWithDefaults() *GitCommitsJSON {
this := GitCommitsJSON{}
return &this
}
// GetCommits returns the Commits field value if set, zero value otherwise.
func (o *GitCommitsJSON) GetCommits() []GitCommitJSON {
if o == nil || IsNil(o.Commits) {
var ret []GitCommitJSON
return ret
}
return o.Commits
}
// GetCommitsOk returns a tuple with the Commits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitsJSON) GetCommitsOk() ([]GitCommitJSON, bool) {
if o == nil || IsNil(o.Commits) {
return nil, false
}
return o.Commits, true
}
// HasCommits returns a boolean if a field has been set.
func (o *GitCommitsJSON) HasCommits() bool {
if o != nil && !IsNil(o.Commits) {
return true
}
return false
}
// SetCommits gets a reference to the given []GitCommitJSON and assigns it to the Commits field.
func (o *GitCommitsJSON) SetCommits(v []GitCommitJSON) {
o.Commits = v
}
func (o GitCommitsJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitCommitsJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commits) {
toSerialize["commits"] = o.Commits
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitCommitsJSON) UnmarshalJSON(data []byte) (err error) {
varGitCommitsJSON := _GitCommitsJSON{}
err = json.Unmarshal(data, &varGitCommitsJSON)
if err != nil {
return err
}
*o = GitCommitsJSON(varGitCommitsJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commits")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitCommitsJSON struct {
value *GitCommitsJSON
isSet bool
}
func (v NullableGitCommitsJSON) Get() *GitCommitsJSON {
return v.value
}
func (v *NullableGitCommitsJSON) Set(val *GitCommitsJSON) {
v.value = val
v.isSet = true
}
func (v NullableGitCommitsJSON) IsSet() bool {
return v.isSet
}
func (v *NullableGitCommitsJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitCommitsJSON(val *GitCommitsJSON) *NullableGitCommitsJSON {
return &NullableGitCommitsJSON{value: val, isSet: true}
}
func (v NullableGitCommitsJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitCommitsJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}