Files
sdk/model_project_projects_deployment.go

687 lines
20 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 ProjectProjectsDeployment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectProjectsDeployment{}
// ProjectProjectsDeployment struct for ProjectProjectsDeployment
type ProjectProjectsDeployment struct {
// Bucket is the object-store bucket its files were written to.
Bucket *string `json:"bucket,omitempty"`
// Bytes is their total size in bytes.
Bytes *int64 `json:"bytes,omitempty"`
// Commit is the revision that was built, for a deployment that came from a repository. Absent for an uploaded artifact, which has no revision.
Commit *string `json:"commit,omitempty"`
// CreatedAt is when the deployment was queued, as Unix seconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Files is how many objects the deployment published.
Files *int64 `json:"files,omitempty"`
// ID identifies this one deployment attempt, and is what CI quotes back to complete it.
Id *string `json:"id,omitempty"`
// LiveURL is where this deployment serves, once it is live.
LiveUrl *string `json:"liveUrl,omitempty"`
// Message is what happened, in words — the build's own note, or on a failure why it failed.
Message *string `json:"message,omitempty"`
// Prefix is the key prefix within that bucket holding EXACTLY this deployment's objects — the unit an upload grant is scoped to, so a grant for one deployment cannot write over another.
Prefix *string `json:"prefix,omitempty"`
// ProjectID is the project this deployment belongs to.
ProjectId *string `json:"projectId,omitempty"`
// Source is what caused the deployment — a git push, an uploaded artifact, a generated site.
Source *string `json:"source,omitempty"`
// Status is where the attempt got to — queued, live, or failed. A deployment that is live is not necessarily the one SERVING: the project's own currentDeploymentId says which is.
Status *string `json:"status,omitempty"`
// UpdatedAt is when it last changed state, as Unix seconds — so the gap between the two is how long the build took.
UpdatedAt *int64 `json:"updatedAt,omitempty"`
// Upload is the prefix-scoped, short-lived S3 write grant handed to CI with a queued git deployment, so it needs no bucket credential (grant.go). Present ONLY on the 202 that creates the deployment — it is never stored and never replayed on a later read, so a grant cannot outlive the build it was minted for by being fetched again.
Upload *ProjectProjectsUploadGrant `json:"upload,omitempty"`
// Version counts deployments of this project from 1, so the history reads as an ordered sequence rather than by timestamp. It is per project, not global.
Version *int64 `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectProjectsDeployment ProjectProjectsDeployment
// NewProjectProjectsDeployment instantiates a new ProjectProjectsDeployment 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 NewProjectProjectsDeployment() *ProjectProjectsDeployment {
this := ProjectProjectsDeployment{}
return &this
}
// NewProjectProjectsDeploymentWithDefaults instantiates a new ProjectProjectsDeployment 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 NewProjectProjectsDeploymentWithDefaults() *ProjectProjectsDeployment {
this := ProjectProjectsDeployment{}
return &this
}
// GetBucket returns the Bucket field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetBucket() string {
if o == nil || IsNil(o.Bucket) {
var ret string
return ret
}
return *o.Bucket
}
// GetBucketOk returns a tuple with the Bucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetBucketOk() (*string, bool) {
if o == nil || IsNil(o.Bucket) {
return nil, false
}
return o.Bucket, true
}
// HasBucket returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasBucket() bool {
if o != nil && !IsNil(o.Bucket) {
return true
}
return false
}
// SetBucket gets a reference to the given string and assigns it to the Bucket field.
func (o *ProjectProjectsDeployment) SetBucket(v string) {
o.Bucket = &v
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetBytes(v int64) {
o.Bytes = &v
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetCommit(v string) {
o.Commit = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *ProjectProjectsDeployment) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetFiles(v int64) {
o.Files = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetId(v string) {
o.Id = &v
}
// GetLiveUrl returns the LiveUrl field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetLiveUrl(v string) {
o.LiveUrl = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetMessage(v string) {
o.Message = &v
}
// GetPrefix returns the Prefix field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetPrefix() string {
if o == nil || IsNil(o.Prefix) {
var ret string
return ret
}
return *o.Prefix
}
// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetPrefixOk() (*string, bool) {
if o == nil || IsNil(o.Prefix) {
return nil, false
}
return o.Prefix, true
}
// HasPrefix returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasPrefix() bool {
if o != nil && !IsNil(o.Prefix) {
return true
}
return false
}
// SetPrefix gets a reference to the given string and assigns it to the Prefix field.
func (o *ProjectProjectsDeployment) SetPrefix(v string) {
o.Prefix = &v
}
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetProjectId() string {
if o == nil || IsNil(o.ProjectId) {
var ret string
return ret
}
return *o.ProjectId
}
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetProjectIdOk() (*string, bool) {
if o == nil || IsNil(o.ProjectId) {
return nil, false
}
return o.ProjectId, true
}
// HasProjectId returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasProjectId() bool {
if o != nil && !IsNil(o.ProjectId) {
return true
}
return false
}
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
func (o *ProjectProjectsDeployment) SetProjectId(v string) {
o.ProjectId = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *ProjectProjectsDeployment) SetSource(v string) {
o.Source = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) 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 *ProjectProjectsDeployment) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetUpdatedAt() int64 {
if o == nil || IsNil(o.UpdatedAt) {
var ret int64
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetUpdatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
func (o *ProjectProjectsDeployment) SetUpdatedAt(v int64) {
o.UpdatedAt = &v
}
// GetUpload returns the Upload field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetUpload() ProjectProjectsUploadGrant {
if o == nil || IsNil(o.Upload) {
var ret ProjectProjectsUploadGrant
return ret
}
return *o.Upload
}
// GetUploadOk returns a tuple with the Upload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetUploadOk() (*ProjectProjectsUploadGrant, bool) {
if o == nil || IsNil(o.Upload) {
return nil, false
}
return o.Upload, true
}
// HasUpload returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasUpload() bool {
if o != nil && !IsNil(o.Upload) {
return true
}
return false
}
// SetUpload gets a reference to the given ProjectProjectsUploadGrant and assigns it to the Upload field.
func (o *ProjectProjectsDeployment) SetUpload(v ProjectProjectsUploadGrant) {
o.Upload = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ProjectProjectsDeployment) GetVersion() int64 {
if o == nil || IsNil(o.Version) {
var ret int64
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectProjectsDeployment) GetVersionOk() (*int64, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *ProjectProjectsDeployment) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
func (o *ProjectProjectsDeployment) SetVersion(v int64) {
o.Version = &v
}
func (o ProjectProjectsDeployment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectProjectsDeployment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bucket) {
toSerialize["bucket"] = o.Bucket
}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LiveUrl) {
toSerialize["liveUrl"] = o.LiveUrl
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Prefix) {
toSerialize["prefix"] = o.Prefix
}
if !IsNil(o.ProjectId) {
toSerialize["projectId"] = o.ProjectId
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if !IsNil(o.Upload) {
toSerialize["upload"] = o.Upload
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectProjectsDeployment) UnmarshalJSON(data []byte) (err error) {
varProjectProjectsDeployment := _ProjectProjectsDeployment{}
err = json.Unmarshal(data, &varProjectProjectsDeployment)
if err != nil {
return err
}
*o = ProjectProjectsDeployment(varProjectProjectsDeployment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bucket")
delete(additionalProperties, "bytes")
delete(additionalProperties, "commit")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "files")
delete(additionalProperties, "id")
delete(additionalProperties, "liveUrl")
delete(additionalProperties, "message")
delete(additionalProperties, "prefix")
delete(additionalProperties, "projectId")
delete(additionalProperties, "source")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "upload")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectProjectsDeployment struct {
value *ProjectProjectsDeployment
isSet bool
}
func (v NullableProjectProjectsDeployment) Get() *ProjectProjectsDeployment {
return v.value
}
func (v *NullableProjectProjectsDeployment) Set(val *ProjectProjectsDeployment) {
v.value = val
v.isSet = true
}
func (v NullableProjectProjectsDeployment) IsSet() bool {
return v.isSet
}
func (v *NullableProjectProjectsDeployment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectProjectsDeployment(val *ProjectProjectsDeployment) *NullableProjectProjectsDeployment {
return &NullableProjectProjectsDeployment{value: val, isSet: true}
}
func (v NullableProjectProjectsDeployment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectProjectsDeployment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}