Files
sdk/model_platform_verdict.go

193 lines
5.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 PlatformVerdict type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformVerdict{}
// PlatformVerdict struct for PlatformVerdict
type PlatformVerdict struct {
// Flags are the findings behind the severity, in detection order: floating-declared, floating-running, stale, un-rolled, then the release-artifact ones. Always present — `[]` for a row that runs what it declares, never null.
Flags []PlatformDriftFlag `json:"flags,omitempty"`
// Severity is the roll-up over Flags — red if any flag is red, else yellow if any is yellow, else ok. It is the column a board sorts and filters on, and \"ok\" is exactly what no flags means.
Severity *string `json:"severity,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformVerdict PlatformVerdict
// NewPlatformVerdict instantiates a new PlatformVerdict 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 NewPlatformVerdict() *PlatformVerdict {
this := PlatformVerdict{}
return &this
}
// NewPlatformVerdictWithDefaults instantiates a new PlatformVerdict 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 NewPlatformVerdictWithDefaults() *PlatformVerdict {
this := PlatformVerdict{}
return &this
}
// GetFlags returns the Flags field value if set, zero value otherwise.
func (o *PlatformVerdict) GetFlags() []PlatformDriftFlag {
if o == nil || IsNil(o.Flags) {
var ret []PlatformDriftFlag
return ret
}
return o.Flags
}
// GetFlagsOk returns a tuple with the Flags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformVerdict) GetFlagsOk() ([]PlatformDriftFlag, bool) {
if o == nil || IsNil(o.Flags) {
return nil, false
}
return o.Flags, true
}
// HasFlags returns a boolean if a field has been set.
func (o *PlatformVerdict) HasFlags() bool {
if o != nil && !IsNil(o.Flags) {
return true
}
return false
}
// SetFlags gets a reference to the given []PlatformDriftFlag and assigns it to the Flags field.
func (o *PlatformVerdict) SetFlags(v []PlatformDriftFlag) {
o.Flags = v
}
// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *PlatformVerdict) GetSeverity() string {
if o == nil || IsNil(o.Severity) {
var ret string
return ret
}
return *o.Severity
}
// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformVerdict) GetSeverityOk() (*string, bool) {
if o == nil || IsNil(o.Severity) {
return nil, false
}
return o.Severity, true
}
// HasSeverity returns a boolean if a field has been set.
func (o *PlatformVerdict) HasSeverity() bool {
if o != nil && !IsNil(o.Severity) {
return true
}
return false
}
// SetSeverity gets a reference to the given string and assigns it to the Severity field.
func (o *PlatformVerdict) SetSeverity(v string) {
o.Severity = &v
}
func (o PlatformVerdict) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformVerdict) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Flags) {
toSerialize["flags"] = o.Flags
}
if !IsNil(o.Severity) {
toSerialize["severity"] = o.Severity
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformVerdict) UnmarshalJSON(data []byte) (err error) {
varPlatformVerdict := _PlatformVerdict{}
err = json.Unmarshal(data, &varPlatformVerdict)
if err != nil {
return err
}
*o = PlatformVerdict(varPlatformVerdict)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "flags")
delete(additionalProperties, "severity")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformVerdict struct {
value *PlatformVerdict
isSet bool
}
func (v NullablePlatformVerdict) Get() *PlatformVerdict {
return v.value
}
func (v *NullablePlatformVerdict) Set(val *PlatformVerdict) {
v.value = val
v.isSet = true
}
func (v NullablePlatformVerdict) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformVerdict) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformVerdict(val *PlatformVerdict) *NullablePlatformVerdict {
return &NullablePlatformVerdict{value: val, isSet: true}
}
func (v NullablePlatformVerdict) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformVerdict) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}