Files
sdk/model_security_finding_view.go

497 lines
13 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 SecurityFindingView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SecurityFindingView{}
// SecurityFindingView struct for SecurityFindingView
type SecurityFindingView struct {
// CreatedAt is when the finding was recorded, in Unix milliseconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Fingerprint is the SHA-256 of the raw secret. It is what makes the same secret recognisable across scans and after rotation without the secret ever being written down.
Fingerprint *string `json:"fingerprint,omitempty"`
// ID addresses this finding.
Id *string `json:"id,omitempty"`
// Line is where in that file.
Line *int64 `json:"line,omitempty"`
// Path is the file the secret was found in.
Path *string `json:"path,omitempty"`
// Preview is the secret MASKED — first and last characters kept, the middle starred — so a reviewer can recognise it without it being disclosed.
Preview *string `json:"preview,omitempty"`
// RuleID is the detection rule that fired.
RuleId *string `json:"ruleId,omitempty"`
// RuleName is that rule's human name.
RuleName *string `json:"ruleName,omitempty"`
// ScanID is the scan that produced it.
ScanId *string `json:"scanId,omitempty"`
// Severity ranks the finding: critical, high, medium or low.
Severity *string `json:"severity,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SecurityFindingView SecurityFindingView
// NewSecurityFindingView instantiates a new SecurityFindingView 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 NewSecurityFindingView() *SecurityFindingView {
this := SecurityFindingView{}
return &this
}
// NewSecurityFindingViewWithDefaults instantiates a new SecurityFindingView 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 NewSecurityFindingViewWithDefaults() *SecurityFindingView {
this := SecurityFindingView{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetFingerprint returns the Fingerprint field value if set, zero value otherwise.
func (o *SecurityFindingView) GetFingerprint() string {
if o == nil || IsNil(o.Fingerprint) {
var ret string
return ret
}
return *o.Fingerprint
}
// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetFingerprintOk() (*string, bool) {
if o == nil || IsNil(o.Fingerprint) {
return nil, false
}
return o.Fingerprint, true
}
// HasFingerprint returns a boolean if a field has been set.
func (o *SecurityFindingView) HasFingerprint() bool {
if o != nil && !IsNil(o.Fingerprint) {
return true
}
return false
}
// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field.
func (o *SecurityFindingView) SetFingerprint(v string) {
o.Fingerprint = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) SetId(v string) {
o.Id = &v
}
// GetLine returns the Line field value if set, zero value otherwise.
func (o *SecurityFindingView) GetLine() int64 {
if o == nil || IsNil(o.Line) {
var ret int64
return ret
}
return *o.Line
}
// GetLineOk returns a tuple with the Line field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetLineOk() (*int64, bool) {
if o == nil || IsNil(o.Line) {
return nil, false
}
return o.Line, true
}
// HasLine returns a boolean if a field has been set.
func (o *SecurityFindingView) HasLine() bool {
if o != nil && !IsNil(o.Line) {
return true
}
return false
}
// SetLine gets a reference to the given int64 and assigns it to the Line field.
func (o *SecurityFindingView) SetLine(v int64) {
o.Line = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *SecurityFindingView) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *SecurityFindingView) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *SecurityFindingView) SetPath(v string) {
o.Path = &v
}
// GetPreview returns the Preview field value if set, zero value otherwise.
func (o *SecurityFindingView) GetPreview() string {
if o == nil || IsNil(o.Preview) {
var ret string
return ret
}
return *o.Preview
}
// GetPreviewOk returns a tuple with the Preview field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetPreviewOk() (*string, bool) {
if o == nil || IsNil(o.Preview) {
return nil, false
}
return o.Preview, true
}
// HasPreview returns a boolean if a field has been set.
func (o *SecurityFindingView) HasPreview() bool {
if o != nil && !IsNil(o.Preview) {
return true
}
return false
}
// SetPreview gets a reference to the given string and assigns it to the Preview field.
func (o *SecurityFindingView) SetPreview(v string) {
o.Preview = &v
}
// GetRuleId returns the RuleId field value if set, zero value otherwise.
func (o *SecurityFindingView) GetRuleId() string {
if o == nil || IsNil(o.RuleId) {
var ret string
return ret
}
return *o.RuleId
}
// GetRuleIdOk returns a tuple with the RuleId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetRuleIdOk() (*string, bool) {
if o == nil || IsNil(o.RuleId) {
return nil, false
}
return o.RuleId, true
}
// HasRuleId returns a boolean if a field has been set.
func (o *SecurityFindingView) HasRuleId() bool {
if o != nil && !IsNil(o.RuleId) {
return true
}
return false
}
// SetRuleId gets a reference to the given string and assigns it to the RuleId field.
func (o *SecurityFindingView) SetRuleId(v string) {
o.RuleId = &v
}
// GetRuleName returns the RuleName field value if set, zero value otherwise.
func (o *SecurityFindingView) GetRuleName() string {
if o == nil || IsNil(o.RuleName) {
var ret string
return ret
}
return *o.RuleName
}
// GetRuleNameOk returns a tuple with the RuleName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetRuleNameOk() (*string, bool) {
if o == nil || IsNil(o.RuleName) {
return nil, false
}
return o.RuleName, true
}
// HasRuleName returns a boolean if a field has been set.
func (o *SecurityFindingView) HasRuleName() bool {
if o != nil && !IsNil(o.RuleName) {
return true
}
return false
}
// SetRuleName gets a reference to the given string and assigns it to the RuleName field.
func (o *SecurityFindingView) SetRuleName(v string) {
o.RuleName = &v
}
// GetScanId returns the ScanId field value if set, zero value otherwise.
func (o *SecurityFindingView) GetScanId() string {
if o == nil || IsNil(o.ScanId) {
var ret string
return ret
}
return *o.ScanId
}
// GetScanIdOk returns a tuple with the ScanId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityFindingView) GetScanIdOk() (*string, bool) {
if o == nil || IsNil(o.ScanId) {
return nil, false
}
return o.ScanId, true
}
// HasScanId returns a boolean if a field has been set.
func (o *SecurityFindingView) HasScanId() bool {
if o != nil && !IsNil(o.ScanId) {
return true
}
return false
}
// SetScanId gets a reference to the given string and assigns it to the ScanId field.
func (o *SecurityFindingView) SetScanId(v string) {
o.ScanId = &v
}
// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) 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 *SecurityFindingView) SetSeverity(v string) {
o.Severity = &v
}
func (o SecurityFindingView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SecurityFindingView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Fingerprint) {
toSerialize["fingerprint"] = o.Fingerprint
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Line) {
toSerialize["line"] = o.Line
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Preview) {
toSerialize["preview"] = o.Preview
}
if !IsNil(o.RuleId) {
toSerialize["ruleId"] = o.RuleId
}
if !IsNil(o.RuleName) {
toSerialize["ruleName"] = o.RuleName
}
if !IsNil(o.ScanId) {
toSerialize["scanId"] = o.ScanId
}
if !IsNil(o.Severity) {
toSerialize["severity"] = o.Severity
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SecurityFindingView) UnmarshalJSON(data []byte) (err error) {
varSecurityFindingView := _SecurityFindingView{}
err = json.Unmarshal(data, &varSecurityFindingView)
if err != nil {
return err
}
*o = SecurityFindingView(varSecurityFindingView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdAt")
delete(additionalProperties, "fingerprint")
delete(additionalProperties, "id")
delete(additionalProperties, "line")
delete(additionalProperties, "path")
delete(additionalProperties, "preview")
delete(additionalProperties, "ruleId")
delete(additionalProperties, "ruleName")
delete(additionalProperties, "scanId")
delete(additionalProperties, "severity")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSecurityFindingView struct {
value *SecurityFindingView
isSet bool
}
func (v NullableSecurityFindingView) Get() *SecurityFindingView {
return v.value
}
func (v *NullableSecurityFindingView) Set(val *SecurityFindingView) {
v.value = val
v.isSet = true
}
func (v NullableSecurityFindingView) IsSet() bool {
return v.isSet
}
func (v *NullableSecurityFindingView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSecurityFindingView(val *SecurityFindingView) *NullableSecurityFindingView {
return &NullableSecurityFindingView{value: val, isSet: true}
}
func (v NullableSecurityFindingView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSecurityFindingView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}