mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.8 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 CodeFileContent type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CodeFileContent{}
|
|
|
|
// CodeFileContent struct for CodeFileContent
|
|
type CodeFileContent struct {
|
|
// Content is the file's text as the index stored it. It is NOT guaranteed byte-verbatim — the git object plane is the source of record for exact bytes, history and blame.
|
|
Content *string `json:"content,omitempty"`
|
|
// Lang is the detected language.
|
|
Lang *string `json:"lang,omitempty"`
|
|
// Path echoes the file that was read.
|
|
Path *string `json:"path,omitempty"`
|
|
// Repo echoes the repository it came from.
|
|
Repo *string `json:"repo,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CodeFileContent CodeFileContent
|
|
|
|
// NewCodeFileContent instantiates a new CodeFileContent 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 NewCodeFileContent() *CodeFileContent {
|
|
this := CodeFileContent{}
|
|
return &this
|
|
}
|
|
|
|
// NewCodeFileContentWithDefaults instantiates a new CodeFileContent 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 NewCodeFileContentWithDefaults() *CodeFileContent {
|
|
this := CodeFileContent{}
|
|
return &this
|
|
}
|
|
|
|
// GetContent returns the Content field value if set, zero value otherwise.
|
|
func (o *CodeFileContent) GetContent() string {
|
|
if o == nil || IsNil(o.Content) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Content
|
|
}
|
|
|
|
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeFileContent) GetContentOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Content) {
|
|
return nil, false
|
|
}
|
|
return o.Content, true
|
|
}
|
|
|
|
// HasContent returns a boolean if a field has been set.
|
|
func (o *CodeFileContent) HasContent() bool {
|
|
if o != nil && !IsNil(o.Content) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetContent gets a reference to the given string and assigns it to the Content field.
|
|
func (o *CodeFileContent) SetContent(v string) {
|
|
o.Content = &v
|
|
}
|
|
|
|
// GetLang returns the Lang field value if set, zero value otherwise.
|
|
func (o *CodeFileContent) GetLang() string {
|
|
if o == nil || IsNil(o.Lang) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Lang
|
|
}
|
|
|
|
// GetLangOk returns a tuple with the Lang field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeFileContent) GetLangOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Lang) {
|
|
return nil, false
|
|
}
|
|
return o.Lang, true
|
|
}
|
|
|
|
// HasLang returns a boolean if a field has been set.
|
|
func (o *CodeFileContent) HasLang() bool {
|
|
if o != nil && !IsNil(o.Lang) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLang gets a reference to the given string and assigns it to the Lang field.
|
|
func (o *CodeFileContent) SetLang(v string) {
|
|
o.Lang = &v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *CodeFileContent) GetPath() string {
|
|
if o == nil || IsNil(o.Path) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Path
|
|
}
|
|
|
|
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeFileContent) GetPathOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Path) {
|
|
return nil, false
|
|
}
|
|
return o.Path, true
|
|
}
|
|
|
|
// HasPath returns a boolean if a field has been set.
|
|
func (o *CodeFileContent) HasPath() bool {
|
|
if o != nil && !IsNil(o.Path) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPath gets a reference to the given string and assigns it to the Path field.
|
|
func (o *CodeFileContent) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *CodeFileContent) 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 *CodeFileContent) 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 *CodeFileContent) 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 *CodeFileContent) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
func (o CodeFileContent) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CodeFileContent) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Content) {
|
|
toSerialize["content"] = o.Content
|
|
}
|
|
if !IsNil(o.Lang) {
|
|
toSerialize["lang"] = o.Lang
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CodeFileContent) UnmarshalJSON(data []byte) (err error) {
|
|
varCodeFileContent := _CodeFileContent{}
|
|
|
|
err = json.Unmarshal(data, &varCodeFileContent)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CodeFileContent(varCodeFileContent)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "content")
|
|
delete(additionalProperties, "lang")
|
|
delete(additionalProperties, "path")
|
|
delete(additionalProperties, "repo")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCodeFileContent struct {
|
|
value *CodeFileContent
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCodeFileContent) Get() *CodeFileContent {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCodeFileContent) Set(val *CodeFileContent) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCodeFileContent) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCodeFileContent) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCodeFileContent(val *CodeFileContent) *NullableCodeFileContent {
|
|
return &NullableCodeFileContent{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCodeFileContent) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCodeFileContent) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|