Files
sdk/model_compute_agent_binding.go

573 lines
17 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 ComputeAgentBinding type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeAgentBinding{}
// ComputeAgentBinding struct for ComputeAgentBinding
type ComputeAgentBinding struct {
// AgentName is the cloud Agent (/v1/agent) this machine runs — the agent a message to the bot is actually run against. It is the one field that decides what the bot DOES.
AgentName *string `json:"agentName,omitempty"`
// BotVersion pins the @hanzo/bot runtime version the machine runs. Empty means the machine took the default in force when it was bound.
BotVersion *string `json:"botVersion,omitempty"`
// CreatedTime is when the binding was first made.
CreatedTime *string `json:"createdTime,omitempty"`
// MachineId is the bound machine as vm addresses it, owner-qualified (\"<org>/<machine>\"). The unqualified half is what this surface's :id routes take.
MachineId *string `json:"machineId,omitempty"`
// Message is vm's human-readable detail on Status (\"machine provisioning; @hanzo/bot runtime not yet confirmed\") — the reason behind the state, not a second state.
Message *string `json:"message,omitempty"`
// Name is the binding's own key, which is the machine's id: a machine hosts at most one agent, so the binding is named for it. This is the key a bots list joins bindings onto machines by.
Name *string `json:"name,omitempty"`
// Org is the Hanzo tenant the binding belongs to.
Org *string `json:"org,omitempty"`
// Owner is the tenant vm filed the binding under, resolved from the ?owner it was called with — which is the caller's validated org and never a body field.
Owner *string `json:"owner,omitempty"`
// Provider is the cloud the bound machine runs on, carried here so a bindings list says where each bot lives without a second read per machine.
Provider *string `json:"provider,omitempty"`
// PublicIp is the bound machine's public address as vm recorded it on the binding. Empty while the machine has none yet.
PublicIp *string `json:"publicIp,omitempty"`
// Status is the binding's lifecycle in VM's OWN words — \"Pending\" while the machine provisions and the runtime is unconfirmed, \"running\" once vm has confirmed it. The vocabulary is vm's and passes through unmapped, which is why its capitalization does not match the machine states beside it, and it is vm's reconciled reading rather than anything asserted here.
Status *string `json:"status,omitempty"`
// UpdatedTime is when vm last reconciled it — the age of Status.
UpdatedTime *string `json:"updatedTime,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeAgentBinding ComputeAgentBinding
// NewComputeAgentBinding instantiates a new ComputeAgentBinding 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 NewComputeAgentBinding() *ComputeAgentBinding {
this := ComputeAgentBinding{}
return &this
}
// NewComputeAgentBindingWithDefaults instantiates a new ComputeAgentBinding 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 NewComputeAgentBindingWithDefaults() *ComputeAgentBinding {
this := ComputeAgentBinding{}
return &this
}
// GetAgentName returns the AgentName field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetAgentName() string {
if o == nil || IsNil(o.AgentName) {
var ret string
return ret
}
return *o.AgentName
}
// GetAgentNameOk returns a tuple with the AgentName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetAgentNameOk() (*string, bool) {
if o == nil || IsNil(o.AgentName) {
return nil, false
}
return o.AgentName, true
}
// HasAgentName returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasAgentName() bool {
if o != nil && !IsNil(o.AgentName) {
return true
}
return false
}
// SetAgentName gets a reference to the given string and assigns it to the AgentName field.
func (o *ComputeAgentBinding) SetAgentName(v string) {
o.AgentName = &v
}
// GetBotVersion returns the BotVersion field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetBotVersion() string {
if o == nil || IsNil(o.BotVersion) {
var ret string
return ret
}
return *o.BotVersion
}
// GetBotVersionOk returns a tuple with the BotVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetBotVersionOk() (*string, bool) {
if o == nil || IsNil(o.BotVersion) {
return nil, false
}
return o.BotVersion, true
}
// HasBotVersion returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasBotVersion() bool {
if o != nil && !IsNil(o.BotVersion) {
return true
}
return false
}
// SetBotVersion gets a reference to the given string and assigns it to the BotVersion field.
func (o *ComputeAgentBinding) SetBotVersion(v string) {
o.BotVersion = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *ComputeAgentBinding) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetMachineId returns the MachineId field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetMachineId() string {
if o == nil || IsNil(o.MachineId) {
var ret string
return ret
}
return *o.MachineId
}
// GetMachineIdOk returns a tuple with the MachineId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetMachineIdOk() (*string, bool) {
if o == nil || IsNil(o.MachineId) {
return nil, false
}
return o.MachineId, true
}
// HasMachineId returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasMachineId() bool {
if o != nil && !IsNil(o.MachineId) {
return true
}
return false
}
// SetMachineId gets a reference to the given string and assigns it to the MachineId field.
func (o *ComputeAgentBinding) SetMachineId(v string) {
o.MachineId = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *ComputeAgentBinding) SetMessage(v string) {
o.Message = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ComputeAgentBinding) 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 *ComputeAgentBinding) 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 *ComputeAgentBinding) 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 *ComputeAgentBinding) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *ComputeAgentBinding) SetOrg(v string) {
o.Org = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *ComputeAgentBinding) SetOwner(v string) {
o.Owner = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ComputeAgentBinding) SetProvider(v string) {
o.Provider = &v
}
// GetPublicIp returns the PublicIp field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetPublicIp() string {
if o == nil || IsNil(o.PublicIp) {
var ret string
return ret
}
return *o.PublicIp
}
// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetPublicIpOk() (*string, bool) {
if o == nil || IsNil(o.PublicIp) {
return nil, false
}
return o.PublicIp, true
}
// HasPublicIp returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasPublicIp() bool {
if o != nil && !IsNil(o.PublicIp) {
return true
}
return false
}
// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field.
func (o *ComputeAgentBinding) SetPublicIp(v string) {
o.PublicIp = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ComputeAgentBinding) 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 *ComputeAgentBinding) 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 *ComputeAgentBinding) 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 *ComputeAgentBinding) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedTime returns the UpdatedTime field value if set, zero value otherwise.
func (o *ComputeAgentBinding) GetUpdatedTime() string {
if o == nil || IsNil(o.UpdatedTime) {
var ret string
return ret
}
return *o.UpdatedTime
}
// GetUpdatedTimeOk returns a tuple with the UpdatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeAgentBinding) GetUpdatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedTime) {
return nil, false
}
return o.UpdatedTime, true
}
// HasUpdatedTime returns a boolean if a field has been set.
func (o *ComputeAgentBinding) HasUpdatedTime() bool {
if o != nil && !IsNil(o.UpdatedTime) {
return true
}
return false
}
// SetUpdatedTime gets a reference to the given string and assigns it to the UpdatedTime field.
func (o *ComputeAgentBinding) SetUpdatedTime(v string) {
o.UpdatedTime = &v
}
func (o ComputeAgentBinding) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeAgentBinding) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AgentName) {
toSerialize["agentName"] = o.AgentName
}
if !IsNil(o.BotVersion) {
toSerialize["botVersion"] = o.BotVersion
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.MachineId) {
toSerialize["machineId"] = o.MachineId
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.PublicIp) {
toSerialize["publicIp"] = o.PublicIp
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedTime) {
toSerialize["updatedTime"] = o.UpdatedTime
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeAgentBinding) UnmarshalJSON(data []byte) (err error) {
varComputeAgentBinding := _ComputeAgentBinding{}
err = json.Unmarshal(data, &varComputeAgentBinding)
if err != nil {
return err
}
*o = ComputeAgentBinding(varComputeAgentBinding)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "agentName")
delete(additionalProperties, "botVersion")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "machineId")
delete(additionalProperties, "message")
delete(additionalProperties, "name")
delete(additionalProperties, "org")
delete(additionalProperties, "owner")
delete(additionalProperties, "provider")
delete(additionalProperties, "publicIp")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedTime")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeAgentBinding struct {
value *ComputeAgentBinding
isSet bool
}
func (v NullableComputeAgentBinding) Get() *ComputeAgentBinding {
return v.value
}
func (v *NullableComputeAgentBinding) Set(val *ComputeAgentBinding) {
v.value = val
v.isSet = true
}
func (v NullableComputeAgentBinding) IsSet() bool {
return v.isSet
}
func (v *NullableComputeAgentBinding) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeAgentBinding(val *ComputeAgentBinding) *NullableComputeAgentBinding {
return &NullableComputeAgentBinding{value: val, isSet: true}
}
func (v NullableComputeAgentBinding) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeAgentBinding) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}