Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

9.2 KB
Raw Blame
/*
BoxLite

BoxLite 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 (
	"encoding/json"
	"fmt"
)

// checks if the ImageAliasEvent type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ImageAliasEvent{}

// ImageAliasEvent struct for ImageAliasEvent
type ImageAliasEvent struct {
	// The alias that moved
	AliasName string `json:"aliasName"`
	// Version the alias pointed at before. Null when the alias did not exist yet
	FromVersionId NullableString `json:"fromVersionId"`
	// Previous digest in historical records. Null for alias creation
	FromDigest NullableString `json:"fromDigest"`
	// Version selected by the alias
	ToVersionId string `json:"toVersionId"`
	// Digest selected by the alias
	ToDigest string `json:"toDigest"`
	// Who created the alias. Null when a registry pull seeded it
	ActorId NullableString `json:"actorId"`
	// When the alias was recorded
	CreatedAt string `json:"createdAt"`
	AdditionalProperties map[string]interface{}
}

type _ImageAliasEvent ImageAliasEvent

// NewImageAliasEvent instantiates a new ImageAliasEvent 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 NewImageAliasEvent(aliasName string, fromVersionId NullableString, fromDigest NullableString, toVersionId string, toDigest string, actorId NullableString, createdAt string) *ImageAliasEvent {
	this := ImageAliasEvent{}
	this.AliasName = aliasName
	this.FromVersionId = fromVersionId
	this.FromDigest = fromDigest
	this.ToVersionId = toVersionId
	this.ToDigest = toDigest
	this.ActorId = actorId
	this.CreatedAt = createdAt
	return &this
}

// NewImageAliasEventWithDefaults instantiates a new ImageAliasEvent 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 NewImageAliasEventWithDefaults() *ImageAliasEvent {
	this := ImageAliasEvent{}
	return &this
}

// GetAliasName returns the AliasName field value
func (o *ImageAliasEvent) GetAliasName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.AliasName
}

// GetAliasNameOk returns a tuple with the AliasName field value
// and a boolean to check if the value has been set.
func (o *ImageAliasEvent) GetAliasNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.AliasName, true
}

// SetAliasName sets field value
func (o *ImageAliasEvent) SetAliasName(v string) {
	o.AliasName = v
}

// GetFromVersionId returns the FromVersionId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageAliasEvent) GetFromVersionId() string {
	if o == nil || o.FromVersionId.Get() == nil {
		var ret string
		return ret
	}

	return *o.FromVersionId.Get()
}

// GetFromVersionIdOk returns a tuple with the FromVersionId field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ImageAliasEvent) GetFromVersionIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.FromVersionId.Get(), o.FromVersionId.IsSet()
}

// SetFromVersionId sets field value
func (o *ImageAliasEvent) SetFromVersionId(v string) {
	o.FromVersionId.Set(&v)
}

// GetFromDigest returns the FromDigest field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageAliasEvent) GetFromDigest() string {
	if o == nil || o.FromDigest.Get() == nil {
		var ret string
		return ret
	}

	return *o.FromDigest.Get()
}

// GetFromDigestOk returns a tuple with the FromDigest field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ImageAliasEvent) GetFromDigestOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.FromDigest.Get(), o.FromDigest.IsSet()
}

// SetFromDigest sets field value
func (o *ImageAliasEvent) SetFromDigest(v string) {
	o.FromDigest.Set(&v)
}

// GetToVersionId returns the ToVersionId field value
func (o *ImageAliasEvent) GetToVersionId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ToVersionId
}

// GetToVersionIdOk returns a tuple with the ToVersionId field value
// and a boolean to check if the value has been set.
func (o *ImageAliasEvent) GetToVersionIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ToVersionId, true
}

// SetToVersionId sets field value
func (o *ImageAliasEvent) SetToVersionId(v string) {
	o.ToVersionId = v
}

// GetToDigest returns the ToDigest field value
func (o *ImageAliasEvent) GetToDigest() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ToDigest
}

// GetToDigestOk returns a tuple with the ToDigest field value
// and a boolean to check if the value has been set.
func (o *ImageAliasEvent) GetToDigestOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ToDigest, true
}

// SetToDigest sets field value
func (o *ImageAliasEvent) SetToDigest(v string) {
	o.ToDigest = v
}

// GetActorId returns the ActorId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageAliasEvent) GetActorId() string {
	if o == nil || o.ActorId.Get() == nil {
		var ret string
		return ret
	}

	return *o.ActorId.Get()
}

// GetActorIdOk returns a tuple with the ActorId field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ImageAliasEvent) GetActorIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.ActorId.Get(), o.ActorId.IsSet()
}

// SetActorId sets field value
func (o *ImageAliasEvent) SetActorId(v string) {
	o.ActorId.Set(&v)
}

// GetCreatedAt returns the CreatedAt field value
func (o *ImageAliasEvent) GetCreatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CreatedAt
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *ImageAliasEvent) GetCreatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CreatedAt, true
}

// SetCreatedAt sets field value
func (o *ImageAliasEvent) SetCreatedAt(v string) {
	o.CreatedAt = v
}

func (o ImageAliasEvent) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o ImageAliasEvent) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["aliasName"] = o.AliasName
	toSerialize["fromVersionId"] = o.FromVersionId.Get()
	toSerialize["fromDigest"] = o.FromDigest.Get()
	toSerialize["toVersionId"] = o.ToVersionId
	toSerialize["toDigest"] = o.ToDigest
	toSerialize["actorId"] = o.ActorId.Get()
	toSerialize["createdAt"] = o.CreatedAt

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *ImageAliasEvent) 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{
		"aliasName",
		"fromVersionId",
		"fromDigest",
		"toVersionId",
		"toDigest",
		"actorId",
		"createdAt",
	}

	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)
		}
	}

	varImageAliasEvent := _ImageAliasEvent{}

	err = json.Unmarshal(data, &varImageAliasEvent)

	if err != nil {
		return err
	}

	*o = ImageAliasEvent(varImageAliasEvent)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "aliasName")
		delete(additionalProperties, "fromVersionId")
		delete(additionalProperties, "fromDigest")
		delete(additionalProperties, "toVersionId")
		delete(additionalProperties, "toDigest")
		delete(additionalProperties, "actorId")
		delete(additionalProperties, "createdAt")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableImageAliasEvent struct {
	value *ImageAliasEvent
	isSet bool
}

func (v NullableImageAliasEvent) Get() *ImageAliasEvent {
	return v.value
}

func (v *NullableImageAliasEvent) Set(val *ImageAliasEvent) {
	v.value = val
	v.isSet = true
}

func (v NullableImageAliasEvent) IsSet() bool {
	return v.isSet
}

func (v *NullableImageAliasEvent) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableImageAliasEvent(val *ImageAliasEvent) *NullableImageAliasEvent {
	return &NullableImageAliasEvent{value: val, isSet: true}
}

func (v NullableImageAliasEvent) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableImageAliasEvent) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}