From 68c22cc932e059f7049a6da7c394bfb8aabe5aad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 01:23:13 +0000 Subject: [PATCH] Bump entgo.io/ent from 0.12.4 to 0.12.5 (#1522) * Bump entgo.io/ent from 0.12.4 to 0.12.5 Bumps [entgo.io/ent](https://github.com/ent/ent) from 0.12.4 to 0.12.5. - [Release notes](https://github.com/ent/ent/releases) - [Commits](https://github.com/ent/ent/compare/v0.12.4...v0.12.5) --- updated-dependencies: - dependency-name: entgo.io/ent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * regen code Signed-off-by: pxp928 --------- Signed-off-by: dependabot[bot] Signed-off-by: pxp928 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pxp928 --- go.mod | 2 +- go.sum | 4 +- pkg/assembler/backends/ent/artifact_update.go | 32 ++++ .../backends/ent/billofmaterials_update.go | 112 ++++++++++++++ .../backends/ent/certification_update.go | 64 ++++++++ .../backends/ent/certifylegal_update.go | 144 ++++++++++++++++++ .../backends/ent/certifyscorecard_update.go | 32 ++++ .../backends/ent/certifyvex_update.go | 128 ++++++++++++++++ .../backends/ent/certifyvuln_update.go | 144 ++++++++++++++++++ pkg/assembler/backends/ent/client.go | 11 +- .../backends/ent/dependency_update.go | 96 ++++++++++++ .../backends/ent/hashequal_update.go | 48 ++++++ .../backends/ent/hasmetadata_update.go | 96 ++++++++++++ .../backends/ent/hassourceat_update.go | 80 ++++++++++ .../backends/ent/isvulnerability_update.go | 80 ++++++++++ pkg/assembler/backends/ent/license_update.go | 16 ++ .../backends/ent/occurrence_update.go | 64 ++++++++ .../backends/ent/packagename_update.go | 32 ++++ .../backends/ent/packagenamespace_update.go | 32 ++++ .../backends/ent/packagetype_update.go | 16 ++ .../backends/ent/packageversion_update.go | 32 ++++ pkg/assembler/backends/ent/pkgequal_update.go | 64 ++++++++ .../backends/ent/pointofcontact_update.go | 96 ++++++++++++ pkg/assembler/backends/ent/runtime/runtime.go | 4 +- .../backends/ent/scorecard_update.go | 64 ++++++++ .../backends/ent/slsaattestation_update.go | 112 ++++++++++++++ .../backends/ent/sourcename_update.go | 32 ++++ .../backends/ent/sourcenamespace_update.go | 32 ++++ .../backends/ent/sourcetype_update.go | 16 ++ .../backends/ent/vulnequal_update.go | 48 ++++++ .../backends/ent/vulnerabilityid_update.go | 32 ++++ .../ent/vulnerabilitymetadata_update.go | 96 ++++++++++++ .../backends/ent/vulnerabilitytype_update.go | 16 ++ 33 files changed, 1869 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 2d85392401..fc90f1ce9c 100644 --- a/go.mod +++ b/go.mod @@ -243,7 +243,7 @@ require ( require ( entgo.io/contrib v0.4.5 - entgo.io/ent v0.12.4 + entgo.io/ent v0.12.5 github.com/99designs/gqlgen v0.17.39 github.com/CycloneDX/cyclonedx-go v0.7.2 github.com/Khan/genqlient v0.6.0 diff --git a/go.sum b/go.sum index 08a3e80f4a..7bd51b85ea 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,8 @@ dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= entgo.io/contrib v0.4.5 h1:BFaOHwFLE8WZjVJadP0XHCIaxgcC1BAtUvAyw7M/GHk= entgo.io/contrib v0.4.5/go.mod h1:wpZyq2DJgthugFvDBlaqMXj9mV4/9ebyGEn7xlTVQqE= -entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8= -entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= +entgo.io/ent v0.12.5 h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4= +entgo.io/ent v0.12.5/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q= github.com/99designs/gqlgen v0.17.39 h1:wPTAyc2fqVjAWT5DsJ21k/lLudgnXzURwbsjVNegFpU= github.com/99designs/gqlgen v0.17.39/go.mod h1:b62q1USk82GYIVjC60h02YguAZLqYZtvWml8KkhJps4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= diff --git a/pkg/assembler/backends/ent/artifact_update.go b/pkg/assembler/backends/ent/artifact_update.go index 95f84c4621..c0140378b7 100644 --- a/pkg/assembler/backends/ent/artifact_update.go +++ b/pkg/assembler/backends/ent/artifact_update.go @@ -37,12 +37,28 @@ func (au *ArtifactUpdate) SetAlgorithm(s string) *ArtifactUpdate { return au } +// SetNillableAlgorithm sets the "algorithm" field if the given value is not nil. +func (au *ArtifactUpdate) SetNillableAlgorithm(s *string) *ArtifactUpdate { + if s != nil { + au.SetAlgorithm(*s) + } + return au +} + // SetDigest sets the "digest" field. func (au *ArtifactUpdate) SetDigest(s string) *ArtifactUpdate { au.mutation.SetDigest(s) return au } +// SetNillableDigest sets the "digest" field if the given value is not nil. +func (au *ArtifactUpdate) SetNillableDigest(s *string) *ArtifactUpdate { + if s != nil { + au.SetDigest(*s) + } + return au +} + // AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by IDs. func (au *ArtifactUpdate) AddOccurrenceIDs(ids ...int) *ArtifactUpdate { au.mutation.AddOccurrenceIDs(ids...) @@ -440,12 +456,28 @@ func (auo *ArtifactUpdateOne) SetAlgorithm(s string) *ArtifactUpdateOne { return auo } +// SetNillableAlgorithm sets the "algorithm" field if the given value is not nil. +func (auo *ArtifactUpdateOne) SetNillableAlgorithm(s *string) *ArtifactUpdateOne { + if s != nil { + auo.SetAlgorithm(*s) + } + return auo +} + // SetDigest sets the "digest" field. func (auo *ArtifactUpdateOne) SetDigest(s string) *ArtifactUpdateOne { auo.mutation.SetDigest(s) return auo } +// SetNillableDigest sets the "digest" field if the given value is not nil. +func (auo *ArtifactUpdateOne) SetNillableDigest(s *string) *ArtifactUpdateOne { + if s != nil { + auo.SetDigest(*s) + } + return auo +} + // AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by IDs. func (auo *ArtifactUpdateOne) AddOccurrenceIDs(ids ...int) *ArtifactUpdateOne { auo.mutation.AddOccurrenceIDs(ids...) diff --git a/pkg/assembler/backends/ent/billofmaterials_update.go b/pkg/assembler/backends/ent/billofmaterials_update.go index 992c130379..1fa2f17875 100644 --- a/pkg/assembler/backends/ent/billofmaterials_update.go +++ b/pkg/assembler/backends/ent/billofmaterials_update.go @@ -76,42 +76,98 @@ func (bomu *BillOfMaterialsUpdate) SetURI(s string) *BillOfMaterialsUpdate { return bomu } +// SetNillableURI sets the "uri" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableURI(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetURI(*s) + } + return bomu +} + // SetAlgorithm sets the "algorithm" field. func (bomu *BillOfMaterialsUpdate) SetAlgorithm(s string) *BillOfMaterialsUpdate { bomu.mutation.SetAlgorithm(s) return bomu } +// SetNillableAlgorithm sets the "algorithm" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableAlgorithm(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetAlgorithm(*s) + } + return bomu +} + // SetDigest sets the "digest" field. func (bomu *BillOfMaterialsUpdate) SetDigest(s string) *BillOfMaterialsUpdate { bomu.mutation.SetDigest(s) return bomu } +// SetNillableDigest sets the "digest" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableDigest(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetDigest(*s) + } + return bomu +} + // SetDownloadLocation sets the "download_location" field. func (bomu *BillOfMaterialsUpdate) SetDownloadLocation(s string) *BillOfMaterialsUpdate { bomu.mutation.SetDownloadLocation(s) return bomu } +// SetNillableDownloadLocation sets the "download_location" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableDownloadLocation(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetDownloadLocation(*s) + } + return bomu +} + // SetOrigin sets the "origin" field. func (bomu *BillOfMaterialsUpdate) SetOrigin(s string) *BillOfMaterialsUpdate { bomu.mutation.SetOrigin(s) return bomu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableOrigin(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetOrigin(*s) + } + return bomu +} + // SetCollector sets the "collector" field. func (bomu *BillOfMaterialsUpdate) SetCollector(s string) *BillOfMaterialsUpdate { bomu.mutation.SetCollector(s) return bomu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableCollector(s *string) *BillOfMaterialsUpdate { + if s != nil { + bomu.SetCollector(*s) + } + return bomu +} + // SetKnownSince sets the "known_since" field. func (bomu *BillOfMaterialsUpdate) SetKnownSince(t time.Time) *BillOfMaterialsUpdate { bomu.mutation.SetKnownSince(t) return bomu } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (bomu *BillOfMaterialsUpdate) SetNillableKnownSince(t *time.Time) *BillOfMaterialsUpdate { + if t != nil { + bomu.SetKnownSince(*t) + } + return bomu +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (bomu *BillOfMaterialsUpdate) SetPackage(p *PackageVersion) *BillOfMaterialsUpdate { return bomu.SetPackageID(p.ID) @@ -320,42 +376,98 @@ func (bomuo *BillOfMaterialsUpdateOne) SetURI(s string) *BillOfMaterialsUpdateOn return bomuo } +// SetNillableURI sets the "uri" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableURI(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetURI(*s) + } + return bomuo +} + // SetAlgorithm sets the "algorithm" field. func (bomuo *BillOfMaterialsUpdateOne) SetAlgorithm(s string) *BillOfMaterialsUpdateOne { bomuo.mutation.SetAlgorithm(s) return bomuo } +// SetNillableAlgorithm sets the "algorithm" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableAlgorithm(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetAlgorithm(*s) + } + return bomuo +} + // SetDigest sets the "digest" field. func (bomuo *BillOfMaterialsUpdateOne) SetDigest(s string) *BillOfMaterialsUpdateOne { bomuo.mutation.SetDigest(s) return bomuo } +// SetNillableDigest sets the "digest" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableDigest(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetDigest(*s) + } + return bomuo +} + // SetDownloadLocation sets the "download_location" field. func (bomuo *BillOfMaterialsUpdateOne) SetDownloadLocation(s string) *BillOfMaterialsUpdateOne { bomuo.mutation.SetDownloadLocation(s) return bomuo } +// SetNillableDownloadLocation sets the "download_location" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableDownloadLocation(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetDownloadLocation(*s) + } + return bomuo +} + // SetOrigin sets the "origin" field. func (bomuo *BillOfMaterialsUpdateOne) SetOrigin(s string) *BillOfMaterialsUpdateOne { bomuo.mutation.SetOrigin(s) return bomuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableOrigin(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetOrigin(*s) + } + return bomuo +} + // SetCollector sets the "collector" field. func (bomuo *BillOfMaterialsUpdateOne) SetCollector(s string) *BillOfMaterialsUpdateOne { bomuo.mutation.SetCollector(s) return bomuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableCollector(s *string) *BillOfMaterialsUpdateOne { + if s != nil { + bomuo.SetCollector(*s) + } + return bomuo +} + // SetKnownSince sets the "known_since" field. func (bomuo *BillOfMaterialsUpdateOne) SetKnownSince(t time.Time) *BillOfMaterialsUpdateOne { bomuo.mutation.SetKnownSince(t) return bomuo } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (bomuo *BillOfMaterialsUpdateOne) SetNillableKnownSince(t *time.Time) *BillOfMaterialsUpdateOne { + if t != nil { + bomuo.SetKnownSince(*t) + } + return bomuo +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (bomuo *BillOfMaterialsUpdateOne) SetPackage(p *PackageVersion) *BillOfMaterialsUpdateOne { return bomuo.SetPackageID(p.ID) diff --git a/pkg/assembler/backends/ent/certification_update.go b/pkg/assembler/backends/ent/certification_update.go index 81ad336a12..e669c0c464 100644 --- a/pkg/assembler/backends/ent/certification_update.go +++ b/pkg/assembler/backends/ent/certification_update.go @@ -132,24 +132,56 @@ func (cu *CertificationUpdate) SetJustification(s string) *CertificationUpdate { return cu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (cu *CertificationUpdate) SetNillableJustification(s *string) *CertificationUpdate { + if s != nil { + cu.SetJustification(*s) + } + return cu +} + // SetOrigin sets the "origin" field. func (cu *CertificationUpdate) SetOrigin(s string) *CertificationUpdate { cu.mutation.SetOrigin(s) return cu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cu *CertificationUpdate) SetNillableOrigin(s *string) *CertificationUpdate { + if s != nil { + cu.SetOrigin(*s) + } + return cu +} + // SetCollector sets the "collector" field. func (cu *CertificationUpdate) SetCollector(s string) *CertificationUpdate { cu.mutation.SetCollector(s) return cu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cu *CertificationUpdate) SetNillableCollector(s *string) *CertificationUpdate { + if s != nil { + cu.SetCollector(*s) + } + return cu +} + // SetKnownSince sets the "known_since" field. func (cu *CertificationUpdate) SetKnownSince(t time.Time) *CertificationUpdate { cu.mutation.SetKnownSince(t) return cu } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (cu *CertificationUpdate) SetNillableKnownSince(t *time.Time) *CertificationUpdate { + if t != nil { + cu.SetKnownSince(*t) + } + return cu +} + // SetSource sets the "source" edge to the SourceName entity. func (cu *CertificationUpdate) SetSource(s *SourceName) *CertificationUpdate { return cu.SetSourceID(s.ID) @@ -513,24 +545,56 @@ func (cuo *CertificationUpdateOne) SetJustification(s string) *CertificationUpda return cuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (cuo *CertificationUpdateOne) SetNillableJustification(s *string) *CertificationUpdateOne { + if s != nil { + cuo.SetJustification(*s) + } + return cuo +} + // SetOrigin sets the "origin" field. func (cuo *CertificationUpdateOne) SetOrigin(s string) *CertificationUpdateOne { cuo.mutation.SetOrigin(s) return cuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cuo *CertificationUpdateOne) SetNillableOrigin(s *string) *CertificationUpdateOne { + if s != nil { + cuo.SetOrigin(*s) + } + return cuo +} + // SetCollector sets the "collector" field. func (cuo *CertificationUpdateOne) SetCollector(s string) *CertificationUpdateOne { cuo.mutation.SetCollector(s) return cuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cuo *CertificationUpdateOne) SetNillableCollector(s *string) *CertificationUpdateOne { + if s != nil { + cuo.SetCollector(*s) + } + return cuo +} + // SetKnownSince sets the "known_since" field. func (cuo *CertificationUpdateOne) SetKnownSince(t time.Time) *CertificationUpdateOne { cuo.mutation.SetKnownSince(t) return cuo } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (cuo *CertificationUpdateOne) SetNillableKnownSince(t *time.Time) *CertificationUpdateOne { + if t != nil { + cuo.SetKnownSince(*t) + } + return cuo +} + // SetSource sets the "source" edge to the SourceName entity. func (cuo *CertificationUpdateOne) SetSource(s *SourceName) *CertificationUpdateOne { return cuo.SetSourceID(s.ID) diff --git a/pkg/assembler/backends/ent/certifylegal_update.go b/pkg/assembler/backends/ent/certifylegal_update.go index c1c811bcf8..e4369e61d2 100644 --- a/pkg/assembler/backends/ent/certifylegal_update.go +++ b/pkg/assembler/backends/ent/certifylegal_update.go @@ -77,54 +77,126 @@ func (clu *CertifyLegalUpdate) SetDeclaredLicense(s string) *CertifyLegalUpdate return clu } +// SetNillableDeclaredLicense sets the "declared_license" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableDeclaredLicense(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetDeclaredLicense(*s) + } + return clu +} + // SetDiscoveredLicense sets the "discovered_license" field. func (clu *CertifyLegalUpdate) SetDiscoveredLicense(s string) *CertifyLegalUpdate { clu.mutation.SetDiscoveredLicense(s) return clu } +// SetNillableDiscoveredLicense sets the "discovered_license" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableDiscoveredLicense(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetDiscoveredLicense(*s) + } + return clu +} + // SetAttribution sets the "attribution" field. func (clu *CertifyLegalUpdate) SetAttribution(s string) *CertifyLegalUpdate { clu.mutation.SetAttribution(s) return clu } +// SetNillableAttribution sets the "attribution" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableAttribution(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetAttribution(*s) + } + return clu +} + // SetJustification sets the "justification" field. func (clu *CertifyLegalUpdate) SetJustification(s string) *CertifyLegalUpdate { clu.mutation.SetJustification(s) return clu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableJustification(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetJustification(*s) + } + return clu +} + // SetTimeScanned sets the "time_scanned" field. func (clu *CertifyLegalUpdate) SetTimeScanned(t time.Time) *CertifyLegalUpdate { clu.mutation.SetTimeScanned(t) return clu } +// SetNillableTimeScanned sets the "time_scanned" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableTimeScanned(t *time.Time) *CertifyLegalUpdate { + if t != nil { + clu.SetTimeScanned(*t) + } + return clu +} + // SetOrigin sets the "origin" field. func (clu *CertifyLegalUpdate) SetOrigin(s string) *CertifyLegalUpdate { clu.mutation.SetOrigin(s) return clu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableOrigin(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetOrigin(*s) + } + return clu +} + // SetCollector sets the "collector" field. func (clu *CertifyLegalUpdate) SetCollector(s string) *CertifyLegalUpdate { clu.mutation.SetCollector(s) return clu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableCollector(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetCollector(*s) + } + return clu +} + // SetDeclaredLicensesHash sets the "declared_licenses_hash" field. func (clu *CertifyLegalUpdate) SetDeclaredLicensesHash(s string) *CertifyLegalUpdate { clu.mutation.SetDeclaredLicensesHash(s) return clu } +// SetNillableDeclaredLicensesHash sets the "declared_licenses_hash" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableDeclaredLicensesHash(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetDeclaredLicensesHash(*s) + } + return clu +} + // SetDiscoveredLicensesHash sets the "discovered_licenses_hash" field. func (clu *CertifyLegalUpdate) SetDiscoveredLicensesHash(s string) *CertifyLegalUpdate { clu.mutation.SetDiscoveredLicensesHash(s) return clu } +// SetNillableDiscoveredLicensesHash sets the "discovered_licenses_hash" field if the given value is not nil. +func (clu *CertifyLegalUpdate) SetNillableDiscoveredLicensesHash(s *string) *CertifyLegalUpdate { + if s != nil { + clu.SetDiscoveredLicensesHash(*s) + } + return clu +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (clu *CertifyLegalUpdate) SetPackage(p *PackageVersion) *CertifyLegalUpdate { return clu.SetPackageID(p.ID) @@ -501,54 +573,126 @@ func (cluo *CertifyLegalUpdateOne) SetDeclaredLicense(s string) *CertifyLegalUpd return cluo } +// SetNillableDeclaredLicense sets the "declared_license" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableDeclaredLicense(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetDeclaredLicense(*s) + } + return cluo +} + // SetDiscoveredLicense sets the "discovered_license" field. func (cluo *CertifyLegalUpdateOne) SetDiscoveredLicense(s string) *CertifyLegalUpdateOne { cluo.mutation.SetDiscoveredLicense(s) return cluo } +// SetNillableDiscoveredLicense sets the "discovered_license" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableDiscoveredLicense(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetDiscoveredLicense(*s) + } + return cluo +} + // SetAttribution sets the "attribution" field. func (cluo *CertifyLegalUpdateOne) SetAttribution(s string) *CertifyLegalUpdateOne { cluo.mutation.SetAttribution(s) return cluo } +// SetNillableAttribution sets the "attribution" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableAttribution(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetAttribution(*s) + } + return cluo +} + // SetJustification sets the "justification" field. func (cluo *CertifyLegalUpdateOne) SetJustification(s string) *CertifyLegalUpdateOne { cluo.mutation.SetJustification(s) return cluo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableJustification(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetJustification(*s) + } + return cluo +} + // SetTimeScanned sets the "time_scanned" field. func (cluo *CertifyLegalUpdateOne) SetTimeScanned(t time.Time) *CertifyLegalUpdateOne { cluo.mutation.SetTimeScanned(t) return cluo } +// SetNillableTimeScanned sets the "time_scanned" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableTimeScanned(t *time.Time) *CertifyLegalUpdateOne { + if t != nil { + cluo.SetTimeScanned(*t) + } + return cluo +} + // SetOrigin sets the "origin" field. func (cluo *CertifyLegalUpdateOne) SetOrigin(s string) *CertifyLegalUpdateOne { cluo.mutation.SetOrigin(s) return cluo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableOrigin(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetOrigin(*s) + } + return cluo +} + // SetCollector sets the "collector" field. func (cluo *CertifyLegalUpdateOne) SetCollector(s string) *CertifyLegalUpdateOne { cluo.mutation.SetCollector(s) return cluo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableCollector(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetCollector(*s) + } + return cluo +} + // SetDeclaredLicensesHash sets the "declared_licenses_hash" field. func (cluo *CertifyLegalUpdateOne) SetDeclaredLicensesHash(s string) *CertifyLegalUpdateOne { cluo.mutation.SetDeclaredLicensesHash(s) return cluo } +// SetNillableDeclaredLicensesHash sets the "declared_licenses_hash" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableDeclaredLicensesHash(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetDeclaredLicensesHash(*s) + } + return cluo +} + // SetDiscoveredLicensesHash sets the "discovered_licenses_hash" field. func (cluo *CertifyLegalUpdateOne) SetDiscoveredLicensesHash(s string) *CertifyLegalUpdateOne { cluo.mutation.SetDiscoveredLicensesHash(s) return cluo } +// SetNillableDiscoveredLicensesHash sets the "discovered_licenses_hash" field if the given value is not nil. +func (cluo *CertifyLegalUpdateOne) SetNillableDiscoveredLicensesHash(s *string) *CertifyLegalUpdateOne { + if s != nil { + cluo.SetDiscoveredLicensesHash(*s) + } + return cluo +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (cluo *CertifyLegalUpdateOne) SetPackage(p *PackageVersion) *CertifyLegalUpdateOne { return cluo.SetPackageID(p.ID) diff --git a/pkg/assembler/backends/ent/certifyscorecard_update.go b/pkg/assembler/backends/ent/certifyscorecard_update.go index 02ccb4f485..a848d87109 100644 --- a/pkg/assembler/backends/ent/certifyscorecard_update.go +++ b/pkg/assembler/backends/ent/certifyscorecard_update.go @@ -35,12 +35,28 @@ func (csu *CertifyScorecardUpdate) SetSourceID(i int) *CertifyScorecardUpdate { return csu } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (csu *CertifyScorecardUpdate) SetNillableSourceID(i *int) *CertifyScorecardUpdate { + if i != nil { + csu.SetSourceID(*i) + } + return csu +} + // SetScorecardID sets the "scorecard_id" field. func (csu *CertifyScorecardUpdate) SetScorecardID(i int) *CertifyScorecardUpdate { csu.mutation.SetScorecardID(i) return csu } +// SetNillableScorecardID sets the "scorecard_id" field if the given value is not nil. +func (csu *CertifyScorecardUpdate) SetNillableScorecardID(i *int) *CertifyScorecardUpdate { + if i != nil { + csu.SetScorecardID(*i) + } + return csu +} + // SetScorecard sets the "scorecard" edge to the Scorecard entity. func (csu *CertifyScorecardUpdate) SetScorecard(s *Scorecard) *CertifyScorecardUpdate { return csu.SetScorecardID(s.ID) @@ -202,12 +218,28 @@ func (csuo *CertifyScorecardUpdateOne) SetSourceID(i int) *CertifyScorecardUpdat return csuo } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (csuo *CertifyScorecardUpdateOne) SetNillableSourceID(i *int) *CertifyScorecardUpdateOne { + if i != nil { + csuo.SetSourceID(*i) + } + return csuo +} + // SetScorecardID sets the "scorecard_id" field. func (csuo *CertifyScorecardUpdateOne) SetScorecardID(i int) *CertifyScorecardUpdateOne { csuo.mutation.SetScorecardID(i) return csuo } +// SetNillableScorecardID sets the "scorecard_id" field if the given value is not nil. +func (csuo *CertifyScorecardUpdateOne) SetNillableScorecardID(i *int) *CertifyScorecardUpdateOne { + if i != nil { + csuo.SetScorecardID(*i) + } + return csuo +} + // SetScorecard sets the "scorecard" edge to the Scorecard entity. func (csuo *CertifyScorecardUpdateOne) SetScorecard(s *Scorecard) *CertifyScorecardUpdateOne { return csuo.SetScorecardID(s.ID) diff --git a/pkg/assembler/backends/ent/certifyvex_update.go b/pkg/assembler/backends/ent/certifyvex_update.go index 4cd892c9cc..e3996bca0e 100644 --- a/pkg/assembler/backends/ent/certifyvex_update.go +++ b/pkg/assembler/backends/ent/certifyvex_update.go @@ -77,48 +77,112 @@ func (cvu *CertifyVexUpdate) SetVulnerabilityID(i int) *CertifyVexUpdate { return cvu } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableVulnerabilityID(i *int) *CertifyVexUpdate { + if i != nil { + cvu.SetVulnerabilityID(*i) + } + return cvu +} + // SetKnownSince sets the "known_since" field. func (cvu *CertifyVexUpdate) SetKnownSince(t time.Time) *CertifyVexUpdate { cvu.mutation.SetKnownSince(t) return cvu } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableKnownSince(t *time.Time) *CertifyVexUpdate { + if t != nil { + cvu.SetKnownSince(*t) + } + return cvu +} + // SetStatus sets the "status" field. func (cvu *CertifyVexUpdate) SetStatus(s string) *CertifyVexUpdate { cvu.mutation.SetStatus(s) return cvu } +// SetNillableStatus sets the "status" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableStatus(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetStatus(*s) + } + return cvu +} + // SetStatement sets the "statement" field. func (cvu *CertifyVexUpdate) SetStatement(s string) *CertifyVexUpdate { cvu.mutation.SetStatement(s) return cvu } +// SetNillableStatement sets the "statement" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableStatement(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetStatement(*s) + } + return cvu +} + // SetStatusNotes sets the "status_notes" field. func (cvu *CertifyVexUpdate) SetStatusNotes(s string) *CertifyVexUpdate { cvu.mutation.SetStatusNotes(s) return cvu } +// SetNillableStatusNotes sets the "status_notes" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableStatusNotes(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetStatusNotes(*s) + } + return cvu +} + // SetJustification sets the "justification" field. func (cvu *CertifyVexUpdate) SetJustification(s string) *CertifyVexUpdate { cvu.mutation.SetJustification(s) return cvu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableJustification(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetJustification(*s) + } + return cvu +} + // SetOrigin sets the "origin" field. func (cvu *CertifyVexUpdate) SetOrigin(s string) *CertifyVexUpdate { cvu.mutation.SetOrigin(s) return cvu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableOrigin(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetOrigin(*s) + } + return cvu +} + // SetCollector sets the "collector" field. func (cvu *CertifyVexUpdate) SetCollector(s string) *CertifyVexUpdate { cvu.mutation.SetCollector(s) return cvu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cvu *CertifyVexUpdate) SetNillableCollector(s *string) *CertifyVexUpdate { + if s != nil { + cvu.SetCollector(*s) + } + return cvu +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (cvu *CertifyVexUpdate) SetPackage(p *PackageVersion) *CertifyVexUpdate { return cvu.SetPackageID(p.ID) @@ -378,48 +442,112 @@ func (cvuo *CertifyVexUpdateOne) SetVulnerabilityID(i int) *CertifyVexUpdateOne return cvuo } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableVulnerabilityID(i *int) *CertifyVexUpdateOne { + if i != nil { + cvuo.SetVulnerabilityID(*i) + } + return cvuo +} + // SetKnownSince sets the "known_since" field. func (cvuo *CertifyVexUpdateOne) SetKnownSince(t time.Time) *CertifyVexUpdateOne { cvuo.mutation.SetKnownSince(t) return cvuo } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableKnownSince(t *time.Time) *CertifyVexUpdateOne { + if t != nil { + cvuo.SetKnownSince(*t) + } + return cvuo +} + // SetStatus sets the "status" field. func (cvuo *CertifyVexUpdateOne) SetStatus(s string) *CertifyVexUpdateOne { cvuo.mutation.SetStatus(s) return cvuo } +// SetNillableStatus sets the "status" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableStatus(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetStatus(*s) + } + return cvuo +} + // SetStatement sets the "statement" field. func (cvuo *CertifyVexUpdateOne) SetStatement(s string) *CertifyVexUpdateOne { cvuo.mutation.SetStatement(s) return cvuo } +// SetNillableStatement sets the "statement" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableStatement(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetStatement(*s) + } + return cvuo +} + // SetStatusNotes sets the "status_notes" field. func (cvuo *CertifyVexUpdateOne) SetStatusNotes(s string) *CertifyVexUpdateOne { cvuo.mutation.SetStatusNotes(s) return cvuo } +// SetNillableStatusNotes sets the "status_notes" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableStatusNotes(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetStatusNotes(*s) + } + return cvuo +} + // SetJustification sets the "justification" field. func (cvuo *CertifyVexUpdateOne) SetJustification(s string) *CertifyVexUpdateOne { cvuo.mutation.SetJustification(s) return cvuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableJustification(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetJustification(*s) + } + return cvuo +} + // SetOrigin sets the "origin" field. func (cvuo *CertifyVexUpdateOne) SetOrigin(s string) *CertifyVexUpdateOne { cvuo.mutation.SetOrigin(s) return cvuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableOrigin(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetOrigin(*s) + } + return cvuo +} + // SetCollector sets the "collector" field. func (cvuo *CertifyVexUpdateOne) SetCollector(s string) *CertifyVexUpdateOne { cvuo.mutation.SetCollector(s) return cvuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cvuo *CertifyVexUpdateOne) SetNillableCollector(s *string) *CertifyVexUpdateOne { + if s != nil { + cvuo.SetCollector(*s) + } + return cvuo +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (cvuo *CertifyVexUpdateOne) SetPackage(p *PackageVersion) *CertifyVexUpdateOne { return cvuo.SetPackageID(p.ID) diff --git a/pkg/assembler/backends/ent/certifyvuln_update.go b/pkg/assembler/backends/ent/certifyvuln_update.go index 7702dcc702..9b85ee7b33 100644 --- a/pkg/assembler/backends/ent/certifyvuln_update.go +++ b/pkg/assembler/backends/ent/certifyvuln_update.go @@ -36,54 +36,126 @@ func (cvu *CertifyVulnUpdate) SetVulnerabilityID(i int) *CertifyVulnUpdate { return cvu } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableVulnerabilityID(i *int) *CertifyVulnUpdate { + if i != nil { + cvu.SetVulnerabilityID(*i) + } + return cvu +} + // SetPackageID sets the "package_id" field. func (cvu *CertifyVulnUpdate) SetPackageID(i int) *CertifyVulnUpdate { cvu.mutation.SetPackageID(i) return cvu } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillablePackageID(i *int) *CertifyVulnUpdate { + if i != nil { + cvu.SetPackageID(*i) + } + return cvu +} + // SetTimeScanned sets the "time_scanned" field. func (cvu *CertifyVulnUpdate) SetTimeScanned(t time.Time) *CertifyVulnUpdate { cvu.mutation.SetTimeScanned(t) return cvu } +// SetNillableTimeScanned sets the "time_scanned" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableTimeScanned(t *time.Time) *CertifyVulnUpdate { + if t != nil { + cvu.SetTimeScanned(*t) + } + return cvu +} + // SetDbURI sets the "db_uri" field. func (cvu *CertifyVulnUpdate) SetDbURI(s string) *CertifyVulnUpdate { cvu.mutation.SetDbURI(s) return cvu } +// SetNillableDbURI sets the "db_uri" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableDbURI(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetDbURI(*s) + } + return cvu +} + // SetDbVersion sets the "db_version" field. func (cvu *CertifyVulnUpdate) SetDbVersion(s string) *CertifyVulnUpdate { cvu.mutation.SetDbVersion(s) return cvu } +// SetNillableDbVersion sets the "db_version" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableDbVersion(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetDbVersion(*s) + } + return cvu +} + // SetScannerURI sets the "scanner_uri" field. func (cvu *CertifyVulnUpdate) SetScannerURI(s string) *CertifyVulnUpdate { cvu.mutation.SetScannerURI(s) return cvu } +// SetNillableScannerURI sets the "scanner_uri" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableScannerURI(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetScannerURI(*s) + } + return cvu +} + // SetScannerVersion sets the "scanner_version" field. func (cvu *CertifyVulnUpdate) SetScannerVersion(s string) *CertifyVulnUpdate { cvu.mutation.SetScannerVersion(s) return cvu } +// SetNillableScannerVersion sets the "scanner_version" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableScannerVersion(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetScannerVersion(*s) + } + return cvu +} + // SetOrigin sets the "origin" field. func (cvu *CertifyVulnUpdate) SetOrigin(s string) *CertifyVulnUpdate { cvu.mutation.SetOrigin(s) return cvu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableOrigin(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetOrigin(*s) + } + return cvu +} + // SetCollector sets the "collector" field. func (cvu *CertifyVulnUpdate) SetCollector(s string) *CertifyVulnUpdate { cvu.mutation.SetCollector(s) return cvu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cvu *CertifyVulnUpdate) SetNillableCollector(s *string) *CertifyVulnUpdate { + if s != nil { + cvu.SetCollector(*s) + } + return cvu +} + // SetVulnerability sets the "vulnerability" edge to the VulnerabilityID entity. func (cvu *CertifyVulnUpdate) SetVulnerability(v *VulnerabilityID) *CertifyVulnUpdate { return cvu.SetVulnerabilityID(v.ID) @@ -266,54 +338,126 @@ func (cvuo *CertifyVulnUpdateOne) SetVulnerabilityID(i int) *CertifyVulnUpdateOn return cvuo } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableVulnerabilityID(i *int) *CertifyVulnUpdateOne { + if i != nil { + cvuo.SetVulnerabilityID(*i) + } + return cvuo +} + // SetPackageID sets the "package_id" field. func (cvuo *CertifyVulnUpdateOne) SetPackageID(i int) *CertifyVulnUpdateOne { cvuo.mutation.SetPackageID(i) return cvuo } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillablePackageID(i *int) *CertifyVulnUpdateOne { + if i != nil { + cvuo.SetPackageID(*i) + } + return cvuo +} + // SetTimeScanned sets the "time_scanned" field. func (cvuo *CertifyVulnUpdateOne) SetTimeScanned(t time.Time) *CertifyVulnUpdateOne { cvuo.mutation.SetTimeScanned(t) return cvuo } +// SetNillableTimeScanned sets the "time_scanned" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableTimeScanned(t *time.Time) *CertifyVulnUpdateOne { + if t != nil { + cvuo.SetTimeScanned(*t) + } + return cvuo +} + // SetDbURI sets the "db_uri" field. func (cvuo *CertifyVulnUpdateOne) SetDbURI(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetDbURI(s) return cvuo } +// SetNillableDbURI sets the "db_uri" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableDbURI(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetDbURI(*s) + } + return cvuo +} + // SetDbVersion sets the "db_version" field. func (cvuo *CertifyVulnUpdateOne) SetDbVersion(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetDbVersion(s) return cvuo } +// SetNillableDbVersion sets the "db_version" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableDbVersion(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetDbVersion(*s) + } + return cvuo +} + // SetScannerURI sets the "scanner_uri" field. func (cvuo *CertifyVulnUpdateOne) SetScannerURI(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetScannerURI(s) return cvuo } +// SetNillableScannerURI sets the "scanner_uri" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableScannerURI(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetScannerURI(*s) + } + return cvuo +} + // SetScannerVersion sets the "scanner_version" field. func (cvuo *CertifyVulnUpdateOne) SetScannerVersion(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetScannerVersion(s) return cvuo } +// SetNillableScannerVersion sets the "scanner_version" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableScannerVersion(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetScannerVersion(*s) + } + return cvuo +} + // SetOrigin sets the "origin" field. func (cvuo *CertifyVulnUpdateOne) SetOrigin(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetOrigin(s) return cvuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableOrigin(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetOrigin(*s) + } + return cvuo +} + // SetCollector sets the "collector" field. func (cvuo *CertifyVulnUpdateOne) SetCollector(s string) *CertifyVulnUpdateOne { cvuo.mutation.SetCollector(s) return cvuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (cvuo *CertifyVulnUpdateOne) SetNillableCollector(s *string) *CertifyVulnUpdateOne { + if s != nil { + cvuo.SetCollector(*s) + } + return cvuo +} + // SetVulnerability sets the "vulnerability" edge to the VulnerabilityID entity. func (cvuo *CertifyVulnUpdateOne) SetVulnerability(v *VulnerabilityID) *CertifyVulnUpdateOne { return cvuo.SetVulnerabilityID(v.ID) diff --git a/pkg/assembler/backends/ent/client.go b/pkg/assembler/backends/ent/client.go index 4d3d1aac2c..959400b5d0 100644 --- a/pkg/assembler/backends/ent/client.go +++ b/pkg/assembler/backends/ent/client.go @@ -118,9 +118,7 @@ type Client struct { // NewClient creates a new client configured with the given options. func NewClient(opts ...Option) *Client { - cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} - cfg.options(opts...) - client := &Client{config: cfg} + client := &Client{config: newConfig(opts...)} client.init() return client } @@ -177,6 +175,13 @@ type ( Option func(*config) ) +// newConfig creates a new config for the client. +func newConfig(opts ...Option) config { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + return cfg +} + // options applies the options on the config object. func (c *config) options(opts ...Option) { for _, opt := range opts { diff --git a/pkg/assembler/backends/ent/dependency_update.go b/pkg/assembler/backends/ent/dependency_update.go index 391990cea4..82a7c0f030 100644 --- a/pkg/assembler/backends/ent/dependency_update.go +++ b/pkg/assembler/backends/ent/dependency_update.go @@ -35,6 +35,14 @@ func (du *DependencyUpdate) SetPackageID(i int) *DependencyUpdate { return du } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (du *DependencyUpdate) SetNillablePackageID(i *int) *DependencyUpdate { + if i != nil { + du.SetPackageID(*i) + } + return du +} + // SetDependentPackageNameID sets the "dependent_package_name_id" field. func (du *DependencyUpdate) SetDependentPackageNameID(i int) *DependencyUpdate { du.mutation.SetDependentPackageNameID(i) @@ -81,30 +89,70 @@ func (du *DependencyUpdate) SetVersionRange(s string) *DependencyUpdate { return du } +// SetNillableVersionRange sets the "version_range" field if the given value is not nil. +func (du *DependencyUpdate) SetNillableVersionRange(s *string) *DependencyUpdate { + if s != nil { + du.SetVersionRange(*s) + } + return du +} + // SetDependencyType sets the "dependency_type" field. func (du *DependencyUpdate) SetDependencyType(dt dependency.DependencyType) *DependencyUpdate { du.mutation.SetDependencyType(dt) return du } +// SetNillableDependencyType sets the "dependency_type" field if the given value is not nil. +func (du *DependencyUpdate) SetNillableDependencyType(dt *dependency.DependencyType) *DependencyUpdate { + if dt != nil { + du.SetDependencyType(*dt) + } + return du +} + // SetJustification sets the "justification" field. func (du *DependencyUpdate) SetJustification(s string) *DependencyUpdate { du.mutation.SetJustification(s) return du } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (du *DependencyUpdate) SetNillableJustification(s *string) *DependencyUpdate { + if s != nil { + du.SetJustification(*s) + } + return du +} + // SetOrigin sets the "origin" field. func (du *DependencyUpdate) SetOrigin(s string) *DependencyUpdate { du.mutation.SetOrigin(s) return du } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (du *DependencyUpdate) SetNillableOrigin(s *string) *DependencyUpdate { + if s != nil { + du.SetOrigin(*s) + } + return du +} + // SetCollector sets the "collector" field. func (du *DependencyUpdate) SetCollector(s string) *DependencyUpdate { du.mutation.SetCollector(s) return du } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (du *DependencyUpdate) SetNillableCollector(s *string) *DependencyUpdate { + if s != nil { + du.SetCollector(*s) + } + return du +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (du *DependencyUpdate) SetPackage(p *PackageVersion) *DependencyUpdate { return du.SetPackageID(p.ID) @@ -323,6 +371,14 @@ func (duo *DependencyUpdateOne) SetPackageID(i int) *DependencyUpdateOne { return duo } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillablePackageID(i *int) *DependencyUpdateOne { + if i != nil { + duo.SetPackageID(*i) + } + return duo +} + // SetDependentPackageNameID sets the "dependent_package_name_id" field. func (duo *DependencyUpdateOne) SetDependentPackageNameID(i int) *DependencyUpdateOne { duo.mutation.SetDependentPackageNameID(i) @@ -369,30 +425,70 @@ func (duo *DependencyUpdateOne) SetVersionRange(s string) *DependencyUpdateOne { return duo } +// SetNillableVersionRange sets the "version_range" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillableVersionRange(s *string) *DependencyUpdateOne { + if s != nil { + duo.SetVersionRange(*s) + } + return duo +} + // SetDependencyType sets the "dependency_type" field. func (duo *DependencyUpdateOne) SetDependencyType(dt dependency.DependencyType) *DependencyUpdateOne { duo.mutation.SetDependencyType(dt) return duo } +// SetNillableDependencyType sets the "dependency_type" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillableDependencyType(dt *dependency.DependencyType) *DependencyUpdateOne { + if dt != nil { + duo.SetDependencyType(*dt) + } + return duo +} + // SetJustification sets the "justification" field. func (duo *DependencyUpdateOne) SetJustification(s string) *DependencyUpdateOne { duo.mutation.SetJustification(s) return duo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillableJustification(s *string) *DependencyUpdateOne { + if s != nil { + duo.SetJustification(*s) + } + return duo +} + // SetOrigin sets the "origin" field. func (duo *DependencyUpdateOne) SetOrigin(s string) *DependencyUpdateOne { duo.mutation.SetOrigin(s) return duo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillableOrigin(s *string) *DependencyUpdateOne { + if s != nil { + duo.SetOrigin(*s) + } + return duo +} + // SetCollector sets the "collector" field. func (duo *DependencyUpdateOne) SetCollector(s string) *DependencyUpdateOne { duo.mutation.SetCollector(s) return duo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (duo *DependencyUpdateOne) SetNillableCollector(s *string) *DependencyUpdateOne { + if s != nil { + duo.SetCollector(*s) + } + return duo +} + // SetPackage sets the "package" edge to the PackageVersion entity. func (duo *DependencyUpdateOne) SetPackage(p *PackageVersion) *DependencyUpdateOne { return duo.SetPackageID(p.ID) diff --git a/pkg/assembler/backends/ent/hashequal_update.go b/pkg/assembler/backends/ent/hashequal_update.go index 145f38f2c9..3733ba8ee3 100644 --- a/pkg/assembler/backends/ent/hashequal_update.go +++ b/pkg/assembler/backends/ent/hashequal_update.go @@ -34,18 +34,42 @@ func (heu *HashEqualUpdate) SetOrigin(s string) *HashEqualUpdate { return heu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (heu *HashEqualUpdate) SetNillableOrigin(s *string) *HashEqualUpdate { + if s != nil { + heu.SetOrigin(*s) + } + return heu +} + // SetCollector sets the "collector" field. func (heu *HashEqualUpdate) SetCollector(s string) *HashEqualUpdate { heu.mutation.SetCollector(s) return heu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (heu *HashEqualUpdate) SetNillableCollector(s *string) *HashEqualUpdate { + if s != nil { + heu.SetCollector(*s) + } + return heu +} + // SetJustification sets the "justification" field. func (heu *HashEqualUpdate) SetJustification(s string) *HashEqualUpdate { heu.mutation.SetJustification(s) return heu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (heu *HashEqualUpdate) SetNillableJustification(s *string) *HashEqualUpdate { + if s != nil { + heu.SetJustification(*s) + } + return heu +} + // AddArtifactIDs adds the "artifacts" edge to the Artifact entity by IDs. func (heu *HashEqualUpdate) AddArtifactIDs(ids ...int) *HashEqualUpdate { heu.mutation.AddArtifactIDs(ids...) @@ -203,18 +227,42 @@ func (heuo *HashEqualUpdateOne) SetOrigin(s string) *HashEqualUpdateOne { return heuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (heuo *HashEqualUpdateOne) SetNillableOrigin(s *string) *HashEqualUpdateOne { + if s != nil { + heuo.SetOrigin(*s) + } + return heuo +} + // SetCollector sets the "collector" field. func (heuo *HashEqualUpdateOne) SetCollector(s string) *HashEqualUpdateOne { heuo.mutation.SetCollector(s) return heuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (heuo *HashEqualUpdateOne) SetNillableCollector(s *string) *HashEqualUpdateOne { + if s != nil { + heuo.SetCollector(*s) + } + return heuo +} + // SetJustification sets the "justification" field. func (heuo *HashEqualUpdateOne) SetJustification(s string) *HashEqualUpdateOne { heuo.mutation.SetJustification(s) return heuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (heuo *HashEqualUpdateOne) SetNillableJustification(s *string) *HashEqualUpdateOne { + if s != nil { + heuo.SetJustification(*s) + } + return heuo +} + // AddArtifactIDs adds the "artifacts" edge to the Artifact entity by IDs. func (heuo *HashEqualUpdateOne) AddArtifactIDs(ids ...int) *HashEqualUpdateOne { heuo.mutation.AddArtifactIDs(ids...) diff --git a/pkg/assembler/backends/ent/hasmetadata_update.go b/pkg/assembler/backends/ent/hasmetadata_update.go index 77272a967b..96ba1011d8 100644 --- a/pkg/assembler/backends/ent/hasmetadata_update.go +++ b/pkg/assembler/backends/ent/hasmetadata_update.go @@ -118,36 +118,84 @@ func (hmu *HasMetadataUpdate) SetTimestamp(t time.Time) *HasMetadataUpdate { return hmu } +// SetNillableTimestamp sets the "timestamp" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableTimestamp(t *time.Time) *HasMetadataUpdate { + if t != nil { + hmu.SetTimestamp(*t) + } + return hmu +} + // SetKey sets the "key" field. func (hmu *HasMetadataUpdate) SetKey(s string) *HasMetadataUpdate { hmu.mutation.SetKey(s) return hmu } +// SetNillableKey sets the "key" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableKey(s *string) *HasMetadataUpdate { + if s != nil { + hmu.SetKey(*s) + } + return hmu +} + // SetValue sets the "value" field. func (hmu *HasMetadataUpdate) SetValue(s string) *HasMetadataUpdate { hmu.mutation.SetValue(s) return hmu } +// SetNillableValue sets the "value" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableValue(s *string) *HasMetadataUpdate { + if s != nil { + hmu.SetValue(*s) + } + return hmu +} + // SetJustification sets the "justification" field. func (hmu *HasMetadataUpdate) SetJustification(s string) *HasMetadataUpdate { hmu.mutation.SetJustification(s) return hmu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableJustification(s *string) *HasMetadataUpdate { + if s != nil { + hmu.SetJustification(*s) + } + return hmu +} + // SetOrigin sets the "origin" field. func (hmu *HasMetadataUpdate) SetOrigin(s string) *HasMetadataUpdate { hmu.mutation.SetOrigin(s) return hmu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableOrigin(s *string) *HasMetadataUpdate { + if s != nil { + hmu.SetOrigin(*s) + } + return hmu +} + // SetCollector sets the "collector" field. func (hmu *HasMetadataUpdate) SetCollector(s string) *HasMetadataUpdate { hmu.mutation.SetCollector(s) return hmu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (hmu *HasMetadataUpdate) SetNillableCollector(s *string) *HasMetadataUpdate { + if s != nil { + hmu.SetCollector(*s) + } + return hmu +} + // SetSource sets the "source" edge to the SourceName entity. func (hmu *HasMetadataUpdate) SetSource(s *SourceName) *HasMetadataUpdate { return hmu.SetSourceID(s.ID) @@ -487,36 +535,84 @@ func (hmuo *HasMetadataUpdateOne) SetTimestamp(t time.Time) *HasMetadataUpdateOn return hmuo } +// SetNillableTimestamp sets the "timestamp" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableTimestamp(t *time.Time) *HasMetadataUpdateOne { + if t != nil { + hmuo.SetTimestamp(*t) + } + return hmuo +} + // SetKey sets the "key" field. func (hmuo *HasMetadataUpdateOne) SetKey(s string) *HasMetadataUpdateOne { hmuo.mutation.SetKey(s) return hmuo } +// SetNillableKey sets the "key" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableKey(s *string) *HasMetadataUpdateOne { + if s != nil { + hmuo.SetKey(*s) + } + return hmuo +} + // SetValue sets the "value" field. func (hmuo *HasMetadataUpdateOne) SetValue(s string) *HasMetadataUpdateOne { hmuo.mutation.SetValue(s) return hmuo } +// SetNillableValue sets the "value" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableValue(s *string) *HasMetadataUpdateOne { + if s != nil { + hmuo.SetValue(*s) + } + return hmuo +} + // SetJustification sets the "justification" field. func (hmuo *HasMetadataUpdateOne) SetJustification(s string) *HasMetadataUpdateOne { hmuo.mutation.SetJustification(s) return hmuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableJustification(s *string) *HasMetadataUpdateOne { + if s != nil { + hmuo.SetJustification(*s) + } + return hmuo +} + // SetOrigin sets the "origin" field. func (hmuo *HasMetadataUpdateOne) SetOrigin(s string) *HasMetadataUpdateOne { hmuo.mutation.SetOrigin(s) return hmuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableOrigin(s *string) *HasMetadataUpdateOne { + if s != nil { + hmuo.SetOrigin(*s) + } + return hmuo +} + // SetCollector sets the "collector" field. func (hmuo *HasMetadataUpdateOne) SetCollector(s string) *HasMetadataUpdateOne { hmuo.mutation.SetCollector(s) return hmuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (hmuo *HasMetadataUpdateOne) SetNillableCollector(s *string) *HasMetadataUpdateOne { + if s != nil { + hmuo.SetCollector(*s) + } + return hmuo +} + // SetSource sets the "source" edge to the SourceName entity. func (hmuo *HasMetadataUpdateOne) SetSource(s *SourceName) *HasMetadataUpdateOne { return hmuo.SetSourceID(s.ID) diff --git a/pkg/assembler/backends/ent/hassourceat_update.go b/pkg/assembler/backends/ent/hassourceat_update.go index 08dbd90aca..fc4c6b7256 100644 --- a/pkg/assembler/backends/ent/hassourceat_update.go +++ b/pkg/assembler/backends/ent/hassourceat_update.go @@ -77,30 +77,70 @@ func (hsau *HasSourceAtUpdate) SetSourceID(i int) *HasSourceAtUpdate { return hsau } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (hsau *HasSourceAtUpdate) SetNillableSourceID(i *int) *HasSourceAtUpdate { + if i != nil { + hsau.SetSourceID(*i) + } + return hsau +} + // SetKnownSince sets the "known_since" field. func (hsau *HasSourceAtUpdate) SetKnownSince(t time.Time) *HasSourceAtUpdate { hsau.mutation.SetKnownSince(t) return hsau } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (hsau *HasSourceAtUpdate) SetNillableKnownSince(t *time.Time) *HasSourceAtUpdate { + if t != nil { + hsau.SetKnownSince(*t) + } + return hsau +} + // SetJustification sets the "justification" field. func (hsau *HasSourceAtUpdate) SetJustification(s string) *HasSourceAtUpdate { hsau.mutation.SetJustification(s) return hsau } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (hsau *HasSourceAtUpdate) SetNillableJustification(s *string) *HasSourceAtUpdate { + if s != nil { + hsau.SetJustification(*s) + } + return hsau +} + // SetOrigin sets the "origin" field. func (hsau *HasSourceAtUpdate) SetOrigin(s string) *HasSourceAtUpdate { hsau.mutation.SetOrigin(s) return hsau } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (hsau *HasSourceAtUpdate) SetNillableOrigin(s *string) *HasSourceAtUpdate { + if s != nil { + hsau.SetOrigin(*s) + } + return hsau +} + // SetCollector sets the "collector" field. func (hsau *HasSourceAtUpdate) SetCollector(s string) *HasSourceAtUpdate { hsau.mutation.SetCollector(s) return hsau } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (hsau *HasSourceAtUpdate) SetNillableCollector(s *string) *HasSourceAtUpdate { + if s != nil { + hsau.SetCollector(*s) + } + return hsau +} + // SetPackageVersion sets the "package_version" edge to the PackageVersion entity. func (hsau *HasSourceAtUpdate) SetPackageVersion(p *PackageVersion) *HasSourceAtUpdate { return hsau.SetPackageVersionID(p.ID) @@ -365,30 +405,70 @@ func (hsauo *HasSourceAtUpdateOne) SetSourceID(i int) *HasSourceAtUpdateOne { return hsauo } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (hsauo *HasSourceAtUpdateOne) SetNillableSourceID(i *int) *HasSourceAtUpdateOne { + if i != nil { + hsauo.SetSourceID(*i) + } + return hsauo +} + // SetKnownSince sets the "known_since" field. func (hsauo *HasSourceAtUpdateOne) SetKnownSince(t time.Time) *HasSourceAtUpdateOne { hsauo.mutation.SetKnownSince(t) return hsauo } +// SetNillableKnownSince sets the "known_since" field if the given value is not nil. +func (hsauo *HasSourceAtUpdateOne) SetNillableKnownSince(t *time.Time) *HasSourceAtUpdateOne { + if t != nil { + hsauo.SetKnownSince(*t) + } + return hsauo +} + // SetJustification sets the "justification" field. func (hsauo *HasSourceAtUpdateOne) SetJustification(s string) *HasSourceAtUpdateOne { hsauo.mutation.SetJustification(s) return hsauo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (hsauo *HasSourceAtUpdateOne) SetNillableJustification(s *string) *HasSourceAtUpdateOne { + if s != nil { + hsauo.SetJustification(*s) + } + return hsauo +} + // SetOrigin sets the "origin" field. func (hsauo *HasSourceAtUpdateOne) SetOrigin(s string) *HasSourceAtUpdateOne { hsauo.mutation.SetOrigin(s) return hsauo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (hsauo *HasSourceAtUpdateOne) SetNillableOrigin(s *string) *HasSourceAtUpdateOne { + if s != nil { + hsauo.SetOrigin(*s) + } + return hsauo +} + // SetCollector sets the "collector" field. func (hsauo *HasSourceAtUpdateOne) SetCollector(s string) *HasSourceAtUpdateOne { hsauo.mutation.SetCollector(s) return hsauo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (hsauo *HasSourceAtUpdateOne) SetNillableCollector(s *string) *HasSourceAtUpdateOne { + if s != nil { + hsauo.SetCollector(*s) + } + return hsauo +} + // SetPackageVersion sets the "package_version" edge to the PackageVersion entity. func (hsauo *HasSourceAtUpdateOne) SetPackageVersion(p *PackageVersion) *HasSourceAtUpdateOne { return hsauo.SetPackageVersionID(p.ID) diff --git a/pkg/assembler/backends/ent/isvulnerability_update.go b/pkg/assembler/backends/ent/isvulnerability_update.go index 38818e9741..ab2057e281 100644 --- a/pkg/assembler/backends/ent/isvulnerability_update.go +++ b/pkg/assembler/backends/ent/isvulnerability_update.go @@ -34,30 +34,70 @@ func (ivu *IsVulnerabilityUpdate) SetOsvID(i int) *IsVulnerabilityUpdate { return ivu } +// SetNillableOsvID sets the "osv_id" field if the given value is not nil. +func (ivu *IsVulnerabilityUpdate) SetNillableOsvID(i *int) *IsVulnerabilityUpdate { + if i != nil { + ivu.SetOsvID(*i) + } + return ivu +} + // SetVulnerabilityID sets the "vulnerability_id" field. func (ivu *IsVulnerabilityUpdate) SetVulnerabilityID(i int) *IsVulnerabilityUpdate { ivu.mutation.SetVulnerabilityID(i) return ivu } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (ivu *IsVulnerabilityUpdate) SetNillableVulnerabilityID(i *int) *IsVulnerabilityUpdate { + if i != nil { + ivu.SetVulnerabilityID(*i) + } + return ivu +} + // SetJustification sets the "justification" field. func (ivu *IsVulnerabilityUpdate) SetJustification(s string) *IsVulnerabilityUpdate { ivu.mutation.SetJustification(s) return ivu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (ivu *IsVulnerabilityUpdate) SetNillableJustification(s *string) *IsVulnerabilityUpdate { + if s != nil { + ivu.SetJustification(*s) + } + return ivu +} + // SetOrigin sets the "origin" field. func (ivu *IsVulnerabilityUpdate) SetOrigin(s string) *IsVulnerabilityUpdate { ivu.mutation.SetOrigin(s) return ivu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (ivu *IsVulnerabilityUpdate) SetNillableOrigin(s *string) *IsVulnerabilityUpdate { + if s != nil { + ivu.SetOrigin(*s) + } + return ivu +} + // SetCollector sets the "collector" field. func (ivu *IsVulnerabilityUpdate) SetCollector(s string) *IsVulnerabilityUpdate { ivu.mutation.SetCollector(s) return ivu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (ivu *IsVulnerabilityUpdate) SetNillableCollector(s *string) *IsVulnerabilityUpdate { + if s != nil { + ivu.SetCollector(*s) + } + return ivu +} + // SetOsv sets the "osv" edge to the VulnerabilityType entity. func (ivu *IsVulnerabilityUpdate) SetOsv(v *VulnerabilityType) *IsVulnerabilityUpdate { return ivu.SetOsvID(v.ID) @@ -228,30 +268,70 @@ func (ivuo *IsVulnerabilityUpdateOne) SetOsvID(i int) *IsVulnerabilityUpdateOne return ivuo } +// SetNillableOsvID sets the "osv_id" field if the given value is not nil. +func (ivuo *IsVulnerabilityUpdateOne) SetNillableOsvID(i *int) *IsVulnerabilityUpdateOne { + if i != nil { + ivuo.SetOsvID(*i) + } + return ivuo +} + // SetVulnerabilityID sets the "vulnerability_id" field. func (ivuo *IsVulnerabilityUpdateOne) SetVulnerabilityID(i int) *IsVulnerabilityUpdateOne { ivuo.mutation.SetVulnerabilityID(i) return ivuo } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (ivuo *IsVulnerabilityUpdateOne) SetNillableVulnerabilityID(i *int) *IsVulnerabilityUpdateOne { + if i != nil { + ivuo.SetVulnerabilityID(*i) + } + return ivuo +} + // SetJustification sets the "justification" field. func (ivuo *IsVulnerabilityUpdateOne) SetJustification(s string) *IsVulnerabilityUpdateOne { ivuo.mutation.SetJustification(s) return ivuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (ivuo *IsVulnerabilityUpdateOne) SetNillableJustification(s *string) *IsVulnerabilityUpdateOne { + if s != nil { + ivuo.SetJustification(*s) + } + return ivuo +} + // SetOrigin sets the "origin" field. func (ivuo *IsVulnerabilityUpdateOne) SetOrigin(s string) *IsVulnerabilityUpdateOne { ivuo.mutation.SetOrigin(s) return ivuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (ivuo *IsVulnerabilityUpdateOne) SetNillableOrigin(s *string) *IsVulnerabilityUpdateOne { + if s != nil { + ivuo.SetOrigin(*s) + } + return ivuo +} + // SetCollector sets the "collector" field. func (ivuo *IsVulnerabilityUpdateOne) SetCollector(s string) *IsVulnerabilityUpdateOne { ivuo.mutation.SetCollector(s) return ivuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (ivuo *IsVulnerabilityUpdateOne) SetNillableCollector(s *string) *IsVulnerabilityUpdateOne { + if s != nil { + ivuo.SetCollector(*s) + } + return ivuo +} + // SetOsv sets the "osv" edge to the VulnerabilityType entity. func (ivuo *IsVulnerabilityUpdateOne) SetOsv(v *VulnerabilityType) *IsVulnerabilityUpdateOne { return ivuo.SetOsvID(v.ID) diff --git a/pkg/assembler/backends/ent/license_update.go b/pkg/assembler/backends/ent/license_update.go index daae08e07c..dafd845765 100644 --- a/pkg/assembler/backends/ent/license_update.go +++ b/pkg/assembler/backends/ent/license_update.go @@ -34,6 +34,14 @@ func (lu *LicenseUpdate) SetName(s string) *LicenseUpdate { return lu } +// SetNillableName sets the "name" field if the given value is not nil. +func (lu *LicenseUpdate) SetNillableName(s *string) *LicenseUpdate { + if s != nil { + lu.SetName(*s) + } + return lu +} + // SetInline sets the "inline" field. func (lu *LicenseUpdate) SetInline(s string) *LicenseUpdate { lu.mutation.SetInline(s) @@ -331,6 +339,14 @@ func (luo *LicenseUpdateOne) SetName(s string) *LicenseUpdateOne { return luo } +// SetNillableName sets the "name" field if the given value is not nil. +func (luo *LicenseUpdateOne) SetNillableName(s *string) *LicenseUpdateOne { + if s != nil { + luo.SetName(*s) + } + return luo +} + // SetInline sets the "inline" field. func (luo *LicenseUpdateOne) SetInline(s string) *LicenseUpdateOne { luo.mutation.SetInline(s) diff --git a/pkg/assembler/backends/ent/occurrence_update.go b/pkg/assembler/backends/ent/occurrence_update.go index 827d0ca321..7b40487e37 100644 --- a/pkg/assembler/backends/ent/occurrence_update.go +++ b/pkg/assembler/backends/ent/occurrence_update.go @@ -36,24 +36,56 @@ func (ou *OccurrenceUpdate) SetArtifactID(i int) *OccurrenceUpdate { return ou } +// SetNillableArtifactID sets the "artifact_id" field if the given value is not nil. +func (ou *OccurrenceUpdate) SetNillableArtifactID(i *int) *OccurrenceUpdate { + if i != nil { + ou.SetArtifactID(*i) + } + return ou +} + // SetJustification sets the "justification" field. func (ou *OccurrenceUpdate) SetJustification(s string) *OccurrenceUpdate { ou.mutation.SetJustification(s) return ou } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (ou *OccurrenceUpdate) SetNillableJustification(s *string) *OccurrenceUpdate { + if s != nil { + ou.SetJustification(*s) + } + return ou +} + // SetOrigin sets the "origin" field. func (ou *OccurrenceUpdate) SetOrigin(s string) *OccurrenceUpdate { ou.mutation.SetOrigin(s) return ou } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (ou *OccurrenceUpdate) SetNillableOrigin(s *string) *OccurrenceUpdate { + if s != nil { + ou.SetOrigin(*s) + } + return ou +} + // SetCollector sets the "collector" field. func (ou *OccurrenceUpdate) SetCollector(s string) *OccurrenceUpdate { ou.mutation.SetCollector(s) return ou } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (ou *OccurrenceUpdate) SetNillableCollector(s *string) *OccurrenceUpdate { + if s != nil { + ou.SetCollector(*s) + } + return ou +} + // SetSourceID sets the "source_id" field. func (ou *OccurrenceUpdate) SetSourceID(i int) *OccurrenceUpdate { ou.mutation.SetSourceID(i) @@ -301,24 +333,56 @@ func (ouo *OccurrenceUpdateOne) SetArtifactID(i int) *OccurrenceUpdateOne { return ouo } +// SetNillableArtifactID sets the "artifact_id" field if the given value is not nil. +func (ouo *OccurrenceUpdateOne) SetNillableArtifactID(i *int) *OccurrenceUpdateOne { + if i != nil { + ouo.SetArtifactID(*i) + } + return ouo +} + // SetJustification sets the "justification" field. func (ouo *OccurrenceUpdateOne) SetJustification(s string) *OccurrenceUpdateOne { ouo.mutation.SetJustification(s) return ouo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (ouo *OccurrenceUpdateOne) SetNillableJustification(s *string) *OccurrenceUpdateOne { + if s != nil { + ouo.SetJustification(*s) + } + return ouo +} + // SetOrigin sets the "origin" field. func (ouo *OccurrenceUpdateOne) SetOrigin(s string) *OccurrenceUpdateOne { ouo.mutation.SetOrigin(s) return ouo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (ouo *OccurrenceUpdateOne) SetNillableOrigin(s *string) *OccurrenceUpdateOne { + if s != nil { + ouo.SetOrigin(*s) + } + return ouo +} + // SetCollector sets the "collector" field. func (ouo *OccurrenceUpdateOne) SetCollector(s string) *OccurrenceUpdateOne { ouo.mutation.SetCollector(s) return ouo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (ouo *OccurrenceUpdateOne) SetNillableCollector(s *string) *OccurrenceUpdateOne { + if s != nil { + ouo.SetCollector(*s) + } + return ouo +} + // SetSourceID sets the "source_id" field. func (ouo *OccurrenceUpdateOne) SetSourceID(i int) *OccurrenceUpdateOne { ouo.mutation.SetSourceID(i) diff --git a/pkg/assembler/backends/ent/packagename_update.go b/pkg/assembler/backends/ent/packagename_update.go index 04167d6e2f..b12fd62ac9 100644 --- a/pkg/assembler/backends/ent/packagename_update.go +++ b/pkg/assembler/backends/ent/packagename_update.go @@ -35,12 +35,28 @@ func (pnu *PackageNameUpdate) SetNamespaceID(i int) *PackageNameUpdate { return pnu } +// SetNillableNamespaceID sets the "namespace_id" field if the given value is not nil. +func (pnu *PackageNameUpdate) SetNillableNamespaceID(i *int) *PackageNameUpdate { + if i != nil { + pnu.SetNamespaceID(*i) + } + return pnu +} + // SetName sets the "name" field. func (pnu *PackageNameUpdate) SetName(s string) *PackageNameUpdate { pnu.mutation.SetName(s) return pnu } +// SetNillableName sets the "name" field if the given value is not nil. +func (pnu *PackageNameUpdate) SetNillableName(s *string) *PackageNameUpdate { + if s != nil { + pnu.SetName(*s) + } + return pnu +} + // SetNamespace sets the "namespace" edge to the PackageNamespace entity. func (pnu *PackageNameUpdate) SetNamespace(p *PackageNamespace) *PackageNameUpdate { return pnu.SetNamespaceID(p.ID) @@ -248,12 +264,28 @@ func (pnuo *PackageNameUpdateOne) SetNamespaceID(i int) *PackageNameUpdateOne { return pnuo } +// SetNillableNamespaceID sets the "namespace_id" field if the given value is not nil. +func (pnuo *PackageNameUpdateOne) SetNillableNamespaceID(i *int) *PackageNameUpdateOne { + if i != nil { + pnuo.SetNamespaceID(*i) + } + return pnuo +} + // SetName sets the "name" field. func (pnuo *PackageNameUpdateOne) SetName(s string) *PackageNameUpdateOne { pnuo.mutation.SetName(s) return pnuo } +// SetNillableName sets the "name" field if the given value is not nil. +func (pnuo *PackageNameUpdateOne) SetNillableName(s *string) *PackageNameUpdateOne { + if s != nil { + pnuo.SetName(*s) + } + return pnuo +} + // SetNamespace sets the "namespace" edge to the PackageNamespace entity. func (pnuo *PackageNameUpdateOne) SetNamespace(p *PackageNamespace) *PackageNameUpdateOne { return pnuo.SetNamespaceID(p.ID) diff --git a/pkg/assembler/backends/ent/packagenamespace_update.go b/pkg/assembler/backends/ent/packagenamespace_update.go index 8d2f79dd94..3c8c2d954d 100644 --- a/pkg/assembler/backends/ent/packagenamespace_update.go +++ b/pkg/assembler/backends/ent/packagenamespace_update.go @@ -35,12 +35,28 @@ func (pnu *PackageNamespaceUpdate) SetPackageID(i int) *PackageNamespaceUpdate { return pnu } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (pnu *PackageNamespaceUpdate) SetNillablePackageID(i *int) *PackageNamespaceUpdate { + if i != nil { + pnu.SetPackageID(*i) + } + return pnu +} + // SetNamespace sets the "namespace" field. func (pnu *PackageNamespaceUpdate) SetNamespace(s string) *PackageNamespaceUpdate { pnu.mutation.SetNamespace(s) return pnu } +// SetNillableNamespace sets the "namespace" field if the given value is not nil. +func (pnu *PackageNamespaceUpdate) SetNillableNamespace(s *string) *PackageNamespaceUpdate { + if s != nil { + pnu.SetNamespace(*s) + } + return pnu +} + // SetPackage sets the "package" edge to the PackageType entity. func (pnu *PackageNamespaceUpdate) SetPackage(p *PackageType) *PackageNamespaceUpdate { return pnu.SetPackageID(p.ID) @@ -243,12 +259,28 @@ func (pnuo *PackageNamespaceUpdateOne) SetPackageID(i int) *PackageNamespaceUpda return pnuo } +// SetNillablePackageID sets the "package_id" field if the given value is not nil. +func (pnuo *PackageNamespaceUpdateOne) SetNillablePackageID(i *int) *PackageNamespaceUpdateOne { + if i != nil { + pnuo.SetPackageID(*i) + } + return pnuo +} + // SetNamespace sets the "namespace" field. func (pnuo *PackageNamespaceUpdateOne) SetNamespace(s string) *PackageNamespaceUpdateOne { pnuo.mutation.SetNamespace(s) return pnuo } +// SetNillableNamespace sets the "namespace" field if the given value is not nil. +func (pnuo *PackageNamespaceUpdateOne) SetNillableNamespace(s *string) *PackageNamespaceUpdateOne { + if s != nil { + pnuo.SetNamespace(*s) + } + return pnuo +} + // SetPackage sets the "package" edge to the PackageType entity. func (pnuo *PackageNamespaceUpdateOne) SetPackage(p *PackageType) *PackageNamespaceUpdateOne { return pnuo.SetPackageID(p.ID) diff --git a/pkg/assembler/backends/ent/packagetype_update.go b/pkg/assembler/backends/ent/packagetype_update.go index 0bdc72c6b4..a40c1343db 100644 --- a/pkg/assembler/backends/ent/packagetype_update.go +++ b/pkg/assembler/backends/ent/packagetype_update.go @@ -34,6 +34,14 @@ func (ptu *PackageTypeUpdate) SetType(s string) *PackageTypeUpdate { return ptu } +// SetNillableType sets the "type" field if the given value is not nil. +func (ptu *PackageTypeUpdate) SetNillableType(s *string) *PackageTypeUpdate { + if s != nil { + ptu.SetType(*s) + } + return ptu +} + // AddNamespaceIDs adds the "namespaces" edge to the PackageNamespace entity by IDs. func (ptu *PackageTypeUpdate) AddNamespaceIDs(ids ...int) *PackageTypeUpdate { ptu.mutation.AddNamespaceIDs(ids...) @@ -198,6 +206,14 @@ func (ptuo *PackageTypeUpdateOne) SetType(s string) *PackageTypeUpdateOne { return ptuo } +// SetNillableType sets the "type" field if the given value is not nil. +func (ptuo *PackageTypeUpdateOne) SetNillableType(s *string) *PackageTypeUpdateOne { + if s != nil { + ptuo.SetType(*s) + } + return ptuo +} + // AddNamespaceIDs adds the "namespaces" edge to the PackageNamespace entity by IDs. func (ptuo *PackageTypeUpdateOne) AddNamespaceIDs(ids ...int) *PackageTypeUpdateOne { ptuo.mutation.AddNamespaceIDs(ids...) diff --git a/pkg/assembler/backends/ent/packageversion_update.go b/pkg/assembler/backends/ent/packageversion_update.go index 22179d2129..810e955b50 100644 --- a/pkg/assembler/backends/ent/packageversion_update.go +++ b/pkg/assembler/backends/ent/packageversion_update.go @@ -39,6 +39,14 @@ func (pvu *PackageVersionUpdate) SetNameID(i int) *PackageVersionUpdate { return pvu } +// SetNillableNameID sets the "name_id" field if the given value is not nil. +func (pvu *PackageVersionUpdate) SetNillableNameID(i *int) *PackageVersionUpdate { + if i != nil { + pvu.SetNameID(*i) + } + return pvu +} + // SetVersion sets the "version" field. func (pvu *PackageVersionUpdate) SetVersion(s string) *PackageVersionUpdate { pvu.mutation.SetVersion(s) @@ -91,6 +99,14 @@ func (pvu *PackageVersionUpdate) SetHash(s string) *PackageVersionUpdate { return pvu } +// SetNillableHash sets the "hash" field if the given value is not nil. +func (pvu *PackageVersionUpdate) SetNillableHash(s *string) *PackageVersionUpdate { + if s != nil { + pvu.SetHash(*s) + } + return pvu +} + // SetName sets the "name" edge to the PackageName entity. func (pvu *PackageVersionUpdate) SetName(p *PackageName) *PackageVersionUpdate { return pvu.SetNameID(p.ID) @@ -472,6 +488,14 @@ func (pvuo *PackageVersionUpdateOne) SetNameID(i int) *PackageVersionUpdateOne { return pvuo } +// SetNillableNameID sets the "name_id" field if the given value is not nil. +func (pvuo *PackageVersionUpdateOne) SetNillableNameID(i *int) *PackageVersionUpdateOne { + if i != nil { + pvuo.SetNameID(*i) + } + return pvuo +} + // SetVersion sets the "version" field. func (pvuo *PackageVersionUpdateOne) SetVersion(s string) *PackageVersionUpdateOne { pvuo.mutation.SetVersion(s) @@ -524,6 +548,14 @@ func (pvuo *PackageVersionUpdateOne) SetHash(s string) *PackageVersionUpdateOne return pvuo } +// SetNillableHash sets the "hash" field if the given value is not nil. +func (pvuo *PackageVersionUpdateOne) SetNillableHash(s *string) *PackageVersionUpdateOne { + if s != nil { + pvuo.SetHash(*s) + } + return pvuo +} + // SetName sets the "name" edge to the PackageName entity. func (pvuo *PackageVersionUpdateOne) SetName(p *PackageName) *PackageVersionUpdateOne { return pvuo.SetNameID(p.ID) diff --git a/pkg/assembler/backends/ent/pkgequal_update.go b/pkg/assembler/backends/ent/pkgequal_update.go index 7b7193188b..a46eb309a2 100644 --- a/pkg/assembler/backends/ent/pkgequal_update.go +++ b/pkg/assembler/backends/ent/pkgequal_update.go @@ -34,24 +34,56 @@ func (peu *PkgEqualUpdate) SetOrigin(s string) *PkgEqualUpdate { return peu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (peu *PkgEqualUpdate) SetNillableOrigin(s *string) *PkgEqualUpdate { + if s != nil { + peu.SetOrigin(*s) + } + return peu +} + // SetCollector sets the "collector" field. func (peu *PkgEqualUpdate) SetCollector(s string) *PkgEqualUpdate { peu.mutation.SetCollector(s) return peu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (peu *PkgEqualUpdate) SetNillableCollector(s *string) *PkgEqualUpdate { + if s != nil { + peu.SetCollector(*s) + } + return peu +} + // SetJustification sets the "justification" field. func (peu *PkgEqualUpdate) SetJustification(s string) *PkgEqualUpdate { peu.mutation.SetJustification(s) return peu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (peu *PkgEqualUpdate) SetNillableJustification(s *string) *PkgEqualUpdate { + if s != nil { + peu.SetJustification(*s) + } + return peu +} + // SetPackagesHash sets the "packages_hash" field. func (peu *PkgEqualUpdate) SetPackagesHash(s string) *PkgEqualUpdate { peu.mutation.SetPackagesHash(s) return peu } +// SetNillablePackagesHash sets the "packages_hash" field if the given value is not nil. +func (peu *PkgEqualUpdate) SetNillablePackagesHash(s *string) *PkgEqualUpdate { + if s != nil { + peu.SetPackagesHash(*s) + } + return peu +} + // AddPackageIDs adds the "packages" edge to the PackageVersion entity by IDs. func (peu *PkgEqualUpdate) AddPackageIDs(ids ...int) *PkgEqualUpdate { peu.mutation.AddPackageIDs(ids...) @@ -212,24 +244,56 @@ func (peuo *PkgEqualUpdateOne) SetOrigin(s string) *PkgEqualUpdateOne { return peuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (peuo *PkgEqualUpdateOne) SetNillableOrigin(s *string) *PkgEqualUpdateOne { + if s != nil { + peuo.SetOrigin(*s) + } + return peuo +} + // SetCollector sets the "collector" field. func (peuo *PkgEqualUpdateOne) SetCollector(s string) *PkgEqualUpdateOne { peuo.mutation.SetCollector(s) return peuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (peuo *PkgEqualUpdateOne) SetNillableCollector(s *string) *PkgEqualUpdateOne { + if s != nil { + peuo.SetCollector(*s) + } + return peuo +} + // SetJustification sets the "justification" field. func (peuo *PkgEqualUpdateOne) SetJustification(s string) *PkgEqualUpdateOne { peuo.mutation.SetJustification(s) return peuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (peuo *PkgEqualUpdateOne) SetNillableJustification(s *string) *PkgEqualUpdateOne { + if s != nil { + peuo.SetJustification(*s) + } + return peuo +} + // SetPackagesHash sets the "packages_hash" field. func (peuo *PkgEqualUpdateOne) SetPackagesHash(s string) *PkgEqualUpdateOne { peuo.mutation.SetPackagesHash(s) return peuo } +// SetNillablePackagesHash sets the "packages_hash" field if the given value is not nil. +func (peuo *PkgEqualUpdateOne) SetNillablePackagesHash(s *string) *PkgEqualUpdateOne { + if s != nil { + peuo.SetPackagesHash(*s) + } + return peuo +} + // AddPackageIDs adds the "packages" edge to the PackageVersion entity by IDs. func (peuo *PkgEqualUpdateOne) AddPackageIDs(ids ...int) *PkgEqualUpdateOne { peuo.mutation.AddPackageIDs(ids...) diff --git a/pkg/assembler/backends/ent/pointofcontact_update.go b/pkg/assembler/backends/ent/pointofcontact_update.go index 4d8a576fac..c60273af3e 100644 --- a/pkg/assembler/backends/ent/pointofcontact_update.go +++ b/pkg/assembler/backends/ent/pointofcontact_update.go @@ -118,36 +118,84 @@ func (pocu *PointOfContactUpdate) SetEmail(s string) *PointOfContactUpdate { return pocu } +// SetNillableEmail sets the "email" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableEmail(s *string) *PointOfContactUpdate { + if s != nil { + pocu.SetEmail(*s) + } + return pocu +} + // SetInfo sets the "info" field. func (pocu *PointOfContactUpdate) SetInfo(s string) *PointOfContactUpdate { pocu.mutation.SetInfo(s) return pocu } +// SetNillableInfo sets the "info" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableInfo(s *string) *PointOfContactUpdate { + if s != nil { + pocu.SetInfo(*s) + } + return pocu +} + // SetSince sets the "since" field. func (pocu *PointOfContactUpdate) SetSince(t time.Time) *PointOfContactUpdate { pocu.mutation.SetSince(t) return pocu } +// SetNillableSince sets the "since" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableSince(t *time.Time) *PointOfContactUpdate { + if t != nil { + pocu.SetSince(*t) + } + return pocu +} + // SetJustification sets the "justification" field. func (pocu *PointOfContactUpdate) SetJustification(s string) *PointOfContactUpdate { pocu.mutation.SetJustification(s) return pocu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableJustification(s *string) *PointOfContactUpdate { + if s != nil { + pocu.SetJustification(*s) + } + return pocu +} + // SetOrigin sets the "origin" field. func (pocu *PointOfContactUpdate) SetOrigin(s string) *PointOfContactUpdate { pocu.mutation.SetOrigin(s) return pocu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableOrigin(s *string) *PointOfContactUpdate { + if s != nil { + pocu.SetOrigin(*s) + } + return pocu +} + // SetCollector sets the "collector" field. func (pocu *PointOfContactUpdate) SetCollector(s string) *PointOfContactUpdate { pocu.mutation.SetCollector(s) return pocu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (pocu *PointOfContactUpdate) SetNillableCollector(s *string) *PointOfContactUpdate { + if s != nil { + pocu.SetCollector(*s) + } + return pocu +} + // SetSource sets the "source" edge to the SourceName entity. func (pocu *PointOfContactUpdate) SetSource(s *SourceName) *PointOfContactUpdate { return pocu.SetSourceID(s.ID) @@ -487,36 +535,84 @@ func (pocuo *PointOfContactUpdateOne) SetEmail(s string) *PointOfContactUpdateOn return pocuo } +// SetNillableEmail sets the "email" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableEmail(s *string) *PointOfContactUpdateOne { + if s != nil { + pocuo.SetEmail(*s) + } + return pocuo +} + // SetInfo sets the "info" field. func (pocuo *PointOfContactUpdateOne) SetInfo(s string) *PointOfContactUpdateOne { pocuo.mutation.SetInfo(s) return pocuo } +// SetNillableInfo sets the "info" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableInfo(s *string) *PointOfContactUpdateOne { + if s != nil { + pocuo.SetInfo(*s) + } + return pocuo +} + // SetSince sets the "since" field. func (pocuo *PointOfContactUpdateOne) SetSince(t time.Time) *PointOfContactUpdateOne { pocuo.mutation.SetSince(t) return pocuo } +// SetNillableSince sets the "since" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableSince(t *time.Time) *PointOfContactUpdateOne { + if t != nil { + pocuo.SetSince(*t) + } + return pocuo +} + // SetJustification sets the "justification" field. func (pocuo *PointOfContactUpdateOne) SetJustification(s string) *PointOfContactUpdateOne { pocuo.mutation.SetJustification(s) return pocuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableJustification(s *string) *PointOfContactUpdateOne { + if s != nil { + pocuo.SetJustification(*s) + } + return pocuo +} + // SetOrigin sets the "origin" field. func (pocuo *PointOfContactUpdateOne) SetOrigin(s string) *PointOfContactUpdateOne { pocuo.mutation.SetOrigin(s) return pocuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableOrigin(s *string) *PointOfContactUpdateOne { + if s != nil { + pocuo.SetOrigin(*s) + } + return pocuo +} + // SetCollector sets the "collector" field. func (pocuo *PointOfContactUpdateOne) SetCollector(s string) *PointOfContactUpdateOne { pocuo.mutation.SetCollector(s) return pocuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (pocuo *PointOfContactUpdateOne) SetNillableCollector(s *string) *PointOfContactUpdateOne { + if s != nil { + pocuo.SetCollector(*s) + } + return pocuo +} + // SetSource sets the "source" edge to the SourceName entity. func (pocuo *PointOfContactUpdateOne) SetSource(s *SourceName) *PointOfContactUpdateOne { return pocuo.SetSourceID(s.ID) diff --git a/pkg/assembler/backends/ent/runtime/runtime.go b/pkg/assembler/backends/ent/runtime/runtime.go index 77a3f2c53c..50fc263991 100644 --- a/pkg/assembler/backends/ent/runtime/runtime.go +++ b/pkg/assembler/backends/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in github.com/guacsec/guac/pkg/assembler/backends/ent/runtime.go const ( - Version = "v0.12.4" // Version of ent codegen. - Sum = "h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=" // Sum of ent codegen. + Version = "v0.12.5" // Version of ent codegen. + Sum = "h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4=" // Sum of ent codegen. ) diff --git a/pkg/assembler/backends/ent/scorecard_update.go b/pkg/assembler/backends/ent/scorecard_update.go index 412a5295f7..0206f353d7 100644 --- a/pkg/assembler/backends/ent/scorecard_update.go +++ b/pkg/assembler/backends/ent/scorecard_update.go @@ -84,24 +84,56 @@ func (su *ScorecardUpdate) SetScorecardVersion(s string) *ScorecardUpdate { return su } +// SetNillableScorecardVersion sets the "scorecard_version" field if the given value is not nil. +func (su *ScorecardUpdate) SetNillableScorecardVersion(s *string) *ScorecardUpdate { + if s != nil { + su.SetScorecardVersion(*s) + } + return su +} + // SetScorecardCommit sets the "scorecard_commit" field. func (su *ScorecardUpdate) SetScorecardCommit(s string) *ScorecardUpdate { su.mutation.SetScorecardCommit(s) return su } +// SetNillableScorecardCommit sets the "scorecard_commit" field if the given value is not nil. +func (su *ScorecardUpdate) SetNillableScorecardCommit(s *string) *ScorecardUpdate { + if s != nil { + su.SetScorecardCommit(*s) + } + return su +} + // SetOrigin sets the "origin" field. func (su *ScorecardUpdate) SetOrigin(s string) *ScorecardUpdate { su.mutation.SetOrigin(s) return su } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (su *ScorecardUpdate) SetNillableOrigin(s *string) *ScorecardUpdate { + if s != nil { + su.SetOrigin(*s) + } + return su +} + // SetCollector sets the "collector" field. func (su *ScorecardUpdate) SetCollector(s string) *ScorecardUpdate { su.mutation.SetCollector(s) return su } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (su *ScorecardUpdate) SetNillableCollector(s *string) *ScorecardUpdate { + if s != nil { + su.SetCollector(*s) + } + return su +} + // AddCertificationIDs adds the "certifications" edge to the CertifyScorecard entity by IDs. func (su *ScorecardUpdate) AddCertificationIDs(ids ...int) *ScorecardUpdate { su.mutation.AddCertificationIDs(ids...) @@ -326,24 +358,56 @@ func (suo *ScorecardUpdateOne) SetScorecardVersion(s string) *ScorecardUpdateOne return suo } +// SetNillableScorecardVersion sets the "scorecard_version" field if the given value is not nil. +func (suo *ScorecardUpdateOne) SetNillableScorecardVersion(s *string) *ScorecardUpdateOne { + if s != nil { + suo.SetScorecardVersion(*s) + } + return suo +} + // SetScorecardCommit sets the "scorecard_commit" field. func (suo *ScorecardUpdateOne) SetScorecardCommit(s string) *ScorecardUpdateOne { suo.mutation.SetScorecardCommit(s) return suo } +// SetNillableScorecardCommit sets the "scorecard_commit" field if the given value is not nil. +func (suo *ScorecardUpdateOne) SetNillableScorecardCommit(s *string) *ScorecardUpdateOne { + if s != nil { + suo.SetScorecardCommit(*s) + } + return suo +} + // SetOrigin sets the "origin" field. func (suo *ScorecardUpdateOne) SetOrigin(s string) *ScorecardUpdateOne { suo.mutation.SetOrigin(s) return suo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (suo *ScorecardUpdateOne) SetNillableOrigin(s *string) *ScorecardUpdateOne { + if s != nil { + suo.SetOrigin(*s) + } + return suo +} + // SetCollector sets the "collector" field. func (suo *ScorecardUpdateOne) SetCollector(s string) *ScorecardUpdateOne { suo.mutation.SetCollector(s) return suo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (suo *ScorecardUpdateOne) SetNillableCollector(s *string) *ScorecardUpdateOne { + if s != nil { + suo.SetCollector(*s) + } + return suo +} + // AddCertificationIDs adds the "certifications" edge to the CertifyScorecard entity by IDs. func (suo *ScorecardUpdateOne) AddCertificationIDs(ids ...int) *ScorecardUpdateOne { suo.mutation.AddCertificationIDs(ids...) diff --git a/pkg/assembler/backends/ent/slsaattestation_update.go b/pkg/assembler/backends/ent/slsaattestation_update.go index e166663552..208d4eebae 100644 --- a/pkg/assembler/backends/ent/slsaattestation_update.go +++ b/pkg/assembler/backends/ent/slsaattestation_update.go @@ -38,18 +38,42 @@ func (sau *SLSAAttestationUpdate) SetBuildType(s string) *SLSAAttestationUpdate return sau } +// SetNillableBuildType sets the "build_type" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableBuildType(s *string) *SLSAAttestationUpdate { + if s != nil { + sau.SetBuildType(*s) + } + return sau +} + // SetBuiltByID sets the "built_by_id" field. func (sau *SLSAAttestationUpdate) SetBuiltByID(i int) *SLSAAttestationUpdate { sau.mutation.SetBuiltByID(i) return sau } +// SetNillableBuiltByID sets the "built_by_id" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableBuiltByID(i *int) *SLSAAttestationUpdate { + if i != nil { + sau.SetBuiltByID(*i) + } + return sau +} + // SetSubjectID sets the "subject_id" field. func (sau *SLSAAttestationUpdate) SetSubjectID(i int) *SLSAAttestationUpdate { sau.mutation.SetSubjectID(i) return sau } +// SetNillableSubjectID sets the "subject_id" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableSubjectID(i *int) *SLSAAttestationUpdate { + if i != nil { + sau.SetSubjectID(*i) + } + return sau +} + // SetSlsaPredicate sets the "slsa_predicate" field. func (sau *SLSAAttestationUpdate) SetSlsaPredicate(mp []*model.SLSAPredicate) *SLSAAttestationUpdate { sau.mutation.SetSlsaPredicate(mp) @@ -74,6 +98,14 @@ func (sau *SLSAAttestationUpdate) SetSlsaVersion(s string) *SLSAAttestationUpdat return sau } +// SetNillableSlsaVersion sets the "slsa_version" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableSlsaVersion(s *string) *SLSAAttestationUpdate { + if s != nil { + sau.SetSlsaVersion(*s) + } + return sau +} + // SetStartedOn sets the "started_on" field. func (sau *SLSAAttestationUpdate) SetStartedOn(t time.Time) *SLSAAttestationUpdate { sau.mutation.SetStartedOn(t) @@ -120,18 +152,42 @@ func (sau *SLSAAttestationUpdate) SetOrigin(s string) *SLSAAttestationUpdate { return sau } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableOrigin(s *string) *SLSAAttestationUpdate { + if s != nil { + sau.SetOrigin(*s) + } + return sau +} + // SetCollector sets the "collector" field. func (sau *SLSAAttestationUpdate) SetCollector(s string) *SLSAAttestationUpdate { sau.mutation.SetCollector(s) return sau } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableCollector(s *string) *SLSAAttestationUpdate { + if s != nil { + sau.SetCollector(*s) + } + return sau +} + // SetBuiltFromHash sets the "built_from_hash" field. func (sau *SLSAAttestationUpdate) SetBuiltFromHash(s string) *SLSAAttestationUpdate { sau.mutation.SetBuiltFromHash(s) return sau } +// SetNillableBuiltFromHash sets the "built_from_hash" field if the given value is not nil. +func (sau *SLSAAttestationUpdate) SetNillableBuiltFromHash(s *string) *SLSAAttestationUpdate { + if s != nil { + sau.SetBuiltFromHash(*s) + } + return sau +} + // AddBuiltFromIDs adds the "built_from" edge to the Artifact entity by IDs. func (sau *SLSAAttestationUpdate) AddBuiltFromIDs(ids ...int) *SLSAAttestationUpdate { sau.mutation.AddBuiltFromIDs(ids...) @@ -412,18 +468,42 @@ func (sauo *SLSAAttestationUpdateOne) SetBuildType(s string) *SLSAAttestationUpd return sauo } +// SetNillableBuildType sets the "build_type" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableBuildType(s *string) *SLSAAttestationUpdateOne { + if s != nil { + sauo.SetBuildType(*s) + } + return sauo +} + // SetBuiltByID sets the "built_by_id" field. func (sauo *SLSAAttestationUpdateOne) SetBuiltByID(i int) *SLSAAttestationUpdateOne { sauo.mutation.SetBuiltByID(i) return sauo } +// SetNillableBuiltByID sets the "built_by_id" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableBuiltByID(i *int) *SLSAAttestationUpdateOne { + if i != nil { + sauo.SetBuiltByID(*i) + } + return sauo +} + // SetSubjectID sets the "subject_id" field. func (sauo *SLSAAttestationUpdateOne) SetSubjectID(i int) *SLSAAttestationUpdateOne { sauo.mutation.SetSubjectID(i) return sauo } +// SetNillableSubjectID sets the "subject_id" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableSubjectID(i *int) *SLSAAttestationUpdateOne { + if i != nil { + sauo.SetSubjectID(*i) + } + return sauo +} + // SetSlsaPredicate sets the "slsa_predicate" field. func (sauo *SLSAAttestationUpdateOne) SetSlsaPredicate(mp []*model.SLSAPredicate) *SLSAAttestationUpdateOne { sauo.mutation.SetSlsaPredicate(mp) @@ -448,6 +528,14 @@ func (sauo *SLSAAttestationUpdateOne) SetSlsaVersion(s string) *SLSAAttestationU return sauo } +// SetNillableSlsaVersion sets the "slsa_version" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableSlsaVersion(s *string) *SLSAAttestationUpdateOne { + if s != nil { + sauo.SetSlsaVersion(*s) + } + return sauo +} + // SetStartedOn sets the "started_on" field. func (sauo *SLSAAttestationUpdateOne) SetStartedOn(t time.Time) *SLSAAttestationUpdateOne { sauo.mutation.SetStartedOn(t) @@ -494,18 +582,42 @@ func (sauo *SLSAAttestationUpdateOne) SetOrigin(s string) *SLSAAttestationUpdate return sauo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableOrigin(s *string) *SLSAAttestationUpdateOne { + if s != nil { + sauo.SetOrigin(*s) + } + return sauo +} + // SetCollector sets the "collector" field. func (sauo *SLSAAttestationUpdateOne) SetCollector(s string) *SLSAAttestationUpdateOne { sauo.mutation.SetCollector(s) return sauo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableCollector(s *string) *SLSAAttestationUpdateOne { + if s != nil { + sauo.SetCollector(*s) + } + return sauo +} + // SetBuiltFromHash sets the "built_from_hash" field. func (sauo *SLSAAttestationUpdateOne) SetBuiltFromHash(s string) *SLSAAttestationUpdateOne { sauo.mutation.SetBuiltFromHash(s) return sauo } +// SetNillableBuiltFromHash sets the "built_from_hash" field if the given value is not nil. +func (sauo *SLSAAttestationUpdateOne) SetNillableBuiltFromHash(s *string) *SLSAAttestationUpdateOne { + if s != nil { + sauo.SetBuiltFromHash(*s) + } + return sauo +} + // AddBuiltFromIDs adds the "built_from" edge to the Artifact entity by IDs. func (sauo *SLSAAttestationUpdateOne) AddBuiltFromIDs(ids ...int) *SLSAAttestationUpdateOne { sauo.mutation.AddBuiltFromIDs(ids...) diff --git a/pkg/assembler/backends/ent/sourcename_update.go b/pkg/assembler/backends/ent/sourcename_update.go index 1c296b34a1..fc579b9b5c 100644 --- a/pkg/assembler/backends/ent/sourcename_update.go +++ b/pkg/assembler/backends/ent/sourcename_update.go @@ -35,6 +35,14 @@ func (snu *SourceNameUpdate) SetName(s string) *SourceNameUpdate { return snu } +// SetNillableName sets the "name" field if the given value is not nil. +func (snu *SourceNameUpdate) SetNillableName(s *string) *SourceNameUpdate { + if s != nil { + snu.SetName(*s) + } + return snu +} + // SetCommit sets the "commit" field. func (snu *SourceNameUpdate) SetCommit(s string) *SourceNameUpdate { snu.mutation.SetCommit(s) @@ -81,6 +89,14 @@ func (snu *SourceNameUpdate) SetNamespaceID(i int) *SourceNameUpdate { return snu } +// SetNillableNamespaceID sets the "namespace_id" field if the given value is not nil. +func (snu *SourceNameUpdate) SetNillableNamespaceID(i *int) *SourceNameUpdate { + if i != nil { + snu.SetNamespaceID(*i) + } + return snu +} + // SetNamespace sets the "namespace" edge to the SourceNamespace entity. func (snu *SourceNameUpdate) SetNamespace(s *SourceNamespace) *SourceNameUpdate { return snu.SetNamespaceID(s.ID) @@ -295,6 +311,14 @@ func (snuo *SourceNameUpdateOne) SetName(s string) *SourceNameUpdateOne { return snuo } +// SetNillableName sets the "name" field if the given value is not nil. +func (snuo *SourceNameUpdateOne) SetNillableName(s *string) *SourceNameUpdateOne { + if s != nil { + snuo.SetName(*s) + } + return snuo +} + // SetCommit sets the "commit" field. func (snuo *SourceNameUpdateOne) SetCommit(s string) *SourceNameUpdateOne { snuo.mutation.SetCommit(s) @@ -341,6 +365,14 @@ func (snuo *SourceNameUpdateOne) SetNamespaceID(i int) *SourceNameUpdateOne { return snuo } +// SetNillableNamespaceID sets the "namespace_id" field if the given value is not nil. +func (snuo *SourceNameUpdateOne) SetNillableNamespaceID(i *int) *SourceNameUpdateOne { + if i != nil { + snuo.SetNamespaceID(*i) + } + return snuo +} + // SetNamespace sets the "namespace" edge to the SourceNamespace entity. func (snuo *SourceNameUpdateOne) SetNamespace(s *SourceNamespace) *SourceNameUpdateOne { return snuo.SetNamespaceID(s.ID) diff --git a/pkg/assembler/backends/ent/sourcenamespace_update.go b/pkg/assembler/backends/ent/sourcenamespace_update.go index 46fbcf9980..dce50fce74 100644 --- a/pkg/assembler/backends/ent/sourcenamespace_update.go +++ b/pkg/assembler/backends/ent/sourcenamespace_update.go @@ -35,12 +35,28 @@ func (snu *SourceNamespaceUpdate) SetNamespace(s string) *SourceNamespaceUpdate return snu } +// SetNillableNamespace sets the "namespace" field if the given value is not nil. +func (snu *SourceNamespaceUpdate) SetNillableNamespace(s *string) *SourceNamespaceUpdate { + if s != nil { + snu.SetNamespace(*s) + } + return snu +} + // SetSourceID sets the "source_id" field. func (snu *SourceNamespaceUpdate) SetSourceID(i int) *SourceNamespaceUpdate { snu.mutation.SetSourceID(i) return snu } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (snu *SourceNamespaceUpdate) SetNillableSourceID(i *int) *SourceNamespaceUpdate { + if i != nil { + snu.SetSourceID(*i) + } + return snu +} + // SetSourceTypeID sets the "source_type" edge to the SourceType entity by ID. func (snu *SourceNamespaceUpdate) SetSourceTypeID(id int) *SourceNamespaceUpdate { snu.mutation.SetSourceTypeID(id) @@ -249,12 +265,28 @@ func (snuo *SourceNamespaceUpdateOne) SetNamespace(s string) *SourceNamespaceUpd return snuo } +// SetNillableNamespace sets the "namespace" field if the given value is not nil. +func (snuo *SourceNamespaceUpdateOne) SetNillableNamespace(s *string) *SourceNamespaceUpdateOne { + if s != nil { + snuo.SetNamespace(*s) + } + return snuo +} + // SetSourceID sets the "source_id" field. func (snuo *SourceNamespaceUpdateOne) SetSourceID(i int) *SourceNamespaceUpdateOne { snuo.mutation.SetSourceID(i) return snuo } +// SetNillableSourceID sets the "source_id" field if the given value is not nil. +func (snuo *SourceNamespaceUpdateOne) SetNillableSourceID(i *int) *SourceNamespaceUpdateOne { + if i != nil { + snuo.SetSourceID(*i) + } + return snuo +} + // SetSourceTypeID sets the "source_type" edge to the SourceType entity by ID. func (snuo *SourceNamespaceUpdateOne) SetSourceTypeID(id int) *SourceNamespaceUpdateOne { snuo.mutation.SetSourceTypeID(id) diff --git a/pkg/assembler/backends/ent/sourcetype_update.go b/pkg/assembler/backends/ent/sourcetype_update.go index 344a6c82ee..99ac929561 100644 --- a/pkg/assembler/backends/ent/sourcetype_update.go +++ b/pkg/assembler/backends/ent/sourcetype_update.go @@ -34,6 +34,14 @@ func (stu *SourceTypeUpdate) SetType(s string) *SourceTypeUpdate { return stu } +// SetNillableType sets the "type" field if the given value is not nil. +func (stu *SourceTypeUpdate) SetNillableType(s *string) *SourceTypeUpdate { + if s != nil { + stu.SetType(*s) + } + return stu +} + // AddNamespaceIDs adds the "namespaces" edge to the SourceNamespace entity by IDs. func (stu *SourceTypeUpdate) AddNamespaceIDs(ids ...int) *SourceTypeUpdate { stu.mutation.AddNamespaceIDs(ids...) @@ -185,6 +193,14 @@ func (stuo *SourceTypeUpdateOne) SetType(s string) *SourceTypeUpdateOne { return stuo } +// SetNillableType sets the "type" field if the given value is not nil. +func (stuo *SourceTypeUpdateOne) SetNillableType(s *string) *SourceTypeUpdateOne { + if s != nil { + stuo.SetType(*s) + } + return stuo +} + // AddNamespaceIDs adds the "namespaces" edge to the SourceNamespace entity by IDs. func (stuo *SourceTypeUpdateOne) AddNamespaceIDs(ids ...int) *SourceTypeUpdateOne { stuo.mutation.AddNamespaceIDs(ids...) diff --git a/pkg/assembler/backends/ent/vulnequal_update.go b/pkg/assembler/backends/ent/vulnequal_update.go index 0edd8c7f1c..500ef315da 100644 --- a/pkg/assembler/backends/ent/vulnequal_update.go +++ b/pkg/assembler/backends/ent/vulnequal_update.go @@ -34,18 +34,42 @@ func (veu *VulnEqualUpdate) SetJustification(s string) *VulnEqualUpdate { return veu } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (veu *VulnEqualUpdate) SetNillableJustification(s *string) *VulnEqualUpdate { + if s != nil { + veu.SetJustification(*s) + } + return veu +} + // SetOrigin sets the "origin" field. func (veu *VulnEqualUpdate) SetOrigin(s string) *VulnEqualUpdate { veu.mutation.SetOrigin(s) return veu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (veu *VulnEqualUpdate) SetNillableOrigin(s *string) *VulnEqualUpdate { + if s != nil { + veu.SetOrigin(*s) + } + return veu +} + // SetCollector sets the "collector" field. func (veu *VulnEqualUpdate) SetCollector(s string) *VulnEqualUpdate { veu.mutation.SetCollector(s) return veu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (veu *VulnEqualUpdate) SetNillableCollector(s *string) *VulnEqualUpdate { + if s != nil { + veu.SetCollector(*s) + } + return veu +} + // AddVulnerabilityIDIDs adds the "vulnerability_ids" edge to the VulnerabilityID entity by IDs. func (veu *VulnEqualUpdate) AddVulnerabilityIDIDs(ids ...int) *VulnEqualUpdate { veu.mutation.AddVulnerabilityIDIDs(ids...) @@ -203,18 +227,42 @@ func (veuo *VulnEqualUpdateOne) SetJustification(s string) *VulnEqualUpdateOne { return veuo } +// SetNillableJustification sets the "justification" field if the given value is not nil. +func (veuo *VulnEqualUpdateOne) SetNillableJustification(s *string) *VulnEqualUpdateOne { + if s != nil { + veuo.SetJustification(*s) + } + return veuo +} + // SetOrigin sets the "origin" field. func (veuo *VulnEqualUpdateOne) SetOrigin(s string) *VulnEqualUpdateOne { veuo.mutation.SetOrigin(s) return veuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (veuo *VulnEqualUpdateOne) SetNillableOrigin(s *string) *VulnEqualUpdateOne { + if s != nil { + veuo.SetOrigin(*s) + } + return veuo +} + // SetCollector sets the "collector" field. func (veuo *VulnEqualUpdateOne) SetCollector(s string) *VulnEqualUpdateOne { veuo.mutation.SetCollector(s) return veuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (veuo *VulnEqualUpdateOne) SetNillableCollector(s *string) *VulnEqualUpdateOne { + if s != nil { + veuo.SetCollector(*s) + } + return veuo +} + // AddVulnerabilityIDIDs adds the "vulnerability_ids" edge to the VulnerabilityID entity by IDs. func (veuo *VulnEqualUpdateOne) AddVulnerabilityIDIDs(ids ...int) *VulnEqualUpdateOne { veuo.mutation.AddVulnerabilityIDIDs(ids...) diff --git a/pkg/assembler/backends/ent/vulnerabilityid_update.go b/pkg/assembler/backends/ent/vulnerabilityid_update.go index 06e0901bad..13df93763a 100644 --- a/pkg/assembler/backends/ent/vulnerabilityid_update.go +++ b/pkg/assembler/backends/ent/vulnerabilityid_update.go @@ -36,12 +36,28 @@ func (viu *VulnerabilityIDUpdate) SetVulnerabilityID(s string) *VulnerabilityIDU return viu } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (viu *VulnerabilityIDUpdate) SetNillableVulnerabilityID(s *string) *VulnerabilityIDUpdate { + if s != nil { + viu.SetVulnerabilityID(*s) + } + return viu +} + // SetTypeID sets the "type_id" field. func (viu *VulnerabilityIDUpdate) SetTypeID(i int) *VulnerabilityIDUpdate { viu.mutation.SetTypeID(i) return viu } +// SetNillableTypeID sets the "type_id" field if the given value is not nil. +func (viu *VulnerabilityIDUpdate) SetNillableTypeID(i *int) *VulnerabilityIDUpdate { + if i != nil { + viu.SetTypeID(*i) + } + return viu +} + // SetType sets the "type" edge to the VulnerabilityType entity. func (viu *VulnerabilityIDUpdate) SetType(v *VulnerabilityType) *VulnerabilityIDUpdate { return viu.SetTypeID(v.ID) @@ -325,12 +341,28 @@ func (viuo *VulnerabilityIDUpdateOne) SetVulnerabilityID(s string) *Vulnerabilit return viuo } +// SetNillableVulnerabilityID sets the "vulnerability_id" field if the given value is not nil. +func (viuo *VulnerabilityIDUpdateOne) SetNillableVulnerabilityID(s *string) *VulnerabilityIDUpdateOne { + if s != nil { + viuo.SetVulnerabilityID(*s) + } + return viuo +} + // SetTypeID sets the "type_id" field. func (viuo *VulnerabilityIDUpdateOne) SetTypeID(i int) *VulnerabilityIDUpdateOne { viuo.mutation.SetTypeID(i) return viuo } +// SetNillableTypeID sets the "type_id" field if the given value is not nil. +func (viuo *VulnerabilityIDUpdateOne) SetNillableTypeID(i *int) *VulnerabilityIDUpdateOne { + if i != nil { + viuo.SetTypeID(*i) + } + return viuo +} + // SetType sets the "type" edge to the VulnerabilityType entity. func (viuo *VulnerabilityIDUpdateOne) SetType(v *VulnerabilityType) *VulnerabilityIDUpdateOne { return viuo.SetTypeID(v.ID) diff --git a/pkg/assembler/backends/ent/vulnerabilitymetadata_update.go b/pkg/assembler/backends/ent/vulnerabilitymetadata_update.go index c88bc739a5..8819e9edd1 100644 --- a/pkg/assembler/backends/ent/vulnerabilitymetadata_update.go +++ b/pkg/assembler/backends/ent/vulnerabilitymetadata_update.go @@ -35,12 +35,28 @@ func (vmu *VulnerabilityMetadataUpdate) SetVulnerabilityIDID(i int) *Vulnerabili return vmu } +// SetNillableVulnerabilityIDID sets the "vulnerability_id_id" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableVulnerabilityIDID(i *int) *VulnerabilityMetadataUpdate { + if i != nil { + vmu.SetVulnerabilityIDID(*i) + } + return vmu +} + // SetScoreType sets the "score_type" field. func (vmu *VulnerabilityMetadataUpdate) SetScoreType(vt vulnerabilitymetadata.ScoreType) *VulnerabilityMetadataUpdate { vmu.mutation.SetScoreType(vt) return vmu } +// SetNillableScoreType sets the "score_type" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableScoreType(vt *vulnerabilitymetadata.ScoreType) *VulnerabilityMetadataUpdate { + if vt != nil { + vmu.SetScoreType(*vt) + } + return vmu +} + // SetScoreValue sets the "score_value" field. func (vmu *VulnerabilityMetadataUpdate) SetScoreValue(f float64) *VulnerabilityMetadataUpdate { vmu.mutation.ResetScoreValue() @@ -48,6 +64,14 @@ func (vmu *VulnerabilityMetadataUpdate) SetScoreValue(f float64) *VulnerabilityM return vmu } +// SetNillableScoreValue sets the "score_value" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableScoreValue(f *float64) *VulnerabilityMetadataUpdate { + if f != nil { + vmu.SetScoreValue(*f) + } + return vmu +} + // AddScoreValue adds f to the "score_value" field. func (vmu *VulnerabilityMetadataUpdate) AddScoreValue(f float64) *VulnerabilityMetadataUpdate { vmu.mutation.AddScoreValue(f) @@ -60,18 +84,42 @@ func (vmu *VulnerabilityMetadataUpdate) SetTimestamp(t time.Time) *Vulnerability return vmu } +// SetNillableTimestamp sets the "timestamp" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableTimestamp(t *time.Time) *VulnerabilityMetadataUpdate { + if t != nil { + vmu.SetTimestamp(*t) + } + return vmu +} + // SetOrigin sets the "origin" field. func (vmu *VulnerabilityMetadataUpdate) SetOrigin(s string) *VulnerabilityMetadataUpdate { vmu.mutation.SetOrigin(s) return vmu } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableOrigin(s *string) *VulnerabilityMetadataUpdate { + if s != nil { + vmu.SetOrigin(*s) + } + return vmu +} + // SetCollector sets the "collector" field. func (vmu *VulnerabilityMetadataUpdate) SetCollector(s string) *VulnerabilityMetadataUpdate { vmu.mutation.SetCollector(s) return vmu } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (vmu *VulnerabilityMetadataUpdate) SetNillableCollector(s *string) *VulnerabilityMetadataUpdate { + if s != nil { + vmu.SetCollector(*s) + } + return vmu +} + // SetVulnerabilityID sets the "vulnerability_id" edge to the VulnerabilityID entity. func (vmu *VulnerabilityMetadataUpdate) SetVulnerabilityID(v *VulnerabilityID) *VulnerabilityMetadataUpdate { return vmu.SetVulnerabilityIDID(v.ID) @@ -213,12 +261,28 @@ func (vmuo *VulnerabilityMetadataUpdateOne) SetVulnerabilityIDID(i int) *Vulnera return vmuo } +// SetNillableVulnerabilityIDID sets the "vulnerability_id_id" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableVulnerabilityIDID(i *int) *VulnerabilityMetadataUpdateOne { + if i != nil { + vmuo.SetVulnerabilityIDID(*i) + } + return vmuo +} + // SetScoreType sets the "score_type" field. func (vmuo *VulnerabilityMetadataUpdateOne) SetScoreType(vt vulnerabilitymetadata.ScoreType) *VulnerabilityMetadataUpdateOne { vmuo.mutation.SetScoreType(vt) return vmuo } +// SetNillableScoreType sets the "score_type" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableScoreType(vt *vulnerabilitymetadata.ScoreType) *VulnerabilityMetadataUpdateOne { + if vt != nil { + vmuo.SetScoreType(*vt) + } + return vmuo +} + // SetScoreValue sets the "score_value" field. func (vmuo *VulnerabilityMetadataUpdateOne) SetScoreValue(f float64) *VulnerabilityMetadataUpdateOne { vmuo.mutation.ResetScoreValue() @@ -226,6 +290,14 @@ func (vmuo *VulnerabilityMetadataUpdateOne) SetScoreValue(f float64) *Vulnerabil return vmuo } +// SetNillableScoreValue sets the "score_value" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableScoreValue(f *float64) *VulnerabilityMetadataUpdateOne { + if f != nil { + vmuo.SetScoreValue(*f) + } + return vmuo +} + // AddScoreValue adds f to the "score_value" field. func (vmuo *VulnerabilityMetadataUpdateOne) AddScoreValue(f float64) *VulnerabilityMetadataUpdateOne { vmuo.mutation.AddScoreValue(f) @@ -238,18 +310,42 @@ func (vmuo *VulnerabilityMetadataUpdateOne) SetTimestamp(t time.Time) *Vulnerabi return vmuo } +// SetNillableTimestamp sets the "timestamp" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableTimestamp(t *time.Time) *VulnerabilityMetadataUpdateOne { + if t != nil { + vmuo.SetTimestamp(*t) + } + return vmuo +} + // SetOrigin sets the "origin" field. func (vmuo *VulnerabilityMetadataUpdateOne) SetOrigin(s string) *VulnerabilityMetadataUpdateOne { vmuo.mutation.SetOrigin(s) return vmuo } +// SetNillableOrigin sets the "origin" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableOrigin(s *string) *VulnerabilityMetadataUpdateOne { + if s != nil { + vmuo.SetOrigin(*s) + } + return vmuo +} + // SetCollector sets the "collector" field. func (vmuo *VulnerabilityMetadataUpdateOne) SetCollector(s string) *VulnerabilityMetadataUpdateOne { vmuo.mutation.SetCollector(s) return vmuo } +// SetNillableCollector sets the "collector" field if the given value is not nil. +func (vmuo *VulnerabilityMetadataUpdateOne) SetNillableCollector(s *string) *VulnerabilityMetadataUpdateOne { + if s != nil { + vmuo.SetCollector(*s) + } + return vmuo +} + // SetVulnerabilityID sets the "vulnerability_id" edge to the VulnerabilityID entity. func (vmuo *VulnerabilityMetadataUpdateOne) SetVulnerabilityID(v *VulnerabilityID) *VulnerabilityMetadataUpdateOne { return vmuo.SetVulnerabilityIDID(v.ID) diff --git a/pkg/assembler/backends/ent/vulnerabilitytype_update.go b/pkg/assembler/backends/ent/vulnerabilitytype_update.go index 22f0f857e9..0bed297e0c 100644 --- a/pkg/assembler/backends/ent/vulnerabilitytype_update.go +++ b/pkg/assembler/backends/ent/vulnerabilitytype_update.go @@ -34,6 +34,14 @@ func (vtu *VulnerabilityTypeUpdate) SetType(s string) *VulnerabilityTypeUpdate { return vtu } +// SetNillableType sets the "type" field if the given value is not nil. +func (vtu *VulnerabilityTypeUpdate) SetNillableType(s *string) *VulnerabilityTypeUpdate { + if s != nil { + vtu.SetType(*s) + } + return vtu +} + // AddVulnerabilityIDIDs adds the "vulnerability_ids" edge to the VulnerabilityID entity by IDs. func (vtu *VulnerabilityTypeUpdate) AddVulnerabilityIDIDs(ids ...int) *VulnerabilityTypeUpdate { vtu.mutation.AddVulnerabilityIDIDs(ids...) @@ -198,6 +206,14 @@ func (vtuo *VulnerabilityTypeUpdateOne) SetType(s string) *VulnerabilityTypeUpda return vtuo } +// SetNillableType sets the "type" field if the given value is not nil. +func (vtuo *VulnerabilityTypeUpdateOne) SetNillableType(s *string) *VulnerabilityTypeUpdateOne { + if s != nil { + vtuo.SetType(*s) + } + return vtuo +} + // AddVulnerabilityIDIDs adds the "vulnerability_ids" edge to the VulnerabilityID entity by IDs. func (vtuo *VulnerabilityTypeUpdateOne) AddVulnerabilityIDIDs(ids ...int) *VulnerabilityTypeUpdateOne { vtuo.mutation.AddVulnerabilityIDIDs(ids...)