Files
sdk/model_git_link_req.go

231 lines
5.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 GitLinkReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitLinkReq{}
// GitLinkReq struct for GitLinkReq
type GitLinkReq struct {
// Name is the repository, from the :name path segment. It is made when the org has none of that name.
Name *string `json:"name,omitempty"`
// Project is the sub-scope to make it in; empty uses the caller's own.
Project *string `json:"project,omitempty"`
// Source is where its history lives: an http(s) clone address, such as https://github.com/acme/widgets.git. Its host must let the caller read it.
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitLinkReq GitLinkReq
// NewGitLinkReq instantiates a new GitLinkReq 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 NewGitLinkReq() *GitLinkReq {
this := GitLinkReq{}
return &this
}
// NewGitLinkReqWithDefaults instantiates a new GitLinkReq 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 NewGitLinkReqWithDefaults() *GitLinkReq {
this := GitLinkReq{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *GitLinkReq) 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 *GitLinkReq) 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 *GitLinkReq) 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 *GitLinkReq) SetName(v string) {
o.Name = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *GitLinkReq) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitLinkReq) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *GitLinkReq) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *GitLinkReq) SetProject(v string) {
o.Project = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *GitLinkReq) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
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 *GitLinkReq) GetSourceOk() (*string, 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 *GitLinkReq) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *GitLinkReq) SetSource(v string) {
o.Source = &v
}
func (o GitLinkReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitLinkReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitLinkReq) UnmarshalJSON(data []byte) (err error) {
varGitLinkReq := _GitLinkReq{}
err = json.Unmarshal(data, &varGitLinkReq)
if err != nil {
return err
}
*o = GitLinkReq(varGitLinkReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "project")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitLinkReq struct {
value *GitLinkReq
isSet bool
}
func (v NullableGitLinkReq) Get() *GitLinkReq {
return v.value
}
func (v *NullableGitLinkReq) Set(val *GitLinkReq) {
v.value = val
v.isSet = true
}
func (v NullableGitLinkReq) IsSet() bool {
return v.isSet
}
func (v *NullableGitLinkReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitLinkReq(val *GitLinkReq) *NullableGitLinkReq {
return &NullableGitLinkReq{value: val, isSet: true}
}
func (v NullableGitLinkReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitLinkReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}