mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.1 KiB
Go
269 lines
7.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 PlatformProjectRename type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformProjectRename{}
|
|
|
|
// PlatformProjectRename struct for PlatformProjectRename
|
|
type PlatformProjectRename struct {
|
|
// Mode is `branch` (the default) or `commit`.
|
|
Mode *string `json:"mode,omitempty"`
|
|
// Name is its new name, which no app may already name.
|
|
Name *string `json:"name,omitempty"`
|
|
// Org names the project's owner, defaulting to the caller's own scope.
|
|
Org *string `json:"org,omitempty"`
|
|
// Project is the project to rename, from the path.
|
|
Project *string `json:"project,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformProjectRename PlatformProjectRename
|
|
|
|
// NewPlatformProjectRename instantiates a new PlatformProjectRename 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 NewPlatformProjectRename() *PlatformProjectRename {
|
|
this := PlatformProjectRename{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformProjectRenameWithDefaults instantiates a new PlatformProjectRename 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 NewPlatformProjectRenameWithDefaults() *PlatformProjectRename {
|
|
this := PlatformProjectRename{}
|
|
return &this
|
|
}
|
|
|
|
// GetMode returns the Mode field value if set, zero value otherwise.
|
|
func (o *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) SetMode(v string) {
|
|
o.Mode = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) 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 *PlatformProjectRename) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
func (o PlatformProjectRename) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformProjectRename) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Mode) {
|
|
toSerialize["mode"] = o.Mode
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
if !IsNil(o.Project) {
|
|
toSerialize["project"] = o.Project
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformProjectRename) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformProjectRename := _PlatformProjectRename{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformProjectRename)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformProjectRename(varPlatformProjectRename)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "mode")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "project")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformProjectRename struct {
|
|
value *PlatformProjectRename
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformProjectRename) Get() *PlatformProjectRename {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformProjectRename) Set(val *PlatformProjectRename) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformProjectRename) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformProjectRename) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformProjectRename(val *PlatformProjectRename) *NullablePlatformProjectRename {
|
|
return &NullablePlatformProjectRename{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformProjectRename) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformProjectRename) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|