mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
4.9 KiB
Go
193 lines
4.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 SecurityRuleset type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SecurityRuleset{}
|
|
|
|
// SecurityRuleset struct for SecurityRuleset
|
|
type SecurityRuleset struct {
|
|
// Rules is how many detection rules the engine holds.
|
|
Rules *int64 `json:"rules,omitempty"`
|
|
// Status is \"ok\" whenever the findings store opened.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SecurityRuleset SecurityRuleset
|
|
|
|
// NewSecurityRuleset instantiates a new SecurityRuleset 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 NewSecurityRuleset() *SecurityRuleset {
|
|
this := SecurityRuleset{}
|
|
return &this
|
|
}
|
|
|
|
// NewSecurityRulesetWithDefaults instantiates a new SecurityRuleset 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 NewSecurityRulesetWithDefaults() *SecurityRuleset {
|
|
this := SecurityRuleset{}
|
|
return &this
|
|
}
|
|
|
|
// GetRules returns the Rules field value if set, zero value otherwise.
|
|
func (o *SecurityRuleset) GetRules() int64 {
|
|
if o == nil || IsNil(o.Rules) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Rules
|
|
}
|
|
|
|
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SecurityRuleset) GetRulesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Rules) {
|
|
return nil, false
|
|
}
|
|
return o.Rules, true
|
|
}
|
|
|
|
// HasRules returns a boolean if a field has been set.
|
|
func (o *SecurityRuleset) HasRules() bool {
|
|
if o != nil && !IsNil(o.Rules) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRules gets a reference to the given int64 and assigns it to the Rules field.
|
|
func (o *SecurityRuleset) SetRules(v int64) {
|
|
o.Rules = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *SecurityRuleset) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SecurityRuleset) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *SecurityRuleset) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *SecurityRuleset) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o SecurityRuleset) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SecurityRuleset) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Rules) {
|
|
toSerialize["rules"] = o.Rules
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SecurityRuleset) UnmarshalJSON(data []byte) (err error) {
|
|
varSecurityRuleset := _SecurityRuleset{}
|
|
|
|
err = json.Unmarshal(data, &varSecurityRuleset)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SecurityRuleset(varSecurityRuleset)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "rules")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSecurityRuleset struct {
|
|
value *SecurityRuleset
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSecurityRuleset) Get() *SecurityRuleset {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSecurityRuleset) Set(val *SecurityRuleset) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSecurityRuleset) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSecurityRuleset) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSecurityRuleset(val *SecurityRuleset) *NullableSecurityRuleset {
|
|
return &NullableSecurityRuleset{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSecurityRuleset) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSecurityRuleset) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|