mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.8 KiB
Go
231 lines
5.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 GitUsageView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitUsageView{}
|
|
|
|
// GitUsageView struct for GitUsageView
|
|
type GitUsageView struct {
|
|
// Org the rollup is for.
|
|
Org *string `json:"org,omitempty"`
|
|
// Repos is every repo the org owns, across every project sub-scope.
|
|
Repos []GitUsageRepo `json:"repos,omitempty"`
|
|
// TotalBytes is the sum over Repos — the org's whole git footprint.
|
|
TotalBytes *int64 `json:"totalBytes,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitUsageView GitUsageView
|
|
|
|
// NewGitUsageView instantiates a new GitUsageView 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 NewGitUsageView() *GitUsageView {
|
|
this := GitUsageView{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitUsageViewWithDefaults instantiates a new GitUsageView 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 NewGitUsageViewWithDefaults() *GitUsageView {
|
|
this := GitUsageView{}
|
|
return &this
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *GitUsageView) 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 *GitUsageView) 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 *GitUsageView) 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 *GitUsageView) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetRepos returns the Repos field value if set, zero value otherwise.
|
|
func (o *GitUsageView) GetRepos() []GitUsageRepo {
|
|
if o == nil || IsNil(o.Repos) {
|
|
var ret []GitUsageRepo
|
|
return ret
|
|
}
|
|
return o.Repos
|
|
}
|
|
|
|
// GetReposOk returns a tuple with the Repos field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitUsageView) GetReposOk() ([]GitUsageRepo, bool) {
|
|
if o == nil || IsNil(o.Repos) {
|
|
return nil, false
|
|
}
|
|
return o.Repos, true
|
|
}
|
|
|
|
// HasRepos returns a boolean if a field has been set.
|
|
func (o *GitUsageView) HasRepos() bool {
|
|
if o != nil && !IsNil(o.Repos) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRepos gets a reference to the given []GitUsageRepo and assigns it to the Repos field.
|
|
func (o *GitUsageView) SetRepos(v []GitUsageRepo) {
|
|
o.Repos = v
|
|
}
|
|
|
|
// GetTotalBytes returns the TotalBytes field value if set, zero value otherwise.
|
|
func (o *GitUsageView) GetTotalBytes() int64 {
|
|
if o == nil || IsNil(o.TotalBytes) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.TotalBytes
|
|
}
|
|
|
|
// GetTotalBytesOk returns a tuple with the TotalBytes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitUsageView) GetTotalBytesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.TotalBytes) {
|
|
return nil, false
|
|
}
|
|
return o.TotalBytes, true
|
|
}
|
|
|
|
// HasTotalBytes returns a boolean if a field has been set.
|
|
func (o *GitUsageView) HasTotalBytes() bool {
|
|
if o != nil && !IsNil(o.TotalBytes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTotalBytes gets a reference to the given int64 and assigns it to the TotalBytes field.
|
|
func (o *GitUsageView) SetTotalBytes(v int64) {
|
|
o.TotalBytes = &v
|
|
}
|
|
|
|
func (o GitUsageView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitUsageView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
if !IsNil(o.Repos) {
|
|
toSerialize["repos"] = o.Repos
|
|
}
|
|
if !IsNil(o.TotalBytes) {
|
|
toSerialize["totalBytes"] = o.TotalBytes
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitUsageView) UnmarshalJSON(data []byte) (err error) {
|
|
varGitUsageView := _GitUsageView{}
|
|
|
|
err = json.Unmarshal(data, &varGitUsageView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitUsageView(varGitUsageView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "repos")
|
|
delete(additionalProperties, "totalBytes")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitUsageView struct {
|
|
value *GitUsageView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitUsageView) Get() *GitUsageView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitUsageView) Set(val *GitUsageView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitUsageView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitUsageView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitUsageView(val *GitUsageView) *NullableGitUsageView {
|
|
return &NullableGitUsageView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitUsageView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitUsageView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|