mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
12 KiB
Go
421 lines
12 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 AgentPatchSessionIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentPatchSessionIn{}
|
|
|
|
// AgentPatchSessionIn struct for AgentPatchSessionIn
|
|
type AgentPatchSessionIn struct {
|
|
// Cwd is where the session is working NOW. It was write-once — captured at register and never again — which is right for a run that starts in a directory and stays there, and wrong for a linked shell, which is a place a person moves around in. The console showed the directory `hanzo link` happened to be run from and kept showing it after the shell had walked away, so the field answered \"which work is this\" with an answer that was true once. A pointer, so an unchanged path is an omitted field rather than a repeated write.
|
|
Cwd *string `json:"cwd,omitempty"`
|
|
// ID is the session to update, from the path.
|
|
Id *string `json:"id,omitempty"`
|
|
// Project tags the product this session built; Published is the author's decision to let anyone read the story (provenance.go). Both are pointers so \"absent\" and \"cleared\" are different requests.
|
|
Project *string `json:"project,omitempty"`
|
|
// Published opens the session's story to the public build route; false withdraws it, and withdrawing is always allowed. PUBLISHING is refused unless the session names a Project — the one set in this same request, or the one already stored — because that route is keyed on (org, project). It widens READ access to what is already there and grants nothing else.
|
|
Published *bool `json:"published,omitempty"`
|
|
// Status moves the session to running, paused, done or error. A session that has already finished refuses any change with 409 — done and error are monotonic — and moving INTO one stamps the end time. This is the surface REPORTING what happened; a control command never writes it.
|
|
Status *string `json:"status,omitempty"`
|
|
// Target re-dispatches a session to a run-target (the #48 association). \"\" detaches.
|
|
Target *string `json:"target,omitempty"`
|
|
// Terminal publishes (or, with \"\", withdraws) the URL this session's live terminal can be watched at. A pointer so \"absent\" and \"withdrawn\" are different requests: a session that stops sharing must be able to say so.
|
|
Terminal *string `json:"terminal,omitempty"`
|
|
// Title rewrites the human line, up to 512 characters — usually because the work turned out to be something other than what it was opened as.
|
|
Title *string `json:"title,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentPatchSessionIn AgentPatchSessionIn
|
|
|
|
// NewAgentPatchSessionIn instantiates a new AgentPatchSessionIn 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 NewAgentPatchSessionIn() *AgentPatchSessionIn {
|
|
this := AgentPatchSessionIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentPatchSessionInWithDefaults instantiates a new AgentPatchSessionIn 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 NewAgentPatchSessionInWithDefaults() *AgentPatchSessionIn {
|
|
this := AgentPatchSessionIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetCwd returns the Cwd field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetCwd() string {
|
|
if o == nil || IsNil(o.Cwd) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Cwd
|
|
}
|
|
|
|
// GetCwdOk returns a tuple with the Cwd field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetCwdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Cwd) {
|
|
return nil, false
|
|
}
|
|
return o.Cwd, true
|
|
}
|
|
|
|
// HasCwd returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasCwd() bool {
|
|
if o != nil && !IsNil(o.Cwd) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCwd gets a reference to the given string and assigns it to the Cwd field.
|
|
func (o *AgentPatchSessionIn) SetCwd(v string) {
|
|
o.Cwd = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *AgentPatchSessionIn) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetProject() string {
|
|
if o == nil || IsNil(o.Project) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Project
|
|
}
|
|
|
|
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetProjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Project) {
|
|
return nil, false
|
|
}
|
|
return o.Project, true
|
|
}
|
|
|
|
// HasProject returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasProject() bool {
|
|
if o != nil && !IsNil(o.Project) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProject gets a reference to the given string and assigns it to the Project field.
|
|
func (o *AgentPatchSessionIn) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetPublished returns the Published field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetPublished() bool {
|
|
if o == nil || IsNil(o.Published) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Published
|
|
}
|
|
|
|
// GetPublishedOk returns a tuple with the Published field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetPublishedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Published) {
|
|
return nil, false
|
|
}
|
|
return o.Published, true
|
|
}
|
|
|
|
// HasPublished returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasPublished() bool {
|
|
if o != nil && !IsNil(o.Published) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPublished gets a reference to the given bool and assigns it to the Published field.
|
|
func (o *AgentPatchSessionIn) SetPublished(v bool) {
|
|
o.Published = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) 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 *AgentPatchSessionIn) 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 *AgentPatchSessionIn) 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 *AgentPatchSessionIn) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetTarget returns the Target field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetTarget() string {
|
|
if o == nil || IsNil(o.Target) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Target
|
|
}
|
|
|
|
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetTargetOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Target) {
|
|
return nil, false
|
|
}
|
|
return o.Target, true
|
|
}
|
|
|
|
// HasTarget returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasTarget() bool {
|
|
if o != nil && !IsNil(o.Target) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTarget gets a reference to the given string and assigns it to the Target field.
|
|
func (o *AgentPatchSessionIn) SetTarget(v string) {
|
|
o.Target = &v
|
|
}
|
|
|
|
// GetTerminal returns the Terminal field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetTerminal() string {
|
|
if o == nil || IsNil(o.Terminal) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Terminal
|
|
}
|
|
|
|
// GetTerminalOk returns a tuple with the Terminal field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetTerminalOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Terminal) {
|
|
return nil, false
|
|
}
|
|
return o.Terminal, true
|
|
}
|
|
|
|
// HasTerminal returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasTerminal() bool {
|
|
if o != nil && !IsNil(o.Terminal) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTerminal gets a reference to the given string and assigns it to the Terminal field.
|
|
func (o *AgentPatchSessionIn) SetTerminal(v string) {
|
|
o.Terminal = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *AgentPatchSessionIn) GetTitle() string {
|
|
if o == nil || IsNil(o.Title) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Title
|
|
}
|
|
|
|
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchSessionIn) GetTitleOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Title) {
|
|
return nil, false
|
|
}
|
|
return o.Title, true
|
|
}
|
|
|
|
// HasTitle returns a boolean if a field has been set.
|
|
func (o *AgentPatchSessionIn) HasTitle() bool {
|
|
if o != nil && !IsNil(o.Title) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTitle gets a reference to the given string and assigns it to the Title field.
|
|
func (o *AgentPatchSessionIn) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
func (o AgentPatchSessionIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentPatchSessionIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Cwd) {
|
|
toSerialize["cwd"] = o.Cwd
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
if !IsNil(o.Published) {
|
|
toSerialize["published"] = o.Published
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.Target) {
|
|
toSerialize["target"] = o.Target
|
|
}
|
|
if !IsNil(o.Terminal) {
|
|
toSerialize["terminal"] = o.Terminal
|
|
}
|
|
if !IsNil(o.Title) {
|
|
toSerialize["title"] = o.Title
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentPatchSessionIn) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentPatchSessionIn := _AgentPatchSessionIn{}
|
|
|
|
err = json.Unmarshal(data, &varAgentPatchSessionIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentPatchSessionIn(varAgentPatchSessionIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "cwd")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "published")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "target")
|
|
delete(additionalProperties, "terminal")
|
|
delete(additionalProperties, "title")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentPatchSessionIn struct {
|
|
value *AgentPatchSessionIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentPatchSessionIn) Get() *AgentPatchSessionIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentPatchSessionIn) Set(val *AgentPatchSessionIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentPatchSessionIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentPatchSessionIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentPatchSessionIn(val *AgentPatchSessionIn) *NullableAgentPatchSessionIn {
|
|
return &NullableAgentPatchSessionIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentPatchSessionIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentPatchSessionIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|