Files
sdk/model_project_projects_deploy_start.go

193 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 ProjectProjectsDeployStart type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectProjectsDeployStart{}
// ProjectProjectsDeployStart struct for ProjectProjectsDeployStart
type ProjectProjectsDeployStart struct {
// Commit is the git sha this build was produced from, recorded on the deployment so a released site can be traced back to its source. Optional. It is the ONLY field here, and deliberately: the predecessor also accepted `source` and `branch`. `source` was the Content-Type discriminator this split removed. `branch` was accepted and DISCARDED — there is no branch column on a deployment, and the lifecycle event derives the branch from the project's own linked one — so declaring it would publish a settable field that does nothing into the document, every generated SDK and the MCP input schema. A field that is read by nothing is not described as if it were. `url:\"-\"` because zip binds the query string OVER a decoded body, so without it a `?commit=` the caller never sent would outrank the one it did.
Commit *string `json:"commit,omitempty"`
// Slug is the site to deploy, from the path.
Slug *string `json:"slug,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectProjectsDeployStart ProjectProjectsDeployStart
// NewProjectProjectsDeployStart instantiates a new ProjectProjectsDeployStart 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 NewProjectProjectsDeployStart() *ProjectProjectsDeployStart {
this := ProjectProjectsDeployStart{}
return &this
}
// NewProjectProjectsDeployStartWithDefaults instantiates a new ProjectProjectsDeployStart 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 NewProjectProjectsDeployStartWithDefaults() *ProjectProjectsDeployStart {
this := ProjectProjectsDeployStart{}
return &this
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *ProjectProjectsDeployStart) GetCommit() string {
if o == nil || IsNil(o.Commit) {
var ret string
return ret
}
return *o.Commit
}
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployStart) GetCommitOk() (*string, bool) {
if o == nil || IsNil(o.Commit) {
return nil, false
}
return o.Commit, true
}
// HasCommit returns a boolean if a field has been set.
func (o *ProjectProjectsDeployStart) HasCommit() bool {
if o != nil && !IsNil(o.Commit) {
return true
}
return false
}
// SetCommit gets a reference to the given string and assigns it to the Commit field.
func (o *ProjectProjectsDeployStart) SetCommit(v string) {
o.Commit = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *ProjectProjectsDeployStart) GetSlug() string {
if o == nil || IsNil(o.Slug) {
var ret string
return ret
}
return *o.Slug
}
// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployStart) GetSlugOk() (*string, bool) {
if o == nil || IsNil(o.Slug) {
return nil, false
}
return o.Slug, true
}
// HasSlug returns a boolean if a field has been set.
func (o *ProjectProjectsDeployStart) HasSlug() bool {
if o != nil && !IsNil(o.Slug) {
return true
}
return false
}
// SetSlug gets a reference to the given string and assigns it to the Slug field.
func (o *ProjectProjectsDeployStart) SetSlug(v string) {
o.Slug = &v
}
func (o ProjectProjectsDeployStart) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectProjectsDeployStart) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectProjectsDeployStart) UnmarshalJSON(data []byte) (err error) {
varProjectProjectsDeployStart := _ProjectProjectsDeployStart{}
err = json.Unmarshal(data, &varProjectProjectsDeployStart)
if err != nil {
return err
}
*o = ProjectProjectsDeployStart(varProjectProjectsDeployStart)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commit")
delete(additionalProperties, "slug")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectProjectsDeployStart struct {
value *ProjectProjectsDeployStart
isSet bool
}
func (v NullableProjectProjectsDeployStart) Get() *ProjectProjectsDeployStart {
return v.value
}
func (v *NullableProjectProjectsDeployStart) Set(val *ProjectProjectsDeployStart) {
v.value = val
v.isSet = true
}
func (v NullableProjectProjectsDeployStart) IsSet() bool {
return v.isSet
}
func (v *NullableProjectProjectsDeployStart) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectProjectsDeployStart(val *ProjectProjectsDeployStart) *NullableProjectProjectsDeployStart {
return &NullableProjectProjectsDeployStart{value: val, isSet: true}
}
func (v NullableProjectProjectsDeployStart) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectProjectsDeployStart) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}