Files
sdk/model_risk_risk_org_feature.go

421 lines
11 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 RiskRiskOrgFeature type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RiskRiskOrgFeature{}
// RiskRiskOrgFeature struct for RiskRiskOrgFeature
type RiskRiskOrgFeature struct {
// Blind is true when the dimension is present in no bucket at all: this organisation's surface does not carry it, and saying so is the difference between no risk and no data.
Blind *bool `json:"blind,omitempty"`
// Buckets is how many five-minute buckets of this organisation's surface were measured.
Buckets *int64 `json:"buckets,omitempty"`
// Max is the largest value it reached in the window.
Max *float64 `json:"max,omitempty"`
// Mean is the dimension's average where it was present.
Mean *float64 `json:"mean,omitempty"`
// Name is the dimension as this API publishes it.
Name *string `json:"name,omitempty"`
// Present is in how many of them the dimension carried a value at all.
Present *int64 `json:"present,omitempty"`
// Source names the plane it is rolled up from, so a dimension that reads zero everywhere traces to a plane the organisation does not use rather than to a defect.
Source *string `json:"source,omitempty"`
// Unit is how to read the numbers below.
Unit *string `json:"unit,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RiskRiskOrgFeature RiskRiskOrgFeature
// NewRiskRiskOrgFeature instantiates a new RiskRiskOrgFeature 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 NewRiskRiskOrgFeature() *RiskRiskOrgFeature {
this := RiskRiskOrgFeature{}
return &this
}
// NewRiskRiskOrgFeatureWithDefaults instantiates a new RiskRiskOrgFeature 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 NewRiskRiskOrgFeatureWithDefaults() *RiskRiskOrgFeature {
this := RiskRiskOrgFeature{}
return &this
}
// GetBlind returns the Blind field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetBlind() bool {
if o == nil || IsNil(o.Blind) {
var ret bool
return ret
}
return *o.Blind
}
// GetBlindOk returns a tuple with the Blind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetBlindOk() (*bool, bool) {
if o == nil || IsNil(o.Blind) {
return nil, false
}
return o.Blind, true
}
// HasBlind returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasBlind() bool {
if o != nil && !IsNil(o.Blind) {
return true
}
return false
}
// SetBlind gets a reference to the given bool and assigns it to the Blind field.
func (o *RiskRiskOrgFeature) SetBlind(v bool) {
o.Blind = &v
}
// GetBuckets returns the Buckets field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetBuckets() int64 {
if o == nil || IsNil(o.Buckets) {
var ret int64
return ret
}
return *o.Buckets
}
// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetBucketsOk() (*int64, bool) {
if o == nil || IsNil(o.Buckets) {
return nil, false
}
return o.Buckets, true
}
// HasBuckets returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasBuckets() bool {
if o != nil && !IsNil(o.Buckets) {
return true
}
return false
}
// SetBuckets gets a reference to the given int64 and assigns it to the Buckets field.
func (o *RiskRiskOrgFeature) SetBuckets(v int64) {
o.Buckets = &v
}
// GetMax returns the Max field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetMax() float64 {
if o == nil || IsNil(o.Max) {
var ret float64
return ret
}
return *o.Max
}
// GetMaxOk returns a tuple with the Max field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetMaxOk() (*float64, bool) {
if o == nil || IsNil(o.Max) {
return nil, false
}
return o.Max, true
}
// HasMax returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasMax() bool {
if o != nil && !IsNil(o.Max) {
return true
}
return false
}
// SetMax gets a reference to the given float64 and assigns it to the Max field.
func (o *RiskRiskOrgFeature) SetMax(v float64) {
o.Max = &v
}
// GetMean returns the Mean field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetMean() float64 {
if o == nil || IsNil(o.Mean) {
var ret float64
return ret
}
return *o.Mean
}
// GetMeanOk returns a tuple with the Mean field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetMeanOk() (*float64, bool) {
if o == nil || IsNil(o.Mean) {
return nil, false
}
return o.Mean, true
}
// HasMean returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasMean() bool {
if o != nil && !IsNil(o.Mean) {
return true
}
return false
}
// SetMean gets a reference to the given float64 and assigns it to the Mean field.
func (o *RiskRiskOrgFeature) SetMean(v float64) {
o.Mean = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *RiskRiskOrgFeature) SetName(v string) {
o.Name = &v
}
// GetPresent returns the Present field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetPresent() int64 {
if o == nil || IsNil(o.Present) {
var ret int64
return ret
}
return *o.Present
}
// GetPresentOk returns a tuple with the Present field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetPresentOk() (*int64, bool) {
if o == nil || IsNil(o.Present) {
return nil, false
}
return o.Present, true
}
// HasPresent returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasPresent() bool {
if o != nil && !IsNil(o.Present) {
return true
}
return false
}
// SetPresent gets a reference to the given int64 and assigns it to the Present field.
func (o *RiskRiskOrgFeature) SetPresent(v int64) {
o.Present = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *RiskRiskOrgFeature) SetSource(v string) {
o.Source = &v
}
// GetUnit returns the Unit field value if set, zero value otherwise.
func (o *RiskRiskOrgFeature) GetUnit() string {
if o == nil || IsNil(o.Unit) {
var ret string
return ret
}
return *o.Unit
}
// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskOrgFeature) GetUnitOk() (*string, bool) {
if o == nil || IsNil(o.Unit) {
return nil, false
}
return o.Unit, true
}
// HasUnit returns a boolean if a field has been set.
func (o *RiskRiskOrgFeature) HasUnit() bool {
if o != nil && !IsNil(o.Unit) {
return true
}
return false
}
// SetUnit gets a reference to the given string and assigns it to the Unit field.
func (o *RiskRiskOrgFeature) SetUnit(v string) {
o.Unit = &v
}
func (o RiskRiskOrgFeature) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RiskRiskOrgFeature) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Blind) {
toSerialize["blind"] = o.Blind
}
if !IsNil(o.Buckets) {
toSerialize["buckets"] = o.Buckets
}
if !IsNil(o.Max) {
toSerialize["max"] = o.Max
}
if !IsNil(o.Mean) {
toSerialize["mean"] = o.Mean
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Present) {
toSerialize["present"] = o.Present
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Unit) {
toSerialize["unit"] = o.Unit
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RiskRiskOrgFeature) UnmarshalJSON(data []byte) (err error) {
varRiskRiskOrgFeature := _RiskRiskOrgFeature{}
err = json.Unmarshal(data, &varRiskRiskOrgFeature)
if err != nil {
return err
}
*o = RiskRiskOrgFeature(varRiskRiskOrgFeature)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "blind")
delete(additionalProperties, "buckets")
delete(additionalProperties, "max")
delete(additionalProperties, "mean")
delete(additionalProperties, "name")
delete(additionalProperties, "present")
delete(additionalProperties, "source")
delete(additionalProperties, "unit")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRiskRiskOrgFeature struct {
value *RiskRiskOrgFeature
isSet bool
}
func (v NullableRiskRiskOrgFeature) Get() *RiskRiskOrgFeature {
return v.value
}
func (v *NullableRiskRiskOrgFeature) Set(val *RiskRiskOrgFeature) {
v.value = val
v.isSet = true
}
func (v NullableRiskRiskOrgFeature) IsSet() bool {
return v.isSet
}
func (v *NullableRiskRiskOrgFeature) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRiskRiskOrgFeature(val *RiskRiskOrgFeature) *NullableRiskRiskOrgFeature {
return &NullableRiskRiskOrgFeature{value: val, isSet: true}
}
func (v NullableRiskRiskOrgFeature) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRiskRiskOrgFeature) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}