Files
sdk/model_project_projects_update.go

648 lines
19 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 ProjectProjectsUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectProjectsUpdate{}
// ProjectProjectsUpdate struct for ProjectProjectsUpdate
type ProjectProjectsUpdate struct {
// CacheControl replaces the Cache-Control policy the edge serves this site's HTML under. Absent leaves it.
CacheControl *string `json:"cacheControl,omitempty"`
// Description replaces the one-line summary. Absent leaves it.
Description *string `json:"description,omitempty"`
// DropLocal turns the drop of localhost events at ingest on or off. Absent leaves it.
DropLocal *bool `json:"dropLocal,omitempty"`
// Framework replaces the build hint. It affects the NEXT build only — nothing already deployed is rebuilt.
Framework *string `json:"framework,omitempty"`
// Hidden is MODERATION, and the only admin-gated field on this body: it pulls a public project out of the catalogue from admin.hanzo.ai without editing the publisher's own visibility choice, so un-hiding restores exactly what they asked for. A tenant sending it is ignored.
Hidden *bool `json:"hidden,omitempty"`
// HiddenReason records WHY moderation hid it, so the action can be explained and reviewed later. Admin-gated like hidden itself.
HiddenReason *string `json:"hiddenReason,omitempty"`
// InternalNetworks replaces the site's own addresses: CIDRs or bare addresses, at most 64. Absent leaves them; send [] to clear.
InternalNetworks []string `json:"internalNetworks,omitempty"`
// License is the terms that upstream work carries, with the same clear-versus- leave rule.
License *string `json:"license,omitempty"`
// Name replaces the display name. Absent leaves it; the slug never moves with it.
Name *string `json:"name,omitempty"`
Repo *ProjectProjectsUpdateRepo `json:"repo,omitempty"`
// Slug is the project to update, from the path. The URL is the addressing authority — a `slug` in the body cannot move the write to another project.
Slug *string `json:"slug,omitempty"`
// Tags sets the site's browser tag config: platform slug → non-secret pixel id (e.g. {\"ga4\":\"G-…\",\"meta\":\"…\"}). track.js injects these first-party and the server CAPI reads them, per site. Absent LEAVES them; a present object REPLACES the set (send {} to clear). The ids are public — they ship in the page — so this is not the SECRET path (a CAPI token is sealed via POST /v1/destination).
Tags map[string]string `json:"tags,omitempty"`
// Upstream credits the third-party work this project was published from, and is settable after the fact because the live demos are the ones that most need crediting. An explicit empty string CLEARS the credit; absent leaves it.
Upstream *string `json:"upstream,omitempty"`
// Visibility flips an existing project between \"public\" and \"private\". Same ONE rule as at create: public is free, private needs a paid plan.
Visibility *string `json:"visibility,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectProjectsUpdate ProjectProjectsUpdate
// NewProjectProjectsUpdate instantiates a new ProjectProjectsUpdate 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 NewProjectProjectsUpdate() *ProjectProjectsUpdate {
this := ProjectProjectsUpdate{}
return &this
}
// NewProjectProjectsUpdateWithDefaults instantiates a new ProjectProjectsUpdate 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 NewProjectProjectsUpdateWithDefaults() *ProjectProjectsUpdate {
this := ProjectProjectsUpdate{}
return &this
}
// GetCacheControl returns the CacheControl field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetCacheControl() string {
if o == nil || IsNil(o.CacheControl) {
var ret string
return ret
}
return *o.CacheControl
}
// GetCacheControlOk returns a tuple with the CacheControl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetCacheControlOk() (*string, bool) {
if o == nil || IsNil(o.CacheControl) {
return nil, false
}
return o.CacheControl, true
}
// HasCacheControl returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasCacheControl() bool {
if o != nil && !IsNil(o.CacheControl) {
return true
}
return false
}
// SetCacheControl gets a reference to the given string and assigns it to the CacheControl field.
func (o *ProjectProjectsUpdate) SetCacheControl(v string) {
o.CacheControl = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ProjectProjectsUpdate) SetDescription(v string) {
o.Description = &v
}
// GetDropLocal returns the DropLocal field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetDropLocal() bool {
if o == nil || IsNil(o.DropLocal) {
var ret bool
return ret
}
return *o.DropLocal
}
// GetDropLocalOk returns a tuple with the DropLocal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetDropLocalOk() (*bool, bool) {
if o == nil || IsNil(o.DropLocal) {
return nil, false
}
return o.DropLocal, true
}
// HasDropLocal returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasDropLocal() bool {
if o != nil && !IsNil(o.DropLocal) {
return true
}
return false
}
// SetDropLocal gets a reference to the given bool and assigns it to the DropLocal field.
func (o *ProjectProjectsUpdate) SetDropLocal(v bool) {
o.DropLocal = &v
}
// GetFramework returns the Framework field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetFramework() string {
if o == nil || IsNil(o.Framework) {
var ret string
return ret
}
return *o.Framework
}
// GetFrameworkOk returns a tuple with the Framework field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetFrameworkOk() (*string, bool) {
if o == nil || IsNil(o.Framework) {
return nil, false
}
return o.Framework, true
}
// HasFramework returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasFramework() bool {
if o != nil && !IsNil(o.Framework) {
return true
}
return false
}
// SetFramework gets a reference to the given string and assigns it to the Framework field.
func (o *ProjectProjectsUpdate) SetFramework(v string) {
o.Framework = &v
}
// GetHidden returns the Hidden field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetHidden() bool {
if o == nil || IsNil(o.Hidden) {
var ret bool
return ret
}
return *o.Hidden
}
// GetHiddenOk returns a tuple with the Hidden field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetHiddenOk() (*bool, bool) {
if o == nil || IsNil(o.Hidden) {
return nil, false
}
return o.Hidden, true
}
// HasHidden returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasHidden() bool {
if o != nil && !IsNil(o.Hidden) {
return true
}
return false
}
// SetHidden gets a reference to the given bool and assigns it to the Hidden field.
func (o *ProjectProjectsUpdate) SetHidden(v bool) {
o.Hidden = &v
}
// GetHiddenReason returns the HiddenReason field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetHiddenReason() string {
if o == nil || IsNil(o.HiddenReason) {
var ret string
return ret
}
return *o.HiddenReason
}
// GetHiddenReasonOk returns a tuple with the HiddenReason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetHiddenReasonOk() (*string, bool) {
if o == nil || IsNil(o.HiddenReason) {
return nil, false
}
return o.HiddenReason, true
}
// HasHiddenReason returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasHiddenReason() bool {
if o != nil && !IsNil(o.HiddenReason) {
return true
}
return false
}
// SetHiddenReason gets a reference to the given string and assigns it to the HiddenReason field.
func (o *ProjectProjectsUpdate) SetHiddenReason(v string) {
o.HiddenReason = &v
}
// GetInternalNetworks returns the InternalNetworks field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetInternalNetworks() []string {
if o == nil || IsNil(o.InternalNetworks) {
var ret []string
return ret
}
return o.InternalNetworks
}
// GetInternalNetworksOk returns a tuple with the InternalNetworks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetInternalNetworksOk() ([]string, bool) {
if o == nil || IsNil(o.InternalNetworks) {
return nil, false
}
return o.InternalNetworks, true
}
// HasInternalNetworks returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasInternalNetworks() bool {
if o != nil && !IsNil(o.InternalNetworks) {
return true
}
return false
}
// SetInternalNetworks gets a reference to the given []string and assigns it to the InternalNetworks field.
func (o *ProjectProjectsUpdate) SetInternalNetworks(v []string) {
o.InternalNetworks = v
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *ProjectProjectsUpdate) SetLicense(v string) {
o.License = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) SetName(v string) {
o.Name = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetRepo() ProjectProjectsUpdateRepo {
if o == nil || IsNil(o.Repo) {
var ret ProjectProjectsUpdateRepo
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetRepoOk() (*ProjectProjectsUpdateRepo, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given ProjectProjectsUpdateRepo and assigns it to the Repo field.
func (o *ProjectProjectsUpdate) SetRepo(v ProjectProjectsUpdateRepo) {
o.Repo = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) 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 *ProjectProjectsUpdate) SetSlug(v string) {
o.Slug = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetTags() map[string]string {
if o == nil || IsNil(o.Tags) {
var ret map[string]string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetTagsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Tags) {
return map[string]string{}, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given map[string]string and assigns it to the Tags field.
func (o *ProjectProjectsUpdate) SetTags(v map[string]string) {
o.Tags = v
}
// GetUpstream returns the Upstream field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetUpstream() string {
if o == nil || IsNil(o.Upstream) {
var ret string
return ret
}
return *o.Upstream
}
// GetUpstreamOk returns a tuple with the Upstream field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetUpstreamOk() (*string, bool) {
if o == nil || IsNil(o.Upstream) {
return nil, false
}
return o.Upstream, true
}
// HasUpstream returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasUpstream() bool {
if o != nil && !IsNil(o.Upstream) {
return true
}
return false
}
// SetUpstream gets a reference to the given string and assigns it to the Upstream field.
func (o *ProjectProjectsUpdate) SetUpstream(v string) {
o.Upstream = &v
}
// GetVisibility returns the Visibility field value if set, zero value otherwise.
func (o *ProjectProjectsUpdate) GetVisibility() string {
if o == nil || IsNil(o.Visibility) {
var ret string
return ret
}
return *o.Visibility
}
// GetVisibilityOk returns a tuple with the Visibility field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsUpdate) GetVisibilityOk() (*string, bool) {
if o == nil || IsNil(o.Visibility) {
return nil, false
}
return o.Visibility, true
}
// HasVisibility returns a boolean if a field has been set.
func (o *ProjectProjectsUpdate) HasVisibility() bool {
if o != nil && !IsNil(o.Visibility) {
return true
}
return false
}
// SetVisibility gets a reference to the given string and assigns it to the Visibility field.
func (o *ProjectProjectsUpdate) SetVisibility(v string) {
o.Visibility = &v
}
func (o ProjectProjectsUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectProjectsUpdate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CacheControl) {
toSerialize["cacheControl"] = o.CacheControl
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DropLocal) {
toSerialize["dropLocal"] = o.DropLocal
}
if !IsNil(o.Framework) {
toSerialize["framework"] = o.Framework
}
if !IsNil(o.Hidden) {
toSerialize["hidden"] = o.Hidden
}
if !IsNil(o.HiddenReason) {
toSerialize["hiddenReason"] = o.HiddenReason
}
if !IsNil(o.InternalNetworks) {
toSerialize["internalNetworks"] = o.InternalNetworks
}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.Upstream) {
toSerialize["upstream"] = o.Upstream
}
if !IsNil(o.Visibility) {
toSerialize["visibility"] = o.Visibility
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectProjectsUpdate) UnmarshalJSON(data []byte) (err error) {
varProjectProjectsUpdate := _ProjectProjectsUpdate{}
err = json.Unmarshal(data, &varProjectProjectsUpdate)
if err != nil {
return err
}
*o = ProjectProjectsUpdate(varProjectProjectsUpdate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "cacheControl")
delete(additionalProperties, "description")
delete(additionalProperties, "dropLocal")
delete(additionalProperties, "framework")
delete(additionalProperties, "hidden")
delete(additionalProperties, "hiddenReason")
delete(additionalProperties, "internalNetworks")
delete(additionalProperties, "license")
delete(additionalProperties, "name")
delete(additionalProperties, "repo")
delete(additionalProperties, "slug")
delete(additionalProperties, "tags")
delete(additionalProperties, "upstream")
delete(additionalProperties, "visibility")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectProjectsUpdate struct {
value *ProjectProjectsUpdate
isSet bool
}
func (v NullableProjectProjectsUpdate) Get() *ProjectProjectsUpdate {
return v.value
}
func (v *NullableProjectProjectsUpdate) Set(val *ProjectProjectsUpdate) {
v.value = val
v.isSet = true
}
func (v NullableProjectProjectsUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableProjectProjectsUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectProjectsUpdate(val *ProjectProjectsUpdate) *NullableProjectProjectsUpdate {
return &NullableProjectProjectsUpdate{value: val, isSet: true}
}
func (v NullableProjectProjectsUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectProjectsUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}