/* Anthrove Orchestrator API This service handles the communication between the manager and the plugs API version: 0.1-PREVIEW Contact: support@anthrove.art */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "bytes" "encoding/json" "fmt" ) // checks if the ModelsOrchestratorTask type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ModelsOrchestratorTask{} // ModelsOrchestratorTask struct for ModelsOrchestratorTask type ModelsOrchestratorTask struct { AnthroveUserId string `json:"anthrove_user_id"` DeepScrape bool `json:"deep_scrape"` PlugTask ModelsPlugTask `json:"plug_task"` } type _ModelsOrchestratorTask ModelsOrchestratorTask // NewModelsOrchestratorTask instantiates a new ModelsOrchestratorTask 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 NewModelsOrchestratorTask(anthroveUserId string, deepScrape bool, plugTask ModelsPlugTask) *ModelsOrchestratorTask { this := ModelsOrchestratorTask{} this.AnthroveUserId = anthroveUserId this.DeepScrape = deepScrape this.PlugTask = plugTask return &this } // NewModelsOrchestratorTaskWithDefaults instantiates a new ModelsOrchestratorTask 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 NewModelsOrchestratorTaskWithDefaults() *ModelsOrchestratorTask { this := ModelsOrchestratorTask{} return &this } // GetAnthroveUserId returns the AnthroveUserId field value func (o *ModelsOrchestratorTask) GetAnthroveUserId() string { if o == nil { var ret string return ret } return o.AnthroveUserId } // GetAnthroveUserIdOk returns a tuple with the AnthroveUserId field value // and a boolean to check if the value has been set. func (o *ModelsOrchestratorTask) GetAnthroveUserIdOk() (*string, bool) { if o == nil { return nil, false } return &o.AnthroveUserId, true } // SetAnthroveUserId sets field value func (o *ModelsOrchestratorTask) SetAnthroveUserId(v string) { o.AnthroveUserId = v } // GetDeepScrape returns the DeepScrape field value func (o *ModelsOrchestratorTask) GetDeepScrape() bool { if o == nil { var ret bool return ret } return o.DeepScrape } // GetDeepScrapeOk returns a tuple with the DeepScrape field value // and a boolean to check if the value has been set. func (o *ModelsOrchestratorTask) GetDeepScrapeOk() (*bool, bool) { if o == nil { return nil, false } return &o.DeepScrape, true } // SetDeepScrape sets field value func (o *ModelsOrchestratorTask) SetDeepScrape(v bool) { o.DeepScrape = v } // GetPlugTask returns the PlugTask field value func (o *ModelsOrchestratorTask) GetPlugTask() ModelsPlugTask { if o == nil { var ret ModelsPlugTask return ret } return o.PlugTask } // GetPlugTaskOk returns a tuple with the PlugTask field value // and a boolean to check if the value has been set. func (o *ModelsOrchestratorTask) GetPlugTaskOk() (*ModelsPlugTask, bool) { if o == nil { return nil, false } return &o.PlugTask, true } // SetPlugTask sets field value func (o *ModelsOrchestratorTask) SetPlugTask(v ModelsPlugTask) { o.PlugTask = v } func (o ModelsOrchestratorTask) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ModelsOrchestratorTask) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["anthrove_user_id"] = o.AnthroveUserId toSerialize["deep_scrape"] = o.DeepScrape toSerialize["plug_task"] = o.PlugTask return toSerialize, nil } func (o *ModelsOrchestratorTask) 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{ "anthrove_user_id", "deep_scrape", "plug_task", } 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) } } varModelsOrchestratorTask := _ModelsOrchestratorTask{} decoder := json.NewDecoder(bytes.NewReader(data)) decoder.DisallowUnknownFields() err = decoder.Decode(&varModelsOrchestratorTask) if err != nil { return err } *o = ModelsOrchestratorTask(varModelsOrchestratorTask) return err } type NullableModelsOrchestratorTask struct { value *ModelsOrchestratorTask isSet bool } func (v NullableModelsOrchestratorTask) Get() *ModelsOrchestratorTask { return v.value } func (v *NullableModelsOrchestratorTask) Set(val *ModelsOrchestratorTask) { v.value = val v.isSet = true } func (v NullableModelsOrchestratorTask) IsSet() bool { return v.isSet } func (v *NullableModelsOrchestratorTask) Unset() { v.value = nil v.isSet = false } func NewNullableModelsOrchestratorTask(val *ModelsOrchestratorTask) *NullableModelsOrchestratorTask { return &NullableModelsOrchestratorTask{value: val, isSet: true} } func (v NullableModelsOrchestratorTask) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableModelsOrchestratorTask) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }