mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.5 KiB
Go
269 lines
6.5 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 GitLink type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitLink{}
|
|
|
|
// GitLink struct for GitLink
|
|
type GitLink struct {
|
|
// CloneURL is the address its history is fetched from and pushed to.
|
|
CloneUrl *string `json:"cloneUrl,omitempty"`
|
|
// Name is the repository's name on its provider.
|
|
Name *string `json:"name,omitempty"`
|
|
// Owner is the account the repository belongs to on its provider.
|
|
Owner *string `json:"owner,omitempty"`
|
|
// Provider is \"github\", \"forge\" (git.hanzo.ai, Hanzo's own), or \"git\" for any other host.
|
|
Provider *string `json:"provider,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitLink GitLink
|
|
|
|
// NewGitLink instantiates a new GitLink 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 NewGitLink() *GitLink {
|
|
this := GitLink{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitLinkWithDefaults instantiates a new GitLink 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 NewGitLinkWithDefaults() *GitLink {
|
|
this := GitLink{}
|
|
return &this
|
|
}
|
|
|
|
// GetCloneUrl returns the CloneUrl field value if set, zero value otherwise.
|
|
func (o *GitLink) GetCloneUrl() string {
|
|
if o == nil || IsNil(o.CloneUrl) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CloneUrl
|
|
}
|
|
|
|
// GetCloneUrlOk returns a tuple with the CloneUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitLink) GetCloneUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CloneUrl) {
|
|
return nil, false
|
|
}
|
|
return o.CloneUrl, true
|
|
}
|
|
|
|
// HasCloneUrl returns a boolean if a field has been set.
|
|
func (o *GitLink) HasCloneUrl() bool {
|
|
if o != nil && !IsNil(o.CloneUrl) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCloneUrl gets a reference to the given string and assigns it to the CloneUrl field.
|
|
func (o *GitLink) SetCloneUrl(v string) {
|
|
o.CloneUrl = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *GitLink) 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 *GitLink) 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 *GitLink) 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 *GitLink) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOwner returns the Owner field value if set, zero value otherwise.
|
|
func (o *GitLink) GetOwner() string {
|
|
if o == nil || IsNil(o.Owner) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Owner
|
|
}
|
|
|
|
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitLink) GetOwnerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Owner) {
|
|
return nil, false
|
|
}
|
|
return o.Owner, true
|
|
}
|
|
|
|
// HasOwner returns a boolean if a field has been set.
|
|
func (o *GitLink) HasOwner() bool {
|
|
if o != nil && !IsNil(o.Owner) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOwner gets a reference to the given string and assigns it to the Owner field.
|
|
func (o *GitLink) SetOwner(v string) {
|
|
o.Owner = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *GitLink) 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 *GitLink) 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 *GitLink) 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 *GitLink) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
func (o GitLink) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitLink) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CloneUrl) {
|
|
toSerialize["cloneUrl"] = o.CloneUrl
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Owner) {
|
|
toSerialize["owner"] = o.Owner
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitLink) UnmarshalJSON(data []byte) (err error) {
|
|
varGitLink := _GitLink{}
|
|
|
|
err = json.Unmarshal(data, &varGitLink)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitLink(varGitLink)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "cloneUrl")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "owner")
|
|
delete(additionalProperties, "provider")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitLink struct {
|
|
value *GitLink
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitLink) Get() *GitLink {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitLink) Set(val *GitLink) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitLink) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitLink) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitLink(val *GitLink) *NullableGitLink {
|
|
return &NullableGitLink{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitLink) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitLink) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|