Files
sdk/model_environment_env_save.go

231 lines
6.1 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 EnvironmentEnvSave type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EnvironmentEnvSave{}
// EnvironmentEnvSave struct for EnvironmentEnvSave
type EnvironmentEnvSave struct {
// Install is run in every fresh checkout before the agent starts, from the repository root, and must be non-interactive. Empty installs nothing.
Install *string `json:"install,omitempty"`
// Repo is the repository's name in the caller's org.
Repo *string `json:"repo,omitempty"`
// Start is left running in the background after the install. Empty starts nothing.
Start *string `json:"start,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EnvironmentEnvSave EnvironmentEnvSave
// NewEnvironmentEnvSave instantiates a new EnvironmentEnvSave 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 NewEnvironmentEnvSave() *EnvironmentEnvSave {
this := EnvironmentEnvSave{}
return &this
}
// NewEnvironmentEnvSaveWithDefaults instantiates a new EnvironmentEnvSave 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 NewEnvironmentEnvSaveWithDefaults() *EnvironmentEnvSave {
this := EnvironmentEnvSave{}
return &this
}
// GetInstall returns the Install field value if set, zero value otherwise.
func (o *EnvironmentEnvSave) GetInstall() string {
if o == nil || IsNil(o.Install) {
var ret string
return ret
}
return *o.Install
}
// GetInstallOk returns a tuple with the Install field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EnvironmentEnvSave) GetInstallOk() (*string, bool) {
if o == nil || IsNil(o.Install) {
return nil, false
}
return o.Install, true
}
// HasInstall returns a boolean if a field has been set.
func (o *EnvironmentEnvSave) HasInstall() bool {
if o != nil && !IsNil(o.Install) {
return true
}
return false
}
// SetInstall gets a reference to the given string and assigns it to the Install field.
func (o *EnvironmentEnvSave) SetInstall(v string) {
o.Install = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *EnvironmentEnvSave) 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 *EnvironmentEnvSave) 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 *EnvironmentEnvSave) 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 *EnvironmentEnvSave) SetRepo(v string) {
o.Repo = &v
}
// GetStart returns the Start field value if set, zero value otherwise.
func (o *EnvironmentEnvSave) GetStart() string {
if o == nil || IsNil(o.Start) {
var ret string
return ret
}
return *o.Start
}
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EnvironmentEnvSave) GetStartOk() (*string, bool) {
if o == nil || IsNil(o.Start) {
return nil, false
}
return o.Start, true
}
// HasStart returns a boolean if a field has been set.
func (o *EnvironmentEnvSave) HasStart() bool {
if o != nil && !IsNil(o.Start) {
return true
}
return false
}
// SetStart gets a reference to the given string and assigns it to the Start field.
func (o *EnvironmentEnvSave) SetStart(v string) {
o.Start = &v
}
func (o EnvironmentEnvSave) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EnvironmentEnvSave) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Install) {
toSerialize["install"] = o.Install
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Start) {
toSerialize["start"] = o.Start
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EnvironmentEnvSave) UnmarshalJSON(data []byte) (err error) {
varEnvironmentEnvSave := _EnvironmentEnvSave{}
err = json.Unmarshal(data, &varEnvironmentEnvSave)
if err != nil {
return err
}
*o = EnvironmentEnvSave(varEnvironmentEnvSave)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "install")
delete(additionalProperties, "repo")
delete(additionalProperties, "start")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEnvironmentEnvSave struct {
value *EnvironmentEnvSave
isSet bool
}
func (v NullableEnvironmentEnvSave) Get() *EnvironmentEnvSave {
return v.value
}
func (v *NullableEnvironmentEnvSave) Set(val *EnvironmentEnvSave) {
v.value = val
v.isSet = true
}
func (v NullableEnvironmentEnvSave) IsSet() bool {
return v.isSet
}
func (v *NullableEnvironmentEnvSave) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEnvironmentEnvSave(val *EnvironmentEnvSave) *NullableEnvironmentEnvSave {
return &NullableEnvironmentEnvSave{value: val, isSet: true}
}
func (v NullableEnvironmentEnvSave) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEnvironmentEnvSave) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}