Files
sdk/model_tool_skill.go

421 lines
11 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 ToolSkill type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolSkill{}
// ToolSkill struct for ToolSkill
type ToolSkill struct {
// Admitted is whether an admin of the org, or a SuperAdmin, wrote this content. Only admitted content is carried into the org's agent runs. A push writes content nobody administering the org attested, and a skill written before writing one took an admin says no until an admin writes it again.
Admitted *bool `json:"admitted,omitempty"`
// Content is the SKILL.md body, markdown.
Content *string `json:"content,omitempty"`
// CreatedAt is when the skill was last written, Unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Description is the one-line summary discovery shows for the skill.
Description *string `json:"description,omitempty"`
// ID is the skill's id within the org. It is DERIVED from Name, so writing the same name again revises that skill rather than adding another.
Id *string `json:"id,omitempty"`
// Name is the skill's name: one lowercase path segment (a-z0-9, _ or -).
Name *string `json:"name,omitempty"`
// Org is the org that authored the skill — the validated caller's, never a value the body supplied.
Org *string `json:"org,omitempty"`
// Source is the repository the skill was read from, \"<project>/<name>\" or \"<name>\"; empty for a skill written through the API. A push replaces every skill of its source at once, so a skill leaves when its file does.
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolSkill ToolSkill
// NewToolSkill instantiates a new ToolSkill 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 NewToolSkill() *ToolSkill {
this := ToolSkill{}
return &this
}
// NewToolSkillWithDefaults instantiates a new ToolSkill 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 NewToolSkillWithDefaults() *ToolSkill {
this := ToolSkill{}
return &this
}
// GetAdmitted returns the Admitted field value if set, zero value otherwise.
func (o *ToolSkill) GetAdmitted() bool {
if o == nil || IsNil(o.Admitted) {
var ret bool
return ret
}
return *o.Admitted
}
// GetAdmittedOk returns a tuple with the Admitted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolSkill) GetAdmittedOk() (*bool, bool) {
if o == nil || IsNil(o.Admitted) {
return nil, false
}
return o.Admitted, true
}
// HasAdmitted returns a boolean if a field has been set.
func (o *ToolSkill) HasAdmitted() bool {
if o != nil && !IsNil(o.Admitted) {
return true
}
return false
}
// SetAdmitted gets a reference to the given bool and assigns it to the Admitted field.
func (o *ToolSkill) SetAdmitted(v bool) {
o.Admitted = &v
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *ToolSkill) GetContent() string {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
return *o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolSkill) GetContentOk() (*string, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *ToolSkill) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *ToolSkill) SetContent(v string) {
o.Content = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *ToolSkill) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
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 *ToolSkill) GetCreatedAtOk() (*int64, 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 *ToolSkill) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *ToolSkill) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ToolSkill) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolSkill) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ToolSkill) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ToolSkill) SetDescription(v string) {
o.Description = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ToolSkill) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolSkill) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *ToolSkill) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ToolSkill) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ToolSkill) 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 *ToolSkill) 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 *ToolSkill) 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 *ToolSkill) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *ToolSkill) 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 *ToolSkill) 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 *ToolSkill) 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 *ToolSkill) SetOrg(v string) {
o.Org = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *ToolSkill) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolSkill) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *ToolSkill) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *ToolSkill) SetSource(v string) {
o.Source = &v
}
func (o ToolSkill) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolSkill) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Admitted) {
toSerialize["admitted"] = o.Admitted
}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolSkill) UnmarshalJSON(data []byte) (err error) {
varToolSkill := _ToolSkill{}
err = json.Unmarshal(data, &varToolSkill)
if err != nil {
return err
}
*o = ToolSkill(varToolSkill)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "admitted")
delete(additionalProperties, "content")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "description")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "org")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolSkill struct {
value *ToolSkill
isSet bool
}
func (v NullableToolSkill) Get() *ToolSkill {
return v.value
}
func (v *NullableToolSkill) Set(val *ToolSkill) {
v.value = val
v.isSet = true
}
func (v NullableToolSkill) IsSet() bool {
return v.isSet
}
func (v *NullableToolSkill) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolSkill(val *ToolSkill) *NullableToolSkill {
return &NullableToolSkill{value: val, isSet: true}
}
func (v NullableToolSkill) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolSkill) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}