Files
sdk/model_sync_endpoint_req.go

231 lines
6.2 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 SyncEndpointReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SyncEndpointReq{}
// SyncEndpointReq struct for SyncEndpointReq
type SyncEndpointReq struct {
// Connector names the stored credential to reach this endpoint with.
Connector *string `json:"connector,omitempty"`
// Locator addresses the resource. For a git source it is the https clone URL on the provider's own host, with no embedded credentials; for a native target it is the repository name.
Locator *string `json:"locator,omitempty"`
// Provider is the platform: github or gitlab for a source; a target defaults to the native Hanzo Git plane.
Provider *string `json:"provider,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SyncEndpointReq SyncEndpointReq
// NewSyncEndpointReq instantiates a new SyncEndpointReq 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 NewSyncEndpointReq() *SyncEndpointReq {
this := SyncEndpointReq{}
return &this
}
// NewSyncEndpointReqWithDefaults instantiates a new SyncEndpointReq 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 NewSyncEndpointReqWithDefaults() *SyncEndpointReq {
this := SyncEndpointReq{}
return &this
}
// GetConnector returns the Connector field value if set, zero value otherwise.
func (o *SyncEndpointReq) GetConnector() string {
if o == nil || IsNil(o.Connector) {
var ret string
return ret
}
return *o.Connector
}
// GetConnectorOk returns a tuple with the Connector field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncEndpointReq) GetConnectorOk() (*string, bool) {
if o == nil || IsNil(o.Connector) {
return nil, false
}
return o.Connector, true
}
// HasConnector returns a boolean if a field has been set.
func (o *SyncEndpointReq) HasConnector() bool {
if o != nil && !IsNil(o.Connector) {
return true
}
return false
}
// SetConnector gets a reference to the given string and assigns it to the Connector field.
func (o *SyncEndpointReq) SetConnector(v string) {
o.Connector = &v
}
// GetLocator returns the Locator field value if set, zero value otherwise.
func (o *SyncEndpointReq) GetLocator() string {
if o == nil || IsNil(o.Locator) {
var ret string
return ret
}
return *o.Locator
}
// GetLocatorOk returns a tuple with the Locator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncEndpointReq) GetLocatorOk() (*string, bool) {
if o == nil || IsNil(o.Locator) {
return nil, false
}
return o.Locator, true
}
// HasLocator returns a boolean if a field has been set.
func (o *SyncEndpointReq) HasLocator() bool {
if o != nil && !IsNil(o.Locator) {
return true
}
return false
}
// SetLocator gets a reference to the given string and assigns it to the Locator field.
func (o *SyncEndpointReq) SetLocator(v string) {
o.Locator = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *SyncEndpointReq) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyncEndpointReq) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *SyncEndpointReq) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *SyncEndpointReq) SetProvider(v string) {
o.Provider = &v
}
func (o SyncEndpointReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SyncEndpointReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Connector) {
toSerialize["connector"] = o.Connector
}
if !IsNil(o.Locator) {
toSerialize["locator"] = o.Locator
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SyncEndpointReq) UnmarshalJSON(data []byte) (err error) {
varSyncEndpointReq := _SyncEndpointReq{}
err = json.Unmarshal(data, &varSyncEndpointReq)
if err != nil {
return err
}
*o = SyncEndpointReq(varSyncEndpointReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "connector")
delete(additionalProperties, "locator")
delete(additionalProperties, "provider")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSyncEndpointReq struct {
value *SyncEndpointReq
isSet bool
}
func (v NullableSyncEndpointReq) Get() *SyncEndpointReq {
return v.value
}
func (v *NullableSyncEndpointReq) Set(val *SyncEndpointReq) {
v.value = val
v.isSet = true
}
func (v NullableSyncEndpointReq) IsSet() bool {
return v.isSet
}
func (v *NullableSyncEndpointReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSyncEndpointReq(val *SyncEndpointReq) *NullableSyncEndpointReq {
return &NullableSyncEndpointReq{value: val, isSet: true}
}
func (v NullableSyncEndpointReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSyncEndpointReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}