Files
sdk/model_risk_risk_value.go

345 lines
8.9 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 RiskRiskValue type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RiskRiskValue{}
// RiskRiskValue struct for RiskRiskValue
type RiskRiskValue struct {
// Baseline is what Observed was measured against: this organisation's own history for this subject.
Baseline *float64 `json:"baseline,omitempty"`
// Blind marks a coordinate that could not be computed and took its neutral value. A model silently reading neutral for a dimension it never has data for is indistinguishable from one reading a genuine absence of risk.
Blind *bool `json:"blind,omitempty"`
// Feature is the dimension.
Feature *string `json:"feature,omitempty"`
// Observed is the raw number X was computed from, quoted so the coordinate reads back as a sentence rather than a bare ratio.
Observed *float64 `json:"observed,omitempty"`
// Unit is how to read Observed.
Unit *string `json:"unit,omitempty"`
// X is the coordinate in the model space, always dimensionless.
X *float64 `json:"x,omitempty"`
AdditionalProperties map[string]interface{}
}
type _RiskRiskValue RiskRiskValue
// NewRiskRiskValue instantiates a new RiskRiskValue 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 NewRiskRiskValue() *RiskRiskValue {
this := RiskRiskValue{}
return &this
}
// NewRiskRiskValueWithDefaults instantiates a new RiskRiskValue 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 NewRiskRiskValueWithDefaults() *RiskRiskValue {
this := RiskRiskValue{}
return &this
}
// GetBaseline returns the Baseline field value if set, zero value otherwise.
func (o *RiskRiskValue) GetBaseline() float64 {
if o == nil || IsNil(o.Baseline) {
var ret float64
return ret
}
return *o.Baseline
}
// GetBaselineOk returns a tuple with the Baseline field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskValue) GetBaselineOk() (*float64, bool) {
if o == nil || IsNil(o.Baseline) {
return nil, false
}
return o.Baseline, true
}
// HasBaseline returns a boolean if a field has been set.
func (o *RiskRiskValue) HasBaseline() bool {
if o != nil && !IsNil(o.Baseline) {
return true
}
return false
}
// SetBaseline gets a reference to the given float64 and assigns it to the Baseline field.
func (o *RiskRiskValue) SetBaseline(v float64) {
o.Baseline = &v
}
// GetBlind returns the Blind field value if set, zero value otherwise.
func (o *RiskRiskValue) 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 *RiskRiskValue) 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 *RiskRiskValue) 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 *RiskRiskValue) SetBlind(v bool) {
o.Blind = &v
}
// GetFeature returns the Feature field value if set, zero value otherwise.
func (o *RiskRiskValue) GetFeature() string {
if o == nil || IsNil(o.Feature) {
var ret string
return ret
}
return *o.Feature
}
// GetFeatureOk returns a tuple with the Feature field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskValue) GetFeatureOk() (*string, bool) {
if o == nil || IsNil(o.Feature) {
return nil, false
}
return o.Feature, true
}
// HasFeature returns a boolean if a field has been set.
func (o *RiskRiskValue) HasFeature() bool {
if o != nil && !IsNil(o.Feature) {
return true
}
return false
}
// SetFeature gets a reference to the given string and assigns it to the Feature field.
func (o *RiskRiskValue) SetFeature(v string) {
o.Feature = &v
}
// GetObserved returns the Observed field value if set, zero value otherwise.
func (o *RiskRiskValue) GetObserved() float64 {
if o == nil || IsNil(o.Observed) {
var ret float64
return ret
}
return *o.Observed
}
// GetObservedOk returns a tuple with the Observed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskValue) GetObservedOk() (*float64, bool) {
if o == nil || IsNil(o.Observed) {
return nil, false
}
return o.Observed, true
}
// HasObserved returns a boolean if a field has been set.
func (o *RiskRiskValue) HasObserved() bool {
if o != nil && !IsNil(o.Observed) {
return true
}
return false
}
// SetObserved gets a reference to the given float64 and assigns it to the Observed field.
func (o *RiskRiskValue) SetObserved(v float64) {
o.Observed = &v
}
// GetUnit returns the Unit field value if set, zero value otherwise.
func (o *RiskRiskValue) 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 *RiskRiskValue) 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 *RiskRiskValue) 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 *RiskRiskValue) SetUnit(v string) {
o.Unit = &v
}
// GetX returns the X field value if set, zero value otherwise.
func (o *RiskRiskValue) GetX() float64 {
if o == nil || IsNil(o.X) {
var ret float64
return ret
}
return *o.X
}
// GetXOk returns a tuple with the X field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RiskRiskValue) GetXOk() (*float64, bool) {
if o == nil || IsNil(o.X) {
return nil, false
}
return o.X, true
}
// HasX returns a boolean if a field has been set.
func (o *RiskRiskValue) HasX() bool {
if o != nil && !IsNil(o.X) {
return true
}
return false
}
// SetX gets a reference to the given float64 and assigns it to the X field.
func (o *RiskRiskValue) SetX(v float64) {
o.X = &v
}
func (o RiskRiskValue) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RiskRiskValue) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Baseline) {
toSerialize["baseline"] = o.Baseline
}
if !IsNil(o.Blind) {
toSerialize["blind"] = o.Blind
}
if !IsNil(o.Feature) {
toSerialize["feature"] = o.Feature
}
if !IsNil(o.Observed) {
toSerialize["observed"] = o.Observed
}
if !IsNil(o.Unit) {
toSerialize["unit"] = o.Unit
}
if !IsNil(o.X) {
toSerialize["x"] = o.X
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RiskRiskValue) UnmarshalJSON(data []byte) (err error) {
varRiskRiskValue := _RiskRiskValue{}
err = json.Unmarshal(data, &varRiskRiskValue)
if err != nil {
return err
}
*o = RiskRiskValue(varRiskRiskValue)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "baseline")
delete(additionalProperties, "blind")
delete(additionalProperties, "feature")
delete(additionalProperties, "observed")
delete(additionalProperties, "unit")
delete(additionalProperties, "x")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRiskRiskValue struct {
value *RiskRiskValue
isSet bool
}
func (v NullableRiskRiskValue) Get() *RiskRiskValue {
return v.value
}
func (v *NullableRiskRiskValue) Set(val *RiskRiskValue) {
v.value = val
v.isSet = true
}
func (v NullableRiskRiskValue) IsSet() bool {
return v.isSet
}
func (v *NullableRiskRiskValue) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRiskRiskValue(val *RiskRiskValue) *NullableRiskRiskValue {
return &NullableRiskRiskValue{value: val, isSet: true}
}
func (v NullableRiskRiskValue) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRiskRiskValue) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}