mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.2 KiB
Go
231 lines
6.2 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 PromptVersionView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PromptVersionView{}
|
|
|
|
// PromptVersionView struct for PromptVersionView
|
|
type PromptVersionView struct {
|
|
// CreatedAt is when this revision was appended, RFC 3339 UTC.
|
|
CreatedAt *string `json:"createdAt,omitempty"`
|
|
// Type is the kind this revision was written with, which may differ from the current one.
|
|
Type *string `json:"type,omitempty"`
|
|
// Version is this revision's number, 1 for the first. Numbers are dense and never reused: deleting the prompt drops the whole history with it.
|
|
Version *int64 `json:"version,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PromptVersionView PromptVersionView
|
|
|
|
// NewPromptVersionView instantiates a new PromptVersionView 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 NewPromptVersionView() *PromptVersionView {
|
|
this := PromptVersionView{}
|
|
return &this
|
|
}
|
|
|
|
// NewPromptVersionViewWithDefaults instantiates a new PromptVersionView 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 NewPromptVersionViewWithDefaults() *PromptVersionView {
|
|
this := PromptVersionView{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *PromptVersionView) GetCreatedAt() string {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptVersionView) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *PromptVersionView) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
|
|
func (o *PromptVersionView) SetCreatedAt(v string) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *PromptVersionView) GetType() string {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptVersionView) GetTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *PromptVersionView) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *PromptVersionView) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
// GetVersion returns the Version field value if set, zero value otherwise.
|
|
func (o *PromptVersionView) GetVersion() int64 {
|
|
if o == nil || IsNil(o.Version) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Version
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptVersionView) GetVersionOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Version) {
|
|
return nil, false
|
|
}
|
|
return o.Version, true
|
|
}
|
|
|
|
// HasVersion returns a boolean if a field has been set.
|
|
func (o *PromptVersionView) HasVersion() bool {
|
|
if o != nil && !IsNil(o.Version) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
|
|
func (o *PromptVersionView) SetVersion(v int64) {
|
|
o.Version = &v
|
|
}
|
|
|
|
func (o PromptVersionView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PromptVersionView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
if !IsNil(o.Version) {
|
|
toSerialize["version"] = o.Version
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PromptVersionView) UnmarshalJSON(data []byte) (err error) {
|
|
varPromptVersionView := _PromptVersionView{}
|
|
|
|
err = json.Unmarshal(data, &varPromptVersionView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PromptVersionView(varPromptVersionView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "type")
|
|
delete(additionalProperties, "version")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePromptVersionView struct {
|
|
value *PromptVersionView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePromptVersionView) Get() *PromptVersionView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePromptVersionView) Set(val *PromptVersionView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePromptVersionView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePromptVersionView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePromptVersionView(val *PromptVersionView) *NullablePromptVersionView {
|
|
return &NullablePromptVersionView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePromptVersionView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePromptVersionView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|