mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
4.8 KiB
Go
193 lines
4.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 GitFilesJSON type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitFilesJSON{}
|
|
|
|
// GitFilesJSON struct for GitFilesJSON
|
|
type GitFilesJSON struct {
|
|
// Files are the selected files, sorted by path. Directories are never returned.
|
|
Files []GitFileJSON `json:"files,omitempty"`
|
|
// Rev is the full revision the ref resolved to — pin follow-up reads to it.
|
|
Rev *string `json:"rev,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitFilesJSON GitFilesJSON
|
|
|
|
// NewGitFilesJSON instantiates a new GitFilesJSON 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 NewGitFilesJSON() *GitFilesJSON {
|
|
this := GitFilesJSON{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitFilesJSONWithDefaults instantiates a new GitFilesJSON 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 NewGitFilesJSONWithDefaults() *GitFilesJSON {
|
|
this := GitFilesJSON{}
|
|
return &this
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *GitFilesJSON) GetFiles() []GitFileJSON {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret []GitFileJSON
|
|
return ret
|
|
}
|
|
return o.Files
|
|
}
|
|
|
|
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitFilesJSON) GetFilesOk() ([]GitFileJSON, bool) {
|
|
if o == nil || IsNil(o.Files) {
|
|
return nil, false
|
|
}
|
|
return o.Files, true
|
|
}
|
|
|
|
// HasFiles returns a boolean if a field has been set.
|
|
func (o *GitFilesJSON) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given []GitFileJSON and assigns it to the Files field.
|
|
func (o *GitFilesJSON) SetFiles(v []GitFileJSON) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetRev returns the Rev field value if set, zero value otherwise.
|
|
func (o *GitFilesJSON) GetRev() string {
|
|
if o == nil || IsNil(o.Rev) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Rev
|
|
}
|
|
|
|
// GetRevOk returns a tuple with the Rev field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitFilesJSON) GetRevOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Rev) {
|
|
return nil, false
|
|
}
|
|
return o.Rev, true
|
|
}
|
|
|
|
// HasRev returns a boolean if a field has been set.
|
|
func (o *GitFilesJSON) HasRev() bool {
|
|
if o != nil && !IsNil(o.Rev) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRev gets a reference to the given string and assigns it to the Rev field.
|
|
func (o *GitFilesJSON) SetRev(v string) {
|
|
o.Rev = &v
|
|
}
|
|
|
|
func (o GitFilesJSON) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitFilesJSON) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.Rev) {
|
|
toSerialize["rev"] = o.Rev
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitFilesJSON) UnmarshalJSON(data []byte) (err error) {
|
|
varGitFilesJSON := _GitFilesJSON{}
|
|
|
|
err = json.Unmarshal(data, &varGitFilesJSON)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitFilesJSON(varGitFilesJSON)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "rev")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitFilesJSON struct {
|
|
value *GitFilesJSON
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitFilesJSON) Get() *GitFilesJSON {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitFilesJSON) Set(val *GitFilesJSON) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitFilesJSON) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitFilesJSON) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitFilesJSON(val *GitFilesJSON) *NullableGitFilesJSON {
|
|
return &NullableGitFilesJSON{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitFilesJSON) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitFilesJSON) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|