mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.3 KiB
Go
345 lines
9.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 FunctionInvocationView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &FunctionInvocationView{}
|
|
|
|
// FunctionInvocationView struct for FunctionInvocationView
|
|
type FunctionInvocationView struct {
|
|
// how long it took
|
|
DurationMs *int64 `json:"durationMs,omitempty"`
|
|
// the invocation's handle
|
|
Id *string `json:"id,omitempty"`
|
|
// the HTTP method that triggered it
|
|
Method *string `json:"method,omitempty"`
|
|
// how the run ended: ok, error or timeout
|
|
Status *string `json:"status,omitempty"`
|
|
// Code is the status the function's OWN code answered with, which is not the status of the reply — a program can answer 500 through a healthy sandbox.
|
|
StatusCode *int64 `json:"statusCode,omitempty"`
|
|
// when it ran, RFC3339
|
|
Time *string `json:"time,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _FunctionInvocationView FunctionInvocationView
|
|
|
|
// NewFunctionInvocationView instantiates a new FunctionInvocationView 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 NewFunctionInvocationView() *FunctionInvocationView {
|
|
this := FunctionInvocationView{}
|
|
return &this
|
|
}
|
|
|
|
// NewFunctionInvocationViewWithDefaults instantiates a new FunctionInvocationView 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 NewFunctionInvocationViewWithDefaults() *FunctionInvocationView {
|
|
this := FunctionInvocationView{}
|
|
return &this
|
|
}
|
|
|
|
// GetDurationMs returns the DurationMs field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) GetDurationMs() int64 {
|
|
if o == nil || IsNil(o.DurationMs) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.DurationMs
|
|
}
|
|
|
|
// GetDurationMsOk returns a tuple with the DurationMs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionInvocationView) GetDurationMsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.DurationMs) {
|
|
return nil, false
|
|
}
|
|
return o.DurationMs, true
|
|
}
|
|
|
|
// HasDurationMs returns a boolean if a field has been set.
|
|
func (o *FunctionInvocationView) HasDurationMs() bool {
|
|
if o != nil && !IsNil(o.DurationMs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDurationMs gets a reference to the given int64 and assigns it to the DurationMs field.
|
|
func (o *FunctionInvocationView) SetDurationMs(v int64) {
|
|
o.DurationMs = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) 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 *FunctionInvocationView) 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 *FunctionInvocationView) 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 *FunctionInvocationView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetMethod returns the Method field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) GetMethod() string {
|
|
if o == nil || IsNil(o.Method) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Method
|
|
}
|
|
|
|
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionInvocationView) GetMethodOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Method) {
|
|
return nil, false
|
|
}
|
|
return o.Method, true
|
|
}
|
|
|
|
// HasMethod returns a boolean if a field has been set.
|
|
func (o *FunctionInvocationView) HasMethod() bool {
|
|
if o != nil && !IsNil(o.Method) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMethod gets a reference to the given string and assigns it to the Method field.
|
|
func (o *FunctionInvocationView) SetMethod(v string) {
|
|
o.Method = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionInvocationView) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *FunctionInvocationView) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *FunctionInvocationView) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetStatusCode returns the StatusCode field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) GetStatusCode() int64 {
|
|
if o == nil || IsNil(o.StatusCode) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.StatusCode
|
|
}
|
|
|
|
// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionInvocationView) GetStatusCodeOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.StatusCode) {
|
|
return nil, false
|
|
}
|
|
return o.StatusCode, true
|
|
}
|
|
|
|
// HasStatusCode returns a boolean if a field has been set.
|
|
func (o *FunctionInvocationView) HasStatusCode() bool {
|
|
if o != nil && !IsNil(o.StatusCode) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatusCode gets a reference to the given int64 and assigns it to the StatusCode field.
|
|
func (o *FunctionInvocationView) SetStatusCode(v int64) {
|
|
o.StatusCode = &v
|
|
}
|
|
|
|
// GetTime returns the Time field value if set, zero value otherwise.
|
|
func (o *FunctionInvocationView) GetTime() string {
|
|
if o == nil || IsNil(o.Time) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Time
|
|
}
|
|
|
|
// GetTimeOk returns a tuple with the Time field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionInvocationView) GetTimeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Time) {
|
|
return nil, false
|
|
}
|
|
return o.Time, true
|
|
}
|
|
|
|
// HasTime returns a boolean if a field has been set.
|
|
func (o *FunctionInvocationView) HasTime() bool {
|
|
if o != nil && !IsNil(o.Time) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTime gets a reference to the given string and assigns it to the Time field.
|
|
func (o *FunctionInvocationView) SetTime(v string) {
|
|
o.Time = &v
|
|
}
|
|
|
|
func (o FunctionInvocationView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o FunctionInvocationView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.DurationMs) {
|
|
toSerialize["durationMs"] = o.DurationMs
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Method) {
|
|
toSerialize["method"] = o.Method
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.StatusCode) {
|
|
toSerialize["statusCode"] = o.StatusCode
|
|
}
|
|
if !IsNil(o.Time) {
|
|
toSerialize["time"] = o.Time
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *FunctionInvocationView) UnmarshalJSON(data []byte) (err error) {
|
|
varFunctionInvocationView := _FunctionInvocationView{}
|
|
|
|
err = json.Unmarshal(data, &varFunctionInvocationView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = FunctionInvocationView(varFunctionInvocationView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "durationMs")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "method")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "statusCode")
|
|
delete(additionalProperties, "time")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableFunctionInvocationView struct {
|
|
value *FunctionInvocationView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFunctionInvocationView) Get() *FunctionInvocationView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFunctionInvocationView) Set(val *FunctionInvocationView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFunctionInvocationView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFunctionInvocationView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFunctionInvocationView(val *FunctionInvocationView) *NullableFunctionInvocationView {
|
|
return &NullableFunctionInvocationView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFunctionInvocationView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFunctionInvocationView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|