Files
sdk/model_platform_project_write.go

383 lines
10 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 PlatformProjectWrite type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformProjectWrite{}
// PlatformProjectWrite struct for PlatformProjectWrite
type PlatformProjectWrite struct {
// Commit is the sha the change created, \"\" when nothing had to move.
Commit *string `json:"commit,omitempty"`
// Live says whether the generator will see it: true only on main.
Live *bool `json:"live,omitempty"`
// Mode is branch (a review; nothing deploys) or commit (main).
Mode *string `json:"mode,omitempty"`
// Moved are the declarations whose partOf moved, and from what.
Moved []PlatformRelabel `json:"moved,omitempty"`
// Project is the project the change leaves the moved apps in.
Project *string `json:"project,omitempty"`
// Ref is the branch the change was pushed to, main for a commit.
Ref *string `json:"ref,omitempty"`
// Review is where to open the pull request for a branch.
Review *string `json:"review,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformProjectWrite PlatformProjectWrite
// NewPlatformProjectWrite instantiates a new PlatformProjectWrite 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 NewPlatformProjectWrite() *PlatformProjectWrite {
this := PlatformProjectWrite{}
return &this
}
// NewPlatformProjectWriteWithDefaults instantiates a new PlatformProjectWrite 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 NewPlatformProjectWriteWithDefaults() *PlatformProjectWrite {
this := PlatformProjectWrite{}
return &this
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *PlatformProjectWrite) 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 *PlatformProjectWrite) 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 *PlatformProjectWrite) 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 *PlatformProjectWrite) SetCommit(v string) {
o.Commit = &v
}
// GetLive returns the Live field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetLive() bool {
if o == nil || IsNil(o.Live) {
var ret bool
return ret
}
return *o.Live
}
// GetLiveOk returns a tuple with the Live field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetLiveOk() (*bool, bool) {
if o == nil || IsNil(o.Live) {
return nil, false
}
return o.Live, true
}
// HasLive returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasLive() bool {
if o != nil && !IsNil(o.Live) {
return true
}
return false
}
// SetLive gets a reference to the given bool and assigns it to the Live field.
func (o *PlatformProjectWrite) SetLive(v bool) {
o.Live = &v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *PlatformProjectWrite) SetMode(v string) {
o.Mode = &v
}
// GetMoved returns the Moved field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetMoved() []PlatformRelabel {
if o == nil || IsNil(o.Moved) {
var ret []PlatformRelabel
return ret
}
return o.Moved
}
// GetMovedOk returns a tuple with the Moved field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetMovedOk() ([]PlatformRelabel, bool) {
if o == nil || IsNil(o.Moved) {
return nil, false
}
return o.Moved, true
}
// HasMoved returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasMoved() bool {
if o != nil && !IsNil(o.Moved) {
return true
}
return false
}
// SetMoved gets a reference to the given []PlatformRelabel and assigns it to the Moved field.
func (o *PlatformProjectWrite) SetMoved(v []PlatformRelabel) {
o.Moved = v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *PlatformProjectWrite) SetProject(v string) {
o.Project = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *PlatformProjectWrite) SetRef(v string) {
o.Ref = &v
}
// GetReview returns the Review field value if set, zero value otherwise.
func (o *PlatformProjectWrite) GetReview() string {
if o == nil || IsNil(o.Review) {
var ret string
return ret
}
return *o.Review
}
// GetReviewOk returns a tuple with the Review field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformProjectWrite) GetReviewOk() (*string, bool) {
if o == nil || IsNil(o.Review) {
return nil, false
}
return o.Review, true
}
// HasReview returns a boolean if a field has been set.
func (o *PlatformProjectWrite) HasReview() bool {
if o != nil && !IsNil(o.Review) {
return true
}
return false
}
// SetReview gets a reference to the given string and assigns it to the Review field.
func (o *PlatformProjectWrite) SetReview(v string) {
o.Review = &v
}
func (o PlatformProjectWrite) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformProjectWrite) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.Live) {
toSerialize["live"] = o.Live
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Moved) {
toSerialize["moved"] = o.Moved
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Review) {
toSerialize["review"] = o.Review
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformProjectWrite) UnmarshalJSON(data []byte) (err error) {
varPlatformProjectWrite := _PlatformProjectWrite{}
err = json.Unmarshal(data, &varPlatformProjectWrite)
if err != nil {
return err
}
*o = PlatformProjectWrite(varPlatformProjectWrite)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commit")
delete(additionalProperties, "live")
delete(additionalProperties, "mode")
delete(additionalProperties, "moved")
delete(additionalProperties, "project")
delete(additionalProperties, "ref")
delete(additionalProperties, "review")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformProjectWrite struct {
value *PlatformProjectWrite
isSet bool
}
func (v NullablePlatformProjectWrite) Get() *PlatformProjectWrite {
return v.value
}
func (v *NullablePlatformProjectWrite) Set(val *PlatformProjectWrite) {
v.value = val
v.isSet = true
}
func (v NullablePlatformProjectWrite) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformProjectWrite) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformProjectWrite(val *PlatformProjectWrite) *NullablePlatformProjectWrite {
return &NullablePlatformProjectWrite{value: val, isSet: true}
}
func (v NullablePlatformProjectWrite) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformProjectWrite) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}