Files
sdk/model_provider_github_search_req.go

193 lines
5.3 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 ProviderGithubSearchReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubSearchReq{}
// ProviderGithubSearchReq struct for ProviderGithubSearchReq
type ProviderGithubSearchReq struct {
// Limit caps the answer; 0 takes the default and anything above the ceiling is clamped rather than refused.
Limit *int64 `json:"limit,omitempty"`
// Q is GitHub's own search syntax, passed through: \"tetris language:go\", \"org:hanzoai stars:>10\". Passing it through rather than inventing a vocabulary means one thing to learn, and it is theirs.
Q *string `json:"q,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubSearchReq ProviderGithubSearchReq
// NewProviderGithubSearchReq instantiates a new ProviderGithubSearchReq 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 NewProviderGithubSearchReq() *ProviderGithubSearchReq {
this := ProviderGithubSearchReq{}
return &this
}
// NewProviderGithubSearchReqWithDefaults instantiates a new ProviderGithubSearchReq 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 NewProviderGithubSearchReqWithDefaults() *ProviderGithubSearchReq {
this := ProviderGithubSearchReq{}
return &this
}
// GetLimit returns the Limit field value if set, zero value otherwise.
func (o *ProviderGithubSearchReq) GetLimit() int64 {
if o == nil || IsNil(o.Limit) {
var ret int64
return ret
}
return *o.Limit
}
// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubSearchReq) GetLimitOk() (*int64, bool) {
if o == nil || IsNil(o.Limit) {
return nil, false
}
return o.Limit, true
}
// HasLimit returns a boolean if a field has been set.
func (o *ProviderGithubSearchReq) HasLimit() bool {
if o != nil && !IsNil(o.Limit) {
return true
}
return false
}
// SetLimit gets a reference to the given int64 and assigns it to the Limit field.
func (o *ProviderGithubSearchReq) SetLimit(v int64) {
o.Limit = &v
}
// GetQ returns the Q field value if set, zero value otherwise.
func (o *ProviderGithubSearchReq) GetQ() string {
if o == nil || IsNil(o.Q) {
var ret string
return ret
}
return *o.Q
}
// GetQOk returns a tuple with the Q field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubSearchReq) GetQOk() (*string, bool) {
if o == nil || IsNil(o.Q) {
return nil, false
}
return o.Q, true
}
// HasQ returns a boolean if a field has been set.
func (o *ProviderGithubSearchReq) HasQ() bool {
if o != nil && !IsNil(o.Q) {
return true
}
return false
}
// SetQ gets a reference to the given string and assigns it to the Q field.
func (o *ProviderGithubSearchReq) SetQ(v string) {
o.Q = &v
}
func (o ProviderGithubSearchReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubSearchReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Limit) {
toSerialize["limit"] = o.Limit
}
if !IsNil(o.Q) {
toSerialize["q"] = o.Q
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubSearchReq) UnmarshalJSON(data []byte) (err error) {
varProviderGithubSearchReq := _ProviderGithubSearchReq{}
err = json.Unmarshal(data, &varProviderGithubSearchReq)
if err != nil {
return err
}
*o = ProviderGithubSearchReq(varProviderGithubSearchReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "limit")
delete(additionalProperties, "q")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubSearchReq struct {
value *ProviderGithubSearchReq
isSet bool
}
func (v NullableProviderGithubSearchReq) Get() *ProviderGithubSearchReq {
return v.value
}
func (v *NullableProviderGithubSearchReq) Set(val *ProviderGithubSearchReq) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubSearchReq) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubSearchReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubSearchReq(val *ProviderGithubSearchReq) *NullableProviderGithubSearchReq {
return &NullableProviderGithubSearchReq{value: val, isSet: true}
}
func (v NullableProviderGithubSearchReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubSearchReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}