Files
sdk/model_provider_github_search_out.go

193 lines
5.5 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 ProviderGithubSearchOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubSearchOut{}
// ProviderGithubSearchOut struct for ProviderGithubSearchOut
type ProviderGithubSearchOut struct {
// Count is how many hits Repos carries. It is that array's length, NOT GitHub's total_count, so it never exceeds limit and says nothing about how many more repositories matched.
Count *int64 `json:"count,omitempty"`
// Repos are the matching repositories in GitHub's own relevance order, capped at limit. Always an array, never null.
Repos []ProviderGithubSearchHit `json:"repos,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubSearchOut ProviderGithubSearchOut
// NewProviderGithubSearchOut instantiates a new ProviderGithubSearchOut 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 NewProviderGithubSearchOut() *ProviderGithubSearchOut {
this := ProviderGithubSearchOut{}
return &this
}
// NewProviderGithubSearchOutWithDefaults instantiates a new ProviderGithubSearchOut 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 NewProviderGithubSearchOutWithDefaults() *ProviderGithubSearchOut {
this := ProviderGithubSearchOut{}
return &this
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *ProviderGithubSearchOut) GetCount() int64 {
if o == nil || IsNil(o.Count) {
var ret int64
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubSearchOut) GetCountOk() (*int64, bool) {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *ProviderGithubSearchOut) HasCount() bool {
if o != nil && !IsNil(o.Count) {
return true
}
return false
}
// SetCount gets a reference to the given int64 and assigns it to the Count field.
func (o *ProviderGithubSearchOut) SetCount(v int64) {
o.Count = &v
}
// GetRepos returns the Repos field value if set, zero value otherwise.
func (o *ProviderGithubSearchOut) GetRepos() []ProviderGithubSearchHit {
if o == nil || IsNil(o.Repos) {
var ret []ProviderGithubSearchHit
return ret
}
return o.Repos
}
// GetReposOk returns a tuple with the Repos field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubSearchOut) GetReposOk() ([]ProviderGithubSearchHit, bool) {
if o == nil || IsNil(o.Repos) {
return nil, false
}
return o.Repos, true
}
// HasRepos returns a boolean if a field has been set.
func (o *ProviderGithubSearchOut) HasRepos() bool {
if o != nil && !IsNil(o.Repos) {
return true
}
return false
}
// SetRepos gets a reference to the given []ProviderGithubSearchHit and assigns it to the Repos field.
func (o *ProviderGithubSearchOut) SetRepos(v []ProviderGithubSearchHit) {
o.Repos = v
}
func (o ProviderGithubSearchOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubSearchOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
if !IsNil(o.Repos) {
toSerialize["repos"] = o.Repos
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubSearchOut) UnmarshalJSON(data []byte) (err error) {
varProviderGithubSearchOut := _ProviderGithubSearchOut{}
err = json.Unmarshal(data, &varProviderGithubSearchOut)
if err != nil {
return err
}
*o = ProviderGithubSearchOut(varProviderGithubSearchOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "count")
delete(additionalProperties, "repos")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubSearchOut struct {
value *ProviderGithubSearchOut
isSet bool
}
func (v NullableProviderGithubSearchOut) Get() *ProviderGithubSearchOut {
return v.value
}
func (v *NullableProviderGithubSearchOut) Set(val *ProviderGithubSearchOut) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubSearchOut) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubSearchOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubSearchOut(val *ProviderGithubSearchOut) *NullableProviderGithubSearchOut {
return &NullableProviderGithubSearchOut{value: val, isSet: true}
}
func (v NullableProviderGithubSearchOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubSearchOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}