| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "context"
- "errors"
- "fmt"
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "entgo.io/ent/schema/field"
- "github.com/Wei-Shaw/sub2api/ent/tlsfingerprintprofile"
- )
- // TLSFingerprintProfileCreate is the builder for creating a TLSFingerprintProfile entity.
- type TLSFingerprintProfileCreate struct {
- config
- mutation *TLSFingerprintProfileMutation
- hooks []Hook
- conflict []sql.ConflictOption
- }
- // SetCreatedAt sets the "created_at" field.
- func (_c *TLSFingerprintProfileCreate) SetCreatedAt(v time.Time) *TLSFingerprintProfileCreate {
- _c.mutation.SetCreatedAt(v)
- return _c
- }
- // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
- func (_c *TLSFingerprintProfileCreate) SetNillableCreatedAt(v *time.Time) *TLSFingerprintProfileCreate {
- if v != nil {
- _c.SetCreatedAt(*v)
- }
- return _c
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (_c *TLSFingerprintProfileCreate) SetUpdatedAt(v time.Time) *TLSFingerprintProfileCreate {
- _c.mutation.SetUpdatedAt(v)
- return _c
- }
- // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
- func (_c *TLSFingerprintProfileCreate) SetNillableUpdatedAt(v *time.Time) *TLSFingerprintProfileCreate {
- if v != nil {
- _c.SetUpdatedAt(*v)
- }
- return _c
- }
- // SetName sets the "name" field.
- func (_c *TLSFingerprintProfileCreate) SetName(v string) *TLSFingerprintProfileCreate {
- _c.mutation.SetName(v)
- return _c
- }
- // SetDescription sets the "description" field.
- func (_c *TLSFingerprintProfileCreate) SetDescription(v string) *TLSFingerprintProfileCreate {
- _c.mutation.SetDescription(v)
- return _c
- }
- // SetNillableDescription sets the "description" field if the given value is not nil.
- func (_c *TLSFingerprintProfileCreate) SetNillableDescription(v *string) *TLSFingerprintProfileCreate {
- if v != nil {
- _c.SetDescription(*v)
- }
- return _c
- }
- // SetEnableGrease sets the "enable_grease" field.
- func (_c *TLSFingerprintProfileCreate) SetEnableGrease(v bool) *TLSFingerprintProfileCreate {
- _c.mutation.SetEnableGrease(v)
- return _c
- }
- // SetNillableEnableGrease sets the "enable_grease" field if the given value is not nil.
- func (_c *TLSFingerprintProfileCreate) SetNillableEnableGrease(v *bool) *TLSFingerprintProfileCreate {
- if v != nil {
- _c.SetEnableGrease(*v)
- }
- return _c
- }
- // SetCipherSuites sets the "cipher_suites" field.
- func (_c *TLSFingerprintProfileCreate) SetCipherSuites(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetCipherSuites(v)
- return _c
- }
- // SetCurves sets the "curves" field.
- func (_c *TLSFingerprintProfileCreate) SetCurves(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetCurves(v)
- return _c
- }
- // SetPointFormats sets the "point_formats" field.
- func (_c *TLSFingerprintProfileCreate) SetPointFormats(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetPointFormats(v)
- return _c
- }
- // SetSignatureAlgorithms sets the "signature_algorithms" field.
- func (_c *TLSFingerprintProfileCreate) SetSignatureAlgorithms(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetSignatureAlgorithms(v)
- return _c
- }
- // SetAlpnProtocols sets the "alpn_protocols" field.
- func (_c *TLSFingerprintProfileCreate) SetAlpnProtocols(v []string) *TLSFingerprintProfileCreate {
- _c.mutation.SetAlpnProtocols(v)
- return _c
- }
- // SetSupportedVersions sets the "supported_versions" field.
- func (_c *TLSFingerprintProfileCreate) SetSupportedVersions(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetSupportedVersions(v)
- return _c
- }
- // SetKeyShareGroups sets the "key_share_groups" field.
- func (_c *TLSFingerprintProfileCreate) SetKeyShareGroups(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetKeyShareGroups(v)
- return _c
- }
- // SetPskModes sets the "psk_modes" field.
- func (_c *TLSFingerprintProfileCreate) SetPskModes(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetPskModes(v)
- return _c
- }
- // SetExtensions sets the "extensions" field.
- func (_c *TLSFingerprintProfileCreate) SetExtensions(v []uint16) *TLSFingerprintProfileCreate {
- _c.mutation.SetExtensions(v)
- return _c
- }
- // Mutation returns the TLSFingerprintProfileMutation object of the builder.
- func (_c *TLSFingerprintProfileCreate) Mutation() *TLSFingerprintProfileMutation {
- return _c.mutation
- }
- // Save creates the TLSFingerprintProfile in the database.
- func (_c *TLSFingerprintProfileCreate) Save(ctx context.Context) (*TLSFingerprintProfile, error) {
- _c.defaults()
- return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
- }
- // SaveX calls Save and panics if Save returns an error.
- func (_c *TLSFingerprintProfileCreate) SaveX(ctx context.Context) *TLSFingerprintProfile {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *TLSFingerprintProfileCreate) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *TLSFingerprintProfileCreate) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // defaults sets the default values of the builder before save.
- func (_c *TLSFingerprintProfileCreate) defaults() {
- if _, ok := _c.mutation.CreatedAt(); !ok {
- v := tlsfingerprintprofile.DefaultCreatedAt()
- _c.mutation.SetCreatedAt(v)
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- v := tlsfingerprintprofile.DefaultUpdatedAt()
- _c.mutation.SetUpdatedAt(v)
- }
- if _, ok := _c.mutation.EnableGrease(); !ok {
- v := tlsfingerprintprofile.DefaultEnableGrease
- _c.mutation.SetEnableGrease(v)
- }
- }
- // check runs all checks and user-defined validators on the builder.
- func (_c *TLSFingerprintProfileCreate) check() error {
- if _, ok := _c.mutation.CreatedAt(); !ok {
- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "TLSFingerprintProfile.created_at"`)}
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "TLSFingerprintProfile.updated_at"`)}
- }
- if _, ok := _c.mutation.Name(); !ok {
- return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "TLSFingerprintProfile.name"`)}
- }
- if v, ok := _c.mutation.Name(); ok {
- if err := tlsfingerprintprofile.NameValidator(v); err != nil {
- return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "TLSFingerprintProfile.name": %w`, err)}
- }
- }
- if _, ok := _c.mutation.EnableGrease(); !ok {
- return &ValidationError{Name: "enable_grease", err: errors.New(`ent: missing required field "TLSFingerprintProfile.enable_grease"`)}
- }
- return nil
- }
- func (_c *TLSFingerprintProfileCreate) sqlSave(ctx context.Context) (*TLSFingerprintProfile, error) {
- if err := _c.check(); err != nil {
- return nil, err
- }
- _node, _spec := _c.createSpec()
- if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- return nil, err
- }
- id := _spec.ID.Value.(int64)
- _node.ID = int64(id)
- _c.mutation.id = &_node.ID
- _c.mutation.done = true
- return _node, nil
- }
- func (_c *TLSFingerprintProfileCreate) createSpec() (*TLSFingerprintProfile, *sqlgraph.CreateSpec) {
- var (
- _node = &TLSFingerprintProfile{config: _c.config}
- _spec = sqlgraph.NewCreateSpec(tlsfingerprintprofile.Table, sqlgraph.NewFieldSpec(tlsfingerprintprofile.FieldID, field.TypeInt64))
- )
- _spec.OnConflict = _c.conflict
- if value, ok := _c.mutation.CreatedAt(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldCreatedAt, field.TypeTime, value)
- _node.CreatedAt = value
- }
- if value, ok := _c.mutation.UpdatedAt(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldUpdatedAt, field.TypeTime, value)
- _node.UpdatedAt = value
- }
- if value, ok := _c.mutation.Name(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldName, field.TypeString, value)
- _node.Name = value
- }
- if value, ok := _c.mutation.Description(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldDescription, field.TypeString, value)
- _node.Description = &value
- }
- if value, ok := _c.mutation.EnableGrease(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldEnableGrease, field.TypeBool, value)
- _node.EnableGrease = value
- }
- if value, ok := _c.mutation.CipherSuites(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldCipherSuites, field.TypeJSON, value)
- _node.CipherSuites = value
- }
- if value, ok := _c.mutation.Curves(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldCurves, field.TypeJSON, value)
- _node.Curves = value
- }
- if value, ok := _c.mutation.PointFormats(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldPointFormats, field.TypeJSON, value)
- _node.PointFormats = value
- }
- if value, ok := _c.mutation.SignatureAlgorithms(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldSignatureAlgorithms, field.TypeJSON, value)
- _node.SignatureAlgorithms = value
- }
- if value, ok := _c.mutation.AlpnProtocols(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldAlpnProtocols, field.TypeJSON, value)
- _node.AlpnProtocols = value
- }
- if value, ok := _c.mutation.SupportedVersions(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldSupportedVersions, field.TypeJSON, value)
- _node.SupportedVersions = value
- }
- if value, ok := _c.mutation.KeyShareGroups(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldKeyShareGroups, field.TypeJSON, value)
- _node.KeyShareGroups = value
- }
- if value, ok := _c.mutation.PskModes(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldPskModes, field.TypeJSON, value)
- _node.PskModes = value
- }
- if value, ok := _c.mutation.Extensions(); ok {
- _spec.SetField(tlsfingerprintprofile.FieldExtensions, field.TypeJSON, value)
- _node.Extensions = value
- }
- return _node, _spec
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.TLSFingerprintProfile.Create().
- // SetCreatedAt(v).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.TLSFingerprintProfileUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (_c *TLSFingerprintProfileCreate) OnConflict(opts ...sql.ConflictOption) *TLSFingerprintProfileUpsertOne {
- _c.conflict = opts
- return &TLSFingerprintProfileUpsertOne{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *TLSFingerprintProfileCreate) OnConflictColumns(columns ...string) *TLSFingerprintProfileUpsertOne {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &TLSFingerprintProfileUpsertOne{
- create: _c,
- }
- }
- type (
- // TLSFingerprintProfileUpsertOne is the builder for "upsert"-ing
- // one TLSFingerprintProfile node.
- TLSFingerprintProfileUpsertOne struct {
- create *TLSFingerprintProfileCreate
- }
- // TLSFingerprintProfileUpsert is the "OnConflict" setter.
- TLSFingerprintProfileUpsert struct {
- *sql.UpdateSet
- }
- )
- // SetUpdatedAt sets the "updated_at" field.
- func (u *TLSFingerprintProfileUpsert) SetUpdatedAt(v time.Time) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldUpdatedAt, v)
- return u
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateUpdatedAt() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldUpdatedAt)
- return u
- }
- // SetName sets the "name" field.
- func (u *TLSFingerprintProfileUpsert) SetName(v string) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldName, v)
- return u
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateName() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldName)
- return u
- }
- // SetDescription sets the "description" field.
- func (u *TLSFingerprintProfileUpsert) SetDescription(v string) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldDescription, v)
- return u
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateDescription() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldDescription)
- return u
- }
- // ClearDescription clears the value of the "description" field.
- func (u *TLSFingerprintProfileUpsert) ClearDescription() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldDescription)
- return u
- }
- // SetEnableGrease sets the "enable_grease" field.
- func (u *TLSFingerprintProfileUpsert) SetEnableGrease(v bool) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldEnableGrease, v)
- return u
- }
- // UpdateEnableGrease sets the "enable_grease" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateEnableGrease() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldEnableGrease)
- return u
- }
- // SetCipherSuites sets the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsert) SetCipherSuites(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldCipherSuites, v)
- return u
- }
- // UpdateCipherSuites sets the "cipher_suites" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateCipherSuites() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldCipherSuites)
- return u
- }
- // ClearCipherSuites clears the value of the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsert) ClearCipherSuites() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldCipherSuites)
- return u
- }
- // SetCurves sets the "curves" field.
- func (u *TLSFingerprintProfileUpsert) SetCurves(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldCurves, v)
- return u
- }
- // UpdateCurves sets the "curves" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateCurves() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldCurves)
- return u
- }
- // ClearCurves clears the value of the "curves" field.
- func (u *TLSFingerprintProfileUpsert) ClearCurves() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldCurves)
- return u
- }
- // SetPointFormats sets the "point_formats" field.
- func (u *TLSFingerprintProfileUpsert) SetPointFormats(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldPointFormats, v)
- return u
- }
- // UpdatePointFormats sets the "point_formats" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdatePointFormats() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldPointFormats)
- return u
- }
- // ClearPointFormats clears the value of the "point_formats" field.
- func (u *TLSFingerprintProfileUpsert) ClearPointFormats() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldPointFormats)
- return u
- }
- // SetSignatureAlgorithms sets the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsert) SetSignatureAlgorithms(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldSignatureAlgorithms, v)
- return u
- }
- // UpdateSignatureAlgorithms sets the "signature_algorithms" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateSignatureAlgorithms() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldSignatureAlgorithms)
- return u
- }
- // ClearSignatureAlgorithms clears the value of the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsert) ClearSignatureAlgorithms() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldSignatureAlgorithms)
- return u
- }
- // SetAlpnProtocols sets the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsert) SetAlpnProtocols(v []string) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldAlpnProtocols, v)
- return u
- }
- // UpdateAlpnProtocols sets the "alpn_protocols" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateAlpnProtocols() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldAlpnProtocols)
- return u
- }
- // ClearAlpnProtocols clears the value of the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsert) ClearAlpnProtocols() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldAlpnProtocols)
- return u
- }
- // SetSupportedVersions sets the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsert) SetSupportedVersions(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldSupportedVersions, v)
- return u
- }
- // UpdateSupportedVersions sets the "supported_versions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateSupportedVersions() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldSupportedVersions)
- return u
- }
- // ClearSupportedVersions clears the value of the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsert) ClearSupportedVersions() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldSupportedVersions)
- return u
- }
- // SetKeyShareGroups sets the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsert) SetKeyShareGroups(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldKeyShareGroups, v)
- return u
- }
- // UpdateKeyShareGroups sets the "key_share_groups" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateKeyShareGroups() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldKeyShareGroups)
- return u
- }
- // ClearKeyShareGroups clears the value of the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsert) ClearKeyShareGroups() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldKeyShareGroups)
- return u
- }
- // SetPskModes sets the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsert) SetPskModes(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldPskModes, v)
- return u
- }
- // UpdatePskModes sets the "psk_modes" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdatePskModes() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldPskModes)
- return u
- }
- // ClearPskModes clears the value of the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsert) ClearPskModes() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldPskModes)
- return u
- }
- // SetExtensions sets the "extensions" field.
- func (u *TLSFingerprintProfileUpsert) SetExtensions(v []uint16) *TLSFingerprintProfileUpsert {
- u.Set(tlsfingerprintprofile.FieldExtensions, v)
- return u
- }
- // UpdateExtensions sets the "extensions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsert) UpdateExtensions() *TLSFingerprintProfileUpsert {
- u.SetExcluded(tlsfingerprintprofile.FieldExtensions)
- return u
- }
- // ClearExtensions clears the value of the "extensions" field.
- func (u *TLSFingerprintProfileUpsert) ClearExtensions() *TLSFingerprintProfileUpsert {
- u.SetNull(tlsfingerprintprofile.FieldExtensions)
- return u
- }
- // UpdateNewValues updates the mutable fields using the new values that were set on create.
- // Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *TLSFingerprintProfileUpsertOne) UpdateNewValues() *TLSFingerprintProfileUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- if _, exists := u.create.mutation.CreatedAt(); exists {
- s.SetIgnore(tlsfingerprintprofile.FieldCreatedAt)
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *TLSFingerprintProfileUpsertOne) Ignore() *TLSFingerprintProfileUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *TLSFingerprintProfileUpsertOne) DoNothing() *TLSFingerprintProfileUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the TLSFingerprintProfileCreate.OnConflict
- // documentation for more info.
- func (u *TLSFingerprintProfileUpsertOne) Update(set func(*TLSFingerprintProfileUpsert)) *TLSFingerprintProfileUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&TLSFingerprintProfileUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *TLSFingerprintProfileUpsertOne) SetUpdatedAt(v time.Time) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateUpdatedAt() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetName sets the "name" field.
- func (u *TLSFingerprintProfileUpsertOne) SetName(v string) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateName() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateName()
- })
- }
- // SetDescription sets the "description" field.
- func (u *TLSFingerprintProfileUpsertOne) SetDescription(v string) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetDescription(v)
- })
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateDescription() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateDescription()
- })
- }
- // ClearDescription clears the value of the "description" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearDescription() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearDescription()
- })
- }
- // SetEnableGrease sets the "enable_grease" field.
- func (u *TLSFingerprintProfileUpsertOne) SetEnableGrease(v bool) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetEnableGrease(v)
- })
- }
- // UpdateEnableGrease sets the "enable_grease" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateEnableGrease() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateEnableGrease()
- })
- }
- // SetCipherSuites sets the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsertOne) SetCipherSuites(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetCipherSuites(v)
- })
- }
- // UpdateCipherSuites sets the "cipher_suites" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateCipherSuites() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateCipherSuites()
- })
- }
- // ClearCipherSuites clears the value of the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearCipherSuites() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearCipherSuites()
- })
- }
- // SetCurves sets the "curves" field.
- func (u *TLSFingerprintProfileUpsertOne) SetCurves(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetCurves(v)
- })
- }
- // UpdateCurves sets the "curves" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateCurves() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateCurves()
- })
- }
- // ClearCurves clears the value of the "curves" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearCurves() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearCurves()
- })
- }
- // SetPointFormats sets the "point_formats" field.
- func (u *TLSFingerprintProfileUpsertOne) SetPointFormats(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetPointFormats(v)
- })
- }
- // UpdatePointFormats sets the "point_formats" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdatePointFormats() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdatePointFormats()
- })
- }
- // ClearPointFormats clears the value of the "point_formats" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearPointFormats() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearPointFormats()
- })
- }
- // SetSignatureAlgorithms sets the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsertOne) SetSignatureAlgorithms(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetSignatureAlgorithms(v)
- })
- }
- // UpdateSignatureAlgorithms sets the "signature_algorithms" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateSignatureAlgorithms() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateSignatureAlgorithms()
- })
- }
- // ClearSignatureAlgorithms clears the value of the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearSignatureAlgorithms() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearSignatureAlgorithms()
- })
- }
- // SetAlpnProtocols sets the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsertOne) SetAlpnProtocols(v []string) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetAlpnProtocols(v)
- })
- }
- // UpdateAlpnProtocols sets the "alpn_protocols" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateAlpnProtocols() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateAlpnProtocols()
- })
- }
- // ClearAlpnProtocols clears the value of the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearAlpnProtocols() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearAlpnProtocols()
- })
- }
- // SetSupportedVersions sets the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsertOne) SetSupportedVersions(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetSupportedVersions(v)
- })
- }
- // UpdateSupportedVersions sets the "supported_versions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateSupportedVersions() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateSupportedVersions()
- })
- }
- // ClearSupportedVersions clears the value of the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearSupportedVersions() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearSupportedVersions()
- })
- }
- // SetKeyShareGroups sets the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsertOne) SetKeyShareGroups(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetKeyShareGroups(v)
- })
- }
- // UpdateKeyShareGroups sets the "key_share_groups" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateKeyShareGroups() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateKeyShareGroups()
- })
- }
- // ClearKeyShareGroups clears the value of the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearKeyShareGroups() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearKeyShareGroups()
- })
- }
- // SetPskModes sets the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsertOne) SetPskModes(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetPskModes(v)
- })
- }
- // UpdatePskModes sets the "psk_modes" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdatePskModes() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdatePskModes()
- })
- }
- // ClearPskModes clears the value of the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearPskModes() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearPskModes()
- })
- }
- // SetExtensions sets the "extensions" field.
- func (u *TLSFingerprintProfileUpsertOne) SetExtensions(v []uint16) *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetExtensions(v)
- })
- }
- // UpdateExtensions sets the "extensions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertOne) UpdateExtensions() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateExtensions()
- })
- }
- // ClearExtensions clears the value of the "extensions" field.
- func (u *TLSFingerprintProfileUpsertOne) ClearExtensions() *TLSFingerprintProfileUpsertOne {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearExtensions()
- })
- }
- // Exec executes the query.
- func (u *TLSFingerprintProfileUpsertOne) Exec(ctx context.Context) error {
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for TLSFingerprintProfileCreate.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *TLSFingerprintProfileUpsertOne) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // Exec executes the UPSERT query and returns the inserted/updated ID.
- func (u *TLSFingerprintProfileUpsertOne) ID(ctx context.Context) (id int64, err error) {
- node, err := u.create.Save(ctx)
- if err != nil {
- return id, err
- }
- return node.ID, nil
- }
- // IDX is like ID, but panics if an error occurs.
- func (u *TLSFingerprintProfileUpsertOne) IDX(ctx context.Context) int64 {
- id, err := u.ID(ctx)
- if err != nil {
- panic(err)
- }
- return id
- }
- // TLSFingerprintProfileCreateBulk is the builder for creating many TLSFingerprintProfile entities in bulk.
- type TLSFingerprintProfileCreateBulk struct {
- config
- err error
- builders []*TLSFingerprintProfileCreate
- conflict []sql.ConflictOption
- }
- // Save creates the TLSFingerprintProfile entities in the database.
- func (_c *TLSFingerprintProfileCreateBulk) Save(ctx context.Context) ([]*TLSFingerprintProfile, error) {
- if _c.err != nil {
- return nil, _c.err
- }
- specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
- nodes := make([]*TLSFingerprintProfile, len(_c.builders))
- mutators := make([]Mutator, len(_c.builders))
- for i := range _c.builders {
- func(i int, root context.Context) {
- builder := _c.builders[i]
- builder.defaults()
- var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
- mutation, ok := m.(*TLSFingerprintProfileMutation)
- if !ok {
- return nil, fmt.Errorf("unexpected mutation type %T", m)
- }
- if err := builder.check(); err != nil {
- return nil, err
- }
- builder.mutation = mutation
- var err error
- nodes[i], specs[i] = builder.createSpec()
- if i < len(mutators)-1 {
- _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
- } else {
- spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
- spec.OnConflict = _c.conflict
- // Invoke the actual operation on the latest mutation in the chain.
- if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- }
- }
- if err != nil {
- return nil, err
- }
- mutation.id = &nodes[i].ID
- if specs[i].ID.Value != nil {
- id := specs[i].ID.Value.(int64)
- nodes[i].ID = int64(id)
- }
- mutation.done = true
- return nodes[i], nil
- })
- for i := len(builder.hooks) - 1; i >= 0; i-- {
- mut = builder.hooks[i](mut)
- }
- mutators[i] = mut
- }(i, ctx)
- }
- if len(mutators) > 0 {
- if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
- return nil, err
- }
- }
- return nodes, nil
- }
- // SaveX is like Save, but panics if an error occurs.
- func (_c *TLSFingerprintProfileCreateBulk) SaveX(ctx context.Context) []*TLSFingerprintProfile {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *TLSFingerprintProfileCreateBulk) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *TLSFingerprintProfileCreateBulk) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.TLSFingerprintProfile.CreateBulk(builders...).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.TLSFingerprintProfileUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (_c *TLSFingerprintProfileCreateBulk) OnConflict(opts ...sql.ConflictOption) *TLSFingerprintProfileUpsertBulk {
- _c.conflict = opts
- return &TLSFingerprintProfileUpsertBulk{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *TLSFingerprintProfileCreateBulk) OnConflictColumns(columns ...string) *TLSFingerprintProfileUpsertBulk {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &TLSFingerprintProfileUpsertBulk{
- create: _c,
- }
- }
- // TLSFingerprintProfileUpsertBulk is the builder for "upsert"-ing
- // a bulk of TLSFingerprintProfile nodes.
- type TLSFingerprintProfileUpsertBulk struct {
- create *TLSFingerprintProfileCreateBulk
- }
- // UpdateNewValues updates the mutable fields using the new values that
- // were set on create. Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *TLSFingerprintProfileUpsertBulk) UpdateNewValues() *TLSFingerprintProfileUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- for _, b := range u.create.builders {
- if _, exists := b.mutation.CreatedAt(); exists {
- s.SetIgnore(tlsfingerprintprofile.FieldCreatedAt)
- }
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.TLSFingerprintProfile.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *TLSFingerprintProfileUpsertBulk) Ignore() *TLSFingerprintProfileUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *TLSFingerprintProfileUpsertBulk) DoNothing() *TLSFingerprintProfileUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the TLSFingerprintProfileCreateBulk.OnConflict
- // documentation for more info.
- func (u *TLSFingerprintProfileUpsertBulk) Update(set func(*TLSFingerprintProfileUpsert)) *TLSFingerprintProfileUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&TLSFingerprintProfileUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetUpdatedAt(v time.Time) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateUpdatedAt() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetName sets the "name" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetName(v string) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateName() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateName()
- })
- }
- // SetDescription sets the "description" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetDescription(v string) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetDescription(v)
- })
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateDescription() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateDescription()
- })
- }
- // ClearDescription clears the value of the "description" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearDescription() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearDescription()
- })
- }
- // SetEnableGrease sets the "enable_grease" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetEnableGrease(v bool) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetEnableGrease(v)
- })
- }
- // UpdateEnableGrease sets the "enable_grease" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateEnableGrease() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateEnableGrease()
- })
- }
- // SetCipherSuites sets the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetCipherSuites(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetCipherSuites(v)
- })
- }
- // UpdateCipherSuites sets the "cipher_suites" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateCipherSuites() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateCipherSuites()
- })
- }
- // ClearCipherSuites clears the value of the "cipher_suites" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearCipherSuites() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearCipherSuites()
- })
- }
- // SetCurves sets the "curves" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetCurves(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetCurves(v)
- })
- }
- // UpdateCurves sets the "curves" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateCurves() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateCurves()
- })
- }
- // ClearCurves clears the value of the "curves" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearCurves() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearCurves()
- })
- }
- // SetPointFormats sets the "point_formats" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetPointFormats(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetPointFormats(v)
- })
- }
- // UpdatePointFormats sets the "point_formats" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdatePointFormats() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdatePointFormats()
- })
- }
- // ClearPointFormats clears the value of the "point_formats" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearPointFormats() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearPointFormats()
- })
- }
- // SetSignatureAlgorithms sets the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetSignatureAlgorithms(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetSignatureAlgorithms(v)
- })
- }
- // UpdateSignatureAlgorithms sets the "signature_algorithms" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateSignatureAlgorithms() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateSignatureAlgorithms()
- })
- }
- // ClearSignatureAlgorithms clears the value of the "signature_algorithms" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearSignatureAlgorithms() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearSignatureAlgorithms()
- })
- }
- // SetAlpnProtocols sets the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetAlpnProtocols(v []string) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetAlpnProtocols(v)
- })
- }
- // UpdateAlpnProtocols sets the "alpn_protocols" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateAlpnProtocols() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateAlpnProtocols()
- })
- }
- // ClearAlpnProtocols clears the value of the "alpn_protocols" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearAlpnProtocols() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearAlpnProtocols()
- })
- }
- // SetSupportedVersions sets the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetSupportedVersions(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetSupportedVersions(v)
- })
- }
- // UpdateSupportedVersions sets the "supported_versions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateSupportedVersions() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateSupportedVersions()
- })
- }
- // ClearSupportedVersions clears the value of the "supported_versions" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearSupportedVersions() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearSupportedVersions()
- })
- }
- // SetKeyShareGroups sets the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetKeyShareGroups(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetKeyShareGroups(v)
- })
- }
- // UpdateKeyShareGroups sets the "key_share_groups" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateKeyShareGroups() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateKeyShareGroups()
- })
- }
- // ClearKeyShareGroups clears the value of the "key_share_groups" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearKeyShareGroups() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearKeyShareGroups()
- })
- }
- // SetPskModes sets the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetPskModes(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetPskModes(v)
- })
- }
- // UpdatePskModes sets the "psk_modes" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdatePskModes() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdatePskModes()
- })
- }
- // ClearPskModes clears the value of the "psk_modes" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearPskModes() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearPskModes()
- })
- }
- // SetExtensions sets the "extensions" field.
- func (u *TLSFingerprintProfileUpsertBulk) SetExtensions(v []uint16) *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.SetExtensions(v)
- })
- }
- // UpdateExtensions sets the "extensions" field to the value that was provided on create.
- func (u *TLSFingerprintProfileUpsertBulk) UpdateExtensions() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.UpdateExtensions()
- })
- }
- // ClearExtensions clears the value of the "extensions" field.
- func (u *TLSFingerprintProfileUpsertBulk) ClearExtensions() *TLSFingerprintProfileUpsertBulk {
- return u.Update(func(s *TLSFingerprintProfileUpsert) {
- s.ClearExtensions()
- })
- }
- // Exec executes the query.
- func (u *TLSFingerprintProfileUpsertBulk) Exec(ctx context.Context) error {
- if u.create.err != nil {
- return u.create.err
- }
- for i, b := range u.create.builders {
- if len(b.conflict) != 0 {
- return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the TLSFingerprintProfileCreateBulk instead", i)
- }
- }
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for TLSFingerprintProfileCreateBulk.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *TLSFingerprintProfileUpsertBulk) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
|