Files
sdk/model_crawl_crawl_result.go

231 lines
6.1 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 CrawlCrawlResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CrawlCrawlResult{}
// CrawlCrawlResult struct for CrawlCrawlResult
type CrawlCrawlResult struct {
// Data is the page, present exactly when Success.
Data *CrawlCrawlDocument `json:"data,omitempty"`
// Error says what stopped the fetch: the host was refused, unreachable, or served something that is not a document.
Error *string `json:"error,omitempty"`
// Success is whether the page was fetched and read. FALSE with an Error is a complete answer, not a fault — check this before reading Data.
Success *bool `json:"success,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CrawlCrawlResult CrawlCrawlResult
// NewCrawlCrawlResult instantiates a new CrawlCrawlResult 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 NewCrawlCrawlResult() *CrawlCrawlResult {
this := CrawlCrawlResult{}
return &this
}
// NewCrawlCrawlResultWithDefaults instantiates a new CrawlCrawlResult 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 NewCrawlCrawlResultWithDefaults() *CrawlCrawlResult {
this := CrawlCrawlResult{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *CrawlCrawlResult) GetData() CrawlCrawlDocument {
if o == nil || IsNil(o.Data) {
var ret CrawlCrawlDocument
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 *CrawlCrawlResult) GetDataOk() (*CrawlCrawlDocument, 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 *CrawlCrawlResult) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given CrawlCrawlDocument and assigns it to the Data field.
func (o *CrawlCrawlResult) SetData(v CrawlCrawlDocument) {
o.Data = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *CrawlCrawlResult) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CrawlCrawlResult) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *CrawlCrawlResult) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *CrawlCrawlResult) SetError(v string) {
o.Error = &v
}
// GetSuccess returns the Success field value if set, zero value otherwise.
func (o *CrawlCrawlResult) GetSuccess() bool {
if o == nil || IsNil(o.Success) {
var ret bool
return ret
}
return *o.Success
}
// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CrawlCrawlResult) GetSuccessOk() (*bool, bool) {
if o == nil || IsNil(o.Success) {
return nil, false
}
return o.Success, true
}
// HasSuccess returns a boolean if a field has been set.
func (o *CrawlCrawlResult) HasSuccess() bool {
if o != nil && !IsNil(o.Success) {
return true
}
return false
}
// SetSuccess gets a reference to the given bool and assigns it to the Success field.
func (o *CrawlCrawlResult) SetSuccess(v bool) {
o.Success = &v
}
func (o CrawlCrawlResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CrawlCrawlResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.Success) {
toSerialize["success"] = o.Success
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CrawlCrawlResult) UnmarshalJSON(data []byte) (err error) {
varCrawlCrawlResult := _CrawlCrawlResult{}
err = json.Unmarshal(data, &varCrawlCrawlResult)
if err != nil {
return err
}
*o = CrawlCrawlResult(varCrawlCrawlResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "error")
delete(additionalProperties, "success")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCrawlCrawlResult struct {
value *CrawlCrawlResult
isSet bool
}
func (v NullableCrawlCrawlResult) Get() *CrawlCrawlResult {
return v.value
}
func (v *NullableCrawlCrawlResult) Set(val *CrawlCrawlResult) {
v.value = val
v.isSet = true
}
func (v NullableCrawlCrawlResult) IsSet() bool {
return v.isSet
}
func (v *NullableCrawlCrawlResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCrawlCrawlResult(val *CrawlCrawlResult) *NullableCrawlCrawlResult {
return &NullableCrawlCrawlResult{value: val, isSet: true}
}
func (v NullableCrawlCrawlResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCrawlCrawlResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}