Files
sdk/model_cluster_serving.go

302 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 ClusterServing type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ClusterServing{}
// ClusterServing struct for ClusterServing
type ClusterServing struct {
ModelId *string `json:"modelId,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Provider *string `json:"provider,omitempty"`
Service *string `json:"service,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ClusterServing ClusterServing
// NewClusterServing instantiates a new ClusterServing 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 NewClusterServing() *ClusterServing {
this := ClusterServing{}
return &this
}
// NewClusterServingWithDefaults instantiates a new ClusterServing 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 NewClusterServingWithDefaults() *ClusterServing {
this := ClusterServing{}
return &this
}
// GetModelId returns the ModelId field value if set, zero value otherwise.
func (o *ClusterServing) GetModelId() string {
if o == nil || IsNil(o.ModelId) {
var ret string
return ret
}
return *o.ModelId
}
// GetModelIdOk returns a tuple with the ModelId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClusterServing) GetModelIdOk() (*string, bool) {
if o == nil || IsNil(o.ModelId) {
return nil, false
}
return o.ModelId, true
}
// HasModelId returns a boolean if a field has been set.
func (o *ClusterServing) HasModelId() bool {
if o != nil && !IsNil(o.ModelId) {
return true
}
return false
}
// SetModelId gets a reference to the given string and assigns it to the ModelId field.
func (o *ClusterServing) SetModelId(v string) {
o.ModelId = &v
}
// GetNamespace returns the Namespace field value if set, zero value otherwise.
func (o *ClusterServing) GetNamespace() string {
if o == nil || IsNil(o.Namespace) {
var ret string
return ret
}
return *o.Namespace
}
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClusterServing) GetNamespaceOk() (*string, bool) {
if o == nil || IsNil(o.Namespace) {
return nil, false
}
return o.Namespace, true
}
// HasNamespace returns a boolean if a field has been set.
func (o *ClusterServing) HasNamespace() bool {
if o != nil && !IsNil(o.Namespace) {
return true
}
return false
}
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
func (o *ClusterServing) SetNamespace(v string) {
o.Namespace = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ClusterServing) 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 *ClusterServing) 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 *ClusterServing) 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 *ClusterServing) SetProvider(v string) {
o.Provider = &v
}
// GetService returns the Service field value if set, zero value otherwise.
func (o *ClusterServing) GetService() string {
if o == nil || IsNil(o.Service) {
var ret string
return ret
}
return *o.Service
}
// GetServiceOk returns a tuple with the Service field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClusterServing) GetServiceOk() (*string, bool) {
if o == nil || IsNil(o.Service) {
return nil, false
}
return o.Service, true
}
// HasService returns a boolean if a field has been set.
func (o *ClusterServing) HasService() bool {
if o != nil && !IsNil(o.Service) {
return true
}
return false
}
// SetService gets a reference to the given string and assigns it to the Service field.
func (o *ClusterServing) SetService(v string) {
o.Service = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ClusterServing) 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 *ClusterServing) 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 *ClusterServing) 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 *ClusterServing) SetUrl(v string) {
o.Url = &v
}
func (o ClusterServing) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ClusterServing) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ModelId) {
toSerialize["modelId"] = o.ModelId
}
if !IsNil(o.Namespace) {
toSerialize["namespace"] = o.Namespace
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Service) {
toSerialize["service"] = o.Service
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ClusterServing) UnmarshalJSON(data []byte) (err error) {
varClusterServing := _ClusterServing{}
err = json.Unmarshal(data, &varClusterServing)
if err != nil {
return err
}
*o = ClusterServing(varClusterServing)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "modelId")
delete(additionalProperties, "namespace")
delete(additionalProperties, "provider")
delete(additionalProperties, "service")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableClusterServing struct {
value *ClusterServing
isSet bool
}
func (v NullableClusterServing) Get() *ClusterServing {
return v.value
}
func (v *NullableClusterServing) Set(val *ClusterServing) {
v.value = val
v.isSet = true
}
func (v NullableClusterServing) IsSet() bool {
return v.isSet
}
func (v *NullableClusterServing) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableClusterServing(val *ClusterServing) *NullableClusterServing {
return &NullableClusterServing{value: val, isSet: true}
}
func (v NullableClusterServing) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableClusterServing) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}