mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
12 KiB
Go
421 lines
12 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 EnvironmentEnvironment type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EnvironmentEnvironment{}
|
|
|
|
// EnvironmentEnvironment struct for EnvironmentEnvironment
|
|
type EnvironmentEnvironment struct {
|
|
// Install is the shell a run executes in its fresh checkout before the agent starts, from the repository root. Empty installs nothing.
|
|
Install *string `json:"install,omitempty"`
|
|
// Proposal is what the last setup run found, until it is saved or replaced.
|
|
Proposal *EnvironmentProposal `json:"proposal,omitempty"`
|
|
// Repo is the codebase: a repository's name in the caller's org.
|
|
Repo *string `json:"repo,omitempty"`
|
|
// Secrets are the names set on this codebase, each exported to the run's commands under that name. Values are never answered.
|
|
Secrets []string `json:"secrets,omitempty"`
|
|
// Session is the setup run that produced the proposal, when there is one.
|
|
Session *string `json:"session,omitempty"`
|
|
// Start is the one command a run leaves running in the background once the install has finished — a dev server, a database. Empty starts nothing.
|
|
Start *string `json:"start,omitempty"`
|
|
// State is `none` when nothing is saved or proposed, `proposed` when a setup run's answer is waiting to be reviewed, and `ready` otherwise.
|
|
State *string `json:"state,omitempty"`
|
|
// UpdatedAt is when this environment last changed, RFC 3339. Absent for none.
|
|
UpdatedAt *string `json:"updatedAt,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EnvironmentEnvironment EnvironmentEnvironment
|
|
|
|
// NewEnvironmentEnvironment instantiates a new EnvironmentEnvironment 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 NewEnvironmentEnvironment() *EnvironmentEnvironment {
|
|
this := EnvironmentEnvironment{}
|
|
return &this
|
|
}
|
|
|
|
// NewEnvironmentEnvironmentWithDefaults instantiates a new EnvironmentEnvironment 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 NewEnvironmentEnvironmentWithDefaults() *EnvironmentEnvironment {
|
|
this := EnvironmentEnvironment{}
|
|
return &this
|
|
}
|
|
|
|
// GetInstall returns the Install field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) SetInstall(v string) {
|
|
o.Install = &v
|
|
}
|
|
|
|
// GetProposal returns the Proposal field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) GetProposal() EnvironmentProposal {
|
|
if o == nil || IsNil(o.Proposal) {
|
|
var ret EnvironmentProposal
|
|
return ret
|
|
}
|
|
return *o.Proposal
|
|
}
|
|
|
|
// GetProposalOk returns a tuple with the Proposal field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EnvironmentEnvironment) GetProposalOk() (*EnvironmentProposal, bool) {
|
|
if o == nil || IsNil(o.Proposal) {
|
|
return nil, false
|
|
}
|
|
return o.Proposal, true
|
|
}
|
|
|
|
// HasProposal returns a boolean if a field has been set.
|
|
func (o *EnvironmentEnvironment) HasProposal() bool {
|
|
if o != nil && !IsNil(o.Proposal) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProposal gets a reference to the given EnvironmentProposal and assigns it to the Proposal field.
|
|
func (o *EnvironmentEnvironment) SetProposal(v EnvironmentProposal) {
|
|
o.Proposal = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetSecrets returns the Secrets field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) GetSecrets() []string {
|
|
if o == nil || IsNil(o.Secrets) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Secrets
|
|
}
|
|
|
|
// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EnvironmentEnvironment) GetSecretsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Secrets) {
|
|
return nil, false
|
|
}
|
|
return o.Secrets, true
|
|
}
|
|
|
|
// HasSecrets returns a boolean if a field has been set.
|
|
func (o *EnvironmentEnvironment) HasSecrets() bool {
|
|
if o != nil && !IsNil(o.Secrets) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSecrets gets a reference to the given []string and assigns it to the Secrets field.
|
|
func (o *EnvironmentEnvironment) SetSecrets(v []string) {
|
|
o.Secrets = v
|
|
}
|
|
|
|
// GetSession returns the Session field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) GetSession() string {
|
|
if o == nil || IsNil(o.Session) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Session
|
|
}
|
|
|
|
// GetSessionOk returns a tuple with the Session field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EnvironmentEnvironment) GetSessionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Session) {
|
|
return nil, false
|
|
}
|
|
return o.Session, true
|
|
}
|
|
|
|
// HasSession returns a boolean if a field has been set.
|
|
func (o *EnvironmentEnvironment) HasSession() bool {
|
|
if o != nil && !IsNil(o.Session) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSession gets a reference to the given string and assigns it to the Session field.
|
|
func (o *EnvironmentEnvironment) SetSession(v string) {
|
|
o.Session = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) 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 *EnvironmentEnvironment) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) GetState() string {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EnvironmentEnvironment) GetStateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *EnvironmentEnvironment) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given string and assigns it to the State field.
|
|
func (o *EnvironmentEnvironment) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *EnvironmentEnvironment) GetUpdatedAt() string {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UpdatedAt
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EnvironmentEnvironment) GetUpdatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.UpdatedAt, true
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *EnvironmentEnvironment) HasUpdatedAt() bool {
|
|
if o != nil && !IsNil(o.UpdatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
|
|
func (o *EnvironmentEnvironment) SetUpdatedAt(v string) {
|
|
o.UpdatedAt = &v
|
|
}
|
|
|
|
func (o EnvironmentEnvironment) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EnvironmentEnvironment) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Install) {
|
|
toSerialize["install"] = o.Install
|
|
}
|
|
if !IsNil(o.Proposal) {
|
|
toSerialize["proposal"] = o.Proposal
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
if !IsNil(o.Secrets) {
|
|
toSerialize["secrets"] = o.Secrets
|
|
}
|
|
if !IsNil(o.Session) {
|
|
toSerialize["session"] = o.Session
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.UpdatedAt) {
|
|
toSerialize["updatedAt"] = o.UpdatedAt
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EnvironmentEnvironment) UnmarshalJSON(data []byte) (err error) {
|
|
varEnvironmentEnvironment := _EnvironmentEnvironment{}
|
|
|
|
err = json.Unmarshal(data, &varEnvironmentEnvironment)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EnvironmentEnvironment(varEnvironmentEnvironment)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "install")
|
|
delete(additionalProperties, "proposal")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "secrets")
|
|
delete(additionalProperties, "session")
|
|
delete(additionalProperties, "start")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "updatedAt")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEnvironmentEnvironment struct {
|
|
value *EnvironmentEnvironment
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEnvironmentEnvironment) Get() *EnvironmentEnvironment {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEnvironmentEnvironment) Set(val *EnvironmentEnvironment) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEnvironmentEnvironment) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEnvironmentEnvironment) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEnvironmentEnvironment(val *EnvironmentEnvironment) *NullableEnvironmentEnvironment {
|
|
return &NullableEnvironmentEnvironment{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEnvironmentEnvironment) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEnvironmentEnvironment) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|