mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.3 KiB
Go
307 lines
8.3 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 PromptCatalogEntry type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PromptCatalogEntry{}
|
|
|
|
// PromptCatalogEntry struct for PromptCatalogEntry
|
|
type PromptCatalogEntry struct {
|
|
// Labels is the starter's second suggested taxonomy, same treatment as Tags.
|
|
Labels []string `json:"labels,omitempty"`
|
|
// Name is the starter's suggested handle. It is NOT taken in your org: the catalog is shared reference content, so this name is free until you import it, and posting it under a name you already use appends a version to yours.
|
|
Name *string `json:"name,omitempty"`
|
|
// Prompt is the starter's full template body, ready to POST as-is. Entries too large to create (over 64 KiB) are dropped from this list rather than offered.
|
|
Prompt *string `json:"prompt,omitempty"`
|
|
// Tags is the starter's suggested taxonomy, carried through unchanged if you import it.
|
|
Tags []string `json:"tags,omitempty"`
|
|
// Type labels the template's kind, defaulted to \"text\" for entries that declare none.
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PromptCatalogEntry PromptCatalogEntry
|
|
|
|
// NewPromptCatalogEntry instantiates a new PromptCatalogEntry 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 NewPromptCatalogEntry() *PromptCatalogEntry {
|
|
this := PromptCatalogEntry{}
|
|
return &this
|
|
}
|
|
|
|
// NewPromptCatalogEntryWithDefaults instantiates a new PromptCatalogEntry 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 NewPromptCatalogEntryWithDefaults() *PromptCatalogEntry {
|
|
this := PromptCatalogEntry{}
|
|
return &this
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *PromptCatalogEntry) GetLabels() []string {
|
|
if o == nil || IsNil(o.Labels) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Labels
|
|
}
|
|
|
|
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptCatalogEntry) GetLabelsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Labels) {
|
|
return nil, false
|
|
}
|
|
return o.Labels, true
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *PromptCatalogEntry) HasLabels() bool {
|
|
if o != nil && !IsNil(o.Labels) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
|
|
func (o *PromptCatalogEntry) SetLabels(v []string) {
|
|
o.Labels = v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PromptCatalogEntry) 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 *PromptCatalogEntry) 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 *PromptCatalogEntry) 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 *PromptCatalogEntry) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPrompt returns the Prompt field value if set, zero value otherwise.
|
|
func (o *PromptCatalogEntry) GetPrompt() string {
|
|
if o == nil || IsNil(o.Prompt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Prompt
|
|
}
|
|
|
|
// GetPromptOk returns a tuple with the Prompt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptCatalogEntry) GetPromptOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Prompt) {
|
|
return nil, false
|
|
}
|
|
return o.Prompt, true
|
|
}
|
|
|
|
// HasPrompt returns a boolean if a field has been set.
|
|
func (o *PromptCatalogEntry) HasPrompt() bool {
|
|
if o != nil && !IsNil(o.Prompt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPrompt gets a reference to the given string and assigns it to the Prompt field.
|
|
func (o *PromptCatalogEntry) SetPrompt(v string) {
|
|
o.Prompt = &v
|
|
}
|
|
|
|
// GetTags returns the Tags field value if set, zero value otherwise.
|
|
func (o *PromptCatalogEntry) GetTags() []string {
|
|
if o == nil || IsNil(o.Tags) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Tags
|
|
}
|
|
|
|
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PromptCatalogEntry) GetTagsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Tags) {
|
|
return nil, false
|
|
}
|
|
return o.Tags, true
|
|
}
|
|
|
|
// HasTags returns a boolean if a field has been set.
|
|
func (o *PromptCatalogEntry) HasTags() bool {
|
|
if o != nil && !IsNil(o.Tags) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTags gets a reference to the given []string and assigns it to the Tags field.
|
|
func (o *PromptCatalogEntry) SetTags(v []string) {
|
|
o.Tags = v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *PromptCatalogEntry) 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 *PromptCatalogEntry) 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 *PromptCatalogEntry) 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 *PromptCatalogEntry) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o PromptCatalogEntry) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PromptCatalogEntry) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Labels) {
|
|
toSerialize["labels"] = o.Labels
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Prompt) {
|
|
toSerialize["prompt"] = o.Prompt
|
|
}
|
|
if !IsNil(o.Tags) {
|
|
toSerialize["tags"] = o.Tags
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PromptCatalogEntry) UnmarshalJSON(data []byte) (err error) {
|
|
varPromptCatalogEntry := _PromptCatalogEntry{}
|
|
|
|
err = json.Unmarshal(data, &varPromptCatalogEntry)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PromptCatalogEntry(varPromptCatalogEntry)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "labels")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "prompt")
|
|
delete(additionalProperties, "tags")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePromptCatalogEntry struct {
|
|
value *PromptCatalogEntry
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePromptCatalogEntry) Get() *PromptCatalogEntry {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePromptCatalogEntry) Set(val *PromptCatalogEntry) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePromptCatalogEntry) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePromptCatalogEntry) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePromptCatalogEntry(val *PromptCatalogEntry) *NullablePromptCatalogEntry {
|
|
return &NullablePromptCatalogEntry{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePromptCatalogEntry) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePromptCatalogEntry) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|