Files
sdk/model_git_open_req.go

307 lines
7.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 GitOpenReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitOpenReq{}
// GitOpenReq struct for GitOpenReq
type GitOpenReq struct {
// Base is the branch the work is proposed INTO, by short name. Defaults to the repo's default branch, which is where a proposal goes when nobody says otherwise.
Base *string `json:"base,omitempty"`
// Body is the longer description. Optional.
Body *string `json:"body,omitempty"`
// Head is the branch holding the work, by short name (agent/fix-503). Required, and must already exist.
Head *string `json:"head,omitempty"`
// Name is the repo the proposal belongs to, from the :name path segment.
Name *string `json:"name,omitempty"`
// Title is the one-line summary of what is being proposed. Required.
Title *string `json:"title,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitOpenReq GitOpenReq
// NewGitOpenReq instantiates a new GitOpenReq 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 NewGitOpenReq() *GitOpenReq {
this := GitOpenReq{}
return &this
}
// NewGitOpenReqWithDefaults instantiates a new GitOpenReq 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 NewGitOpenReqWithDefaults() *GitOpenReq {
this := GitOpenReq{}
return &this
}
// GetBase returns the Base field value if set, zero value otherwise.
func (o *GitOpenReq) GetBase() string {
if o == nil || IsNil(o.Base) {
var ret string
return ret
}
return *o.Base
}
// GetBaseOk returns a tuple with the Base field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitOpenReq) GetBaseOk() (*string, bool) {
if o == nil || IsNil(o.Base) {
return nil, false
}
return o.Base, true
}
// HasBase returns a boolean if a field has been set.
func (o *GitOpenReq) HasBase() bool {
if o != nil && !IsNil(o.Base) {
return true
}
return false
}
// SetBase gets a reference to the given string and assigns it to the Base field.
func (o *GitOpenReq) SetBase(v string) {
o.Base = &v
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *GitOpenReq) GetBody() string {
if o == nil || IsNil(o.Body) {
var ret string
return ret
}
return *o.Body
}
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitOpenReq) GetBodyOk() (*string, bool) {
if o == nil || IsNil(o.Body) {
return nil, false
}
return o.Body, true
}
// HasBody returns a boolean if a field has been set.
func (o *GitOpenReq) HasBody() bool {
if o != nil && !IsNil(o.Body) {
return true
}
return false
}
// SetBody gets a reference to the given string and assigns it to the Body field.
func (o *GitOpenReq) SetBody(v string) {
o.Body = &v
}
// GetHead returns the Head field value if set, zero value otherwise.
func (o *GitOpenReq) GetHead() string {
if o == nil || IsNil(o.Head) {
var ret string
return ret
}
return *o.Head
}
// GetHeadOk returns a tuple with the Head field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitOpenReq) GetHeadOk() (*string, bool) {
if o == nil || IsNil(o.Head) {
return nil, false
}
return o.Head, true
}
// HasHead returns a boolean if a field has been set.
func (o *GitOpenReq) HasHead() bool {
if o != nil && !IsNil(o.Head) {
return true
}
return false
}
// SetHead gets a reference to the given string and assigns it to the Head field.
func (o *GitOpenReq) SetHead(v string) {
o.Head = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *GitOpenReq) 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 *GitOpenReq) 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 *GitOpenReq) 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 *GitOpenReq) SetName(v string) {
o.Name = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *GitOpenReq) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitOpenReq) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *GitOpenReq) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *GitOpenReq) SetTitle(v string) {
o.Title = &v
}
func (o GitOpenReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitOpenReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Base) {
toSerialize["base"] = o.Base
}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.Head) {
toSerialize["head"] = o.Head
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitOpenReq) UnmarshalJSON(data []byte) (err error) {
varGitOpenReq := _GitOpenReq{}
err = json.Unmarshal(data, &varGitOpenReq)
if err != nil {
return err
}
*o = GitOpenReq(varGitOpenReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "base")
delete(additionalProperties, "body")
delete(additionalProperties, "head")
delete(additionalProperties, "name")
delete(additionalProperties, "title")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitOpenReq struct {
value *GitOpenReq
isSet bool
}
func (v NullableGitOpenReq) Get() *GitOpenReq {
return v.value
}
func (v *NullableGitOpenReq) Set(val *GitOpenReq) {
v.value = val
v.isSet = true
}
func (v NullableGitOpenReq) IsSet() bool {
return v.isSet
}
func (v *NullableGitOpenReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitOpenReq(val *GitOpenReq) *NullableGitOpenReq {
return &NullableGitOpenReq{value: val, isSet: true}
}
func (v NullableGitOpenReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitOpenReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}