Files
sdk/model_agent_artifact.go

383 lines
9.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 AgentArtifact type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentArtifact{}
// AgentArtifact struct for AgentArtifact
type AgentArtifact struct {
// Kind is file, patch, preview, pull or deploy. A file or a patch is stored, and its bytes are read at GET /v1/agent/coding/{session}/artifacts/{name}.
Kind *string `json:"kind,omitempty"`
// Name is the artifact's handle: a changed file's path in the workspace, or `changes.patch` for the whole change; for a link, its kind and what it names.
Name *string `json:"name,omitempty"`
// Port is a preview's port in the run's sandbox, which POST /v1/sandbox/{id}/preview opens while the sandbox is kept.
Port *int64 `json:"port,omitempty"`
// Sandbox is the sandbox a preview is served from.
Sandbox *string `json:"sandbox,omitempty"`
// SHA256 is a stored artifact's digest, hex.
Sha256 *string `json:"sha256,omitempty"`
// Size is a stored artifact's length in bytes.
Size *int64 `json:"size,omitempty"`
// URL is where a link points: a preview's host, a pull request, a deployment.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentArtifact AgentArtifact
// NewAgentArtifact instantiates a new AgentArtifact 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 NewAgentArtifact() *AgentArtifact {
this := AgentArtifact{}
return &this
}
// NewAgentArtifactWithDefaults instantiates a new AgentArtifact 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 NewAgentArtifactWithDefaults() *AgentArtifact {
this := AgentArtifact{}
return &this
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *AgentArtifact) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *AgentArtifact) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *AgentArtifact) SetKind(v string) {
o.Kind = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AgentArtifact) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *AgentArtifact) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *AgentArtifact) SetName(v string) {
o.Name = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *AgentArtifact) GetPort() int64 {
if o == nil || IsNil(o.Port) {
var ret int64
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetPortOk() (*int64, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *AgentArtifact) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int64 and assigns it to the Port field.
func (o *AgentArtifact) SetPort(v int64) {
o.Port = &v
}
// GetSandbox returns the Sandbox field value if set, zero value otherwise.
func (o *AgentArtifact) GetSandbox() string {
if o == nil || IsNil(o.Sandbox) {
var ret string
return ret
}
return *o.Sandbox
}
// GetSandboxOk returns a tuple with the Sandbox field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetSandboxOk() (*string, bool) {
if o == nil || IsNil(o.Sandbox) {
return nil, false
}
return o.Sandbox, true
}
// HasSandbox returns a boolean if a field has been set.
func (o *AgentArtifact) HasSandbox() bool {
if o != nil && !IsNil(o.Sandbox) {
return true
}
return false
}
// SetSandbox gets a reference to the given string and assigns it to the Sandbox field.
func (o *AgentArtifact) SetSandbox(v string) {
o.Sandbox = &v
}
// GetSha256 returns the Sha256 field value if set, zero value otherwise.
func (o *AgentArtifact) GetSha256() string {
if o == nil || IsNil(o.Sha256) {
var ret string
return ret
}
return *o.Sha256
}
// GetSha256Ok returns a tuple with the Sha256 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetSha256Ok() (*string, bool) {
if o == nil || IsNil(o.Sha256) {
return nil, false
}
return o.Sha256, true
}
// HasSha256 returns a boolean if a field has been set.
func (o *AgentArtifact) HasSha256() bool {
if o != nil && !IsNil(o.Sha256) {
return true
}
return false
}
// SetSha256 gets a reference to the given string and assigns it to the Sha256 field.
func (o *AgentArtifact) SetSha256(v string) {
o.Sha256 = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *AgentArtifact) 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 *AgentArtifact) 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 *AgentArtifact) 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 *AgentArtifact) SetSize(v int64) {
o.Size = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *AgentArtifact) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentArtifact) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *AgentArtifact) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *AgentArtifact) SetUrl(v string) {
o.Url = &v
}
func (o AgentArtifact) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentArtifact) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if !IsNil(o.Sandbox) {
toSerialize["sandbox"] = o.Sandbox
}
if !IsNil(o.Sha256) {
toSerialize["sha256"] = o.Sha256
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentArtifact) UnmarshalJSON(data []byte) (err error) {
varAgentArtifact := _AgentArtifact{}
err = json.Unmarshal(data, &varAgentArtifact)
if err != nil {
return err
}
*o = AgentArtifact(varAgentArtifact)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "kind")
delete(additionalProperties, "name")
delete(additionalProperties, "port")
delete(additionalProperties, "sandbox")
delete(additionalProperties, "sha256")
delete(additionalProperties, "size")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentArtifact struct {
value *AgentArtifact
isSet bool
}
func (v NullableAgentArtifact) Get() *AgentArtifact {
return v.value
}
func (v *NullableAgentArtifact) Set(val *AgentArtifact) {
v.value = val
v.isSet = true
}
func (v NullableAgentArtifact) IsSet() bool {
return v.isSet
}
func (v *NullableAgentArtifact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentArtifact(val *AgentArtifact) *NullableAgentArtifact {
return &NullableAgentArtifact{value: val, isSet: true}
}
func (v NullableAgentArtifact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentArtifact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}