Files
sdk/model_flag_evaluate_in.go

231 lines
6.3 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 FlagEvaluateIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlagEvaluateIn{}
// FlagEvaluateIn struct for FlagEvaluateIn
type FlagEvaluateIn struct {
// DistinctID is the identity the flags are evaluated for. Required.
DistinctId *string `json:"distinct_id,omitempty"`
Groups interface{} `json:"groups,omitempty"`
PersonProperties interface{} `json:"person_properties,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FlagEvaluateIn FlagEvaluateIn
// NewFlagEvaluateIn instantiates a new FlagEvaluateIn 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 NewFlagEvaluateIn() *FlagEvaluateIn {
this := FlagEvaluateIn{}
return &this
}
// NewFlagEvaluateInWithDefaults instantiates a new FlagEvaluateIn 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 NewFlagEvaluateInWithDefaults() *FlagEvaluateIn {
this := FlagEvaluateIn{}
return &this
}
// GetDistinctId returns the DistinctId field value if set, zero value otherwise.
func (o *FlagEvaluateIn) GetDistinctId() string {
if o == nil || IsNil(o.DistinctId) {
var ret string
return ret
}
return *o.DistinctId
}
// GetDistinctIdOk returns a tuple with the DistinctId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagEvaluateIn) GetDistinctIdOk() (*string, bool) {
if o == nil || IsNil(o.DistinctId) {
return nil, false
}
return o.DistinctId, true
}
// HasDistinctId returns a boolean if a field has been set.
func (o *FlagEvaluateIn) HasDistinctId() bool {
if o != nil && !IsNil(o.DistinctId) {
return true
}
return false
}
// SetDistinctId gets a reference to the given string and assigns it to the DistinctId field.
func (o *FlagEvaluateIn) SetDistinctId(v string) {
o.DistinctId = &v
}
// GetGroups returns the Groups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *FlagEvaluateIn) GetGroups() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Groups
}
// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *FlagEvaluateIn) GetGroupsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Groups) {
return nil, false
}
return &o.Groups, true
}
// HasGroups returns a boolean if a field has been set.
func (o *FlagEvaluateIn) HasGroups() bool {
if o != nil && !IsNil(o.Groups) {
return true
}
return false
}
// SetGroups gets a reference to the given interface{} and assigns it to the Groups field.
func (o *FlagEvaluateIn) SetGroups(v interface{}) {
o.Groups = v
}
// GetPersonProperties returns the PersonProperties field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *FlagEvaluateIn) GetPersonProperties() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.PersonProperties
}
// GetPersonPropertiesOk returns a tuple with the PersonProperties field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *FlagEvaluateIn) GetPersonPropertiesOk() (*interface{}, bool) {
if o == nil || IsNil(o.PersonProperties) {
return nil, false
}
return &o.PersonProperties, true
}
// HasPersonProperties returns a boolean if a field has been set.
func (o *FlagEvaluateIn) HasPersonProperties() bool {
if o != nil && !IsNil(o.PersonProperties) {
return true
}
return false
}
// SetPersonProperties gets a reference to the given interface{} and assigns it to the PersonProperties field.
func (o *FlagEvaluateIn) SetPersonProperties(v interface{}) {
o.PersonProperties = v
}
func (o FlagEvaluateIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlagEvaluateIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DistinctId) {
toSerialize["distinct_id"] = o.DistinctId
}
if o.Groups != nil {
toSerialize["groups"] = o.Groups
}
if o.PersonProperties != nil {
toSerialize["person_properties"] = o.PersonProperties
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FlagEvaluateIn) UnmarshalJSON(data []byte) (err error) {
varFlagEvaluateIn := _FlagEvaluateIn{}
err = json.Unmarshal(data, &varFlagEvaluateIn)
if err != nil {
return err
}
*o = FlagEvaluateIn(varFlagEvaluateIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "distinct_id")
delete(additionalProperties, "groups")
delete(additionalProperties, "person_properties")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFlagEvaluateIn struct {
value *FlagEvaluateIn
isSet bool
}
func (v NullableFlagEvaluateIn) Get() *FlagEvaluateIn {
return v.value
}
func (v *NullableFlagEvaluateIn) Set(val *FlagEvaluateIn) {
v.value = val
v.isSet = true
}
func (v NullableFlagEvaluateIn) IsSet() bool {
return v.isSet
}
func (v *NullableFlagEvaluateIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlagEvaluateIn(val *FlagEvaluateIn) *NullableFlagEvaluateIn {
return &NullableFlagEvaluateIn{value: val, isSet: true}
}
func (v NullableFlagEvaluateIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlagEvaluateIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}