Files
sdk/model_agent_coding_pull.go

383 lines
9.9 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 AgentCodingPull type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentCodingPull{}
// AgentCodingPull struct for AgentCodingPull
type AgentCodingPull struct {
// Mergeable is the forge's verdict that the base takes the branch without conflict.
Mergeable *bool `json:"mergeable,omitempty"`
// MoreReviews says it has more reviews than the first 50 that Reviews lists.
MoreReviews *bool `json:"moreReviews,omitempty"`
// Number is the pull request's number in its repository.
Number *int64 `json:"number,omitempty"`
// Reviews are its reviews, oldest first: the first 50.
Reviews []AgentCodingReview `json:"reviews,omitempty"`
// State is open, closed or merged.
State *string `json:"state,omitempty"`
// Title is its title.
Title *string `json:"title,omitempty"`
// URL is where a person reads and merges it.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentCodingPull AgentCodingPull
// NewAgentCodingPull instantiates a new AgentCodingPull 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 NewAgentCodingPull() *AgentCodingPull {
this := AgentCodingPull{}
return &this
}
// NewAgentCodingPullWithDefaults instantiates a new AgentCodingPull 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 NewAgentCodingPullWithDefaults() *AgentCodingPull {
this := AgentCodingPull{}
return &this
}
// GetMergeable returns the Mergeable field value if set, zero value otherwise.
func (o *AgentCodingPull) GetMergeable() bool {
if o == nil || IsNil(o.Mergeable) {
var ret bool
return ret
}
return *o.Mergeable
}
// GetMergeableOk returns a tuple with the Mergeable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingPull) GetMergeableOk() (*bool, bool) {
if o == nil || IsNil(o.Mergeable) {
return nil, false
}
return o.Mergeable, true
}
// HasMergeable returns a boolean if a field has been set.
func (o *AgentCodingPull) HasMergeable() bool {
if o != nil && !IsNil(o.Mergeable) {
return true
}
return false
}
// SetMergeable gets a reference to the given bool and assigns it to the Mergeable field.
func (o *AgentCodingPull) SetMergeable(v bool) {
o.Mergeable = &v
}
// GetMoreReviews returns the MoreReviews field value if set, zero value otherwise.
func (o *AgentCodingPull) GetMoreReviews() bool {
if o == nil || IsNil(o.MoreReviews) {
var ret bool
return ret
}
return *o.MoreReviews
}
// GetMoreReviewsOk returns a tuple with the MoreReviews field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingPull) GetMoreReviewsOk() (*bool, bool) {
if o == nil || IsNil(o.MoreReviews) {
return nil, false
}
return o.MoreReviews, true
}
// HasMoreReviews returns a boolean if a field has been set.
func (o *AgentCodingPull) HasMoreReviews() bool {
if o != nil && !IsNil(o.MoreReviews) {
return true
}
return false
}
// SetMoreReviews gets a reference to the given bool and assigns it to the MoreReviews field.
func (o *AgentCodingPull) SetMoreReviews(v bool) {
o.MoreReviews = &v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) SetNumber(v int64) {
o.Number = &v
}
// GetReviews returns the Reviews field value if set, zero value otherwise.
func (o *AgentCodingPull) GetReviews() []AgentCodingReview {
if o == nil || IsNil(o.Reviews) {
var ret []AgentCodingReview
return ret
}
return o.Reviews
}
// GetReviewsOk returns a tuple with the Reviews field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingPull) GetReviewsOk() ([]AgentCodingReview, bool) {
if o == nil || IsNil(o.Reviews) {
return nil, false
}
return o.Reviews, true
}
// HasReviews returns a boolean if a field has been set.
func (o *AgentCodingPull) HasReviews() bool {
if o != nil && !IsNil(o.Reviews) {
return true
}
return false
}
// SetReviews gets a reference to the given []AgentCodingReview and assigns it to the Reviews field.
func (o *AgentCodingPull) SetReviews(v []AgentCodingReview) {
o.Reviews = v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) SetState(v string) {
o.State = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) 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 *AgentCodingPull) SetUrl(v string) {
o.Url = &v
}
func (o AgentCodingPull) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentCodingPull) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Mergeable) {
toSerialize["mergeable"] = o.Mergeable
}
if !IsNil(o.MoreReviews) {
toSerialize["moreReviews"] = o.MoreReviews
}
if !IsNil(o.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.Reviews) {
toSerialize["reviews"] = o.Reviews
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentCodingPull) UnmarshalJSON(data []byte) (err error) {
varAgentCodingPull := _AgentCodingPull{}
err = json.Unmarshal(data, &varAgentCodingPull)
if err != nil {
return err
}
*o = AgentCodingPull(varAgentCodingPull)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "mergeable")
delete(additionalProperties, "moreReviews")
delete(additionalProperties, "number")
delete(additionalProperties, "reviews")
delete(additionalProperties, "state")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentCodingPull struct {
value *AgentCodingPull
isSet bool
}
func (v NullableAgentCodingPull) Get() *AgentCodingPull {
return v.value
}
func (v *NullableAgentCodingPull) Set(val *AgentCodingPull) {
v.value = val
v.isSet = true
}
func (v NullableAgentCodingPull) IsSet() bool {
return v.isSet
}
func (v *NullableAgentCodingPull) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentCodingPull(val *AgentCodingPull) *NullableAgentCodingPull {
return &NullableAgentCodingPull{value: val, isSet: true}
}
func (v NullableAgentCodingPull) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentCodingPull) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}