Files
sdk/model_books_ask_request.go

231 lines
6.0 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 BooksAskRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BooksAskRequest{}
// BooksAskRequest struct for BooksAskRequest
type BooksAskRequest struct {
// From is the RFC3339 start of the metric window. Empty means all time, treated as a single reporting period (see monthsBetween).
From *string `json:"from,omitempty"`
// Question is the plain-language question about the org's books, e.g. \"what is my MRR?\". Longer than 2000 characters is truncated, never refused.
Question *string `json:"question,omitempty"`
// To is the RFC3339 end of the metric window. Empty means up to now.
To *string `json:"to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BooksAskRequest BooksAskRequest
// NewBooksAskRequest instantiates a new BooksAskRequest 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 NewBooksAskRequest() *BooksAskRequest {
this := BooksAskRequest{}
return &this
}
// NewBooksAskRequestWithDefaults instantiates a new BooksAskRequest 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 NewBooksAskRequestWithDefaults() *BooksAskRequest {
this := BooksAskRequest{}
return &this
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *BooksAskRequest) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskRequest) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *BooksAskRequest) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *BooksAskRequest) SetFrom(v string) {
o.From = &v
}
// GetQuestion returns the Question field value if set, zero value otherwise.
func (o *BooksAskRequest) GetQuestion() string {
if o == nil || IsNil(o.Question) {
var ret string
return ret
}
return *o.Question
}
// GetQuestionOk returns a tuple with the Question field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskRequest) GetQuestionOk() (*string, bool) {
if o == nil || IsNil(o.Question) {
return nil, false
}
return o.Question, true
}
// HasQuestion returns a boolean if a field has been set.
func (o *BooksAskRequest) HasQuestion() bool {
if o != nil && !IsNil(o.Question) {
return true
}
return false
}
// SetQuestion gets a reference to the given string and assigns it to the Question field.
func (o *BooksAskRequest) SetQuestion(v string) {
o.Question = &v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *BooksAskRequest) GetTo() string {
if o == nil || IsNil(o.To) {
var ret string
return ret
}
return *o.To
}
// GetToOk returns a tuple with the To field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskRequest) GetToOk() (*string, bool) {
if o == nil || IsNil(o.To) {
return nil, false
}
return o.To, true
}
// HasTo returns a boolean if a field has been set.
func (o *BooksAskRequest) HasTo() bool {
if o != nil && !IsNil(o.To) {
return true
}
return false
}
// SetTo gets a reference to the given string and assigns it to the To field.
func (o *BooksAskRequest) SetTo(v string) {
o.To = &v
}
func (o BooksAskRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BooksAskRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if !IsNil(o.Question) {
toSerialize["question"] = o.Question
}
if !IsNil(o.To) {
toSerialize["to"] = o.To
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BooksAskRequest) UnmarshalJSON(data []byte) (err error) {
varBooksAskRequest := _BooksAskRequest{}
err = json.Unmarshal(data, &varBooksAskRequest)
if err != nil {
return err
}
*o = BooksAskRequest(varBooksAskRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "from")
delete(additionalProperties, "question")
delete(additionalProperties, "to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBooksAskRequest struct {
value *BooksAskRequest
isSet bool
}
func (v NullableBooksAskRequest) Get() *BooksAskRequest {
return v.value
}
func (v *NullableBooksAskRequest) Set(val *BooksAskRequest) {
v.value = val
v.isSet = true
}
func (v NullableBooksAskRequest) IsSet() bool {
return v.isSet
}
func (v *NullableBooksAskRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBooksAskRequest(val *BooksAskRequest) *NullableBooksAskRequest {
return &NullableBooksAskRequest{value: val, isSet: true}
}
func (v NullableBooksAskRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBooksAskRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}