Files
sdk/model_git_activity_window.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 GitActivityWindow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitActivityWindow{}
// GitActivityWindow struct for GitActivityWindow
type GitActivityWindow struct {
// By is the commit date counted: \"committer\", when the work landed.
By *string `json:"by,omitempty"`
// From is the first UTC day counted, YYYY-MM-DD.
From *string `json:"from,omitempty"`
// To is the last UTC day counted, YYYY-MM-DD.
To *string `json:"to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitActivityWindow GitActivityWindow
// NewGitActivityWindow instantiates a new GitActivityWindow 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 NewGitActivityWindow() *GitActivityWindow {
this := GitActivityWindow{}
return &this
}
// NewGitActivityWindowWithDefaults instantiates a new GitActivityWindow 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 NewGitActivityWindowWithDefaults() *GitActivityWindow {
this := GitActivityWindow{}
return &this
}
// GetBy returns the By field value if set, zero value otherwise.
func (o *GitActivityWindow) GetBy() string {
if o == nil || IsNil(o.By) {
var ret string
return ret
}
return *o.By
}
// GetByOk returns a tuple with the By field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityWindow) GetByOk() (*string, bool) {
if o == nil || IsNil(o.By) {
return nil, false
}
return o.By, true
}
// HasBy returns a boolean if a field has been set.
func (o *GitActivityWindow) HasBy() bool {
if o != nil && !IsNil(o.By) {
return true
}
return false
}
// SetBy gets a reference to the given string and assigns it to the By field.
func (o *GitActivityWindow) SetBy(v string) {
o.By = &v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *GitActivityWindow) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityWindow) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *GitActivityWindow) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *GitActivityWindow) SetFrom(v string) {
o.From = &v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *GitActivityWindow) GetTo() string {
if o == nil || IsNil(o.To) {
var ret string
return ret
}
return *o.To
}
// GetToOk returns a tuple with the To field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitActivityWindow) GetToOk() (*string, bool) {
if o == nil || IsNil(o.To) {
return nil, false
}
return o.To, true
}
// HasTo returns a boolean if a field has been set.
func (o *GitActivityWindow) HasTo() bool {
if o != nil && !IsNil(o.To) {
return true
}
return false
}
// SetTo gets a reference to the given string and assigns it to the To field.
func (o *GitActivityWindow) SetTo(v string) {
o.To = &v
}
func (o GitActivityWindow) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitActivityWindow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.By) {
toSerialize["by"] = o.By
}
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if !IsNil(o.To) {
toSerialize["to"] = o.To
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitActivityWindow) UnmarshalJSON(data []byte) (err error) {
varGitActivityWindow := _GitActivityWindow{}
err = json.Unmarshal(data, &varGitActivityWindow)
if err != nil {
return err
}
*o = GitActivityWindow(varGitActivityWindow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "by")
delete(additionalProperties, "from")
delete(additionalProperties, "to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitActivityWindow struct {
value *GitActivityWindow
isSet bool
}
func (v NullableGitActivityWindow) Get() *GitActivityWindow {
return v.value
}
func (v *NullableGitActivityWindow) Set(val *GitActivityWindow) {
v.value = val
v.isSet = true
}
func (v NullableGitActivityWindow) IsSet() bool {
return v.isSet
}
func (v *NullableGitActivityWindow) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitActivityWindow(val *GitActivityWindow) *NullableGitActivityWindow {
return &NullableGitActivityWindow{value: val, isSet: true}
}
func (v NullableGitActivityWindow) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitActivityWindow) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}