Files
sdk/model_git_activity_repo.go

687 lines
17 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 GitActivityRepo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitActivityRepo{}
// GitActivityRepo struct for GitActivityRepo
type GitActivityRepo struct {
// Active30 is whether it has a commit in the last 30 days.
Active30 *bool `json:"active30,omitempty"`
// Commits is its distinct commits in the window.
Commits *int64 `json:"commits,omitempty"`
// Description is the repository's own.
Description *string `json:"description,omitempty"`
// Forge is its page on the forge.
Forge *string `json:"forge,omitempty"`
// Fork is whether GitHub calls it a fork.
Fork *bool `json:"fork,omitempty"`
// GitHub is its page on GitHub when GitHub publishes it.
Github *string `json:"github,omitempty"`
// Group is the group that owns the org.
Group *string `json:"group,omitempty"`
// Last is its newest commit time, RFC 3339 UTC; empty when none in the window.
Last *string `json:"last,omitempty"`
// Merges is how many of those are merges.
Merges *int64 `json:"merges,omitempty"`
// Mirror is whether the forge pulls it from github.com.
Mirror *bool `json:"mirror,omitempty"`
// Months is Commits per calendar month, oldest first, one per entry of the document's Months.
Months []int64 `json:"months,omitempty"`
// Org is the org that holds it.
Org *string `json:"org,omitempty"`
// Ours is how many of those the estate's people authored.
Ours *int64 `json:"ours,omitempty"`
// Repo is org/name.
Repo *string `json:"repo,omitempty"`
// Stars is its stars on the forge.
Stars *int64 `json:"stars,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitActivityRepo GitActivityRepo
// NewGitActivityRepo instantiates a new GitActivityRepo 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 NewGitActivityRepo() *GitActivityRepo {
this := GitActivityRepo{}
return &this
}
// NewGitActivityRepoWithDefaults instantiates a new GitActivityRepo 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 NewGitActivityRepoWithDefaults() *GitActivityRepo {
this := GitActivityRepo{}
return &this
}
// GetActive30 returns the Active30 field value if set, zero value otherwise.
func (o *GitActivityRepo) GetActive30() bool {
if o == nil || IsNil(o.Active30) {
var ret bool
return ret
}
return *o.Active30
}
// GetActive30Ok returns a tuple with the Active30 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetActive30Ok() (*bool, bool) {
if o == nil || IsNil(o.Active30) {
return nil, false
}
return o.Active30, true
}
// HasActive30 returns a boolean if a field has been set.
func (o *GitActivityRepo) HasActive30() bool {
if o != nil && !IsNil(o.Active30) {
return true
}
return false
}
// SetActive30 gets a reference to the given bool and assigns it to the Active30 field.
func (o *GitActivityRepo) SetActive30(v bool) {
o.Active30 = &v
}
// GetCommits returns the Commits field value if set, zero value otherwise.
func (o *GitActivityRepo) GetCommits() int64 {
if o == nil || IsNil(o.Commits) {
var ret int64
return ret
}
return *o.Commits
}
// GetCommitsOk returns a tuple with the Commits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetCommitsOk() (*int64, bool) {
if o == nil || IsNil(o.Commits) {
return nil, false
}
return o.Commits, true
}
// HasCommits returns a boolean if a field has been set.
func (o *GitActivityRepo) HasCommits() bool {
if o != nil && !IsNil(o.Commits) {
return true
}
return false
}
// SetCommits gets a reference to the given int64 and assigns it to the Commits field.
func (o *GitActivityRepo) SetCommits(v int64) {
o.Commits = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *GitActivityRepo) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *GitActivityRepo) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *GitActivityRepo) SetDescription(v string) {
o.Description = &v
}
// GetForge returns the Forge field value if set, zero value otherwise.
func (o *GitActivityRepo) GetForge() string {
if o == nil || IsNil(o.Forge) {
var ret string
return ret
}
return *o.Forge
}
// GetForgeOk returns a tuple with the Forge field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetForgeOk() (*string, bool) {
if o == nil || IsNil(o.Forge) {
return nil, false
}
return o.Forge, true
}
// HasForge returns a boolean if a field has been set.
func (o *GitActivityRepo) HasForge() bool {
if o != nil && !IsNil(o.Forge) {
return true
}
return false
}
// SetForge gets a reference to the given string and assigns it to the Forge field.
func (o *GitActivityRepo) SetForge(v string) {
o.Forge = &v
}
// GetFork returns the Fork field value if set, zero value otherwise.
func (o *GitActivityRepo) GetFork() bool {
if o == nil || IsNil(o.Fork) {
var ret bool
return ret
}
return *o.Fork
}
// GetForkOk returns a tuple with the Fork field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetForkOk() (*bool, bool) {
if o == nil || IsNil(o.Fork) {
return nil, false
}
return o.Fork, true
}
// HasFork returns a boolean if a field has been set.
func (o *GitActivityRepo) HasFork() bool {
if o != nil && !IsNil(o.Fork) {
return true
}
return false
}
// SetFork gets a reference to the given bool and assigns it to the Fork field.
func (o *GitActivityRepo) SetFork(v bool) {
o.Fork = &v
}
// GetGithub returns the Github field value if set, zero value otherwise.
func (o *GitActivityRepo) GetGithub() string {
if o == nil || IsNil(o.Github) {
var ret string
return ret
}
return *o.Github
}
// GetGithubOk returns a tuple with the Github field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetGithubOk() (*string, bool) {
if o == nil || IsNil(o.Github) {
return nil, false
}
return o.Github, true
}
// HasGithub returns a boolean if a field has been set.
func (o *GitActivityRepo) HasGithub() bool {
if o != nil && !IsNil(o.Github) {
return true
}
return false
}
// SetGithub gets a reference to the given string and assigns it to the Github field.
func (o *GitActivityRepo) SetGithub(v string) {
o.Github = &v
}
// GetGroup returns the Group field value if set, zero value otherwise.
func (o *GitActivityRepo) GetGroup() string {
if o == nil || IsNil(o.Group) {
var ret string
return ret
}
return *o.Group
}
// GetGroupOk returns a tuple with the Group field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetGroupOk() (*string, bool) {
if o == nil || IsNil(o.Group) {
return nil, false
}
return o.Group, true
}
// HasGroup returns a boolean if a field has been set.
func (o *GitActivityRepo) HasGroup() bool {
if o != nil && !IsNil(o.Group) {
return true
}
return false
}
// SetGroup gets a reference to the given string and assigns it to the Group field.
func (o *GitActivityRepo) SetGroup(v string) {
o.Group = &v
}
// GetLast returns the Last field value if set, zero value otherwise.
func (o *GitActivityRepo) GetLast() string {
if o == nil || IsNil(o.Last) {
var ret string
return ret
}
return *o.Last
}
// GetLastOk returns a tuple with the Last field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetLastOk() (*string, bool) {
if o == nil || IsNil(o.Last) {
return nil, false
}
return o.Last, true
}
// HasLast returns a boolean if a field has been set.
func (o *GitActivityRepo) HasLast() bool {
if o != nil && !IsNil(o.Last) {
return true
}
return false
}
// SetLast gets a reference to the given string and assigns it to the Last field.
func (o *GitActivityRepo) SetLast(v string) {
o.Last = &v
}
// GetMerges returns the Merges field value if set, zero value otherwise.
func (o *GitActivityRepo) GetMerges() int64 {
if o == nil || IsNil(o.Merges) {
var ret int64
return ret
}
return *o.Merges
}
// GetMergesOk returns a tuple with the Merges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetMergesOk() (*int64, bool) {
if o == nil || IsNil(o.Merges) {
return nil, false
}
return o.Merges, true
}
// HasMerges returns a boolean if a field has been set.
func (o *GitActivityRepo) HasMerges() bool {
if o != nil && !IsNil(o.Merges) {
return true
}
return false
}
// SetMerges gets a reference to the given int64 and assigns it to the Merges field.
func (o *GitActivityRepo) SetMerges(v int64) {
o.Merges = &v
}
// GetMirror returns the Mirror field value if set, zero value otherwise.
func (o *GitActivityRepo) GetMirror() bool {
if o == nil || IsNil(o.Mirror) {
var ret bool
return ret
}
return *o.Mirror
}
// GetMirrorOk returns a tuple with the Mirror field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetMirrorOk() (*bool, bool) {
if o == nil || IsNil(o.Mirror) {
return nil, false
}
return o.Mirror, true
}
// HasMirror returns a boolean if a field has been set.
func (o *GitActivityRepo) HasMirror() bool {
if o != nil && !IsNil(o.Mirror) {
return true
}
return false
}
// SetMirror gets a reference to the given bool and assigns it to the Mirror field.
func (o *GitActivityRepo) SetMirror(v bool) {
o.Mirror = &v
}
// GetMonths returns the Months field value if set, zero value otherwise.
func (o *GitActivityRepo) GetMonths() []int64 {
if o == nil || IsNil(o.Months) {
var ret []int64
return ret
}
return o.Months
}
// GetMonthsOk returns a tuple with the Months field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetMonthsOk() ([]int64, bool) {
if o == nil || IsNil(o.Months) {
return nil, false
}
return o.Months, true
}
// HasMonths returns a boolean if a field has been set.
func (o *GitActivityRepo) HasMonths() bool {
if o != nil && !IsNil(o.Months) {
return true
}
return false
}
// SetMonths gets a reference to the given []int64 and assigns it to the Months field.
func (o *GitActivityRepo) SetMonths(v []int64) {
o.Months = v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *GitActivityRepo) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *GitActivityRepo) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *GitActivityRepo) SetOrg(v string) {
o.Org = &v
}
// GetOurs returns the Ours field value if set, zero value otherwise.
func (o *GitActivityRepo) GetOurs() int64 {
if o == nil || IsNil(o.Ours) {
var ret int64
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 *GitActivityRepo) GetOursOk() (*int64, 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 *GitActivityRepo) HasOurs() bool {
if o != nil && !IsNil(o.Ours) {
return true
}
return false
}
// SetOurs gets a reference to the given int64 and assigns it to the Ours field.
func (o *GitActivityRepo) SetOurs(v int64) {
o.Ours = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *GitActivityRepo) 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 *GitActivityRepo) 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 *GitActivityRepo) 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 *GitActivityRepo) SetRepo(v string) {
o.Repo = &v
}
// GetStars returns the Stars field value if set, zero value otherwise.
func (o *GitActivityRepo) GetStars() int64 {
if o == nil || IsNil(o.Stars) {
var ret int64
return ret
}
return *o.Stars
}
// GetStarsOk returns a tuple with the Stars field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityRepo) GetStarsOk() (*int64, bool) {
if o == nil || IsNil(o.Stars) {
return nil, false
}
return o.Stars, true
}
// HasStars returns a boolean if a field has been set.
func (o *GitActivityRepo) HasStars() bool {
if o != nil && !IsNil(o.Stars) {
return true
}
return false
}
// SetStars gets a reference to the given int64 and assigns it to the Stars field.
func (o *GitActivityRepo) SetStars(v int64) {
o.Stars = &v
}
func (o GitActivityRepo) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitActivityRepo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Active30) {
toSerialize["active30"] = o.Active30
}
if !IsNil(o.Commits) {
toSerialize["commits"] = o.Commits
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Forge) {
toSerialize["forge"] = o.Forge
}
if !IsNil(o.Fork) {
toSerialize["fork"] = o.Fork
}
if !IsNil(o.Github) {
toSerialize["github"] = o.Github
}
if !IsNil(o.Group) {
toSerialize["group"] = o.Group
}
if !IsNil(o.Last) {
toSerialize["last"] = o.Last
}
if !IsNil(o.Merges) {
toSerialize["merges"] = o.Merges
}
if !IsNil(o.Mirror) {
toSerialize["mirror"] = o.Mirror
}
if !IsNil(o.Months) {
toSerialize["months"] = o.Months
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Ours) {
toSerialize["ours"] = o.Ours
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Stars) {
toSerialize["stars"] = o.Stars
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitActivityRepo) UnmarshalJSON(data []byte) (err error) {
varGitActivityRepo := _GitActivityRepo{}
err = json.Unmarshal(data, &varGitActivityRepo)
if err != nil {
return err
}
*o = GitActivityRepo(varGitActivityRepo)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "active30")
delete(additionalProperties, "commits")
delete(additionalProperties, "description")
delete(additionalProperties, "forge")
delete(additionalProperties, "fork")
delete(additionalProperties, "github")
delete(additionalProperties, "group")
delete(additionalProperties, "last")
delete(additionalProperties, "merges")
delete(additionalProperties, "mirror")
delete(additionalProperties, "months")
delete(additionalProperties, "org")
delete(additionalProperties, "ours")
delete(additionalProperties, "repo")
delete(additionalProperties, "stars")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitActivityRepo struct {
value *GitActivityRepo
isSet bool
}
func (v NullableGitActivityRepo) Get() *GitActivityRepo {
return v.value
}
func (v *NullableGitActivityRepo) Set(val *GitActivityRepo) {
v.value = val
v.isSet = true
}
func (v NullableGitActivityRepo) IsSet() bool {
return v.isSet
}
func (v *NullableGitActivityRepo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitActivityRepo(val *GitActivityRepo) *NullableGitActivityRepo {
return &NullableGitActivityRepo{value: val, isSet: true}
}
func (v NullableGitActivityRepo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitActivityRepo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}