Files
sdk/model_crawl_crawl_document.go

269 lines
7.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 CrawlCrawlDocument type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CrawlCrawlDocument{}
// CrawlCrawlDocument struct for CrawlCrawlDocument
type CrawlCrawlDocument struct {
// Markdown is the page's content, extracted and rendered to markdown. This is the field to read.
Markdown *string `json:"markdown,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
// Title is the document's title, when it carried one.
Title *string `json:"title,omitempty"`
// URL is the address actually read, after redirects.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CrawlCrawlDocument CrawlCrawlDocument
// NewCrawlCrawlDocument instantiates a new CrawlCrawlDocument 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 NewCrawlCrawlDocument() *CrawlCrawlDocument {
this := CrawlCrawlDocument{}
return &this
}
// NewCrawlCrawlDocumentWithDefaults instantiates a new CrawlCrawlDocument 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 NewCrawlCrawlDocumentWithDefaults() *CrawlCrawlDocument {
this := CrawlCrawlDocument{}
return &this
}
// GetMarkdown returns the Markdown field value if set, zero value otherwise.
func (o *CrawlCrawlDocument) GetMarkdown() string {
if o == nil || IsNil(o.Markdown) {
var ret string
return ret
}
return *o.Markdown
}
// GetMarkdownOk returns a tuple with the Markdown field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CrawlCrawlDocument) GetMarkdownOk() (*string, bool) {
if o == nil || IsNil(o.Markdown) {
return nil, false
}
return o.Markdown, true
}
// HasMarkdown returns a boolean if a field has been set.
func (o *CrawlCrawlDocument) HasMarkdown() bool {
if o != nil && !IsNil(o.Markdown) {
return true
}
return false
}
// SetMarkdown gets a reference to the given string and assigns it to the Markdown field.
func (o *CrawlCrawlDocument) SetMarkdown(v string) {
o.Markdown = &v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CrawlCrawlDocument) GetMetadata() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata 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 *CrawlCrawlDocument) GetMetadataOk() (*interface{}, bool) {
if o == nil || IsNil(o.Metadata) {
return nil, false
}
return &o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *CrawlCrawlDocument) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given interface{} and assigns it to the Metadata field.
func (o *CrawlCrawlDocument) SetMetadata(v interface{}) {
o.Metadata = v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *CrawlCrawlDocument) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CrawlCrawlDocument) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *CrawlCrawlDocument) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *CrawlCrawlDocument) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *CrawlCrawlDocument) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CrawlCrawlDocument) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *CrawlCrawlDocument) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *CrawlCrawlDocument) SetUrl(v string) {
o.Url = &v
}
func (o CrawlCrawlDocument) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CrawlCrawlDocument) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Markdown) {
toSerialize["markdown"] = o.Markdown
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CrawlCrawlDocument) UnmarshalJSON(data []byte) (err error) {
varCrawlCrawlDocument := _CrawlCrawlDocument{}
err = json.Unmarshal(data, &varCrawlCrawlDocument)
if err != nil {
return err
}
*o = CrawlCrawlDocument(varCrawlCrawlDocument)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "markdown")
delete(additionalProperties, "metadata")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCrawlCrawlDocument struct {
value *CrawlCrawlDocument
isSet bool
}
func (v NullableCrawlCrawlDocument) Get() *CrawlCrawlDocument {
return v.value
}
func (v *NullableCrawlCrawlDocument) Set(val *CrawlCrawlDocument) {
v.value = val
v.isSet = true
}
func (v NullableCrawlCrawlDocument) IsSet() bool {
return v.isSet
}
func (v *NullableCrawlCrawlDocument) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCrawlCrawlDocument(val *CrawlCrawlDocument) *NullableCrawlCrawlDocument {
return &NullableCrawlCrawlDocument{value: val, isSet: true}
}
func (v NullableCrawlCrawlDocument) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCrawlCrawlDocument) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}