mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
9.8 KiB
Go
383 lines
9.8 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 SyncSyncReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SyncSyncReq{}
|
|
|
|
// SyncSyncReq struct for SyncSyncReq
|
|
type SyncSyncReq struct {
|
|
// Actor is the identity the sync writes as, used as the loop guard so its own writes do not re-trigger it. Defaults to the deployment's GIT_SYNC_ACTOR.
|
|
Actor *string `json:"actor,omitempty"`
|
|
// Direction is both (the default), pull, push or off.
|
|
Direction *string `json:"direction,omitempty"`
|
|
// Kind is what is being synced. Only \"git\" today, which is also the default.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Run reconciles once immediately after the upsert, in the background.
|
|
Run *bool `json:"run,omitempty"`
|
|
// Source is the upstream end. Required.
|
|
Source *SyncEndpointReq `json:"source,omitempty"`
|
|
// Target is the downstream end. Optional for git: a native repository named after the source is derived when it is omitted.
|
|
Target *SyncEndpointReq `json:"target,omitempty"`
|
|
// Trigger is what starts a reconcile: webhook (the default), poll or manual.
|
|
Trigger *string `json:"trigger,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SyncSyncReq SyncSyncReq
|
|
|
|
// NewSyncSyncReq instantiates a new SyncSyncReq 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 NewSyncSyncReq() *SyncSyncReq {
|
|
this := SyncSyncReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewSyncSyncReqWithDefaults instantiates a new SyncSyncReq 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 NewSyncSyncReqWithDefaults() *SyncSyncReq {
|
|
this := SyncSyncReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetActor returns the Actor field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) SetActor(v string) {
|
|
o.Actor = &v
|
|
}
|
|
|
|
// GetDirection returns the Direction field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) SetDirection(v string) {
|
|
o.Direction = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetRun returns the Run field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) GetRun() bool {
|
|
if o == nil || IsNil(o.Run) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Run
|
|
}
|
|
|
|
// GetRunOk returns a tuple with the Run field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SyncSyncReq) GetRunOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Run) {
|
|
return nil, false
|
|
}
|
|
return o.Run, true
|
|
}
|
|
|
|
// HasRun returns a boolean if a field has been set.
|
|
func (o *SyncSyncReq) HasRun() bool {
|
|
if o != nil && !IsNil(o.Run) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRun gets a reference to the given bool and assigns it to the Run field.
|
|
func (o *SyncSyncReq) SetRun(v bool) {
|
|
o.Run = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) GetSource() SyncEndpointReq {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret SyncEndpointReq
|
|
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 *SyncSyncReq) GetSourceOk() (*SyncEndpointReq, 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 *SyncSyncReq) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given SyncEndpointReq and assigns it to the Source field.
|
|
func (o *SyncSyncReq) SetSource(v SyncEndpointReq) {
|
|
o.Source = &v
|
|
}
|
|
|
|
// GetTarget returns the Target field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) GetTarget() SyncEndpointReq {
|
|
if o == nil || IsNil(o.Target) {
|
|
var ret SyncEndpointReq
|
|
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 *SyncSyncReq) GetTargetOk() (*SyncEndpointReq, 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 *SyncSyncReq) HasTarget() bool {
|
|
if o != nil && !IsNil(o.Target) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTarget gets a reference to the given SyncEndpointReq and assigns it to the Target field.
|
|
func (o *SyncSyncReq) SetTarget(v SyncEndpointReq) {
|
|
o.Target = &v
|
|
}
|
|
|
|
// GetTrigger returns the Trigger field value if set, zero value otherwise.
|
|
func (o *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) 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 *SyncSyncReq) SetTrigger(v string) {
|
|
o.Trigger = &v
|
|
}
|
|
|
|
func (o SyncSyncReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SyncSyncReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Actor) {
|
|
toSerialize["actor"] = o.Actor
|
|
}
|
|
if !IsNil(o.Direction) {
|
|
toSerialize["direction"] = o.Direction
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Run) {
|
|
toSerialize["run"] = o.Run
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
if !IsNil(o.Target) {
|
|
toSerialize["target"] = o.Target
|
|
}
|
|
if !IsNil(o.Trigger) {
|
|
toSerialize["trigger"] = o.Trigger
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SyncSyncReq) UnmarshalJSON(data []byte) (err error) {
|
|
varSyncSyncReq := _SyncSyncReq{}
|
|
|
|
err = json.Unmarshal(data, &varSyncSyncReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SyncSyncReq(varSyncSyncReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "actor")
|
|
delete(additionalProperties, "direction")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "run")
|
|
delete(additionalProperties, "source")
|
|
delete(additionalProperties, "target")
|
|
delete(additionalProperties, "trigger")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSyncSyncReq struct {
|
|
value *SyncSyncReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSyncSyncReq) Get() *SyncSyncReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSyncSyncReq) Set(val *SyncSyncReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSyncSyncReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSyncSyncReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSyncSyncReq(val *SyncSyncReq) *NullableSyncSyncReq {
|
|
return &NullableSyncSyncReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSyncSyncReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSyncSyncReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|