mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.5 KiB
Go
345 lines
9.5 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 AgentCodingStarted type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentCodingStarted{}
|
|
|
|
// AgentCodingStarted struct for AgentCodingStarted
|
|
type AgentCodingStarted struct {
|
|
// Branch is the ref the run will push its work to, and the ONLY ref it is permitted to write. It exists before the work does, so it is safe to tell somebody where to look while the run is still going.
|
|
Branch *string `json:"branch,omitempty"`
|
|
// Pull is the CLI command or instruction to pull this run locally, e.g. `hanzo pull <sessionId>`.
|
|
Pull *string `json:"pull,omitempty"`
|
|
// Repo is the repository the run was admitted against, echoed back as the engine resolved it.
|
|
Repo *string `json:"repo,omitempty"`
|
|
// Routed says the run went to one of the org's own registered machines rather than to a sandbox in our cluster. False is the ordinary case.
|
|
Routed *bool `json:"routed,omitempty"`
|
|
// SessionID is the run's handle: its durable record, and the root its live progress streams under at /v1/agent/sessions/stream?root=<sessionId>. Every later question about this run is asked with it.
|
|
SessionId *string `json:"sessionId,omitempty"`
|
|
// TargetID names that machine when Routed is true, and is empty otherwise.
|
|
TargetId *string `json:"targetId,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentCodingStarted AgentCodingStarted
|
|
|
|
// NewAgentCodingStarted instantiates a new AgentCodingStarted 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 NewAgentCodingStarted() *AgentCodingStarted {
|
|
this := AgentCodingStarted{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentCodingStartedWithDefaults instantiates a new AgentCodingStarted 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 NewAgentCodingStartedWithDefaults() *AgentCodingStarted {
|
|
this := AgentCodingStarted{}
|
|
return &this
|
|
}
|
|
|
|
// GetBranch returns the Branch field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetBranch() string {
|
|
if o == nil || IsNil(o.Branch) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Branch
|
|
}
|
|
|
|
// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetBranchOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Branch) {
|
|
return nil, false
|
|
}
|
|
return o.Branch, true
|
|
}
|
|
|
|
// HasBranch returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasBranch() bool {
|
|
if o != nil && !IsNil(o.Branch) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBranch gets a reference to the given string and assigns it to the Branch field.
|
|
func (o *AgentCodingStarted) SetBranch(v string) {
|
|
o.Branch = &v
|
|
}
|
|
|
|
// GetPull returns the Pull field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetPull() string {
|
|
if o == nil || IsNil(o.Pull) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Pull
|
|
}
|
|
|
|
// GetPullOk returns a tuple with the Pull field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetPullOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Pull) {
|
|
return nil, false
|
|
}
|
|
return o.Pull, true
|
|
}
|
|
|
|
// HasPull returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasPull() bool {
|
|
if o != nil && !IsNil(o.Pull) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPull gets a reference to the given string and assigns it to the Pull field.
|
|
func (o *AgentCodingStarted) SetPull(v string) {
|
|
o.Pull = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetRepo() string {
|
|
if o == nil || IsNil(o.Repo) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Repo
|
|
}
|
|
|
|
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetRepoOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Repo) {
|
|
return nil, false
|
|
}
|
|
return o.Repo, true
|
|
}
|
|
|
|
// HasRepo returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasRepo() bool {
|
|
if o != nil && !IsNil(o.Repo) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRepo gets a reference to the given string and assigns it to the Repo field.
|
|
func (o *AgentCodingStarted) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetRouted returns the Routed field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetRouted() bool {
|
|
if o == nil || IsNil(o.Routed) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Routed
|
|
}
|
|
|
|
// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetRoutedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Routed) {
|
|
return nil, false
|
|
}
|
|
return o.Routed, true
|
|
}
|
|
|
|
// HasRouted returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasRouted() bool {
|
|
if o != nil && !IsNil(o.Routed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRouted gets a reference to the given bool and assigns it to the Routed field.
|
|
func (o *AgentCodingStarted) SetRouted(v bool) {
|
|
o.Routed = &v
|
|
}
|
|
|
|
// GetSessionId returns the SessionId field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetSessionId() string {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SessionId
|
|
}
|
|
|
|
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetSessionIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
return nil, false
|
|
}
|
|
return o.SessionId, true
|
|
}
|
|
|
|
// HasSessionId returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasSessionId() bool {
|
|
if o != nil && !IsNil(o.SessionId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSessionId gets a reference to the given string and assigns it to the SessionId field.
|
|
func (o *AgentCodingStarted) SetSessionId(v string) {
|
|
o.SessionId = &v
|
|
}
|
|
|
|
// GetTargetId returns the TargetId field value if set, zero value otherwise.
|
|
func (o *AgentCodingStarted) GetTargetId() string {
|
|
if o == nil || IsNil(o.TargetId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TargetId
|
|
}
|
|
|
|
// GetTargetIdOk returns a tuple with the TargetId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentCodingStarted) GetTargetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TargetId) {
|
|
return nil, false
|
|
}
|
|
return o.TargetId, true
|
|
}
|
|
|
|
// HasTargetId returns a boolean if a field has been set.
|
|
func (o *AgentCodingStarted) HasTargetId() bool {
|
|
if o != nil && !IsNil(o.TargetId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTargetId gets a reference to the given string and assigns it to the TargetId field.
|
|
func (o *AgentCodingStarted) SetTargetId(v string) {
|
|
o.TargetId = &v
|
|
}
|
|
|
|
func (o AgentCodingStarted) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentCodingStarted) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Branch) {
|
|
toSerialize["branch"] = o.Branch
|
|
}
|
|
if !IsNil(o.Pull) {
|
|
toSerialize["pull"] = o.Pull
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
if !IsNil(o.Routed) {
|
|
toSerialize["routed"] = o.Routed
|
|
}
|
|
if !IsNil(o.SessionId) {
|
|
toSerialize["sessionId"] = o.SessionId
|
|
}
|
|
if !IsNil(o.TargetId) {
|
|
toSerialize["targetId"] = o.TargetId
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentCodingStarted) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentCodingStarted := _AgentCodingStarted{}
|
|
|
|
err = json.Unmarshal(data, &varAgentCodingStarted)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentCodingStarted(varAgentCodingStarted)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "branch")
|
|
delete(additionalProperties, "pull")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "routed")
|
|
delete(additionalProperties, "sessionId")
|
|
delete(additionalProperties, "targetId")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentCodingStarted struct {
|
|
value *AgentCodingStarted
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentCodingStarted) Get() *AgentCodingStarted {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentCodingStarted) Set(val *AgentCodingStarted) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentCodingStarted) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentCodingStarted) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentCodingStarted(val *AgentCodingStarted) *NullableAgentCodingStarted {
|
|
return &NullableAgentCodingStarted{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentCodingStarted) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentCodingStarted) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|