Files
sdk/model_git_activity_commit.go

345 lines
8.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 GitActivityCommit type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitActivityCommit{}
// GitActivityCommit struct for GitActivityCommit
type GitActivityCommit struct {
// At is the commit time, RFC 3339 UTC.
At *string `json:"at,omitempty"`
// Message is the subject line.
Message *string `json:"message,omitempty"`
// Ours is whether the estate's people authored it.
Ours *bool `json:"ours,omitempty"`
// Repo is org/name.
Repo *string `json:"repo,omitempty"`
// SHA is the commit.
Sha *string `json:"sha,omitempty"`
// URL is the commit on the forge.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitActivityCommit GitActivityCommit
// NewGitActivityCommit instantiates a new GitActivityCommit 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 NewGitActivityCommit() *GitActivityCommit {
this := GitActivityCommit{}
return &this
}
// NewGitActivityCommitWithDefaults instantiates a new GitActivityCommit 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 NewGitActivityCommitWithDefaults() *GitActivityCommit {
this := GitActivityCommit{}
return &this
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) SetAt(v string) {
o.At = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) SetMessage(v string) {
o.Message = &v
}
// GetOurs returns the Ours field value if set, zero value otherwise.
func (o *GitActivityCommit) GetOurs() bool {
if o == nil || IsNil(o.Ours) {
var ret bool
return ret
}
return *o.Ours
}
// GetOursOk returns a tuple with the Ours field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityCommit) GetOursOk() (*bool, bool) {
if o == nil || IsNil(o.Ours) {
return nil, false
}
return o.Ours, true
}
// HasOurs returns a boolean if a field has been set.
func (o *GitActivityCommit) HasOurs() bool {
if o != nil && !IsNil(o.Ours) {
return true
}
return false
}
// SetOurs gets a reference to the given bool and assigns it to the Ours field.
func (o *GitActivityCommit) SetOurs(v bool) {
o.Ours = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) SetRepo(v string) {
o.Repo = &v
}
// GetSha returns the Sha field value if set, zero value otherwise.
func (o *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) SetSha(v string) {
o.Sha = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) 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 *GitActivityCommit) SetUrl(v string) {
o.Url = &v
}
func (o GitActivityCommit) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitActivityCommit) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Ours) {
toSerialize["ours"] = o.Ours
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Sha) {
toSerialize["sha"] = o.Sha
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitActivityCommit) UnmarshalJSON(data []byte) (err error) {
varGitActivityCommit := _GitActivityCommit{}
err = json.Unmarshal(data, &varGitActivityCommit)
if err != nil {
return err
}
*o = GitActivityCommit(varGitActivityCommit)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "at")
delete(additionalProperties, "message")
delete(additionalProperties, "ours")
delete(additionalProperties, "repo")
delete(additionalProperties, "sha")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitActivityCommit struct {
value *GitActivityCommit
isSet bool
}
func (v NullableGitActivityCommit) Get() *GitActivityCommit {
return v.value
}
func (v *NullableGitActivityCommit) Set(val *GitActivityCommit) {
v.value = val
v.isSet = true
}
func (v NullableGitActivityCommit) IsSet() bool {
return v.isSet
}
func (v *NullableGitActivityCommit) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitActivityCommit(val *GitActivityCommit) *NullableGitActivityCommit {
return &NullableGitActivityCommit{value: val, isSet: true}
}
func (v NullableGitActivityCommit) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitActivityCommit) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}