Files
sdk/model_post_ai_workflows_200_response.go

272 lines
7.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"
"fmt"
)
// checks if the PostAiWorkflows200Response type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PostAiWorkflows200Response{}
// PostAiWorkflows200Response struct for PostAiWorkflows200Response
type PostAiWorkflows200Response struct {
Data *Workflow `json:"data,omitempty"`
Data2 interface{} `json:"data2,omitempty"`
// Empty on success, the reason on failure.
Msg string `json:"msg"`
Status string `json:"status"`
AdditionalProperties map[string]interface{}
}
type _PostAiWorkflows200Response PostAiWorkflows200Response
// NewPostAiWorkflows200Response instantiates a new PostAiWorkflows200Response 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 NewPostAiWorkflows200Response(msg string, status string) *PostAiWorkflows200Response {
this := PostAiWorkflows200Response{}
this.Msg = msg
this.Status = status
return &this
}
// NewPostAiWorkflows200ResponseWithDefaults instantiates a new PostAiWorkflows200Response 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 NewPostAiWorkflows200ResponseWithDefaults() *PostAiWorkflows200Response {
this := PostAiWorkflows200Response{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *PostAiWorkflows200Response) GetData() Workflow {
if o == nil || IsNil(o.Data) {
var ret Workflow
return ret
}
return *o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PostAiWorkflows200Response) GetDataOk() (*Workflow, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *PostAiWorkflows200Response) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given Workflow and assigns it to the Data field.
func (o *PostAiWorkflows200Response) SetData(v Workflow) {
o.Data = &v
}
// GetData2 returns the Data2 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PostAiWorkflows200Response) GetData2() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Data2
}
// GetData2Ok returns a tuple with the Data2 field value if set, nil otherwise
// 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 *PostAiWorkflows200Response) GetData2Ok() (*interface{}, bool) {
if o == nil || IsNil(o.Data2) {
return nil, false
}
return &o.Data2, true
}
// HasData2 returns a boolean if a field has been set.
func (o *PostAiWorkflows200Response) HasData2() bool {
if o != nil && !IsNil(o.Data2) {
return true
}
return false
}
// SetData2 gets a reference to the given interface{} and assigns it to the Data2 field.
func (o *PostAiWorkflows200Response) SetData2(v interface{}) {
o.Data2 = v
}
// GetMsg returns the Msg field value
func (o *PostAiWorkflows200Response) GetMsg() string {
if o == nil {
var ret string
return ret
}
return o.Msg
}
// GetMsgOk returns a tuple with the Msg field value
// and a boolean to check if the value has been set.
func (o *PostAiWorkflows200Response) GetMsgOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Msg, true
}
// SetMsg sets field value
func (o *PostAiWorkflows200Response) SetMsg(v string) {
o.Msg = v
}
// GetStatus returns the Status field value
func (o *PostAiWorkflows200Response) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *PostAiWorkflows200Response) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *PostAiWorkflows200Response) SetStatus(v string) {
o.Status = v
}
func (o PostAiWorkflows200Response) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PostAiWorkflows200Response) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if o.Data2 != nil {
toSerialize["data2"] = o.Data2
}
toSerialize["msg"] = o.Msg
toSerialize["status"] = o.Status
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PostAiWorkflows200Response) 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{
"msg",
"status",
}
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)
}
}
varPostAiWorkflows200Response := _PostAiWorkflows200Response{}
err = json.Unmarshal(data, &varPostAiWorkflows200Response)
if err != nil {
return err
}
*o = PostAiWorkflows200Response(varPostAiWorkflows200Response)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "data2")
delete(additionalProperties, "msg")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePostAiWorkflows200Response struct {
value *PostAiWorkflows200Response
isSet bool
}
func (v NullablePostAiWorkflows200Response) Get() *PostAiWorkflows200Response {
return v.value
}
func (v *NullablePostAiWorkflows200Response) Set(val *PostAiWorkflows200Response) {
v.value = val
v.isSet = true
}
func (v NullablePostAiWorkflows200Response) IsSet() bool {
return v.isSet
}
func (v *NullablePostAiWorkflows200Response) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePostAiWorkflows200Response(val *PostAiWorkflows200Response) *NullablePostAiWorkflows200Response {
return &NullablePostAiWorkflows200Response{value: val, isSet: true}
}
func (v NullablePostAiWorkflows200Response) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePostAiWorkflows200Response) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}