Files
sdk/model_author_deploy_record.go

345 lines
9.6 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 AuthorDeployRecord type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuthorDeployRecord{}
// AuthorDeployRecord struct for AuthorDeployRecord
type AuthorDeployRecord struct {
// Created reports whether this call recorded a new attribution edge (201) or found an existing one (200). Absent when nothing was recorded.
Created *bool `json:"created,omitempty"`
// CreatedAt is when the edge was first recorded, in unix seconds. Absent when nothing was recorded.
CreatedAt *int64 `json:"createdAt,omitempty"`
// DeployID is the attribution edge's handle. Absent when nothing was recorded.
DeployId *string `json:"deployId,omitempty"`
// Reason says why nothing was attributed. Present only when recorded is false.
Reason *string `json:"reason,omitempty"`
// Recorded reports whether the deploy was attributed to an author at all. False is the ordinary answer for a project built from no repository, or from one no author has verified — never an error, so a deploy path can fire this unconditionally.
Recorded *bool `json:"recorded,omitempty"`
// Self reports that the deploying org IS the author's org. Such a deploy is recorded for provenance but excluded from accrual. Absent when nothing was recorded.
Self *bool `json:"self,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AuthorDeployRecord AuthorDeployRecord
// NewAuthorDeployRecord instantiates a new AuthorDeployRecord 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 NewAuthorDeployRecord() *AuthorDeployRecord {
this := AuthorDeployRecord{}
return &this
}
// NewAuthorDeployRecordWithDefaults instantiates a new AuthorDeployRecord 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 NewAuthorDeployRecordWithDefaults() *AuthorDeployRecord {
this := AuthorDeployRecord{}
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *AuthorDeployRecord) GetCreated() bool {
if o == nil || IsNil(o.Created) {
var ret bool
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorDeployRecord) GetCreatedOk() (*bool, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *AuthorDeployRecord) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given bool and assigns it to the Created field.
func (o *AuthorDeployRecord) SetCreated(v bool) {
o.Created = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *AuthorDeployRecord) 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 *AuthorDeployRecord) 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 *AuthorDeployRecord) 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 *AuthorDeployRecord) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetDeployId returns the DeployId field value if set, zero value otherwise.
func (o *AuthorDeployRecord) GetDeployId() string {
if o == nil || IsNil(o.DeployId) {
var ret string
return ret
}
return *o.DeployId
}
// GetDeployIdOk returns a tuple with the DeployId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorDeployRecord) GetDeployIdOk() (*string, bool) {
if o == nil || IsNil(o.DeployId) {
return nil, false
}
return o.DeployId, true
}
// HasDeployId returns a boolean if a field has been set.
func (o *AuthorDeployRecord) HasDeployId() bool {
if o != nil && !IsNil(o.DeployId) {
return true
}
return false
}
// SetDeployId gets a reference to the given string and assigns it to the DeployId field.
func (o *AuthorDeployRecord) SetDeployId(v string) {
o.DeployId = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *AuthorDeployRecord) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorDeployRecord) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *AuthorDeployRecord) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *AuthorDeployRecord) SetReason(v string) {
o.Reason = &v
}
// GetRecorded returns the Recorded field value if set, zero value otherwise.
func (o *AuthorDeployRecord) GetRecorded() bool {
if o == nil || IsNil(o.Recorded) {
var ret bool
return ret
}
return *o.Recorded
}
// GetRecordedOk returns a tuple with the Recorded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorDeployRecord) GetRecordedOk() (*bool, bool) {
if o == nil || IsNil(o.Recorded) {
return nil, false
}
return o.Recorded, true
}
// HasRecorded returns a boolean if a field has been set.
func (o *AuthorDeployRecord) HasRecorded() bool {
if o != nil && !IsNil(o.Recorded) {
return true
}
return false
}
// SetRecorded gets a reference to the given bool and assigns it to the Recorded field.
func (o *AuthorDeployRecord) SetRecorded(v bool) {
o.Recorded = &v
}
// GetSelf returns the Self field value if set, zero value otherwise.
func (o *AuthorDeployRecord) GetSelf() bool {
if o == nil || IsNil(o.Self) {
var ret bool
return ret
}
return *o.Self
}
// GetSelfOk returns a tuple with the Self field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorDeployRecord) GetSelfOk() (*bool, bool) {
if o == nil || IsNil(o.Self) {
return nil, false
}
return o.Self, true
}
// HasSelf returns a boolean if a field has been set.
func (o *AuthorDeployRecord) HasSelf() bool {
if o != nil && !IsNil(o.Self) {
return true
}
return false
}
// SetSelf gets a reference to the given bool and assigns it to the Self field.
func (o *AuthorDeployRecord) SetSelf(v bool) {
o.Self = &v
}
func (o AuthorDeployRecord) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthorDeployRecord) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.DeployId) {
toSerialize["deployId"] = o.DeployId
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Recorded) {
toSerialize["recorded"] = o.Recorded
}
if !IsNil(o.Self) {
toSerialize["self"] = o.Self
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AuthorDeployRecord) UnmarshalJSON(data []byte) (err error) {
varAuthorDeployRecord := _AuthorDeployRecord{}
err = json.Unmarshal(data, &varAuthorDeployRecord)
if err != nil {
return err
}
*o = AuthorDeployRecord(varAuthorDeployRecord)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "deployId")
delete(additionalProperties, "reason")
delete(additionalProperties, "recorded")
delete(additionalProperties, "self")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAuthorDeployRecord struct {
value *AuthorDeployRecord
isSet bool
}
func (v NullableAuthorDeployRecord) Get() *AuthorDeployRecord {
return v.value
}
func (v *NullableAuthorDeployRecord) Set(val *AuthorDeployRecord) {
v.value = val
v.isSet = true
}
func (v NullableAuthorDeployRecord) IsSet() bool {
return v.isSet
}
func (v *NullableAuthorDeployRecord) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthorDeployRecord(val *AuthorDeployRecord) *NullableAuthorDeployRecord {
return &NullableAuthorDeployRecord{value: val, isSet: true}
}
func (v NullableAuthorDeployRecord) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthorDeployRecord) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}