mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.7 KiB
Go
269 lines
7.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 ComputeEngineAdvertisement type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ComputeEngineAdvertisement{}
|
|
|
|
// ComputeEngineAdvertisement struct for ComputeEngineAdvertisement
|
|
type ComputeEngineAdvertisement struct {
|
|
// APIs are the wire formats the engine serves on that one port: \"openai\", \"anthropic\", or both.
|
|
Apis []string `json:"apis,omitempty"`
|
|
// Models are the model ids the node's own GET /v1/models answered with — what this GPU can actually be asked for.
|
|
Models []string `json:"models,omitempty"`
|
|
// Status is \"ready\" when the node's engine answered, \"unreachable\" when it did not. Advertised is not the same as serving, and this is the difference.
|
|
Status *string `json:"status,omitempty"`
|
|
// URL is the base address the node advertised its engine on — where a model call to this GPU is sent. The node chose it, so reaching it is a question about the node's network, not about this surface.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ComputeEngineAdvertisement ComputeEngineAdvertisement
|
|
|
|
// NewComputeEngineAdvertisement instantiates a new ComputeEngineAdvertisement 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 NewComputeEngineAdvertisement() *ComputeEngineAdvertisement {
|
|
this := ComputeEngineAdvertisement{}
|
|
return &this
|
|
}
|
|
|
|
// NewComputeEngineAdvertisementWithDefaults instantiates a new ComputeEngineAdvertisement 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 NewComputeEngineAdvertisementWithDefaults() *ComputeEngineAdvertisement {
|
|
this := ComputeEngineAdvertisement{}
|
|
return &this
|
|
}
|
|
|
|
// GetApis returns the Apis field value if set, zero value otherwise.
|
|
func (o *ComputeEngineAdvertisement) GetApis() []string {
|
|
if o == nil || IsNil(o.Apis) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Apis
|
|
}
|
|
|
|
// GetApisOk returns a tuple with the Apis field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeEngineAdvertisement) GetApisOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Apis) {
|
|
return nil, false
|
|
}
|
|
return o.Apis, true
|
|
}
|
|
|
|
// HasApis returns a boolean if a field has been set.
|
|
func (o *ComputeEngineAdvertisement) HasApis() bool {
|
|
if o != nil && !IsNil(o.Apis) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetApis gets a reference to the given []string and assigns it to the Apis field.
|
|
func (o *ComputeEngineAdvertisement) SetApis(v []string) {
|
|
o.Apis = v
|
|
}
|
|
|
|
// GetModels returns the Models field value if set, zero value otherwise.
|
|
func (o *ComputeEngineAdvertisement) GetModels() []string {
|
|
if o == nil || IsNil(o.Models) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Models
|
|
}
|
|
|
|
// GetModelsOk returns a tuple with the Models field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeEngineAdvertisement) GetModelsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Models) {
|
|
return nil, false
|
|
}
|
|
return o.Models, true
|
|
}
|
|
|
|
// HasModels returns a boolean if a field has been set.
|
|
func (o *ComputeEngineAdvertisement) HasModels() bool {
|
|
if o != nil && !IsNil(o.Models) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModels gets a reference to the given []string and assigns it to the Models field.
|
|
func (o *ComputeEngineAdvertisement) SetModels(v []string) {
|
|
o.Models = v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) 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 *ComputeEngineAdvertisement) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o ComputeEngineAdvertisement) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ComputeEngineAdvertisement) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Apis) {
|
|
toSerialize["apis"] = o.Apis
|
|
}
|
|
if !IsNil(o.Models) {
|
|
toSerialize["models"] = o.Models
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ComputeEngineAdvertisement) UnmarshalJSON(data []byte) (err error) {
|
|
varComputeEngineAdvertisement := _ComputeEngineAdvertisement{}
|
|
|
|
err = json.Unmarshal(data, &varComputeEngineAdvertisement)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ComputeEngineAdvertisement(varComputeEngineAdvertisement)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "apis")
|
|
delete(additionalProperties, "models")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableComputeEngineAdvertisement struct {
|
|
value *ComputeEngineAdvertisement
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableComputeEngineAdvertisement) Get() *ComputeEngineAdvertisement {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableComputeEngineAdvertisement) Set(val *ComputeEngineAdvertisement) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableComputeEngineAdvertisement) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableComputeEngineAdvertisement) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableComputeEngineAdvertisement(val *ComputeEngineAdvertisement) *NullableComputeEngineAdvertisement {
|
|
return &NullableComputeEngineAdvertisement{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableComputeEngineAdvertisement) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableComputeEngineAdvertisement) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|