Files
sdk/model_sync_sync_view.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 SyncSyncView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SyncSyncView{}
// SyncSyncView struct for SyncSyncView
type SyncSyncView struct {
// Actor is the identity a reconcile writes AS. It is the loop guard: a change this identity made is one we already have, so it is not synced back.
Actor *string `json:"actor,omitempty"`
// CreatedAt is when the link was first declared, RFC3339 in UTC.
CreatedAt *string `json:"createdAt,omitempty"`
// Direction is which way work flows: \"both\", \"pull\" (target ← source), \"push\" (source → target), or \"off\" — which keeps the link declared and moves nothing.
Direction *string `json:"direction,omitempty"`
// ID is the link's handle, derived from its source and target — which is what makes re-declaring the same pair an update rather than a duplicate.
Id *string `json:"id,omitempty"`
// Kind is what is being synced. \"git\" today; the field exists so a storage or database link is a value here rather than a second route family.
Kind *string `json:"kind,omitempty"`
// Native is the repo link's copy on the forge: where it lives and how it stands. Absent for an account link, and absent when the forge could not be read — an unread forge is not reported as a healthy one.
Native *SyncNativeView `json:"native,omitempty"`
// Scope is \"repo\" for a link to one repository, or \"account\" for a link to a whole GitHub account, which declares a repo link for every repository the account holds — the ones created later included.
Scope *string `json:"scope,omitempty"`
// Source is the side read FROM on a pull.
Source *SyncEndpointView `json:"source,omitempty"`
// Target is the side written TO on a push.
Target *SyncEndpointView `json:"target,omitempty"`
// Trigger is what starts a reconcile: \"webhook\" (the provider tells us), \"poll\" (we ask on a schedule), or \"manual\" (only an explicit call).
Trigger *string `json:"trigger,omitempty"`
// UpdatedAt is bumped by every reconcile, so it reads as the LAST-SYNCED time rather than the last edit. Absent until the first one runs.
UpdatedAt *string `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SyncSyncView SyncSyncView
// NewSyncSyncView instantiates a new SyncSyncView 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 NewSyncSyncView() *SyncSyncView {
this := SyncSyncView{}
return &this
}
// NewSyncSyncViewWithDefaults instantiates a new SyncSyncView 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 NewSyncSyncViewWithDefaults() *SyncSyncView {
this := SyncSyncView{}
return &this
}
// GetActor returns the Actor field value if set, zero value otherwise.
func (o *SyncSyncView) GetActor() string {
if o == nil || IsNil(o.Actor) {
var ret string
return ret
}
return *o.Actor
}
// GetActorOk returns a tuple with the Actor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetActorOk() (*string, bool) {
if o == nil || IsNil(o.Actor) {
return nil, false
}
return o.Actor, true
}
// HasActor returns a boolean if a field has been set.
func (o *SyncSyncView) HasActor() bool {
if o != nil && !IsNil(o.Actor) {
return true
}
return false
}
// SetActor gets a reference to the given string and assigns it to the Actor field.
func (o *SyncSyncView) SetActor(v string) {
o.Actor = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SyncSyncView) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
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 *SyncSyncView) GetCreatedAtOk() (*string, 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 *SyncSyncView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *SyncSyncView) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetDirection returns the Direction field value if set, zero value otherwise.
func (o *SyncSyncView) GetDirection() string {
if o == nil || IsNil(o.Direction) {
var ret string
return ret
}
return *o.Direction
}
// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetDirectionOk() (*string, bool) {
if o == nil || IsNil(o.Direction) {
return nil, false
}
return o.Direction, true
}
// HasDirection returns a boolean if a field has been set.
func (o *SyncSyncView) HasDirection() bool {
if o != nil && !IsNil(o.Direction) {
return true
}
return false
}
// SetDirection gets a reference to the given string and assigns it to the Direction field.
func (o *SyncSyncView) SetDirection(v string) {
o.Direction = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SyncSyncView) 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 *SyncSyncView) 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 *SyncSyncView) 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 *SyncSyncView) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *SyncSyncView) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *SyncSyncView) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *SyncSyncView) SetKind(v string) {
o.Kind = &v
}
// GetNative returns the Native field value if set, zero value otherwise.
func (o *SyncSyncView) GetNative() SyncNativeView {
if o == nil || IsNil(o.Native) {
var ret SyncNativeView
return ret
}
return *o.Native
}
// GetNativeOk returns a tuple with the Native field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetNativeOk() (*SyncNativeView, bool) {
if o == nil || IsNil(o.Native) {
return nil, false
}
return o.Native, true
}
// HasNative returns a boolean if a field has been set.
func (o *SyncSyncView) HasNative() bool {
if o != nil && !IsNil(o.Native) {
return true
}
return false
}
// SetNative gets a reference to the given SyncNativeView and assigns it to the Native field.
func (o *SyncSyncView) SetNative(v SyncNativeView) {
o.Native = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *SyncSyncView) GetScope() string {
if o == nil || IsNil(o.Scope) {
var ret string
return ret
}
return *o.Scope
}
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetScopeOk() (*string, bool) {
if o == nil || IsNil(o.Scope) {
return nil, false
}
return o.Scope, true
}
// HasScope returns a boolean if a field has been set.
func (o *SyncSyncView) HasScope() bool {
if o != nil && !IsNil(o.Scope) {
return true
}
return false
}
// SetScope gets a reference to the given string and assigns it to the Scope field.
func (o *SyncSyncView) SetScope(v string) {
o.Scope = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *SyncSyncView) GetSource() SyncEndpointView {
if o == nil || IsNil(o.Source) {
var ret SyncEndpointView
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 *SyncSyncView) GetSourceOk() (*SyncEndpointView, 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 *SyncSyncView) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given SyncEndpointView and assigns it to the Source field.
func (o *SyncSyncView) SetSource(v SyncEndpointView) {
o.Source = &v
}
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *SyncSyncView) GetTarget() SyncEndpointView {
if o == nil || IsNil(o.Target) {
var ret SyncEndpointView
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 *SyncSyncView) GetTargetOk() (*SyncEndpointView, 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 *SyncSyncView) HasTarget() bool {
if o != nil && !IsNil(o.Target) {
return true
}
return false
}
// SetTarget gets a reference to the given SyncEndpointView and assigns it to the Target field.
func (o *SyncSyncView) SetTarget(v SyncEndpointView) {
o.Target = &v
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *SyncSyncView) GetTrigger() string {
if o == nil || IsNil(o.Trigger) {
var ret string
return ret
}
return *o.Trigger
}
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncSyncView) GetTriggerOk() (*string, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
return o.Trigger, true
}
// HasTrigger returns a boolean if a field has been set.
func (o *SyncSyncView) HasTrigger() bool {
if o != nil && !IsNil(o.Trigger) {
return true
}
return false
}
// SetTrigger gets a reference to the given string and assigns it to the Trigger field.
func (o *SyncSyncView) SetTrigger(v string) {
o.Trigger = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *SyncSyncView) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
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 *SyncSyncView) GetUpdatedAtOk() (*string, 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 *SyncSyncView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *SyncSyncView) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
func (o SyncSyncView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SyncSyncView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actor) {
toSerialize["actor"] = o.Actor
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Direction) {
toSerialize["direction"] = o.Direction
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Native) {
toSerialize["native"] = o.Native
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
if !IsNil(o.Trigger) {
toSerialize["trigger"] = o.Trigger
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SyncSyncView) UnmarshalJSON(data []byte) (err error) {
varSyncSyncView := _SyncSyncView{}
err = json.Unmarshal(data, &varSyncSyncView)
if err != nil {
return err
}
*o = SyncSyncView(varSyncSyncView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actor")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "direction")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "native")
delete(additionalProperties, "scope")
delete(additionalProperties, "source")
delete(additionalProperties, "target")
delete(additionalProperties, "trigger")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSyncSyncView struct {
value *SyncSyncView
isSet bool
}
func (v NullableSyncSyncView) Get() *SyncSyncView {
return v.value
}
func (v *NullableSyncSyncView) Set(val *SyncSyncView) {
v.value = val
v.isSet = true
}
func (v NullableSyncSyncView) IsSet() bool {
return v.isSet
}
func (v *NullableSyncSyncView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSyncSyncView(val *SyncSyncView) *NullableSyncSyncView {
return &NullableSyncSyncView{value: val, isSet: true}
}
func (v NullableSyncSyncView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSyncSyncView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}