Files
sdk/model_code_context_in.go

231 lines
5.9 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 CodeContextIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CodeContextIn{}
// CodeContextIn struct for CodeContextIn
type CodeContextIn struct {
// BudgetTokens caps the bundle's size. Clamped to [256, 32000]; 0 or absent uses 4000.
BudgetTokens *int64 `json:"budgetTokens,omitempty"`
// Query is what to retrieve context for. Required, max 4000 bytes.
Query *string `json:"query,omitempty"`
// Repo narrows retrieval to one repository. Empty searches every repo the org has indexed.
Repo *string `json:"repo,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CodeContextIn CodeContextIn
// NewCodeContextIn instantiates a new CodeContextIn 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 NewCodeContextIn() *CodeContextIn {
this := CodeContextIn{}
return &this
}
// NewCodeContextInWithDefaults instantiates a new CodeContextIn 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 NewCodeContextInWithDefaults() *CodeContextIn {
this := CodeContextIn{}
return &this
}
// GetBudgetTokens returns the BudgetTokens field value if set, zero value otherwise.
func (o *CodeContextIn) GetBudgetTokens() int64 {
if o == nil || IsNil(o.BudgetTokens) {
var ret int64
return ret
}
return *o.BudgetTokens
}
// GetBudgetTokensOk returns a tuple with the BudgetTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeContextIn) GetBudgetTokensOk() (*int64, bool) {
if o == nil || IsNil(o.BudgetTokens) {
return nil, false
}
return o.BudgetTokens, true
}
// HasBudgetTokens returns a boolean if a field has been set.
func (o *CodeContextIn) HasBudgetTokens() bool {
if o != nil && !IsNil(o.BudgetTokens) {
return true
}
return false
}
// SetBudgetTokens gets a reference to the given int64 and assigns it to the BudgetTokens field.
func (o *CodeContextIn) SetBudgetTokens(v int64) {
o.BudgetTokens = &v
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *CodeContextIn) GetQuery() string {
if o == nil || IsNil(o.Query) {
var ret string
return ret
}
return *o.Query
}
// GetQueryOk returns a tuple with the Query field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeContextIn) GetQueryOk() (*string, bool) {
if o == nil || IsNil(o.Query) {
return nil, false
}
return o.Query, true
}
// HasQuery returns a boolean if a field has been set.
func (o *CodeContextIn) HasQuery() bool {
if o != nil && !IsNil(o.Query) {
return true
}
return false
}
// SetQuery gets a reference to the given string and assigns it to the Query field.
func (o *CodeContextIn) SetQuery(v string) {
o.Query = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *CodeContextIn) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CodeContextIn) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *CodeContextIn) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *CodeContextIn) SetRepo(v string) {
o.Repo = &v
}
func (o CodeContextIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CodeContextIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BudgetTokens) {
toSerialize["budgetTokens"] = o.BudgetTokens
}
if !IsNil(o.Query) {
toSerialize["query"] = o.Query
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CodeContextIn) UnmarshalJSON(data []byte) (err error) {
varCodeContextIn := _CodeContextIn{}
err = json.Unmarshal(data, &varCodeContextIn)
if err != nil {
return err
}
*o = CodeContextIn(varCodeContextIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "budgetTokens")
delete(additionalProperties, "query")
delete(additionalProperties, "repo")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCodeContextIn struct {
value *CodeContextIn
isSet bool
}
func (v NullableCodeContextIn) Get() *CodeContextIn {
return v.value
}
func (v *NullableCodeContextIn) Set(val *CodeContextIn) {
v.value = val
v.isSet = true
}
func (v NullableCodeContextIn) IsSet() bool {
return v.isSet
}
func (v *NullableCodeContextIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCodeContextIn(val *CodeContextIn) *NullableCodeContextIn {
return &NullableCodeContextIn{value: val, isSet: true}
}
func (v NullableCodeContextIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCodeContextIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}