Files
sdk/model_agent_coding_blob.go

345 lines
8.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 AgentCodingBlob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentCodingBlob{}
// AgentCodingBlob struct for AgentCodingBlob
type AgentCodingBlob struct {
// Binary marks content that is not 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 repository, whatever was returned below.
Size *int64 `json:"size,omitempty"`
// Truncated marks a file past the 1 MiB view cap. No content is sent.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentCodingBlob AgentCodingBlob
// NewAgentCodingBlob instantiates a new AgentCodingBlob 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 NewAgentCodingBlob() *AgentCodingBlob {
this := AgentCodingBlob{}
return &this
}
// NewAgentCodingBlobWithDefaults instantiates a new AgentCodingBlob 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 NewAgentCodingBlobWithDefaults() *AgentCodingBlob {
this := AgentCodingBlob{}
return &this
}
// GetBinary returns the Binary field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetBinary(v bool) {
o.Binary = &v
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetContent(v string) {
o.Content = &v
}
// GetEncoding returns the Encoding field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetEncoding(v string) {
o.Encoding = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetPath(v string) {
o.Path = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetSize(v int64) {
o.Size = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) 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 *AgentCodingBlob) SetTruncated(v bool) {
o.Truncated = &v
}
func (o AgentCodingBlob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentCodingBlob) 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 *AgentCodingBlob) UnmarshalJSON(data []byte) (err error) {
varAgentCodingBlob := _AgentCodingBlob{}
err = json.Unmarshal(data, &varAgentCodingBlob)
if err != nil {
return err
}
*o = AgentCodingBlob(varAgentCodingBlob)
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 NullableAgentCodingBlob struct {
value *AgentCodingBlob
isSet bool
}
func (v NullableAgentCodingBlob) Get() *AgentCodingBlob {
return v.value
}
func (v *NullableAgentCodingBlob) Set(val *AgentCodingBlob) {
v.value = val
v.isSet = true
}
func (v NullableAgentCodingBlob) IsSet() bool {
return v.isSet
}
func (v *NullableAgentCodingBlob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentCodingBlob(val *AgentCodingBlob) *NullableAgentCodingBlob {
return &NullableAgentCodingBlob{value: val, isSet: true}
}
func (v NullableAgentCodingBlob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentCodingBlob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}