Files
sdk/model_security_scan_view.go

459 lines
12 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 SecurityScanView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SecurityScanView{}
// SecurityScanView struct for SecurityScanView
type SecurityScanView struct {
// CreatedAt is when the scan ran, in Unix milliseconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Critical is how many findings carry the highest severity.
Critical *int64 `json:"critical,omitempty"`
// Files is how many files the scan read.
Files *int64 `json:"files,omitempty"`
// Findings is how many secrets fired across them.
Findings *int64 `json:"findings,omitempty"`
// High is how many findings rank high.
High *int64 `json:"high,omitempty"`
// ID addresses this scan and every finding on it.
Id *string `json:"id,omitempty"`
// Low is how many findings rank low.
Low *int64 `json:"low,omitempty"`
// Medium is how many findings rank medium.
Medium *int64 `json:"medium,omitempty"`
// Project is the sub-scope the scan was filed under.
Project *string `json:"project,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SecurityScanView SecurityScanView
// NewSecurityScanView instantiates a new SecurityScanView 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 NewSecurityScanView() *SecurityScanView {
this := SecurityScanView{}
return &this
}
// NewSecurityScanViewWithDefaults instantiates a new SecurityScanView 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 NewSecurityScanViewWithDefaults() *SecurityScanView {
this := SecurityScanView{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SecurityScanView) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *SecurityScanView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *SecurityScanView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetCritical returns the Critical field value if set, zero value otherwise.
func (o *SecurityScanView) GetCritical() int64 {
if o == nil || IsNil(o.Critical) {
var ret int64
return ret
}
return *o.Critical
}
// GetCriticalOk returns a tuple with the Critical field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetCriticalOk() (*int64, bool) {
if o == nil || IsNil(o.Critical) {
return nil, false
}
return o.Critical, true
}
// HasCritical returns a boolean if a field has been set.
func (o *SecurityScanView) HasCritical() bool {
if o != nil && !IsNil(o.Critical) {
return true
}
return false
}
// SetCritical gets a reference to the given int64 and assigns it to the Critical field.
func (o *SecurityScanView) SetCritical(v int64) {
o.Critical = &v
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *SecurityScanView) GetFiles() int64 {
if o == nil || IsNil(o.Files) {
var ret int64
return ret
}
return *o.Files
}
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetFilesOk() (*int64, bool) {
if o == nil || IsNil(o.Files) {
return nil, false
}
return o.Files, true
}
// HasFiles returns a boolean if a field has been set.
func (o *SecurityScanView) HasFiles() bool {
if o != nil && !IsNil(o.Files) {
return true
}
return false
}
// SetFiles gets a reference to the given int64 and assigns it to the Files field.
func (o *SecurityScanView) SetFiles(v int64) {
o.Files = &v
}
// GetFindings returns the Findings field value if set, zero value otherwise.
func (o *SecurityScanView) GetFindings() int64 {
if o == nil || IsNil(o.Findings) {
var ret int64
return ret
}
return *o.Findings
}
// GetFindingsOk returns a tuple with the Findings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetFindingsOk() (*int64, bool) {
if o == nil || IsNil(o.Findings) {
return nil, false
}
return o.Findings, true
}
// HasFindings returns a boolean if a field has been set.
func (o *SecurityScanView) HasFindings() bool {
if o != nil && !IsNil(o.Findings) {
return true
}
return false
}
// SetFindings gets a reference to the given int64 and assigns it to the Findings field.
func (o *SecurityScanView) SetFindings(v int64) {
o.Findings = &v
}
// GetHigh returns the High field value if set, zero value otherwise.
func (o *SecurityScanView) GetHigh() int64 {
if o == nil || IsNil(o.High) {
var ret int64
return ret
}
return *o.High
}
// GetHighOk returns a tuple with the High field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetHighOk() (*int64, bool) {
if o == nil || IsNil(o.High) {
return nil, false
}
return o.High, true
}
// HasHigh returns a boolean if a field has been set.
func (o *SecurityScanView) HasHigh() bool {
if o != nil && !IsNil(o.High) {
return true
}
return false
}
// SetHigh gets a reference to the given int64 and assigns it to the High field.
func (o *SecurityScanView) SetHigh(v int64) {
o.High = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SecurityScanView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *SecurityScanView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *SecurityScanView) SetId(v string) {
o.Id = &v
}
// GetLow returns the Low field value if set, zero value otherwise.
func (o *SecurityScanView) GetLow() int64 {
if o == nil || IsNil(o.Low) {
var ret int64
return ret
}
return *o.Low
}
// GetLowOk returns a tuple with the Low field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetLowOk() (*int64, bool) {
if o == nil || IsNil(o.Low) {
return nil, false
}
return o.Low, true
}
// HasLow returns a boolean if a field has been set.
func (o *SecurityScanView) HasLow() bool {
if o != nil && !IsNil(o.Low) {
return true
}
return false
}
// SetLow gets a reference to the given int64 and assigns it to the Low field.
func (o *SecurityScanView) SetLow(v int64) {
o.Low = &v
}
// GetMedium returns the Medium field value if set, zero value otherwise.
func (o *SecurityScanView) GetMedium() int64 {
if o == nil || IsNil(o.Medium) {
var ret int64
return ret
}
return *o.Medium
}
// GetMediumOk returns a tuple with the Medium field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetMediumOk() (*int64, bool) {
if o == nil || IsNil(o.Medium) {
return nil, false
}
return o.Medium, true
}
// HasMedium returns a boolean if a field has been set.
func (o *SecurityScanView) HasMedium() bool {
if o != nil && !IsNil(o.Medium) {
return true
}
return false
}
// SetMedium gets a reference to the given int64 and assigns it to the Medium field.
func (o *SecurityScanView) SetMedium(v int64) {
o.Medium = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *SecurityScanView) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityScanView) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *SecurityScanView) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *SecurityScanView) SetProject(v string) {
o.Project = &v
}
func (o SecurityScanView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SecurityScanView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Critical) {
toSerialize["critical"] = o.Critical
}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.Findings) {
toSerialize["findings"] = o.Findings
}
if !IsNil(o.High) {
toSerialize["high"] = o.High
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Low) {
toSerialize["low"] = o.Low
}
if !IsNil(o.Medium) {
toSerialize["medium"] = o.Medium
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SecurityScanView) UnmarshalJSON(data []byte) (err error) {
varSecurityScanView := _SecurityScanView{}
err = json.Unmarshal(data, &varSecurityScanView)
if err != nil {
return err
}
*o = SecurityScanView(varSecurityScanView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdAt")
delete(additionalProperties, "critical")
delete(additionalProperties, "files")
delete(additionalProperties, "findings")
delete(additionalProperties, "high")
delete(additionalProperties, "id")
delete(additionalProperties, "low")
delete(additionalProperties, "medium")
delete(additionalProperties, "project")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSecurityScanView struct {
value *SecurityScanView
isSet bool
}
func (v NullableSecurityScanView) Get() *SecurityScanView {
return v.value
}
func (v *NullableSecurityScanView) Set(val *SecurityScanView) {
v.value = val
v.isSet = true
}
func (v NullableSecurityScanView) IsSet() bool {
return v.isSet
}
func (v *NullableSecurityScanView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSecurityScanView(val *SecurityScanView) *NullableSecurityScanView {
return &NullableSecurityScanView{value: val, isSet: true}
}
func (v NullableSecurityScanView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSecurityScanView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}