mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.0 KiB
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 CodeIndexIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CodeIndexIn{}
|
|
|
|
// CodeIndexIn struct for CodeIndexIn
|
|
type CodeIndexIn struct {
|
|
// Files is the full set of files to index. Required and non-empty; max 20000 files, 1 MiB per file and 1 GiB in total. Unchanged files are skipped by content hash, so re-sending the whole tree is cheap.
|
|
Files []CodeFileInput `json:"files,omitempty"`
|
|
// Prune deletes indexed files that are NOT in this request — which makes the call a full sync of the repo rather than an upsert. Only pass it when Files is the complete tree.
|
|
Prune *bool `json:"prune,omitempty"`
|
|
// Repo is the repository label to index under. Required, max 200 bytes. It is a stored column value, not a filesystem path.
|
|
Repo *string `json:"repo,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CodeIndexIn CodeIndexIn
|
|
|
|
// NewCodeIndexIn instantiates a new CodeIndexIn 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 NewCodeIndexIn() *CodeIndexIn {
|
|
this := CodeIndexIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewCodeIndexInWithDefaults instantiates a new CodeIndexIn 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 NewCodeIndexInWithDefaults() *CodeIndexIn {
|
|
this := CodeIndexIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *CodeIndexIn) GetFiles() []CodeFileInput {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret []CodeFileInput
|
|
return ret
|
|
}
|
|
return o.Files
|
|
}
|
|
|
|
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexIn) GetFilesOk() ([]CodeFileInput, bool) {
|
|
if o == nil || IsNil(o.Files) {
|
|
return nil, false
|
|
}
|
|
return o.Files, true
|
|
}
|
|
|
|
// HasFiles returns a boolean if a field has been set.
|
|
func (o *CodeIndexIn) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given []CodeFileInput and assigns it to the Files field.
|
|
func (o *CodeIndexIn) SetFiles(v []CodeFileInput) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetPrune returns the Prune field value if set, zero value otherwise.
|
|
func (o *CodeIndexIn) GetPrune() bool {
|
|
if o == nil || IsNil(o.Prune) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Prune
|
|
}
|
|
|
|
// GetPruneOk returns a tuple with the Prune field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeIndexIn) GetPruneOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Prune) {
|
|
return nil, false
|
|
}
|
|
return o.Prune, true
|
|
}
|
|
|
|
// HasPrune returns a boolean if a field has been set.
|
|
func (o *CodeIndexIn) HasPrune() bool {
|
|
if o != nil && !IsNil(o.Prune) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPrune gets a reference to the given bool and assigns it to the Prune field.
|
|
func (o *CodeIndexIn) SetPrune(v bool) {
|
|
o.Prune = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *CodeIndexIn) 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 *CodeIndexIn) 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 *CodeIndexIn) 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 *CodeIndexIn) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
func (o CodeIndexIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CodeIndexIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.Prune) {
|
|
toSerialize["prune"] = o.Prune
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CodeIndexIn) UnmarshalJSON(data []byte) (err error) {
|
|
varCodeIndexIn := _CodeIndexIn{}
|
|
|
|
err = json.Unmarshal(data, &varCodeIndexIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CodeIndexIn(varCodeIndexIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "prune")
|
|
delete(additionalProperties, "repo")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCodeIndexIn struct {
|
|
value *CodeIndexIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCodeIndexIn) Get() *CodeIndexIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCodeIndexIn) Set(val *CodeIndexIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCodeIndexIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCodeIndexIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCodeIndexIn(val *CodeIndexIn) *NullableCodeIndexIn {
|
|
return &NullableCodeIndexIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCodeIndexIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCodeIndexIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|