Files
sdk/model_agent_coding_review.go

307 lines
8.0 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 AgentCodingReview type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentCodingReview{}
// AgentCodingReview struct for AgentCodingReview
type AgentCodingReview struct {
// At is when it was submitted, RFC 3339 in UTC; empty for one that has not been.
At *string `json:"at,omitempty"`
// Author is the reviewer's forge login.
Author *string `json:"author,omitempty"`
// Body is what the reviewer wrote; empty for a bare verdict. At most 16 KiB of it, and 256 KiB across the reviews listed.
Body *string `json:"body,omitempty"`
// State is the verdict: approved, request_changes, comment, pending or request_review.
State *string `json:"state,omitempty"`
// Truncated marks a Body cut at either bound — or left empty past the second, where the review keeps its author, verdict and time.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentCodingReview AgentCodingReview
// NewAgentCodingReview instantiates a new AgentCodingReview 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 NewAgentCodingReview() *AgentCodingReview {
this := AgentCodingReview{}
return &this
}
// NewAgentCodingReviewWithDefaults instantiates a new AgentCodingReview 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 NewAgentCodingReviewWithDefaults() *AgentCodingReview {
this := AgentCodingReview{}
return &this
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *AgentCodingReview) GetAt() string {
if o == nil || IsNil(o.At) {
var ret string
return ret
}
return *o.At
}
// GetAtOk returns a tuple with the At field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingReview) GetAtOk() (*string, bool) {
if o == nil || IsNil(o.At) {
return nil, false
}
return o.At, true
}
// HasAt returns a boolean if a field has been set.
func (o *AgentCodingReview) HasAt() bool {
if o != nil && !IsNil(o.At) {
return true
}
return false
}
// SetAt gets a reference to the given string and assigns it to the At field.
func (o *AgentCodingReview) SetAt(v string) {
o.At = &v
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) SetAuthor(v string) {
o.Author = &v
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) SetBody(v string) {
o.Body = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) 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 *AgentCodingReview) SetState(v string) {
o.State = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *AgentCodingReview) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentCodingReview) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *AgentCodingReview) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *AgentCodingReview) SetTruncated(v bool) {
o.Truncated = &v
}
func (o AgentCodingReview) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentCodingReview) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentCodingReview) UnmarshalJSON(data []byte) (err error) {
varAgentCodingReview := _AgentCodingReview{}
err = json.Unmarshal(data, &varAgentCodingReview)
if err != nil {
return err
}
*o = AgentCodingReview(varAgentCodingReview)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "at")
delete(additionalProperties, "author")
delete(additionalProperties, "body")
delete(additionalProperties, "state")
delete(additionalProperties, "truncated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentCodingReview struct {
value *AgentCodingReview
isSet bool
}
func (v NullableAgentCodingReview) Get() *AgentCodingReview {
return v.value
}
func (v *NullableAgentCodingReview) Set(val *AgentCodingReview) {
v.value = val
v.isSet = true
}
func (v NullableAgentCodingReview) IsSet() bool {
return v.isSet
}
func (v *NullableAgentCodingReview) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentCodingReview(val *AgentCodingReview) *NullableAgentCodingReview {
return &NullableAgentCodingReview{value: val, isSet: true}
}
func (v NullableAgentCodingReview) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentCodingReview) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}