Files
sdk/model_git_pull_view.go

535 lines
13 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 GitPullView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitPullView{}
// GitPullView struct for GitPullView
type GitPullView struct {
// Author is the user who opened it; empty for a caller with no user.
Author *string `json:"author,omitempty"`
// Base is the branch the work is proposed into.
Base *string `json:"base,omitempty"`
// Body is the longer description; empty when none was given.
Body *string `json:"body,omitempty"`
// CreatedAt is RFC 3339 UTC.
CreatedAt *string `json:"createdAt,omitempty"`
// Head is the branch holding the work.
Head *string `json:"head,omitempty"`
// MergedRev is what base points at now that the merge landed. Empty while the proposal is open.
MergedRev *string `json:"mergedRev,omitempty"`
// Number is the proposal's per-repo handle, dense from 1.
Number *int64 `json:"number,omitempty"`
// Repo is the repository the proposal belongs to.
Repo *string `json:"repo,omitempty"`
// State is \"open\" or \"merged\".
State *string `json:"state,omitempty"`
// Title is the one-line summary.
Title *string `json:"title,omitempty"`
// UpdatedAt is RFC 3339 UTC.
UpdatedAt *string `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitPullView GitPullView
// NewGitPullView instantiates a new GitPullView 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 NewGitPullView() *GitPullView {
this := GitPullView{}
return &this
}
// NewGitPullViewWithDefaults instantiates a new GitPullView 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 NewGitPullViewWithDefaults() *GitPullView {
this := GitPullView{}
return &this
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *GitPullView) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *GitPullView) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *GitPullView) SetAuthor(v string) {
o.Author = &v
}
// GetBase returns the Base field value if set, zero value otherwise.
func (o *GitPullView) 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 *GitPullView) 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 *GitPullView) 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 *GitPullView) SetBase(v string) {
o.Base = &v
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *GitPullView) 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 *GitPullView) 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 *GitPullView) 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 *GitPullView) SetBody(v string) {
o.Body = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *GitPullView) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetCreatedAtOk() (*string, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *GitPullView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *GitPullView) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetHead returns the Head field value if set, zero value otherwise.
func (o *GitPullView) 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 *GitPullView) 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 *GitPullView) 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 *GitPullView) SetHead(v string) {
o.Head = &v
}
// GetMergedRev returns the MergedRev field value if set, zero value otherwise.
func (o *GitPullView) GetMergedRev() string {
if o == nil || IsNil(o.MergedRev) {
var ret string
return ret
}
return *o.MergedRev
}
// GetMergedRevOk returns a tuple with the MergedRev field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetMergedRevOk() (*string, bool) {
if o == nil || IsNil(o.MergedRev) {
return nil, false
}
return o.MergedRev, true
}
// HasMergedRev returns a boolean if a field has been set.
func (o *GitPullView) HasMergedRev() bool {
if o != nil && !IsNil(o.MergedRev) {
return true
}
return false
}
// SetMergedRev gets a reference to the given string and assigns it to the MergedRev field.
func (o *GitPullView) SetMergedRev(v string) {
o.MergedRev = &v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *GitPullView) GetNumber() int64 {
if o == nil || IsNil(o.Number) {
var ret int64
return ret
}
return *o.Number
}
// GetNumberOk returns a tuple with the Number field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetNumberOk() (*int64, bool) {
if o == nil || IsNil(o.Number) {
return nil, false
}
return o.Number, true
}
// HasNumber returns a boolean if a field has been set.
func (o *GitPullView) HasNumber() bool {
if o != nil && !IsNil(o.Number) {
return true
}
return false
}
// SetNumber gets a reference to the given int64 and assigns it to the Number field.
func (o *GitPullView) SetNumber(v int64) {
o.Number = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *GitPullView) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *GitPullView) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *GitPullView) SetRepo(v string) {
o.Repo = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *GitPullView) GetState() string {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetStateOk() (*string, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *GitPullView) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *GitPullView) SetState(v string) {
o.State = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *GitPullView) 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 *GitPullView) 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 *GitPullView) 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 *GitPullView) SetTitle(v string) {
o.Title = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *GitPullView) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitPullView) GetUpdatedAtOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *GitPullView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *GitPullView) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
func (o GitPullView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitPullView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
if !IsNil(o.Base) {
toSerialize["base"] = o.Base
}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Head) {
toSerialize["head"] = o.Head
}
if !IsNil(o.MergedRev) {
toSerialize["mergedRev"] = o.MergedRev
}
if !IsNil(o.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitPullView) UnmarshalJSON(data []byte) (err error) {
varGitPullView := _GitPullView{}
err = json.Unmarshal(data, &varGitPullView)
if err != nil {
return err
}
*o = GitPullView(varGitPullView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "author")
delete(additionalProperties, "base")
delete(additionalProperties, "body")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "head")
delete(additionalProperties, "mergedRev")
delete(additionalProperties, "number")
delete(additionalProperties, "repo")
delete(additionalProperties, "state")
delete(additionalProperties, "title")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitPullView struct {
value *GitPullView
isSet bool
}
func (v NullableGitPullView) Get() *GitPullView {
return v.value
}
func (v *NullableGitPullView) Set(val *GitPullView) {
v.value = val
v.isSet = true
}
func (v NullableGitPullView) IsSet() bool {
return v.isSet
}
func (v *NullableGitPullView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitPullView(val *GitPullView) *NullableGitPullView {
return &NullableGitPullView{value: val, isSet: true}
}
func (v NullableGitPullView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitPullView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}