mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.1 KiB
Go
231 lines
6.1 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 GitMirrorTargetReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitMirrorTargetReq{}
|
|
|
|
// GitMirrorTargetReq struct for GitMirrorTargetReq
|
|
type GitMirrorTargetReq struct {
|
|
// Host is an optional assertion of the target's hostname. The authoritative host is the one in URL; a value that disagrees with it is refused.
|
|
Host *string `json:"host,omitempty"`
|
|
// Name is the repo whose advanced refs are pushed downstream, from the :name path segment.
|
|
Name *string `json:"name,omitempty"`
|
|
// URL is the downstream https git remote. Must be https to an allowlisted host (github.com / gitlab.com); any embedded credentials are stripped. Required.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitMirrorTargetReq GitMirrorTargetReq
|
|
|
|
// NewGitMirrorTargetReq instantiates a new GitMirrorTargetReq 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 NewGitMirrorTargetReq() *GitMirrorTargetReq {
|
|
this := GitMirrorTargetReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitMirrorTargetReqWithDefaults instantiates a new GitMirrorTargetReq 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 NewGitMirrorTargetReqWithDefaults() *GitMirrorTargetReq {
|
|
this := GitMirrorTargetReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetHost returns the Host field value if set, zero value otherwise.
|
|
func (o *GitMirrorTargetReq) GetHost() string {
|
|
if o == nil || IsNil(o.Host) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Host
|
|
}
|
|
|
|
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitMirrorTargetReq) GetHostOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Host) {
|
|
return nil, false
|
|
}
|
|
return o.Host, true
|
|
}
|
|
|
|
// HasHost returns a boolean if a field has been set.
|
|
func (o *GitMirrorTargetReq) HasHost() bool {
|
|
if o != nil && !IsNil(o.Host) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHost gets a reference to the given string and assigns it to the Host field.
|
|
func (o *GitMirrorTargetReq) SetHost(v string) {
|
|
o.Host = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *GitMirrorTargetReq) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitMirrorTargetReq) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *GitMirrorTargetReq) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *GitMirrorTargetReq) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *GitMirrorTargetReq) GetUrl() string {
|
|
if o == nil || IsNil(o.Url) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Url
|
|
}
|
|
|
|
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitMirrorTargetReq) GetUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Url) {
|
|
return nil, false
|
|
}
|
|
return o.Url, true
|
|
}
|
|
|
|
// HasUrl returns a boolean if a field has been set.
|
|
func (o *GitMirrorTargetReq) HasUrl() bool {
|
|
if o != nil && !IsNil(o.Url) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUrl gets a reference to the given string and assigns it to the Url field.
|
|
func (o *GitMirrorTargetReq) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o GitMirrorTargetReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitMirrorTargetReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Host) {
|
|
toSerialize["host"] = o.Host
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitMirrorTargetReq) UnmarshalJSON(data []byte) (err error) {
|
|
varGitMirrorTargetReq := _GitMirrorTargetReq{}
|
|
|
|
err = json.Unmarshal(data, &varGitMirrorTargetReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitMirrorTargetReq(varGitMirrorTargetReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "host")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitMirrorTargetReq struct {
|
|
value *GitMirrorTargetReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitMirrorTargetReq) Get() *GitMirrorTargetReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitMirrorTargetReq) Set(val *GitMirrorTargetReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitMirrorTargetReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitMirrorTargetReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitMirrorTargetReq(val *GitMirrorTargetReq) *NullableGitMirrorTargetReq {
|
|
return &NullableGitMirrorTargetReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitMirrorTargetReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitMirrorTargetReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|