Files
sdk/model_git_commit_json.go

345 lines
8.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 GitCommitJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitCommitJSON{}
// GitCommitJSON struct for GitCommitJSON
type GitCommitJSON struct {
// AuthorEmail is the commit author's email.
AuthorEmail *string `json:"authorEmail,omitempty"`
// AuthorName is the commit author's name.
AuthorName *string `json:"authorName,omitempty"`
// Date is the author date, RFC 3339 UTC.
Date *string `json:"date,omitempty"`
// Message is the commit's SUBJECT — its first line only.
Message *string `json:"message,omitempty"`
// SHA is the full commit hash.
Sha *string `json:"sha,omitempty"`
// ShortSHA is the abbreviated hash a UI displays.
ShortSha *string `json:"shortSha,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitCommitJSON GitCommitJSON
// NewGitCommitJSON instantiates a new GitCommitJSON 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 NewGitCommitJSON() *GitCommitJSON {
this := GitCommitJSON{}
return &this
}
// NewGitCommitJSONWithDefaults instantiates a new GitCommitJSON 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 NewGitCommitJSONWithDefaults() *GitCommitJSON {
this := GitCommitJSON{}
return &this
}
// GetAuthorEmail returns the AuthorEmail field value if set, zero value otherwise.
func (o *GitCommitJSON) GetAuthorEmail() string {
if o == nil || IsNil(o.AuthorEmail) {
var ret string
return ret
}
return *o.AuthorEmail
}
// GetAuthorEmailOk returns a tuple with the AuthorEmail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetAuthorEmailOk() (*string, bool) {
if o == nil || IsNil(o.AuthorEmail) {
return nil, false
}
return o.AuthorEmail, true
}
// HasAuthorEmail returns a boolean if a field has been set.
func (o *GitCommitJSON) HasAuthorEmail() bool {
if o != nil && !IsNil(o.AuthorEmail) {
return true
}
return false
}
// SetAuthorEmail gets a reference to the given string and assigns it to the AuthorEmail field.
func (o *GitCommitJSON) SetAuthorEmail(v string) {
o.AuthorEmail = &v
}
// GetAuthorName returns the AuthorName field value if set, zero value otherwise.
func (o *GitCommitJSON) GetAuthorName() string {
if o == nil || IsNil(o.AuthorName) {
var ret string
return ret
}
return *o.AuthorName
}
// GetAuthorNameOk returns a tuple with the AuthorName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetAuthorNameOk() (*string, bool) {
if o == nil || IsNil(o.AuthorName) {
return nil, false
}
return o.AuthorName, true
}
// HasAuthorName returns a boolean if a field has been set.
func (o *GitCommitJSON) HasAuthorName() bool {
if o != nil && !IsNil(o.AuthorName) {
return true
}
return false
}
// SetAuthorName gets a reference to the given string and assigns it to the AuthorName field.
func (o *GitCommitJSON) SetAuthorName(v string) {
o.AuthorName = &v
}
// GetDate returns the Date field value if set, zero value otherwise.
func (o *GitCommitJSON) GetDate() string {
if o == nil || IsNil(o.Date) {
var ret string
return ret
}
return *o.Date
}
// GetDateOk returns a tuple with the Date field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetDateOk() (*string, bool) {
if o == nil || IsNil(o.Date) {
return nil, false
}
return o.Date, true
}
// HasDate returns a boolean if a field has been set.
func (o *GitCommitJSON) HasDate() bool {
if o != nil && !IsNil(o.Date) {
return true
}
return false
}
// SetDate gets a reference to the given string and assigns it to the Date field.
func (o *GitCommitJSON) SetDate(v string) {
o.Date = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *GitCommitJSON) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *GitCommitJSON) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *GitCommitJSON) SetMessage(v string) {
o.Message = &v
}
// GetSha returns the Sha field value if set, zero value otherwise.
func (o *GitCommitJSON) GetSha() string {
if o == nil || IsNil(o.Sha) {
var ret string
return ret
}
return *o.Sha
}
// GetShaOk returns a tuple with the Sha field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetShaOk() (*string, bool) {
if o == nil || IsNil(o.Sha) {
return nil, false
}
return o.Sha, true
}
// HasSha returns a boolean if a field has been set.
func (o *GitCommitJSON) HasSha() bool {
if o != nil && !IsNil(o.Sha) {
return true
}
return false
}
// SetSha gets a reference to the given string and assigns it to the Sha field.
func (o *GitCommitJSON) SetSha(v string) {
o.Sha = &v
}
// GetShortSha returns the ShortSha field value if set, zero value otherwise.
func (o *GitCommitJSON) GetShortSha() string {
if o == nil || IsNil(o.ShortSha) {
var ret string
return ret
}
return *o.ShortSha
}
// GetShortShaOk returns a tuple with the ShortSha field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitCommitJSON) GetShortShaOk() (*string, bool) {
if o == nil || IsNil(o.ShortSha) {
return nil, false
}
return o.ShortSha, true
}
// HasShortSha returns a boolean if a field has been set.
func (o *GitCommitJSON) HasShortSha() bool {
if o != nil && !IsNil(o.ShortSha) {
return true
}
return false
}
// SetShortSha gets a reference to the given string and assigns it to the ShortSha field.
func (o *GitCommitJSON) SetShortSha(v string) {
o.ShortSha = &v
}
func (o GitCommitJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitCommitJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AuthorEmail) {
toSerialize["authorEmail"] = o.AuthorEmail
}
if !IsNil(o.AuthorName) {
toSerialize["authorName"] = o.AuthorName
}
if !IsNil(o.Date) {
toSerialize["date"] = o.Date
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Sha) {
toSerialize["sha"] = o.Sha
}
if !IsNil(o.ShortSha) {
toSerialize["shortSha"] = o.ShortSha
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitCommitJSON) UnmarshalJSON(data []byte) (err error) {
varGitCommitJSON := _GitCommitJSON{}
err = json.Unmarshal(data, &varGitCommitJSON)
if err != nil {
return err
}
*o = GitCommitJSON(varGitCommitJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "authorEmail")
delete(additionalProperties, "authorName")
delete(additionalProperties, "date")
delete(additionalProperties, "message")
delete(additionalProperties, "sha")
delete(additionalProperties, "shortSha")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitCommitJSON struct {
value *GitCommitJSON
isSet bool
}
func (v NullableGitCommitJSON) Get() *GitCommitJSON {
return v.value
}
func (v *NullableGitCommitJSON) Set(val *GitCommitJSON) {
v.value = val
v.isSet = true
}
func (v NullableGitCommitJSON) IsSet() bool {
return v.isSet
}
func (v *NullableGitCommitJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitCommitJSON(val *GitCommitJSON) *NullableGitCommitJSON {
return &NullableGitCommitJSON{value: val, isSet: true}
}
func (v NullableGitCommitJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitCommitJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}