Files
sdk/model_agent_coding_file.go

383 lines
10 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 AgentCodingFile type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentCodingFile{}
// AgentCodingFile struct for AgentCodingFile
type AgentCodingFile struct {
// Additions counts the lines the change adds, over the whole file whether or not all of its patch is carried.
Additions *int64 `json:"additions,omitempty"`
// Deletions counts the lines the change removes, the same way.
Deletions *int64 `json:"deletions,omitempty"`
// From is where a renamed file was. Omitted for every other status.
From *string `json:"from,omitempty"`
// Patch is the file's unified-diff hunks, from its first \"@@\". Empty for a binary file and for a rename that moved no line.
Patch *string `json:"patch,omitempty"`
// Path is where the file is on the branch — for a deleted file, where it was.
Path *string `json:"path,omitempty"`
// Status is added, modified, deleted or renamed.
Status *string `json:"status,omitempty"`
// Truncated marks a patch cut short: at 64 KiB for one file, or past 1 MiB of patch across the change, when later files carry none. The counts are whole.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentCodingFile AgentCodingFile
// NewAgentCodingFile instantiates a new AgentCodingFile 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 NewAgentCodingFile() *AgentCodingFile {
this := AgentCodingFile{}
return &this
}
// NewAgentCodingFileWithDefaults instantiates a new AgentCodingFile 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 NewAgentCodingFileWithDefaults() *AgentCodingFile {
this := AgentCodingFile{}
return &this
}
// GetAdditions returns the Additions field value if set, zero value otherwise.
func (o *AgentCodingFile) GetAdditions() int64 {
if o == nil || IsNil(o.Additions) {
var ret int64
return ret
}
return *o.Additions
}
// GetAdditionsOk returns a tuple with the Additions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingFile) GetAdditionsOk() (*int64, bool) {
if o == nil || IsNil(o.Additions) {
return nil, false
}
return o.Additions, true
}
// HasAdditions returns a boolean if a field has been set.
func (o *AgentCodingFile) HasAdditions() bool {
if o != nil && !IsNil(o.Additions) {
return true
}
return false
}
// SetAdditions gets a reference to the given int64 and assigns it to the Additions field.
func (o *AgentCodingFile) SetAdditions(v int64) {
o.Additions = &v
}
// GetDeletions returns the Deletions field value if set, zero value otherwise.
func (o *AgentCodingFile) GetDeletions() int64 {
if o == nil || IsNil(o.Deletions) {
var ret int64
return ret
}
return *o.Deletions
}
// GetDeletionsOk returns a tuple with the Deletions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingFile) GetDeletionsOk() (*int64, bool) {
if o == nil || IsNil(o.Deletions) {
return nil, false
}
return o.Deletions, true
}
// HasDeletions returns a boolean if a field has been set.
func (o *AgentCodingFile) HasDeletions() bool {
if o != nil && !IsNil(o.Deletions) {
return true
}
return false
}
// SetDeletions gets a reference to the given int64 and assigns it to the Deletions field.
func (o *AgentCodingFile) SetDeletions(v int64) {
o.Deletions = &v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *AgentCodingFile) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingFile) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *AgentCodingFile) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *AgentCodingFile) SetFrom(v string) {
o.From = &v
}
// GetPatch returns the Patch field value if set, zero value otherwise.
func (o *AgentCodingFile) GetPatch() string {
if o == nil || IsNil(o.Patch) {
var ret string
return ret
}
return *o.Patch
}
// GetPatchOk returns a tuple with the Patch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingFile) GetPatchOk() (*string, bool) {
if o == nil || IsNil(o.Patch) {
return nil, false
}
return o.Patch, true
}
// HasPatch returns a boolean if a field has been set.
func (o *AgentCodingFile) HasPatch() bool {
if o != nil && !IsNil(o.Patch) {
return true
}
return false
}
// SetPatch gets a reference to the given string and assigns it to the Patch field.
func (o *AgentCodingFile) SetPatch(v string) {
o.Patch = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *AgentCodingFile) 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 *AgentCodingFile) 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 *AgentCodingFile) 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 *AgentCodingFile) SetPath(v string) {
o.Path = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *AgentCodingFile) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingFile) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *AgentCodingFile) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *AgentCodingFile) SetStatus(v string) {
o.Status = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *AgentCodingFile) 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 *AgentCodingFile) 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 *AgentCodingFile) 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 *AgentCodingFile) SetTruncated(v bool) {
o.Truncated = &v
}
func (o AgentCodingFile) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentCodingFile) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Additions) {
toSerialize["additions"] = o.Additions
}
if !IsNil(o.Deletions) {
toSerialize["deletions"] = o.Deletions
}
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if !IsNil(o.Patch) {
toSerialize["patch"] = o.Patch
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentCodingFile) UnmarshalJSON(data []byte) (err error) {
varAgentCodingFile := _AgentCodingFile{}
err = json.Unmarshal(data, &varAgentCodingFile)
if err != nil {
return err
}
*o = AgentCodingFile(varAgentCodingFile)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "additions")
delete(additionalProperties, "deletions")
delete(additionalProperties, "from")
delete(additionalProperties, "patch")
delete(additionalProperties, "path")
delete(additionalProperties, "status")
delete(additionalProperties, "truncated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentCodingFile struct {
value *AgentCodingFile
isSet bool
}
func (v NullableAgentCodingFile) Get() *AgentCodingFile {
return v.value
}
func (v *NullableAgentCodingFile) Set(val *AgentCodingFile) {
v.value = val
v.isSet = true
}
func (v NullableAgentCodingFile) IsSet() bool {
return v.isSet
}
func (v *NullableAgentCodingFile) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentCodingFile(val *AgentCodingFile) *NullableAgentCodingFile {
return &NullableAgentCodingFile{value: val, isSet: true}
}
func (v NullableAgentCodingFile) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentCodingFile) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}