mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
272 lines
7.2 KiB
Go
272 lines
7.2 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 PostAiArticles200Response type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PostAiArticles200Response{}
|
|
|
|
// PostAiArticles200Response struct for PostAiArticles200Response
|
|
type PostAiArticles200Response struct {
|
|
Data *Article `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 _PostAiArticles200Response PostAiArticles200Response
|
|
|
|
// NewPostAiArticles200Response instantiates a new PostAiArticles200Response 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 NewPostAiArticles200Response(msg string, status string) *PostAiArticles200Response {
|
|
this := PostAiArticles200Response{}
|
|
this.Msg = msg
|
|
this.Status = status
|
|
return &this
|
|
}
|
|
|
|
// NewPostAiArticles200ResponseWithDefaults instantiates a new PostAiArticles200Response 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 NewPostAiArticles200ResponseWithDefaults() *PostAiArticles200Response {
|
|
this := PostAiArticles200Response{}
|
|
return &this
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise.
|
|
func (o *PostAiArticles200Response) GetData() Article {
|
|
if o == nil || IsNil(o.Data) {
|
|
var ret Article
|
|
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 *PostAiArticles200Response) GetDataOk() (*Article, 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 *PostAiArticles200Response) HasData() bool {
|
|
if o != nil && !IsNil(o.Data) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given Article and assigns it to the Data field.
|
|
func (o *PostAiArticles200Response) SetData(v Article) {
|
|
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 *PostAiArticles200Response) 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 *PostAiArticles200Response) 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 *PostAiArticles200Response) 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 *PostAiArticles200Response) SetData2(v interface{}) {
|
|
o.Data2 = v
|
|
}
|
|
|
|
// GetMsg returns the Msg field value
|
|
func (o *PostAiArticles200Response) 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 *PostAiArticles200Response) GetMsgOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Msg, true
|
|
}
|
|
|
|
// SetMsg sets field value
|
|
func (o *PostAiArticles200Response) SetMsg(v string) {
|
|
o.Msg = v
|
|
}
|
|
|
|
// GetStatus returns the Status field value
|
|
func (o *PostAiArticles200Response) 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 *PostAiArticles200Response) GetStatusOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Status, true
|
|
}
|
|
|
|
// SetStatus sets field value
|
|
func (o *PostAiArticles200Response) SetStatus(v string) {
|
|
o.Status = v
|
|
}
|
|
|
|
func (o PostAiArticles200Response) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PostAiArticles200Response) 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 *PostAiArticles200Response) 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)
|
|
}
|
|
}
|
|
|
|
varPostAiArticles200Response := _PostAiArticles200Response{}
|
|
|
|
err = json.Unmarshal(data, &varPostAiArticles200Response)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PostAiArticles200Response(varPostAiArticles200Response)
|
|
|
|
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 NullablePostAiArticles200Response struct {
|
|
value *PostAiArticles200Response
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePostAiArticles200Response) Get() *PostAiArticles200Response {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePostAiArticles200Response) Set(val *PostAiArticles200Response) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePostAiArticles200Response) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePostAiArticles200Response) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePostAiArticles200Response(val *PostAiArticles200Response) *NullablePostAiArticles200Response {
|
|
return &NullablePostAiArticles200Response{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePostAiArticles200Response) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePostAiArticles200Response) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|