Files
sdk/model_project_projects_complete.go

535 lines
15 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 ProjectProjectsComplete type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectProjectsComplete{}
// ProjectProjectsComplete struct for ProjectProjectsComplete
type ProjectProjectsComplete struct {
// Bytes is their total size in bytes.
Bytes *int64 `json:"bytes,omitempty"`
// Commit is the revision that was built, recorded on the deployment.
Commit *string `json:"commit,omitempty"`
// Copy lists the keys to take from CopyFrom's prefix, relative to it, copied before the release is checked. Each must also be named in Keys, which stays the whole release, and be a clean relative path; anything else is a 400.
Copy []string `json:"copy,omitempty"`
// CopyFrom names another site of the same org whose prefix already holds the bytes of Copy. A host that shares a build with another differs from it by a page or two, so CI uploads those and asks for the rest to be copied inside the object store instead of sent again over the runner's link. A site the org does not hold is a 404. Read only on a live completion that names keys.
CopyFrom *string `json:"copyFrom,omitempty"`
// Files is how many objects CI published.
Files *int64 `json:"files,omitempty"`
// ID is the queued deployment to complete, from the path.
Id *string `json:"id,omitempty"`
// Keys is the whole release, RELATIVE to the deployment prefix. A live completion that names it is refused with 409 while any of these keys is absent from the store, and the prefix is then reconciled against it: an upload grant authorizes writes only, so CI cannot remove a file, and cloud deletes what this list does not name instead (grant.go). Omit it and nothing is checked or deleted — the prefix only grows, the pre-grant behaviour.
Keys []string `json:"keys,omitempty"`
// LiveURL is a HINT at the address the site should serve at. The public host is claimed by cloud first, so this can refine the URL a deployment reports but can never assert a subdomain another tenant holds.
LiveUrl *string `json:"liveUrl,omitempty"`
// Message is what happened, in words — on an error completion, why it failed.
Message *string `json:"message,omitempty"`
// Slug is the project the deployment belongs to, from the path.
Slug *string `json:"slug,omitempty"`
// Status is how the build ended: `live` if it succeeded, `error` if it did not. Nothing else is accepted.
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectProjectsComplete ProjectProjectsComplete
// NewProjectProjectsComplete instantiates a new ProjectProjectsComplete 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 NewProjectProjectsComplete() *ProjectProjectsComplete {
this := ProjectProjectsComplete{}
return &this
}
// NewProjectProjectsCompleteWithDefaults instantiates a new ProjectProjectsComplete 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 NewProjectProjectsCompleteWithDefaults() *ProjectProjectsComplete {
this := ProjectProjectsComplete{}
return &this
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetBytes() int64 {
if o == nil || IsNil(o.Bytes) {
var ret int64
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetBytesOk() (*int64, bool) {
if o == nil || IsNil(o.Bytes) {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasBytes() bool {
if o != nil && !IsNil(o.Bytes) {
return true
}
return false
}
// SetBytes gets a reference to the given int64 and assigns it to the Bytes field.
func (o *ProjectProjectsComplete) SetBytes(v int64) {
o.Bytes = &v
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) 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 *ProjectProjectsComplete) 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 *ProjectProjectsComplete) 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 *ProjectProjectsComplete) SetCommit(v string) {
o.Commit = &v
}
// GetCopy returns the Copy field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetCopy() []string {
if o == nil || IsNil(o.Copy) {
var ret []string
return ret
}
return o.Copy
}
// GetCopyOk returns a tuple with the Copy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetCopyOk() ([]string, bool) {
if o == nil || IsNil(o.Copy) {
return nil, false
}
return o.Copy, true
}
// HasCopy returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasCopy() bool {
if o != nil && !IsNil(o.Copy) {
return true
}
return false
}
// SetCopy gets a reference to the given []string and assigns it to the Copy field.
func (o *ProjectProjectsComplete) SetCopy(v []string) {
o.Copy = v
}
// GetCopyFrom returns the CopyFrom field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetCopyFrom() string {
if o == nil || IsNil(o.CopyFrom) {
var ret string
return ret
}
return *o.CopyFrom
}
// GetCopyFromOk returns a tuple with the CopyFrom field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetCopyFromOk() (*string, bool) {
if o == nil || IsNil(o.CopyFrom) {
return nil, false
}
return o.CopyFrom, true
}
// HasCopyFrom returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasCopyFrom() bool {
if o != nil && !IsNil(o.CopyFrom) {
return true
}
return false
}
// SetCopyFrom gets a reference to the given string and assigns it to the CopyFrom field.
func (o *ProjectProjectsComplete) SetCopyFrom(v string) {
o.CopyFrom = &v
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetFiles() int64 {
if o == nil || IsNil(o.Files) {
var ret int64
return ret
}
return *o.Files
}
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetFilesOk() (*int64, bool) {
if o == nil || IsNil(o.Files) {
return nil, false
}
return o.Files, true
}
// HasFiles returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasFiles() bool {
if o != nil && !IsNil(o.Files) {
return true
}
return false
}
// SetFiles gets a reference to the given int64 and assigns it to the Files field.
func (o *ProjectProjectsComplete) SetFiles(v int64) {
o.Files = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ProjectProjectsComplete) SetId(v string) {
o.Id = &v
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetKeys() []string {
if o == nil || IsNil(o.Keys) {
var ret []string
return ret
}
return o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetKeysOk() ([]string, bool) {
if o == nil || IsNil(o.Keys) {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasKeys() bool {
if o != nil && !IsNil(o.Keys) {
return true
}
return false
}
// SetKeys gets a reference to the given []string and assigns it to the Keys field.
func (o *ProjectProjectsComplete) SetKeys(v []string) {
o.Keys = v
}
// GetLiveUrl returns the LiveUrl field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetLiveUrl() string {
if o == nil || IsNil(o.LiveUrl) {
var ret string
return ret
}
return *o.LiveUrl
}
// GetLiveUrlOk returns a tuple with the LiveUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetLiveUrlOk() (*string, bool) {
if o == nil || IsNil(o.LiveUrl) {
return nil, false
}
return o.LiveUrl, true
}
// HasLiveUrl returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasLiveUrl() bool {
if o != nil && !IsNil(o.LiveUrl) {
return true
}
return false
}
// SetLiveUrl gets a reference to the given string and assigns it to the LiveUrl field.
func (o *ProjectProjectsComplete) SetLiveUrl(v string) {
o.LiveUrl = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *ProjectProjectsComplete) SetMessage(v string) {
o.Message = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) 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 *ProjectProjectsComplete) 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 *ProjectProjectsComplete) 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 *ProjectProjectsComplete) SetSlug(v string) {
o.Slug = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ProjectProjectsComplete) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsComplete) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *ProjectProjectsComplete) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *ProjectProjectsComplete) SetStatus(v string) {
o.Status = &v
}
func (o ProjectProjectsComplete) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectProjectsComplete) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.Copy) {
toSerialize["copy"] = o.Copy
}
if !IsNil(o.CopyFrom) {
toSerialize["copyFrom"] = o.CopyFrom
}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Keys) {
toSerialize["keys"] = o.Keys
}
if !IsNil(o.LiveUrl) {
toSerialize["liveUrl"] = o.LiveUrl
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectProjectsComplete) UnmarshalJSON(data []byte) (err error) {
varProjectProjectsComplete := _ProjectProjectsComplete{}
err = json.Unmarshal(data, &varProjectProjectsComplete)
if err != nil {
return err
}
*o = ProjectProjectsComplete(varProjectProjectsComplete)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bytes")
delete(additionalProperties, "commit")
delete(additionalProperties, "copy")
delete(additionalProperties, "copyFrom")
delete(additionalProperties, "files")
delete(additionalProperties, "id")
delete(additionalProperties, "keys")
delete(additionalProperties, "liveUrl")
delete(additionalProperties, "message")
delete(additionalProperties, "slug")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectProjectsComplete struct {
value *ProjectProjectsComplete
isSet bool
}
func (v NullableProjectProjectsComplete) Get() *ProjectProjectsComplete {
return v.value
}
func (v *NullableProjectProjectsComplete) Set(val *ProjectProjectsComplete) {
v.value = val
v.isSet = true
}
func (v NullableProjectProjectsComplete) IsSet() bool {
return v.isSet
}
func (v *NullableProjectProjectsComplete) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectProjectsComplete(val *ProjectProjectsComplete) *NullableProjectProjectsComplete {
return &NullableProjectProjectsComplete{value: val, isSet: true}
}
func (v NullableProjectProjectsComplete) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectProjectsComplete) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}