Files
sdk/model_sbom_sbom_view.go

421 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 SbomSbomView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SbomSbomView{}
// SbomSbomView struct for SbomSbomView
type SbomSbomView struct {
// ComponentCount is how many components this response carries — after the cap, so it matches components exactly rather than the image's true total.
ComponentCount *int64 `json:"componentCount,omitempty"`
// Components is the flattened dependency set, ordered by type then name.
Components []SbomSbomComponent `json:"components,omitempty"`
// GitSha is the commit the image was built from. Empty on the same terms as sourceRepo.
GitSha *string `json:"gitSha,omitempty"`
// ImageDigest is the content-addressed digest the components are keyed under, and is what identifies this bill of materials however it was asked for.
ImageDigest *string `json:"imageDigest,omitempty"`
// ImageRef is the image reference recorded alongside the digest. Empty when the components were ingested against a digest with no ref.
ImageRef *string `json:"imageRef,omitempty"`
// IngestedAt is when the bill of materials was recorded, RFC 3339.
IngestedAt *string `json:"ingestedAt,omitempty"`
// SourceRepo is the repository the image was built from. Empty unless the ingest declared it — a pull from the registry does not learn it.
SourceRepo *string `json:"sourceRepo,omitempty"`
// Truncated is true when the image has MORE components than the cap returns.
Truncated *bool `json:"truncated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SbomSbomView SbomSbomView
// NewSbomSbomView instantiates a new SbomSbomView 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 NewSbomSbomView() *SbomSbomView {
this := SbomSbomView{}
return &this
}
// NewSbomSbomViewWithDefaults instantiates a new SbomSbomView 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 NewSbomSbomViewWithDefaults() *SbomSbomView {
this := SbomSbomView{}
return &this
}
// GetComponentCount returns the ComponentCount field value if set, zero value otherwise.
func (o *SbomSbomView) GetComponentCount() int64 {
if o == nil || IsNil(o.ComponentCount) {
var ret int64
return ret
}
return *o.ComponentCount
}
// GetComponentCountOk returns a tuple with the ComponentCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetComponentCountOk() (*int64, bool) {
if o == nil || IsNil(o.ComponentCount) {
return nil, false
}
return o.ComponentCount, true
}
// HasComponentCount returns a boolean if a field has been set.
func (o *SbomSbomView) HasComponentCount() bool {
if o != nil && !IsNil(o.ComponentCount) {
return true
}
return false
}
// SetComponentCount gets a reference to the given int64 and assigns it to the ComponentCount field.
func (o *SbomSbomView) SetComponentCount(v int64) {
o.ComponentCount = &v
}
// GetComponents returns the Components field value if set, zero value otherwise.
func (o *SbomSbomView) GetComponents() []SbomSbomComponent {
if o == nil || IsNil(o.Components) {
var ret []SbomSbomComponent
return ret
}
return o.Components
}
// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetComponentsOk() ([]SbomSbomComponent, bool) {
if o == nil || IsNil(o.Components) {
return nil, false
}
return o.Components, true
}
// HasComponents returns a boolean if a field has been set.
func (o *SbomSbomView) HasComponents() bool {
if o != nil && !IsNil(o.Components) {
return true
}
return false
}
// SetComponents gets a reference to the given []SbomSbomComponent and assigns it to the Components field.
func (o *SbomSbomView) SetComponents(v []SbomSbomComponent) {
o.Components = v
}
// GetGitSha returns the GitSha field value if set, zero value otherwise.
func (o *SbomSbomView) GetGitSha() string {
if o == nil || IsNil(o.GitSha) {
var ret string
return ret
}
return *o.GitSha
}
// GetGitShaOk returns a tuple with the GitSha field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetGitShaOk() (*string, bool) {
if o == nil || IsNil(o.GitSha) {
return nil, false
}
return o.GitSha, true
}
// HasGitSha returns a boolean if a field has been set.
func (o *SbomSbomView) HasGitSha() bool {
if o != nil && !IsNil(o.GitSha) {
return true
}
return false
}
// SetGitSha gets a reference to the given string and assigns it to the GitSha field.
func (o *SbomSbomView) SetGitSha(v string) {
o.GitSha = &v
}
// GetImageDigest returns the ImageDigest field value if set, zero value otherwise.
func (o *SbomSbomView) GetImageDigest() string {
if o == nil || IsNil(o.ImageDigest) {
var ret string
return ret
}
return *o.ImageDigest
}
// GetImageDigestOk returns a tuple with the ImageDigest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetImageDigestOk() (*string, bool) {
if o == nil || IsNil(o.ImageDigest) {
return nil, false
}
return o.ImageDigest, true
}
// HasImageDigest returns a boolean if a field has been set.
func (o *SbomSbomView) HasImageDigest() bool {
if o != nil && !IsNil(o.ImageDigest) {
return true
}
return false
}
// SetImageDigest gets a reference to the given string and assigns it to the ImageDigest field.
func (o *SbomSbomView) SetImageDigest(v string) {
o.ImageDigest = &v
}
// GetImageRef returns the ImageRef field value if set, zero value otherwise.
func (o *SbomSbomView) GetImageRef() string {
if o == nil || IsNil(o.ImageRef) {
var ret string
return ret
}
return *o.ImageRef
}
// GetImageRefOk returns a tuple with the ImageRef field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetImageRefOk() (*string, bool) {
if o == nil || IsNil(o.ImageRef) {
return nil, false
}
return o.ImageRef, true
}
// HasImageRef returns a boolean if a field has been set.
func (o *SbomSbomView) HasImageRef() bool {
if o != nil && !IsNil(o.ImageRef) {
return true
}
return false
}
// SetImageRef gets a reference to the given string and assigns it to the ImageRef field.
func (o *SbomSbomView) SetImageRef(v string) {
o.ImageRef = &v
}
// GetIngestedAt returns the IngestedAt field value if set, zero value otherwise.
func (o *SbomSbomView) GetIngestedAt() string {
if o == nil || IsNil(o.IngestedAt) {
var ret string
return ret
}
return *o.IngestedAt
}
// GetIngestedAtOk returns a tuple with the IngestedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetIngestedAtOk() (*string, bool) {
if o == nil || IsNil(o.IngestedAt) {
return nil, false
}
return o.IngestedAt, true
}
// HasIngestedAt returns a boolean if a field has been set.
func (o *SbomSbomView) HasIngestedAt() bool {
if o != nil && !IsNil(o.IngestedAt) {
return true
}
return false
}
// SetIngestedAt gets a reference to the given string and assigns it to the IngestedAt field.
func (o *SbomSbomView) SetIngestedAt(v string) {
o.IngestedAt = &v
}
// GetSourceRepo returns the SourceRepo field value if set, zero value otherwise.
func (o *SbomSbomView) GetSourceRepo() string {
if o == nil || IsNil(o.SourceRepo) {
var ret string
return ret
}
return *o.SourceRepo
}
// GetSourceRepoOk returns a tuple with the SourceRepo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetSourceRepoOk() (*string, bool) {
if o == nil || IsNil(o.SourceRepo) {
return nil, false
}
return o.SourceRepo, true
}
// HasSourceRepo returns a boolean if a field has been set.
func (o *SbomSbomView) HasSourceRepo() bool {
if o != nil && !IsNil(o.SourceRepo) {
return true
}
return false
}
// SetSourceRepo gets a reference to the given string and assigns it to the SourceRepo field.
func (o *SbomSbomView) SetSourceRepo(v string) {
o.SourceRepo = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *SbomSbomView) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SbomSbomView) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *SbomSbomView) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *SbomSbomView) SetTruncated(v bool) {
o.Truncated = &v
}
func (o SbomSbomView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SbomSbomView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ComponentCount) {
toSerialize["componentCount"] = o.ComponentCount
}
if !IsNil(o.Components) {
toSerialize["components"] = o.Components
}
if !IsNil(o.GitSha) {
toSerialize["gitSha"] = o.GitSha
}
if !IsNil(o.ImageDigest) {
toSerialize["imageDigest"] = o.ImageDigest
}
if !IsNil(o.ImageRef) {
toSerialize["imageRef"] = o.ImageRef
}
if !IsNil(o.IngestedAt) {
toSerialize["ingestedAt"] = o.IngestedAt
}
if !IsNil(o.SourceRepo) {
toSerialize["sourceRepo"] = o.SourceRepo
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SbomSbomView) UnmarshalJSON(data []byte) (err error) {
varSbomSbomView := _SbomSbomView{}
err = json.Unmarshal(data, &varSbomSbomView)
if err != nil {
return err
}
*o = SbomSbomView(varSbomSbomView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "componentCount")
delete(additionalProperties, "components")
delete(additionalProperties, "gitSha")
delete(additionalProperties, "imageDigest")
delete(additionalProperties, "imageRef")
delete(additionalProperties, "ingestedAt")
delete(additionalProperties, "sourceRepo")
delete(additionalProperties, "truncated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSbomSbomView struct {
value *SbomSbomView
isSet bool
}
func (v NullableSbomSbomView) Get() *SbomSbomView {
return v.value
}
func (v *NullableSbomSbomView) Set(val *SbomSbomView) {
v.value = val
v.isSet = true
}
func (v NullableSbomSbomView) IsSet() bool {
return v.isSet
}
func (v *NullableSbomSbomView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSbomSbomView(val *SbomSbomView) *NullableSbomSbomView {
return &NullableSbomSbomView{value: val, isSet: true}
}
func (v NullableSbomSbomView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSbomSbomView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}