Files
zeekayandHanzo Dev 9cfc3af66d the Go client for Hanzo Runtime
Generated from Runtime's OpenAPI document, and pure standard library — it
requires nothing else, so a caller pays only for this package.

It lives here rather than inside Runtime because a nested module is resolved
by the path it declares, and one declaring a path it does not sit at is
reachable by nobody: no proxy answers for it and no consumer can name it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-14 08:41:09 -07:00

246 lines
5.0 KiB
Go

/*
Runtime
Runtime AI platform API Docs
API version: 1.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package apiclient
import (
"bytes"
"encoding/json"
"fmt"
)
// checks if the User type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &User{}
// User struct for User
type User struct {
// User ID
Id string `json:"id"`
// User name
Name string `json:"name"`
// User email
Email string `json:"email"`
// User public keys
PublicKeys []UserPublicKey `json:"publicKeys"`
}
type _User User
// NewUser instantiates a new User 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 NewUser(id string, name string, email string, publicKeys []UserPublicKey) *User {
this := User{}
this.Id = id
this.Name = name
this.Email = email
this.PublicKeys = publicKeys
return &this
}
// NewUserWithDefaults instantiates a new User 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 NewUserWithDefaults() *User {
this := User{}
return &this
}
// GetId returns the Id field value
func (o *User) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *User) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *User) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value
func (o *User) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *User) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *User) SetName(v string) {
o.Name = v
}
// GetEmail returns the Email field value
func (o *User) GetEmail() string {
if o == nil {
var ret string
return ret
}
return o.Email
}
// GetEmailOk returns a tuple with the Email field value
// and a boolean to check if the value has been set.
func (o *User) GetEmailOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Email, true
}
// SetEmail sets field value
func (o *User) SetEmail(v string) {
o.Email = v
}
// GetPublicKeys returns the PublicKeys field value
func (o *User) GetPublicKeys() []UserPublicKey {
if o == nil {
var ret []UserPublicKey
return ret
}
return o.PublicKeys
}
// GetPublicKeysOk returns a tuple with the PublicKeys field value
// and a boolean to check if the value has been set.
func (o *User) GetPublicKeysOk() ([]UserPublicKey, bool) {
if o == nil {
return nil, false
}
return o.PublicKeys, true
}
// SetPublicKeys sets field value
func (o *User) SetPublicKeys(v []UserPublicKey) {
o.PublicKeys = v
}
func (o User) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o User) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["name"] = o.Name
toSerialize["email"] = o.Email
toSerialize["publicKeys"] = o.PublicKeys
return toSerialize, nil
}
func (o *User) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"name",
"email",
"publicKeys",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varUser := _User{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varUser)
if err != nil {
return err
}
*o = User(varUser)
return err
}
type NullableUser struct {
value *User
isSet bool
}
func (v NullableUser) Get() *User {
return v.value
}
func (v *NullableUser) Set(val *User) {
v.value = val
v.isSet = true
}
func (v NullableUser) IsSet() bool {
return v.isSet
}
func (v *NullableUser) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUser(val *User) *NullableUser {
return &NullableUser{value: val, isSet: true}
}
func (v NullableUser) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUser) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}