Files
sdk/model_git_file_json.go

307 lines
7.7 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 GitFileJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitFileJSON{}
// GitFileJSON struct for GitFileJSON
type GitFileJSON struct {
// Content is the file's bytes, empty when Truncated.
Content *string `json:"content,omitempty"`
// Encoding is how Content is carried: \"utf8\" verbatim, or \"base64\".
Encoding *string `json:"encoding,omitempty"`
// Path is the file's repo-relative path.
Path *string `json:"path,omitempty"`
// Size is the file's byte length in the repo.
Size *int64 `json:"size,omitempty"`
// Truncated marks a file past the read cap; no content is sent. A caller assembling a desired set must treat this as INCOMPLETE, never as empty.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitFileJSON GitFileJSON
// NewGitFileJSON instantiates a new GitFileJSON 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 NewGitFileJSON() *GitFileJSON {
this := GitFileJSON{}
return &this
}
// NewGitFileJSONWithDefaults instantiates a new GitFileJSON 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 NewGitFileJSONWithDefaults() *GitFileJSON {
this := GitFileJSON{}
return &this
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *GitFileJSON) GetContent() string {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
return *o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitFileJSON) GetContentOk() (*string, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *GitFileJSON) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *GitFileJSON) SetContent(v string) {
o.Content = &v
}
// GetEncoding returns the Encoding field value if set, zero value otherwise.
func (o *GitFileJSON) GetEncoding() string {
if o == nil || IsNil(o.Encoding) {
var ret string
return ret
}
return *o.Encoding
}
// GetEncodingOk returns a tuple with the Encoding field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitFileJSON) GetEncodingOk() (*string, bool) {
if o == nil || IsNil(o.Encoding) {
return nil, false
}
return o.Encoding, true
}
// HasEncoding returns a boolean if a field has been set.
func (o *GitFileJSON) HasEncoding() bool {
if o != nil && !IsNil(o.Encoding) {
return true
}
return false
}
// SetEncoding gets a reference to the given string and assigns it to the Encoding field.
func (o *GitFileJSON) SetEncoding(v string) {
o.Encoding = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *GitFileJSON) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitFileJSON) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *GitFileJSON) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *GitFileJSON) SetPath(v string) {
o.Path = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *GitFileJSON) GetSize() int64 {
if o == nil || IsNil(o.Size) {
var ret int64
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitFileJSON) GetSizeOk() (*int64, bool) {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *GitFileJSON) HasSize() bool {
if o != nil && !IsNil(o.Size) {
return true
}
return false
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *GitFileJSON) SetSize(v int64) {
o.Size = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *GitFileJSON) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitFileJSON) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *GitFileJSON) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *GitFileJSON) SetTruncated(v bool) {
o.Truncated = &v
}
func (o GitFileJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitFileJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.Encoding) {
toSerialize["encoding"] = o.Encoding
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitFileJSON) UnmarshalJSON(data []byte) (err error) {
varGitFileJSON := _GitFileJSON{}
err = json.Unmarshal(data, &varGitFileJSON)
if err != nil {
return err
}
*o = GitFileJSON(varGitFileJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "content")
delete(additionalProperties, "encoding")
delete(additionalProperties, "path")
delete(additionalProperties, "size")
delete(additionalProperties, "truncated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitFileJSON struct {
value *GitFileJSON
isSet bool
}
func (v NullableGitFileJSON) Get() *GitFileJSON {
return v.value
}
func (v *NullableGitFileJSON) Set(val *GitFileJSON) {
v.value = val
v.isSet = true
}
func (v NullableGitFileJSON) IsSet() bool {
return v.isSet
}
func (v *NullableGitFileJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitFileJSON(val *GitFileJSON) *NullableGitFileJSON {
return &NullableGitFileJSON{value: val, isSet: true}
}
func (v NullableGitFileJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitFileJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}