mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.3 KiB
Go
269 lines
7.3 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 PlatformProjectCreate type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformProjectCreate{}
|
|
|
|
// PlatformProjectCreate struct for PlatformProjectCreate
|
|
type PlatformProjectCreate struct {
|
|
// Apps are the declarations it starts with, each by values directory (`org`, defaulting to the caller's own) and name. At least one: a project is the apps that name it.
|
|
Apps []PlatformDeclRef `json:"apps,omitempty"`
|
|
// Mode is `branch` (the default: a review branch, nothing deploys) or `commit` (main).
|
|
Mode *string `json:"mode,omitempty"`
|
|
// Name is the project, a DNS-1123 label; it becomes each app's `partOf`.
|
|
Name *string `json:"name,omitempty"`
|
|
// Org names the project's owner, defaulting to the caller's own scope; naming another is an act-as only a SuperAdmin has.
|
|
Org *string `json:"org,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformProjectCreate PlatformProjectCreate
|
|
|
|
// NewPlatformProjectCreate instantiates a new PlatformProjectCreate 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 NewPlatformProjectCreate() *PlatformProjectCreate {
|
|
this := PlatformProjectCreate{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformProjectCreateWithDefaults instantiates a new PlatformProjectCreate 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 NewPlatformProjectCreateWithDefaults() *PlatformProjectCreate {
|
|
this := PlatformProjectCreate{}
|
|
return &this
|
|
}
|
|
|
|
// GetApps returns the Apps field value if set, zero value otherwise.
|
|
func (o *PlatformProjectCreate) GetApps() []PlatformDeclRef {
|
|
if o == nil || IsNil(o.Apps) {
|
|
var ret []PlatformDeclRef
|
|
return ret
|
|
}
|
|
return o.Apps
|
|
}
|
|
|
|
// GetAppsOk returns a tuple with the Apps field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectCreate) GetAppsOk() ([]PlatformDeclRef, bool) {
|
|
if o == nil || IsNil(o.Apps) {
|
|
return nil, false
|
|
}
|
|
return o.Apps, true
|
|
}
|
|
|
|
// HasApps returns a boolean if a field has been set.
|
|
func (o *PlatformProjectCreate) HasApps() bool {
|
|
if o != nil && !IsNil(o.Apps) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetApps gets a reference to the given []PlatformDeclRef and assigns it to the Apps field.
|
|
func (o *PlatformProjectCreate) SetApps(v []PlatformDeclRef) {
|
|
o.Apps = v
|
|
}
|
|
|
|
// GetMode returns the Mode field value if set, zero value otherwise.
|
|
func (o *PlatformProjectCreate) 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 *PlatformProjectCreate) 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 *PlatformProjectCreate) 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 *PlatformProjectCreate) SetMode(v string) {
|
|
o.Mode = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PlatformProjectCreate) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectCreate) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *PlatformProjectCreate) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *PlatformProjectCreate) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *PlatformProjectCreate) GetOrg() string {
|
|
if o == nil || IsNil(o.Org) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Org
|
|
}
|
|
|
|
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectCreate) GetOrgOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Org) {
|
|
return nil, false
|
|
}
|
|
return o.Org, true
|
|
}
|
|
|
|
// HasOrg returns a boolean if a field has been set.
|
|
func (o *PlatformProjectCreate) HasOrg() bool {
|
|
if o != nil && !IsNil(o.Org) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOrg gets a reference to the given string and assigns it to the Org field.
|
|
func (o *PlatformProjectCreate) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
func (o PlatformProjectCreate) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformProjectCreate) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Apps) {
|
|
toSerialize["apps"] = o.Apps
|
|
}
|
|
if !IsNil(o.Mode) {
|
|
toSerialize["mode"] = o.Mode
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformProjectCreate) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformProjectCreate := _PlatformProjectCreate{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformProjectCreate)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformProjectCreate(varPlatformProjectCreate)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "apps")
|
|
delete(additionalProperties, "mode")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "org")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformProjectCreate struct {
|
|
value *PlatformProjectCreate
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformProjectCreate) Get() *PlatformProjectCreate {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformProjectCreate) Set(val *PlatformProjectCreate) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformProjectCreate) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformProjectCreate) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformProjectCreate(val *PlatformProjectCreate) *NullablePlatformProjectCreate {
|
|
return &NullablePlatformProjectCreate{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformProjectCreate) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformProjectCreate) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|