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 ProjectProjectsFork type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProjectProjectsFork{}
|
|
|
|
// ProjectProjectsFork struct for ProjectProjectsFork
|
|
type ProjectProjectsFork struct {
|
|
// target project name (optional; defaults to the parent's title)
|
|
Name *string `json:"name,omitempty"`
|
|
// parent slug to fork — catalog template or published project (required)
|
|
Slug *string `json:"slug,omitempty"`
|
|
// Target overrides the derived project slug (optional; defaults to the parent slug). Kept distinct from Slug so callers can rename on fork.
|
|
Target *string `json:"target,omitempty"`
|
|
// Variant picks a template's format/page/theme (optional; defaults to the template's first shape). This is the axis the catalog used to spend sibling slugs on, so it is expressed here, where the user's preference is.
|
|
Variant *string `json:"variant,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProjectProjectsFork ProjectProjectsFork
|
|
|
|
// NewProjectProjectsFork instantiates a new ProjectProjectsFork 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 NewProjectProjectsFork() *ProjectProjectsFork {
|
|
this := ProjectProjectsFork{}
|
|
return &this
|
|
}
|
|
|
|
// NewProjectProjectsForkWithDefaults instantiates a new ProjectProjectsFork 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 NewProjectProjectsForkWithDefaults() *ProjectProjectsFork {
|
|
this := ProjectProjectsFork{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ProjectProjectsFork) 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 *ProjectProjectsFork) 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 *ProjectProjectsFork) 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 *ProjectProjectsFork) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetSlug returns the Slug field value if set, zero value otherwise.
|
|
func (o *ProjectProjectsFork) 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 *ProjectProjectsFork) 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 *ProjectProjectsFork) 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 *ProjectProjectsFork) SetSlug(v string) {
|
|
o.Slug = &v
|
|
}
|
|
|
|
// GetTarget returns the Target field value if set, zero value otherwise.
|
|
func (o *ProjectProjectsFork) GetTarget() string {
|
|
if o == nil || IsNil(o.Target) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Target
|
|
}
|
|
|
|
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProjectProjectsFork) GetTargetOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Target) {
|
|
return nil, false
|
|
}
|
|
return o.Target, true
|
|
}
|
|
|
|
// HasTarget returns a boolean if a field has been set.
|
|
func (o *ProjectProjectsFork) HasTarget() bool {
|
|
if o != nil && !IsNil(o.Target) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTarget gets a reference to the given string and assigns it to the Target field.
|
|
func (o *ProjectProjectsFork) SetTarget(v string) {
|
|
o.Target = &v
|
|
}
|
|
|
|
// GetVariant returns the Variant field value if set, zero value otherwise.
|
|
func (o *ProjectProjectsFork) GetVariant() string {
|
|
if o == nil || IsNil(o.Variant) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Variant
|
|
}
|
|
|
|
// GetVariantOk returns a tuple with the Variant field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProjectProjectsFork) GetVariantOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Variant) {
|
|
return nil, false
|
|
}
|
|
return o.Variant, true
|
|
}
|
|
|
|
// HasVariant returns a boolean if a field has been set.
|
|
func (o *ProjectProjectsFork) HasVariant() bool {
|
|
if o != nil && !IsNil(o.Variant) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVariant gets a reference to the given string and assigns it to the Variant field.
|
|
func (o *ProjectProjectsFork) SetVariant(v string) {
|
|
o.Variant = &v
|
|
}
|
|
|
|
func (o ProjectProjectsFork) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProjectProjectsFork) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Slug) {
|
|
toSerialize["slug"] = o.Slug
|
|
}
|
|
if !IsNil(o.Target) {
|
|
toSerialize["target"] = o.Target
|
|
}
|
|
if !IsNil(o.Variant) {
|
|
toSerialize["variant"] = o.Variant
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProjectProjectsFork) UnmarshalJSON(data []byte) (err error) {
|
|
varProjectProjectsFork := _ProjectProjectsFork{}
|
|
|
|
err = json.Unmarshal(data, &varProjectProjectsFork)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProjectProjectsFork(varProjectProjectsFork)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "slug")
|
|
delete(additionalProperties, "target")
|
|
delete(additionalProperties, "variant")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProjectProjectsFork struct {
|
|
value *ProjectProjectsFork
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProjectProjectsFork) Get() *ProjectProjectsFork {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProjectProjectsFork) Set(val *ProjectProjectsFork) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProjectProjectsFork) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProjectProjectsFork) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProjectProjectsFork(val *ProjectProjectsFork) *NullableProjectProjectsFork {
|
|
return &NullableProjectProjectsFork{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProjectProjectsFork) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProjectProjectsFork) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|