Files
sdk/model_sbom_sbom_component.go

307 lines
8.0 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 SbomSbomComponent type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SbomSbomComponent{}
// SbomSbomComponent struct for SbomSbomComponent
type SbomSbomComponent struct {
// License is the FIRST license fact found for the component: its SPDX id, else its name, else the expression. Empty when the document declares none.
License *string `json:"license,omitempty"`
// Name is the dependency's package name as CycloneDX records it.
Name *string `json:"name,omitempty"`
// Purl is the package URL — the ecosystem-qualified identity a vulnerability feed can be joined on.
Purl *string `json:"purl,omitempty"`
// Type is the CycloneDX component type: library, application, framework, …
Type *string `json:"type,omitempty"`
// Version is the resolved version of that package.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SbomSbomComponent SbomSbomComponent
// NewSbomSbomComponent instantiates a new SbomSbomComponent 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 NewSbomSbomComponent() *SbomSbomComponent {
this := SbomSbomComponent{}
return &this
}
// NewSbomSbomComponentWithDefaults instantiates a new SbomSbomComponent 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 NewSbomSbomComponentWithDefaults() *SbomSbomComponent {
this := SbomSbomComponent{}
return &this
}
// GetLicense returns the License field value if set, zero value otherwise.
func (o *SbomSbomComponent) GetLicense() string {
if o == nil || IsNil(o.License) {
var ret string
return ret
}
return *o.License
}
// GetLicenseOk returns a tuple with the License field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomComponent) GetLicenseOk() (*string, bool) {
if o == nil || IsNil(o.License) {
return nil, false
}
return o.License, true
}
// HasLicense returns a boolean if a field has been set.
func (o *SbomSbomComponent) HasLicense() bool {
if o != nil && !IsNil(o.License) {
return true
}
return false
}
// SetLicense gets a reference to the given string and assigns it to the License field.
func (o *SbomSbomComponent) SetLicense(v string) {
o.License = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *SbomSbomComponent) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomComponent) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *SbomSbomComponent) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *SbomSbomComponent) SetName(v string) {
o.Name = &v
}
// GetPurl returns the Purl field value if set, zero value otherwise.
func (o *SbomSbomComponent) GetPurl() string {
if o == nil || IsNil(o.Purl) {
var ret string
return ret
}
return *o.Purl
}
// GetPurlOk returns a tuple with the Purl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomComponent) GetPurlOk() (*string, bool) {
if o == nil || IsNil(o.Purl) {
return nil, false
}
return o.Purl, true
}
// HasPurl returns a boolean if a field has been set.
func (o *SbomSbomComponent) HasPurl() bool {
if o != nil && !IsNil(o.Purl) {
return true
}
return false
}
// SetPurl gets a reference to the given string and assigns it to the Purl field.
func (o *SbomSbomComponent) SetPurl(v string) {
o.Purl = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *SbomSbomComponent) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomComponent) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *SbomSbomComponent) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *SbomSbomComponent) SetType(v string) {
o.Type = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *SbomSbomComponent) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomComponent) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *SbomSbomComponent) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *SbomSbomComponent) SetVersion(v string) {
o.Version = &v
}
func (o SbomSbomComponent) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SbomSbomComponent) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.License) {
toSerialize["license"] = o.License
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Purl) {
toSerialize["purl"] = o.Purl
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SbomSbomComponent) UnmarshalJSON(data []byte) (err error) {
varSbomSbomComponent := _SbomSbomComponent{}
err = json.Unmarshal(data, &varSbomSbomComponent)
if err != nil {
return err
}
*o = SbomSbomComponent(varSbomSbomComponent)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "license")
delete(additionalProperties, "name")
delete(additionalProperties, "purl")
delete(additionalProperties, "type")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSbomSbomComponent struct {
value *SbomSbomComponent
isSet bool
}
func (v NullableSbomSbomComponent) Get() *SbomSbomComponent {
return v.value
}
func (v *NullableSbomSbomComponent) Set(val *SbomSbomComponent) {
v.value = val
v.isSet = true
}
func (v NullableSbomSbomComponent) IsSet() bool {
return v.isSet
}
func (v *NullableSbomSbomComponent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSbomSbomComponent(val *SbomSbomComponent) *NullableSbomSbomComponent {
return &NullableSbomSbomComponent{value: val, isSet: true}
}
func (v NullableSbomSbomComponent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSbomSbomComponent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}