Files
sdk/model_git_blob_json.go

345 lines
8.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 GitBlobJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitBlobJSON{}
// GitBlobJSON struct for GitBlobJSON
type GitBlobJSON struct {
// Binary marks content git could not treat as text; it comes back base64.
Binary *bool `json:"binary,omitempty"`
// 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, whatever was returned below.
Size *int64 `json:"size,omitempty"`
// Truncated marks a file past the 1 MiB view cap. No content is sent — clone the repo for it.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitBlobJSON GitBlobJSON
// NewGitBlobJSON instantiates a new GitBlobJSON 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 NewGitBlobJSON() *GitBlobJSON {
this := GitBlobJSON{}
return &this
}
// NewGitBlobJSONWithDefaults instantiates a new GitBlobJSON 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 NewGitBlobJSONWithDefaults() *GitBlobJSON {
this := GitBlobJSON{}
return &this
}
// GetBinary returns the Binary field value if set, zero value otherwise.
func (o *GitBlobJSON) GetBinary() bool {
if o == nil || IsNil(o.Binary) {
var ret bool
return ret
}
return *o.Binary
}
// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitBlobJSON) GetBinaryOk() (*bool, bool) {
if o == nil || IsNil(o.Binary) {
return nil, false
}
return o.Binary, true
}
// HasBinary returns a boolean if a field has been set.
func (o *GitBlobJSON) HasBinary() bool {
if o != nil && !IsNil(o.Binary) {
return true
}
return false
}
// SetBinary gets a reference to the given bool and assigns it to the Binary field.
func (o *GitBlobJSON) SetBinary(v bool) {
o.Binary = &v
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) SetContent(v string) {
o.Content = &v
}
// GetEncoding returns the Encoding field value if set, zero value otherwise.
func (o *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) SetEncoding(v string) {
o.Encoding = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) SetPath(v string) {
o.Path = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) SetSize(v int64) {
o.Size = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) 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 *GitBlobJSON) SetTruncated(v bool) {
o.Truncated = &v
}
func (o GitBlobJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitBlobJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Binary) {
toSerialize["binary"] = o.Binary
}
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 *GitBlobJSON) UnmarshalJSON(data []byte) (err error) {
varGitBlobJSON := _GitBlobJSON{}
err = json.Unmarshal(data, &varGitBlobJSON)
if err != nil {
return err
}
*o = GitBlobJSON(varGitBlobJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "binary")
delete(additionalProperties, "content")
delete(additionalProperties, "encoding")
delete(additionalProperties, "path")
delete(additionalProperties, "size")
delete(additionalProperties, "truncated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitBlobJSON struct {
value *GitBlobJSON
isSet bool
}
func (v NullableGitBlobJSON) Get() *GitBlobJSON {
return v.value
}
func (v *NullableGitBlobJSON) Set(val *GitBlobJSON) {
v.value = val
v.isSet = true
}
func (v NullableGitBlobJSON) IsSet() bool {
return v.isSet
}
func (v *NullableGitBlobJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitBlobJSON(val *GitBlobJSON) *NullableGitBlobJSON {
return &NullableGitBlobJSON{value: val, isSet: true}
}
func (v NullableGitBlobJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitBlobJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}