where.go 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527
  1. // Code generated by entc, DO NOT EDIT.
  2. package decision
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. "github.com/crowdsecurity/crowdsec/pkg/database/ent/predicate"
  8. )
  9. // ID filters vertices based on their ID field.
  10. func ID(id int) predicate.Decision {
  11. return predicate.Decision(func(s *sql.Selector) {
  12. s.Where(sql.EQ(s.C(FieldID), id))
  13. })
  14. }
  15. // IDEQ applies the EQ predicate on the ID field.
  16. func IDEQ(id int) predicate.Decision {
  17. return predicate.Decision(func(s *sql.Selector) {
  18. s.Where(sql.EQ(s.C(FieldID), id))
  19. })
  20. }
  21. // IDNEQ applies the NEQ predicate on the ID field.
  22. func IDNEQ(id int) predicate.Decision {
  23. return predicate.Decision(func(s *sql.Selector) {
  24. s.Where(sql.NEQ(s.C(FieldID), id))
  25. })
  26. }
  27. // IDIn applies the In predicate on the ID field.
  28. func IDIn(ids ...int) predicate.Decision {
  29. return predicate.Decision(func(s *sql.Selector) {
  30. // if not arguments were provided, append the FALSE constants,
  31. // since we can't apply "IN ()". This will make this predicate falsy.
  32. if len(ids) == 0 {
  33. s.Where(sql.False())
  34. return
  35. }
  36. v := make([]interface{}, len(ids))
  37. for i := range v {
  38. v[i] = ids[i]
  39. }
  40. s.Where(sql.In(s.C(FieldID), v...))
  41. })
  42. }
  43. // IDNotIn applies the NotIn predicate on the ID field.
  44. func IDNotIn(ids ...int) predicate.Decision {
  45. return predicate.Decision(func(s *sql.Selector) {
  46. // if not arguments were provided, append the FALSE constants,
  47. // since we can't apply "IN ()". This will make this predicate falsy.
  48. if len(ids) == 0 {
  49. s.Where(sql.False())
  50. return
  51. }
  52. v := make([]interface{}, len(ids))
  53. for i := range v {
  54. v[i] = ids[i]
  55. }
  56. s.Where(sql.NotIn(s.C(FieldID), v...))
  57. })
  58. }
  59. // IDGT applies the GT predicate on the ID field.
  60. func IDGT(id int) predicate.Decision {
  61. return predicate.Decision(func(s *sql.Selector) {
  62. s.Where(sql.GT(s.C(FieldID), id))
  63. })
  64. }
  65. // IDGTE applies the GTE predicate on the ID field.
  66. func IDGTE(id int) predicate.Decision {
  67. return predicate.Decision(func(s *sql.Selector) {
  68. s.Where(sql.GTE(s.C(FieldID), id))
  69. })
  70. }
  71. // IDLT applies the LT predicate on the ID field.
  72. func IDLT(id int) predicate.Decision {
  73. return predicate.Decision(func(s *sql.Selector) {
  74. s.Where(sql.LT(s.C(FieldID), id))
  75. })
  76. }
  77. // IDLTE applies the LTE predicate on the ID field.
  78. func IDLTE(id int) predicate.Decision {
  79. return predicate.Decision(func(s *sql.Selector) {
  80. s.Where(sql.LTE(s.C(FieldID), id))
  81. })
  82. }
  83. // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
  84. func CreatedAt(v time.Time) predicate.Decision {
  85. return predicate.Decision(func(s *sql.Selector) {
  86. s.Where(sql.EQ(s.C(FieldCreatedAt), v))
  87. })
  88. }
  89. // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
  90. func UpdatedAt(v time.Time) predicate.Decision {
  91. return predicate.Decision(func(s *sql.Selector) {
  92. s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
  93. })
  94. }
  95. // Until applies equality check predicate on the "until" field. It's identical to UntilEQ.
  96. func Until(v time.Time) predicate.Decision {
  97. return predicate.Decision(func(s *sql.Selector) {
  98. s.Where(sql.EQ(s.C(FieldUntil), v))
  99. })
  100. }
  101. // Scenario applies equality check predicate on the "scenario" field. It's identical to ScenarioEQ.
  102. func Scenario(v string) predicate.Decision {
  103. return predicate.Decision(func(s *sql.Selector) {
  104. s.Where(sql.EQ(s.C(FieldScenario), v))
  105. })
  106. }
  107. // Type applies equality check predicate on the "type" field. It's identical to TypeEQ.
  108. func Type(v string) predicate.Decision {
  109. return predicate.Decision(func(s *sql.Selector) {
  110. s.Where(sql.EQ(s.C(FieldType), v))
  111. })
  112. }
  113. // StartIP applies equality check predicate on the "start_ip" field. It's identical to StartIPEQ.
  114. func StartIP(v int64) predicate.Decision {
  115. return predicate.Decision(func(s *sql.Selector) {
  116. s.Where(sql.EQ(s.C(FieldStartIP), v))
  117. })
  118. }
  119. // EndIP applies equality check predicate on the "end_ip" field. It's identical to EndIPEQ.
  120. func EndIP(v int64) predicate.Decision {
  121. return predicate.Decision(func(s *sql.Selector) {
  122. s.Where(sql.EQ(s.C(FieldEndIP), v))
  123. })
  124. }
  125. // StartSuffix applies equality check predicate on the "start_suffix" field. It's identical to StartSuffixEQ.
  126. func StartSuffix(v int64) predicate.Decision {
  127. return predicate.Decision(func(s *sql.Selector) {
  128. s.Where(sql.EQ(s.C(FieldStartSuffix), v))
  129. })
  130. }
  131. // EndSuffix applies equality check predicate on the "end_suffix" field. It's identical to EndSuffixEQ.
  132. func EndSuffix(v int64) predicate.Decision {
  133. return predicate.Decision(func(s *sql.Selector) {
  134. s.Where(sql.EQ(s.C(FieldEndSuffix), v))
  135. })
  136. }
  137. // IPSize applies equality check predicate on the "ip_size" field. It's identical to IPSizeEQ.
  138. func IPSize(v int64) predicate.Decision {
  139. return predicate.Decision(func(s *sql.Selector) {
  140. s.Where(sql.EQ(s.C(FieldIPSize), v))
  141. })
  142. }
  143. // Scope applies equality check predicate on the "scope" field. It's identical to ScopeEQ.
  144. func Scope(v string) predicate.Decision {
  145. return predicate.Decision(func(s *sql.Selector) {
  146. s.Where(sql.EQ(s.C(FieldScope), v))
  147. })
  148. }
  149. // Value applies equality check predicate on the "value" field. It's identical to ValueEQ.
  150. func Value(v string) predicate.Decision {
  151. return predicate.Decision(func(s *sql.Selector) {
  152. s.Where(sql.EQ(s.C(FieldValue), v))
  153. })
  154. }
  155. // Origin applies equality check predicate on the "origin" field. It's identical to OriginEQ.
  156. func Origin(v string) predicate.Decision {
  157. return predicate.Decision(func(s *sql.Selector) {
  158. s.Where(sql.EQ(s.C(FieldOrigin), v))
  159. })
  160. }
  161. // Simulated applies equality check predicate on the "simulated" field. It's identical to SimulatedEQ.
  162. func Simulated(v bool) predicate.Decision {
  163. return predicate.Decision(func(s *sql.Selector) {
  164. s.Where(sql.EQ(s.C(FieldSimulated), v))
  165. })
  166. }
  167. // CreatedAtEQ applies the EQ predicate on the "created_at" field.
  168. func CreatedAtEQ(v time.Time) predicate.Decision {
  169. return predicate.Decision(func(s *sql.Selector) {
  170. s.Where(sql.EQ(s.C(FieldCreatedAt), v))
  171. })
  172. }
  173. // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
  174. func CreatedAtNEQ(v time.Time) predicate.Decision {
  175. return predicate.Decision(func(s *sql.Selector) {
  176. s.Where(sql.NEQ(s.C(FieldCreatedAt), v))
  177. })
  178. }
  179. // CreatedAtIn applies the In predicate on the "created_at" field.
  180. func CreatedAtIn(vs ...time.Time) predicate.Decision {
  181. v := make([]interface{}, len(vs))
  182. for i := range v {
  183. v[i] = vs[i]
  184. }
  185. return predicate.Decision(func(s *sql.Selector) {
  186. // if not arguments were provided, append the FALSE constants,
  187. // since we can't apply "IN ()". This will make this predicate falsy.
  188. if len(v) == 0 {
  189. s.Where(sql.False())
  190. return
  191. }
  192. s.Where(sql.In(s.C(FieldCreatedAt), v...))
  193. })
  194. }
  195. // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
  196. func CreatedAtNotIn(vs ...time.Time) predicate.Decision {
  197. v := make([]interface{}, len(vs))
  198. for i := range v {
  199. v[i] = vs[i]
  200. }
  201. return predicate.Decision(func(s *sql.Selector) {
  202. // if not arguments were provided, append the FALSE constants,
  203. // since we can't apply "IN ()". This will make this predicate falsy.
  204. if len(v) == 0 {
  205. s.Where(sql.False())
  206. return
  207. }
  208. s.Where(sql.NotIn(s.C(FieldCreatedAt), v...))
  209. })
  210. }
  211. // CreatedAtGT applies the GT predicate on the "created_at" field.
  212. func CreatedAtGT(v time.Time) predicate.Decision {
  213. return predicate.Decision(func(s *sql.Selector) {
  214. s.Where(sql.GT(s.C(FieldCreatedAt), v))
  215. })
  216. }
  217. // CreatedAtGTE applies the GTE predicate on the "created_at" field.
  218. func CreatedAtGTE(v time.Time) predicate.Decision {
  219. return predicate.Decision(func(s *sql.Selector) {
  220. s.Where(sql.GTE(s.C(FieldCreatedAt), v))
  221. })
  222. }
  223. // CreatedAtLT applies the LT predicate on the "created_at" field.
  224. func CreatedAtLT(v time.Time) predicate.Decision {
  225. return predicate.Decision(func(s *sql.Selector) {
  226. s.Where(sql.LT(s.C(FieldCreatedAt), v))
  227. })
  228. }
  229. // CreatedAtLTE applies the LTE predicate on the "created_at" field.
  230. func CreatedAtLTE(v time.Time) predicate.Decision {
  231. return predicate.Decision(func(s *sql.Selector) {
  232. s.Where(sql.LTE(s.C(FieldCreatedAt), v))
  233. })
  234. }
  235. // CreatedAtIsNil applies the IsNil predicate on the "created_at" field.
  236. func CreatedAtIsNil() predicate.Decision {
  237. return predicate.Decision(func(s *sql.Selector) {
  238. s.Where(sql.IsNull(s.C(FieldCreatedAt)))
  239. })
  240. }
  241. // CreatedAtNotNil applies the NotNil predicate on the "created_at" field.
  242. func CreatedAtNotNil() predicate.Decision {
  243. return predicate.Decision(func(s *sql.Selector) {
  244. s.Where(sql.NotNull(s.C(FieldCreatedAt)))
  245. })
  246. }
  247. // UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
  248. func UpdatedAtEQ(v time.Time) predicate.Decision {
  249. return predicate.Decision(func(s *sql.Selector) {
  250. s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
  251. })
  252. }
  253. // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
  254. func UpdatedAtNEQ(v time.Time) predicate.Decision {
  255. return predicate.Decision(func(s *sql.Selector) {
  256. s.Where(sql.NEQ(s.C(FieldUpdatedAt), v))
  257. })
  258. }
  259. // UpdatedAtIn applies the In predicate on the "updated_at" field.
  260. func UpdatedAtIn(vs ...time.Time) predicate.Decision {
  261. v := make([]interface{}, len(vs))
  262. for i := range v {
  263. v[i] = vs[i]
  264. }
  265. return predicate.Decision(func(s *sql.Selector) {
  266. // if not arguments were provided, append the FALSE constants,
  267. // since we can't apply "IN ()". This will make this predicate falsy.
  268. if len(v) == 0 {
  269. s.Where(sql.False())
  270. return
  271. }
  272. s.Where(sql.In(s.C(FieldUpdatedAt), v...))
  273. })
  274. }
  275. // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
  276. func UpdatedAtNotIn(vs ...time.Time) predicate.Decision {
  277. v := make([]interface{}, len(vs))
  278. for i := range v {
  279. v[i] = vs[i]
  280. }
  281. return predicate.Decision(func(s *sql.Selector) {
  282. // if not arguments were provided, append the FALSE constants,
  283. // since we can't apply "IN ()". This will make this predicate falsy.
  284. if len(v) == 0 {
  285. s.Where(sql.False())
  286. return
  287. }
  288. s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...))
  289. })
  290. }
  291. // UpdatedAtGT applies the GT predicate on the "updated_at" field.
  292. func UpdatedAtGT(v time.Time) predicate.Decision {
  293. return predicate.Decision(func(s *sql.Selector) {
  294. s.Where(sql.GT(s.C(FieldUpdatedAt), v))
  295. })
  296. }
  297. // UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
  298. func UpdatedAtGTE(v time.Time) predicate.Decision {
  299. return predicate.Decision(func(s *sql.Selector) {
  300. s.Where(sql.GTE(s.C(FieldUpdatedAt), v))
  301. })
  302. }
  303. // UpdatedAtLT applies the LT predicate on the "updated_at" field.
  304. func UpdatedAtLT(v time.Time) predicate.Decision {
  305. return predicate.Decision(func(s *sql.Selector) {
  306. s.Where(sql.LT(s.C(FieldUpdatedAt), v))
  307. })
  308. }
  309. // UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
  310. func UpdatedAtLTE(v time.Time) predicate.Decision {
  311. return predicate.Decision(func(s *sql.Selector) {
  312. s.Where(sql.LTE(s.C(FieldUpdatedAt), v))
  313. })
  314. }
  315. // UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.
  316. func UpdatedAtIsNil() predicate.Decision {
  317. return predicate.Decision(func(s *sql.Selector) {
  318. s.Where(sql.IsNull(s.C(FieldUpdatedAt)))
  319. })
  320. }
  321. // UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.
  322. func UpdatedAtNotNil() predicate.Decision {
  323. return predicate.Decision(func(s *sql.Selector) {
  324. s.Where(sql.NotNull(s.C(FieldUpdatedAt)))
  325. })
  326. }
  327. // UntilEQ applies the EQ predicate on the "until" field.
  328. func UntilEQ(v time.Time) predicate.Decision {
  329. return predicate.Decision(func(s *sql.Selector) {
  330. s.Where(sql.EQ(s.C(FieldUntil), v))
  331. })
  332. }
  333. // UntilNEQ applies the NEQ predicate on the "until" field.
  334. func UntilNEQ(v time.Time) predicate.Decision {
  335. return predicate.Decision(func(s *sql.Selector) {
  336. s.Where(sql.NEQ(s.C(FieldUntil), v))
  337. })
  338. }
  339. // UntilIn applies the In predicate on the "until" field.
  340. func UntilIn(vs ...time.Time) predicate.Decision {
  341. v := make([]interface{}, len(vs))
  342. for i := range v {
  343. v[i] = vs[i]
  344. }
  345. return predicate.Decision(func(s *sql.Selector) {
  346. // if not arguments were provided, append the FALSE constants,
  347. // since we can't apply "IN ()". This will make this predicate falsy.
  348. if len(v) == 0 {
  349. s.Where(sql.False())
  350. return
  351. }
  352. s.Where(sql.In(s.C(FieldUntil), v...))
  353. })
  354. }
  355. // UntilNotIn applies the NotIn predicate on the "until" field.
  356. func UntilNotIn(vs ...time.Time) predicate.Decision {
  357. v := make([]interface{}, len(vs))
  358. for i := range v {
  359. v[i] = vs[i]
  360. }
  361. return predicate.Decision(func(s *sql.Selector) {
  362. // if not arguments were provided, append the FALSE constants,
  363. // since we can't apply "IN ()". This will make this predicate falsy.
  364. if len(v) == 0 {
  365. s.Where(sql.False())
  366. return
  367. }
  368. s.Where(sql.NotIn(s.C(FieldUntil), v...))
  369. })
  370. }
  371. // UntilGT applies the GT predicate on the "until" field.
  372. func UntilGT(v time.Time) predicate.Decision {
  373. return predicate.Decision(func(s *sql.Selector) {
  374. s.Where(sql.GT(s.C(FieldUntil), v))
  375. })
  376. }
  377. // UntilGTE applies the GTE predicate on the "until" field.
  378. func UntilGTE(v time.Time) predicate.Decision {
  379. return predicate.Decision(func(s *sql.Selector) {
  380. s.Where(sql.GTE(s.C(FieldUntil), v))
  381. })
  382. }
  383. // UntilLT applies the LT predicate on the "until" field.
  384. func UntilLT(v time.Time) predicate.Decision {
  385. return predicate.Decision(func(s *sql.Selector) {
  386. s.Where(sql.LT(s.C(FieldUntil), v))
  387. })
  388. }
  389. // UntilLTE applies the LTE predicate on the "until" field.
  390. func UntilLTE(v time.Time) predicate.Decision {
  391. return predicate.Decision(func(s *sql.Selector) {
  392. s.Where(sql.LTE(s.C(FieldUntil), v))
  393. })
  394. }
  395. // ScenarioEQ applies the EQ predicate on the "scenario" field.
  396. func ScenarioEQ(v string) predicate.Decision {
  397. return predicate.Decision(func(s *sql.Selector) {
  398. s.Where(sql.EQ(s.C(FieldScenario), v))
  399. })
  400. }
  401. // ScenarioNEQ applies the NEQ predicate on the "scenario" field.
  402. func ScenarioNEQ(v string) predicate.Decision {
  403. return predicate.Decision(func(s *sql.Selector) {
  404. s.Where(sql.NEQ(s.C(FieldScenario), v))
  405. })
  406. }
  407. // ScenarioIn applies the In predicate on the "scenario" field.
  408. func ScenarioIn(vs ...string) predicate.Decision {
  409. v := make([]interface{}, len(vs))
  410. for i := range v {
  411. v[i] = vs[i]
  412. }
  413. return predicate.Decision(func(s *sql.Selector) {
  414. // if not arguments were provided, append the FALSE constants,
  415. // since we can't apply "IN ()". This will make this predicate falsy.
  416. if len(v) == 0 {
  417. s.Where(sql.False())
  418. return
  419. }
  420. s.Where(sql.In(s.C(FieldScenario), v...))
  421. })
  422. }
  423. // ScenarioNotIn applies the NotIn predicate on the "scenario" field.
  424. func ScenarioNotIn(vs ...string) predicate.Decision {
  425. v := make([]interface{}, len(vs))
  426. for i := range v {
  427. v[i] = vs[i]
  428. }
  429. return predicate.Decision(func(s *sql.Selector) {
  430. // if not arguments were provided, append the FALSE constants,
  431. // since we can't apply "IN ()". This will make this predicate falsy.
  432. if len(v) == 0 {
  433. s.Where(sql.False())
  434. return
  435. }
  436. s.Where(sql.NotIn(s.C(FieldScenario), v...))
  437. })
  438. }
  439. // ScenarioGT applies the GT predicate on the "scenario" field.
  440. func ScenarioGT(v string) predicate.Decision {
  441. return predicate.Decision(func(s *sql.Selector) {
  442. s.Where(sql.GT(s.C(FieldScenario), v))
  443. })
  444. }
  445. // ScenarioGTE applies the GTE predicate on the "scenario" field.
  446. func ScenarioGTE(v string) predicate.Decision {
  447. return predicate.Decision(func(s *sql.Selector) {
  448. s.Where(sql.GTE(s.C(FieldScenario), v))
  449. })
  450. }
  451. // ScenarioLT applies the LT predicate on the "scenario" field.
  452. func ScenarioLT(v string) predicate.Decision {
  453. return predicate.Decision(func(s *sql.Selector) {
  454. s.Where(sql.LT(s.C(FieldScenario), v))
  455. })
  456. }
  457. // ScenarioLTE applies the LTE predicate on the "scenario" field.
  458. func ScenarioLTE(v string) predicate.Decision {
  459. return predicate.Decision(func(s *sql.Selector) {
  460. s.Where(sql.LTE(s.C(FieldScenario), v))
  461. })
  462. }
  463. // ScenarioContains applies the Contains predicate on the "scenario" field.
  464. func ScenarioContains(v string) predicate.Decision {
  465. return predicate.Decision(func(s *sql.Selector) {
  466. s.Where(sql.Contains(s.C(FieldScenario), v))
  467. })
  468. }
  469. // ScenarioHasPrefix applies the HasPrefix predicate on the "scenario" field.
  470. func ScenarioHasPrefix(v string) predicate.Decision {
  471. return predicate.Decision(func(s *sql.Selector) {
  472. s.Where(sql.HasPrefix(s.C(FieldScenario), v))
  473. })
  474. }
  475. // ScenarioHasSuffix applies the HasSuffix predicate on the "scenario" field.
  476. func ScenarioHasSuffix(v string) predicate.Decision {
  477. return predicate.Decision(func(s *sql.Selector) {
  478. s.Where(sql.HasSuffix(s.C(FieldScenario), v))
  479. })
  480. }
  481. // ScenarioEqualFold applies the EqualFold predicate on the "scenario" field.
  482. func ScenarioEqualFold(v string) predicate.Decision {
  483. return predicate.Decision(func(s *sql.Selector) {
  484. s.Where(sql.EqualFold(s.C(FieldScenario), v))
  485. })
  486. }
  487. // ScenarioContainsFold applies the ContainsFold predicate on the "scenario" field.
  488. func ScenarioContainsFold(v string) predicate.Decision {
  489. return predicate.Decision(func(s *sql.Selector) {
  490. s.Where(sql.ContainsFold(s.C(FieldScenario), v))
  491. })
  492. }
  493. // TypeEQ applies the EQ predicate on the "type" field.
  494. func TypeEQ(v string) predicate.Decision {
  495. return predicate.Decision(func(s *sql.Selector) {
  496. s.Where(sql.EQ(s.C(FieldType), v))
  497. })
  498. }
  499. // TypeNEQ applies the NEQ predicate on the "type" field.
  500. func TypeNEQ(v string) predicate.Decision {
  501. return predicate.Decision(func(s *sql.Selector) {
  502. s.Where(sql.NEQ(s.C(FieldType), v))
  503. })
  504. }
  505. // TypeIn applies the In predicate on the "type" field.
  506. func TypeIn(vs ...string) predicate.Decision {
  507. v := make([]interface{}, len(vs))
  508. for i := range v {
  509. v[i] = vs[i]
  510. }
  511. return predicate.Decision(func(s *sql.Selector) {
  512. // if not arguments were provided, append the FALSE constants,
  513. // since we can't apply "IN ()". This will make this predicate falsy.
  514. if len(v) == 0 {
  515. s.Where(sql.False())
  516. return
  517. }
  518. s.Where(sql.In(s.C(FieldType), v...))
  519. })
  520. }
  521. // TypeNotIn applies the NotIn predicate on the "type" field.
  522. func TypeNotIn(vs ...string) predicate.Decision {
  523. v := make([]interface{}, len(vs))
  524. for i := range v {
  525. v[i] = vs[i]
  526. }
  527. return predicate.Decision(func(s *sql.Selector) {
  528. // if not arguments were provided, append the FALSE constants,
  529. // since we can't apply "IN ()". This will make this predicate falsy.
  530. if len(v) == 0 {
  531. s.Where(sql.False())
  532. return
  533. }
  534. s.Where(sql.NotIn(s.C(FieldType), v...))
  535. })
  536. }
  537. // TypeGT applies the GT predicate on the "type" field.
  538. func TypeGT(v string) predicate.Decision {
  539. return predicate.Decision(func(s *sql.Selector) {
  540. s.Where(sql.GT(s.C(FieldType), v))
  541. })
  542. }
  543. // TypeGTE applies the GTE predicate on the "type" field.
  544. func TypeGTE(v string) predicate.Decision {
  545. return predicate.Decision(func(s *sql.Selector) {
  546. s.Where(sql.GTE(s.C(FieldType), v))
  547. })
  548. }
  549. // TypeLT applies the LT predicate on the "type" field.
  550. func TypeLT(v string) predicate.Decision {
  551. return predicate.Decision(func(s *sql.Selector) {
  552. s.Where(sql.LT(s.C(FieldType), v))
  553. })
  554. }
  555. // TypeLTE applies the LTE predicate on the "type" field.
  556. func TypeLTE(v string) predicate.Decision {
  557. return predicate.Decision(func(s *sql.Selector) {
  558. s.Where(sql.LTE(s.C(FieldType), v))
  559. })
  560. }
  561. // TypeContains applies the Contains predicate on the "type" field.
  562. func TypeContains(v string) predicate.Decision {
  563. return predicate.Decision(func(s *sql.Selector) {
  564. s.Where(sql.Contains(s.C(FieldType), v))
  565. })
  566. }
  567. // TypeHasPrefix applies the HasPrefix predicate on the "type" field.
  568. func TypeHasPrefix(v string) predicate.Decision {
  569. return predicate.Decision(func(s *sql.Selector) {
  570. s.Where(sql.HasPrefix(s.C(FieldType), v))
  571. })
  572. }
  573. // TypeHasSuffix applies the HasSuffix predicate on the "type" field.
  574. func TypeHasSuffix(v string) predicate.Decision {
  575. return predicate.Decision(func(s *sql.Selector) {
  576. s.Where(sql.HasSuffix(s.C(FieldType), v))
  577. })
  578. }
  579. // TypeEqualFold applies the EqualFold predicate on the "type" field.
  580. func TypeEqualFold(v string) predicate.Decision {
  581. return predicate.Decision(func(s *sql.Selector) {
  582. s.Where(sql.EqualFold(s.C(FieldType), v))
  583. })
  584. }
  585. // TypeContainsFold applies the ContainsFold predicate on the "type" field.
  586. func TypeContainsFold(v string) predicate.Decision {
  587. return predicate.Decision(func(s *sql.Selector) {
  588. s.Where(sql.ContainsFold(s.C(FieldType), v))
  589. })
  590. }
  591. // StartIPEQ applies the EQ predicate on the "start_ip" field.
  592. func StartIPEQ(v int64) predicate.Decision {
  593. return predicate.Decision(func(s *sql.Selector) {
  594. s.Where(sql.EQ(s.C(FieldStartIP), v))
  595. })
  596. }
  597. // StartIPNEQ applies the NEQ predicate on the "start_ip" field.
  598. func StartIPNEQ(v int64) predicate.Decision {
  599. return predicate.Decision(func(s *sql.Selector) {
  600. s.Where(sql.NEQ(s.C(FieldStartIP), v))
  601. })
  602. }
  603. // StartIPIn applies the In predicate on the "start_ip" field.
  604. func StartIPIn(vs ...int64) predicate.Decision {
  605. v := make([]interface{}, len(vs))
  606. for i := range v {
  607. v[i] = vs[i]
  608. }
  609. return predicate.Decision(func(s *sql.Selector) {
  610. // if not arguments were provided, append the FALSE constants,
  611. // since we can't apply "IN ()". This will make this predicate falsy.
  612. if len(v) == 0 {
  613. s.Where(sql.False())
  614. return
  615. }
  616. s.Where(sql.In(s.C(FieldStartIP), v...))
  617. })
  618. }
  619. // StartIPNotIn applies the NotIn predicate on the "start_ip" field.
  620. func StartIPNotIn(vs ...int64) predicate.Decision {
  621. v := make([]interface{}, len(vs))
  622. for i := range v {
  623. v[i] = vs[i]
  624. }
  625. return predicate.Decision(func(s *sql.Selector) {
  626. // if not arguments were provided, append the FALSE constants,
  627. // since we can't apply "IN ()". This will make this predicate falsy.
  628. if len(v) == 0 {
  629. s.Where(sql.False())
  630. return
  631. }
  632. s.Where(sql.NotIn(s.C(FieldStartIP), v...))
  633. })
  634. }
  635. // StartIPGT applies the GT predicate on the "start_ip" field.
  636. func StartIPGT(v int64) predicate.Decision {
  637. return predicate.Decision(func(s *sql.Selector) {
  638. s.Where(sql.GT(s.C(FieldStartIP), v))
  639. })
  640. }
  641. // StartIPGTE applies the GTE predicate on the "start_ip" field.
  642. func StartIPGTE(v int64) predicate.Decision {
  643. return predicate.Decision(func(s *sql.Selector) {
  644. s.Where(sql.GTE(s.C(FieldStartIP), v))
  645. })
  646. }
  647. // StartIPLT applies the LT predicate on the "start_ip" field.
  648. func StartIPLT(v int64) predicate.Decision {
  649. return predicate.Decision(func(s *sql.Selector) {
  650. s.Where(sql.LT(s.C(FieldStartIP), v))
  651. })
  652. }
  653. // StartIPLTE applies the LTE predicate on the "start_ip" field.
  654. func StartIPLTE(v int64) predicate.Decision {
  655. return predicate.Decision(func(s *sql.Selector) {
  656. s.Where(sql.LTE(s.C(FieldStartIP), v))
  657. })
  658. }
  659. // StartIPIsNil applies the IsNil predicate on the "start_ip" field.
  660. func StartIPIsNil() predicate.Decision {
  661. return predicate.Decision(func(s *sql.Selector) {
  662. s.Where(sql.IsNull(s.C(FieldStartIP)))
  663. })
  664. }
  665. // StartIPNotNil applies the NotNil predicate on the "start_ip" field.
  666. func StartIPNotNil() predicate.Decision {
  667. return predicate.Decision(func(s *sql.Selector) {
  668. s.Where(sql.NotNull(s.C(FieldStartIP)))
  669. })
  670. }
  671. // EndIPEQ applies the EQ predicate on the "end_ip" field.
  672. func EndIPEQ(v int64) predicate.Decision {
  673. return predicate.Decision(func(s *sql.Selector) {
  674. s.Where(sql.EQ(s.C(FieldEndIP), v))
  675. })
  676. }
  677. // EndIPNEQ applies the NEQ predicate on the "end_ip" field.
  678. func EndIPNEQ(v int64) predicate.Decision {
  679. return predicate.Decision(func(s *sql.Selector) {
  680. s.Where(sql.NEQ(s.C(FieldEndIP), v))
  681. })
  682. }
  683. // EndIPIn applies the In predicate on the "end_ip" field.
  684. func EndIPIn(vs ...int64) predicate.Decision {
  685. v := make([]interface{}, len(vs))
  686. for i := range v {
  687. v[i] = vs[i]
  688. }
  689. return predicate.Decision(func(s *sql.Selector) {
  690. // if not arguments were provided, append the FALSE constants,
  691. // since we can't apply "IN ()". This will make this predicate falsy.
  692. if len(v) == 0 {
  693. s.Where(sql.False())
  694. return
  695. }
  696. s.Where(sql.In(s.C(FieldEndIP), v...))
  697. })
  698. }
  699. // EndIPNotIn applies the NotIn predicate on the "end_ip" field.
  700. func EndIPNotIn(vs ...int64) predicate.Decision {
  701. v := make([]interface{}, len(vs))
  702. for i := range v {
  703. v[i] = vs[i]
  704. }
  705. return predicate.Decision(func(s *sql.Selector) {
  706. // if not arguments were provided, append the FALSE constants,
  707. // since we can't apply "IN ()". This will make this predicate falsy.
  708. if len(v) == 0 {
  709. s.Where(sql.False())
  710. return
  711. }
  712. s.Where(sql.NotIn(s.C(FieldEndIP), v...))
  713. })
  714. }
  715. // EndIPGT applies the GT predicate on the "end_ip" field.
  716. func EndIPGT(v int64) predicate.Decision {
  717. return predicate.Decision(func(s *sql.Selector) {
  718. s.Where(sql.GT(s.C(FieldEndIP), v))
  719. })
  720. }
  721. // EndIPGTE applies the GTE predicate on the "end_ip" field.
  722. func EndIPGTE(v int64) predicate.Decision {
  723. return predicate.Decision(func(s *sql.Selector) {
  724. s.Where(sql.GTE(s.C(FieldEndIP), v))
  725. })
  726. }
  727. // EndIPLT applies the LT predicate on the "end_ip" field.
  728. func EndIPLT(v int64) predicate.Decision {
  729. return predicate.Decision(func(s *sql.Selector) {
  730. s.Where(sql.LT(s.C(FieldEndIP), v))
  731. })
  732. }
  733. // EndIPLTE applies the LTE predicate on the "end_ip" field.
  734. func EndIPLTE(v int64) predicate.Decision {
  735. return predicate.Decision(func(s *sql.Selector) {
  736. s.Where(sql.LTE(s.C(FieldEndIP), v))
  737. })
  738. }
  739. // EndIPIsNil applies the IsNil predicate on the "end_ip" field.
  740. func EndIPIsNil() predicate.Decision {
  741. return predicate.Decision(func(s *sql.Selector) {
  742. s.Where(sql.IsNull(s.C(FieldEndIP)))
  743. })
  744. }
  745. // EndIPNotNil applies the NotNil predicate on the "end_ip" field.
  746. func EndIPNotNil() predicate.Decision {
  747. return predicate.Decision(func(s *sql.Selector) {
  748. s.Where(sql.NotNull(s.C(FieldEndIP)))
  749. })
  750. }
  751. // StartSuffixEQ applies the EQ predicate on the "start_suffix" field.
  752. func StartSuffixEQ(v int64) predicate.Decision {
  753. return predicate.Decision(func(s *sql.Selector) {
  754. s.Where(sql.EQ(s.C(FieldStartSuffix), v))
  755. })
  756. }
  757. // StartSuffixNEQ applies the NEQ predicate on the "start_suffix" field.
  758. func StartSuffixNEQ(v int64) predicate.Decision {
  759. return predicate.Decision(func(s *sql.Selector) {
  760. s.Where(sql.NEQ(s.C(FieldStartSuffix), v))
  761. })
  762. }
  763. // StartSuffixIn applies the In predicate on the "start_suffix" field.
  764. func StartSuffixIn(vs ...int64) predicate.Decision {
  765. v := make([]interface{}, len(vs))
  766. for i := range v {
  767. v[i] = vs[i]
  768. }
  769. return predicate.Decision(func(s *sql.Selector) {
  770. // if not arguments were provided, append the FALSE constants,
  771. // since we can't apply "IN ()". This will make this predicate falsy.
  772. if len(v) == 0 {
  773. s.Where(sql.False())
  774. return
  775. }
  776. s.Where(sql.In(s.C(FieldStartSuffix), v...))
  777. })
  778. }
  779. // StartSuffixNotIn applies the NotIn predicate on the "start_suffix" field.
  780. func StartSuffixNotIn(vs ...int64) predicate.Decision {
  781. v := make([]interface{}, len(vs))
  782. for i := range v {
  783. v[i] = vs[i]
  784. }
  785. return predicate.Decision(func(s *sql.Selector) {
  786. // if not arguments were provided, append the FALSE constants,
  787. // since we can't apply "IN ()". This will make this predicate falsy.
  788. if len(v) == 0 {
  789. s.Where(sql.False())
  790. return
  791. }
  792. s.Where(sql.NotIn(s.C(FieldStartSuffix), v...))
  793. })
  794. }
  795. // StartSuffixGT applies the GT predicate on the "start_suffix" field.
  796. func StartSuffixGT(v int64) predicate.Decision {
  797. return predicate.Decision(func(s *sql.Selector) {
  798. s.Where(sql.GT(s.C(FieldStartSuffix), v))
  799. })
  800. }
  801. // StartSuffixGTE applies the GTE predicate on the "start_suffix" field.
  802. func StartSuffixGTE(v int64) predicate.Decision {
  803. return predicate.Decision(func(s *sql.Selector) {
  804. s.Where(sql.GTE(s.C(FieldStartSuffix), v))
  805. })
  806. }
  807. // StartSuffixLT applies the LT predicate on the "start_suffix" field.
  808. func StartSuffixLT(v int64) predicate.Decision {
  809. return predicate.Decision(func(s *sql.Selector) {
  810. s.Where(sql.LT(s.C(FieldStartSuffix), v))
  811. })
  812. }
  813. // StartSuffixLTE applies the LTE predicate on the "start_suffix" field.
  814. func StartSuffixLTE(v int64) predicate.Decision {
  815. return predicate.Decision(func(s *sql.Selector) {
  816. s.Where(sql.LTE(s.C(FieldStartSuffix), v))
  817. })
  818. }
  819. // StartSuffixIsNil applies the IsNil predicate on the "start_suffix" field.
  820. func StartSuffixIsNil() predicate.Decision {
  821. return predicate.Decision(func(s *sql.Selector) {
  822. s.Where(sql.IsNull(s.C(FieldStartSuffix)))
  823. })
  824. }
  825. // StartSuffixNotNil applies the NotNil predicate on the "start_suffix" field.
  826. func StartSuffixNotNil() predicate.Decision {
  827. return predicate.Decision(func(s *sql.Selector) {
  828. s.Where(sql.NotNull(s.C(FieldStartSuffix)))
  829. })
  830. }
  831. // EndSuffixEQ applies the EQ predicate on the "end_suffix" field.
  832. func EndSuffixEQ(v int64) predicate.Decision {
  833. return predicate.Decision(func(s *sql.Selector) {
  834. s.Where(sql.EQ(s.C(FieldEndSuffix), v))
  835. })
  836. }
  837. // EndSuffixNEQ applies the NEQ predicate on the "end_suffix" field.
  838. func EndSuffixNEQ(v int64) predicate.Decision {
  839. return predicate.Decision(func(s *sql.Selector) {
  840. s.Where(sql.NEQ(s.C(FieldEndSuffix), v))
  841. })
  842. }
  843. // EndSuffixIn applies the In predicate on the "end_suffix" field.
  844. func EndSuffixIn(vs ...int64) predicate.Decision {
  845. v := make([]interface{}, len(vs))
  846. for i := range v {
  847. v[i] = vs[i]
  848. }
  849. return predicate.Decision(func(s *sql.Selector) {
  850. // if not arguments were provided, append the FALSE constants,
  851. // since we can't apply "IN ()". This will make this predicate falsy.
  852. if len(v) == 0 {
  853. s.Where(sql.False())
  854. return
  855. }
  856. s.Where(sql.In(s.C(FieldEndSuffix), v...))
  857. })
  858. }
  859. // EndSuffixNotIn applies the NotIn predicate on the "end_suffix" field.
  860. func EndSuffixNotIn(vs ...int64) predicate.Decision {
  861. v := make([]interface{}, len(vs))
  862. for i := range v {
  863. v[i] = vs[i]
  864. }
  865. return predicate.Decision(func(s *sql.Selector) {
  866. // if not arguments were provided, append the FALSE constants,
  867. // since we can't apply "IN ()". This will make this predicate falsy.
  868. if len(v) == 0 {
  869. s.Where(sql.False())
  870. return
  871. }
  872. s.Where(sql.NotIn(s.C(FieldEndSuffix), v...))
  873. })
  874. }
  875. // EndSuffixGT applies the GT predicate on the "end_suffix" field.
  876. func EndSuffixGT(v int64) predicate.Decision {
  877. return predicate.Decision(func(s *sql.Selector) {
  878. s.Where(sql.GT(s.C(FieldEndSuffix), v))
  879. })
  880. }
  881. // EndSuffixGTE applies the GTE predicate on the "end_suffix" field.
  882. func EndSuffixGTE(v int64) predicate.Decision {
  883. return predicate.Decision(func(s *sql.Selector) {
  884. s.Where(sql.GTE(s.C(FieldEndSuffix), v))
  885. })
  886. }
  887. // EndSuffixLT applies the LT predicate on the "end_suffix" field.
  888. func EndSuffixLT(v int64) predicate.Decision {
  889. return predicate.Decision(func(s *sql.Selector) {
  890. s.Where(sql.LT(s.C(FieldEndSuffix), v))
  891. })
  892. }
  893. // EndSuffixLTE applies the LTE predicate on the "end_suffix" field.
  894. func EndSuffixLTE(v int64) predicate.Decision {
  895. return predicate.Decision(func(s *sql.Selector) {
  896. s.Where(sql.LTE(s.C(FieldEndSuffix), v))
  897. })
  898. }
  899. // EndSuffixIsNil applies the IsNil predicate on the "end_suffix" field.
  900. func EndSuffixIsNil() predicate.Decision {
  901. return predicate.Decision(func(s *sql.Selector) {
  902. s.Where(sql.IsNull(s.C(FieldEndSuffix)))
  903. })
  904. }
  905. // EndSuffixNotNil applies the NotNil predicate on the "end_suffix" field.
  906. func EndSuffixNotNil() predicate.Decision {
  907. return predicate.Decision(func(s *sql.Selector) {
  908. s.Where(sql.NotNull(s.C(FieldEndSuffix)))
  909. })
  910. }
  911. // IPSizeEQ applies the EQ predicate on the "ip_size" field.
  912. func IPSizeEQ(v int64) predicate.Decision {
  913. return predicate.Decision(func(s *sql.Selector) {
  914. s.Where(sql.EQ(s.C(FieldIPSize), v))
  915. })
  916. }
  917. // IPSizeNEQ applies the NEQ predicate on the "ip_size" field.
  918. func IPSizeNEQ(v int64) predicate.Decision {
  919. return predicate.Decision(func(s *sql.Selector) {
  920. s.Where(sql.NEQ(s.C(FieldIPSize), v))
  921. })
  922. }
  923. // IPSizeIn applies the In predicate on the "ip_size" field.
  924. func IPSizeIn(vs ...int64) predicate.Decision {
  925. v := make([]interface{}, len(vs))
  926. for i := range v {
  927. v[i] = vs[i]
  928. }
  929. return predicate.Decision(func(s *sql.Selector) {
  930. // if not arguments were provided, append the FALSE constants,
  931. // since we can't apply "IN ()". This will make this predicate falsy.
  932. if len(v) == 0 {
  933. s.Where(sql.False())
  934. return
  935. }
  936. s.Where(sql.In(s.C(FieldIPSize), v...))
  937. })
  938. }
  939. // IPSizeNotIn applies the NotIn predicate on the "ip_size" field.
  940. func IPSizeNotIn(vs ...int64) predicate.Decision {
  941. v := make([]interface{}, len(vs))
  942. for i := range v {
  943. v[i] = vs[i]
  944. }
  945. return predicate.Decision(func(s *sql.Selector) {
  946. // if not arguments were provided, append the FALSE constants,
  947. // since we can't apply "IN ()". This will make this predicate falsy.
  948. if len(v) == 0 {
  949. s.Where(sql.False())
  950. return
  951. }
  952. s.Where(sql.NotIn(s.C(FieldIPSize), v...))
  953. })
  954. }
  955. // IPSizeGT applies the GT predicate on the "ip_size" field.
  956. func IPSizeGT(v int64) predicate.Decision {
  957. return predicate.Decision(func(s *sql.Selector) {
  958. s.Where(sql.GT(s.C(FieldIPSize), v))
  959. })
  960. }
  961. // IPSizeGTE applies the GTE predicate on the "ip_size" field.
  962. func IPSizeGTE(v int64) predicate.Decision {
  963. return predicate.Decision(func(s *sql.Selector) {
  964. s.Where(sql.GTE(s.C(FieldIPSize), v))
  965. })
  966. }
  967. // IPSizeLT applies the LT predicate on the "ip_size" field.
  968. func IPSizeLT(v int64) predicate.Decision {
  969. return predicate.Decision(func(s *sql.Selector) {
  970. s.Where(sql.LT(s.C(FieldIPSize), v))
  971. })
  972. }
  973. // IPSizeLTE applies the LTE predicate on the "ip_size" field.
  974. func IPSizeLTE(v int64) predicate.Decision {
  975. return predicate.Decision(func(s *sql.Selector) {
  976. s.Where(sql.LTE(s.C(FieldIPSize), v))
  977. })
  978. }
  979. // IPSizeIsNil applies the IsNil predicate on the "ip_size" field.
  980. func IPSizeIsNil() predicate.Decision {
  981. return predicate.Decision(func(s *sql.Selector) {
  982. s.Where(sql.IsNull(s.C(FieldIPSize)))
  983. })
  984. }
  985. // IPSizeNotNil applies the NotNil predicate on the "ip_size" field.
  986. func IPSizeNotNil() predicate.Decision {
  987. return predicate.Decision(func(s *sql.Selector) {
  988. s.Where(sql.NotNull(s.C(FieldIPSize)))
  989. })
  990. }
  991. // ScopeEQ applies the EQ predicate on the "scope" field.
  992. func ScopeEQ(v string) predicate.Decision {
  993. return predicate.Decision(func(s *sql.Selector) {
  994. s.Where(sql.EQ(s.C(FieldScope), v))
  995. })
  996. }
  997. // ScopeNEQ applies the NEQ predicate on the "scope" field.
  998. func ScopeNEQ(v string) predicate.Decision {
  999. return predicate.Decision(func(s *sql.Selector) {
  1000. s.Where(sql.NEQ(s.C(FieldScope), v))
  1001. })
  1002. }
  1003. // ScopeIn applies the In predicate on the "scope" field.
  1004. func ScopeIn(vs ...string) predicate.Decision {
  1005. v := make([]interface{}, len(vs))
  1006. for i := range v {
  1007. v[i] = vs[i]
  1008. }
  1009. return predicate.Decision(func(s *sql.Selector) {
  1010. // if not arguments were provided, append the FALSE constants,
  1011. // since we can't apply "IN ()". This will make this predicate falsy.
  1012. if len(v) == 0 {
  1013. s.Where(sql.False())
  1014. return
  1015. }
  1016. s.Where(sql.In(s.C(FieldScope), v...))
  1017. })
  1018. }
  1019. // ScopeNotIn applies the NotIn predicate on the "scope" field.
  1020. func ScopeNotIn(vs ...string) predicate.Decision {
  1021. v := make([]interface{}, len(vs))
  1022. for i := range v {
  1023. v[i] = vs[i]
  1024. }
  1025. return predicate.Decision(func(s *sql.Selector) {
  1026. // if not arguments were provided, append the FALSE constants,
  1027. // since we can't apply "IN ()". This will make this predicate falsy.
  1028. if len(v) == 0 {
  1029. s.Where(sql.False())
  1030. return
  1031. }
  1032. s.Where(sql.NotIn(s.C(FieldScope), v...))
  1033. })
  1034. }
  1035. // ScopeGT applies the GT predicate on the "scope" field.
  1036. func ScopeGT(v string) predicate.Decision {
  1037. return predicate.Decision(func(s *sql.Selector) {
  1038. s.Where(sql.GT(s.C(FieldScope), v))
  1039. })
  1040. }
  1041. // ScopeGTE applies the GTE predicate on the "scope" field.
  1042. func ScopeGTE(v string) predicate.Decision {
  1043. return predicate.Decision(func(s *sql.Selector) {
  1044. s.Where(sql.GTE(s.C(FieldScope), v))
  1045. })
  1046. }
  1047. // ScopeLT applies the LT predicate on the "scope" field.
  1048. func ScopeLT(v string) predicate.Decision {
  1049. return predicate.Decision(func(s *sql.Selector) {
  1050. s.Where(sql.LT(s.C(FieldScope), v))
  1051. })
  1052. }
  1053. // ScopeLTE applies the LTE predicate on the "scope" field.
  1054. func ScopeLTE(v string) predicate.Decision {
  1055. return predicate.Decision(func(s *sql.Selector) {
  1056. s.Where(sql.LTE(s.C(FieldScope), v))
  1057. })
  1058. }
  1059. // ScopeContains applies the Contains predicate on the "scope" field.
  1060. func ScopeContains(v string) predicate.Decision {
  1061. return predicate.Decision(func(s *sql.Selector) {
  1062. s.Where(sql.Contains(s.C(FieldScope), v))
  1063. })
  1064. }
  1065. // ScopeHasPrefix applies the HasPrefix predicate on the "scope" field.
  1066. func ScopeHasPrefix(v string) predicate.Decision {
  1067. return predicate.Decision(func(s *sql.Selector) {
  1068. s.Where(sql.HasPrefix(s.C(FieldScope), v))
  1069. })
  1070. }
  1071. // ScopeHasSuffix applies the HasSuffix predicate on the "scope" field.
  1072. func ScopeHasSuffix(v string) predicate.Decision {
  1073. return predicate.Decision(func(s *sql.Selector) {
  1074. s.Where(sql.HasSuffix(s.C(FieldScope), v))
  1075. })
  1076. }
  1077. // ScopeEqualFold applies the EqualFold predicate on the "scope" field.
  1078. func ScopeEqualFold(v string) predicate.Decision {
  1079. return predicate.Decision(func(s *sql.Selector) {
  1080. s.Where(sql.EqualFold(s.C(FieldScope), v))
  1081. })
  1082. }
  1083. // ScopeContainsFold applies the ContainsFold predicate on the "scope" field.
  1084. func ScopeContainsFold(v string) predicate.Decision {
  1085. return predicate.Decision(func(s *sql.Selector) {
  1086. s.Where(sql.ContainsFold(s.C(FieldScope), v))
  1087. })
  1088. }
  1089. // ValueEQ applies the EQ predicate on the "value" field.
  1090. func ValueEQ(v string) predicate.Decision {
  1091. return predicate.Decision(func(s *sql.Selector) {
  1092. s.Where(sql.EQ(s.C(FieldValue), v))
  1093. })
  1094. }
  1095. // ValueNEQ applies the NEQ predicate on the "value" field.
  1096. func ValueNEQ(v string) predicate.Decision {
  1097. return predicate.Decision(func(s *sql.Selector) {
  1098. s.Where(sql.NEQ(s.C(FieldValue), v))
  1099. })
  1100. }
  1101. // ValueIn applies the In predicate on the "value" field.
  1102. func ValueIn(vs ...string) predicate.Decision {
  1103. v := make([]interface{}, len(vs))
  1104. for i := range v {
  1105. v[i] = vs[i]
  1106. }
  1107. return predicate.Decision(func(s *sql.Selector) {
  1108. // if not arguments were provided, append the FALSE constants,
  1109. // since we can't apply "IN ()". This will make this predicate falsy.
  1110. if len(v) == 0 {
  1111. s.Where(sql.False())
  1112. return
  1113. }
  1114. s.Where(sql.In(s.C(FieldValue), v...))
  1115. })
  1116. }
  1117. // ValueNotIn applies the NotIn predicate on the "value" field.
  1118. func ValueNotIn(vs ...string) predicate.Decision {
  1119. v := make([]interface{}, len(vs))
  1120. for i := range v {
  1121. v[i] = vs[i]
  1122. }
  1123. return predicate.Decision(func(s *sql.Selector) {
  1124. // if not arguments were provided, append the FALSE constants,
  1125. // since we can't apply "IN ()". This will make this predicate falsy.
  1126. if len(v) == 0 {
  1127. s.Where(sql.False())
  1128. return
  1129. }
  1130. s.Where(sql.NotIn(s.C(FieldValue), v...))
  1131. })
  1132. }
  1133. // ValueGT applies the GT predicate on the "value" field.
  1134. func ValueGT(v string) predicate.Decision {
  1135. return predicate.Decision(func(s *sql.Selector) {
  1136. s.Where(sql.GT(s.C(FieldValue), v))
  1137. })
  1138. }
  1139. // ValueGTE applies the GTE predicate on the "value" field.
  1140. func ValueGTE(v string) predicate.Decision {
  1141. return predicate.Decision(func(s *sql.Selector) {
  1142. s.Where(sql.GTE(s.C(FieldValue), v))
  1143. })
  1144. }
  1145. // ValueLT applies the LT predicate on the "value" field.
  1146. func ValueLT(v string) predicate.Decision {
  1147. return predicate.Decision(func(s *sql.Selector) {
  1148. s.Where(sql.LT(s.C(FieldValue), v))
  1149. })
  1150. }
  1151. // ValueLTE applies the LTE predicate on the "value" field.
  1152. func ValueLTE(v string) predicate.Decision {
  1153. return predicate.Decision(func(s *sql.Selector) {
  1154. s.Where(sql.LTE(s.C(FieldValue), v))
  1155. })
  1156. }
  1157. // ValueContains applies the Contains predicate on the "value" field.
  1158. func ValueContains(v string) predicate.Decision {
  1159. return predicate.Decision(func(s *sql.Selector) {
  1160. s.Where(sql.Contains(s.C(FieldValue), v))
  1161. })
  1162. }
  1163. // ValueHasPrefix applies the HasPrefix predicate on the "value" field.
  1164. func ValueHasPrefix(v string) predicate.Decision {
  1165. return predicate.Decision(func(s *sql.Selector) {
  1166. s.Where(sql.HasPrefix(s.C(FieldValue), v))
  1167. })
  1168. }
  1169. // ValueHasSuffix applies the HasSuffix predicate on the "value" field.
  1170. func ValueHasSuffix(v string) predicate.Decision {
  1171. return predicate.Decision(func(s *sql.Selector) {
  1172. s.Where(sql.HasSuffix(s.C(FieldValue), v))
  1173. })
  1174. }
  1175. // ValueEqualFold applies the EqualFold predicate on the "value" field.
  1176. func ValueEqualFold(v string) predicate.Decision {
  1177. return predicate.Decision(func(s *sql.Selector) {
  1178. s.Where(sql.EqualFold(s.C(FieldValue), v))
  1179. })
  1180. }
  1181. // ValueContainsFold applies the ContainsFold predicate on the "value" field.
  1182. func ValueContainsFold(v string) predicate.Decision {
  1183. return predicate.Decision(func(s *sql.Selector) {
  1184. s.Where(sql.ContainsFold(s.C(FieldValue), v))
  1185. })
  1186. }
  1187. // OriginEQ applies the EQ predicate on the "origin" field.
  1188. func OriginEQ(v string) predicate.Decision {
  1189. return predicate.Decision(func(s *sql.Selector) {
  1190. s.Where(sql.EQ(s.C(FieldOrigin), v))
  1191. })
  1192. }
  1193. // OriginNEQ applies the NEQ predicate on the "origin" field.
  1194. func OriginNEQ(v string) predicate.Decision {
  1195. return predicate.Decision(func(s *sql.Selector) {
  1196. s.Where(sql.NEQ(s.C(FieldOrigin), v))
  1197. })
  1198. }
  1199. // OriginIn applies the In predicate on the "origin" field.
  1200. func OriginIn(vs ...string) predicate.Decision {
  1201. v := make([]interface{}, len(vs))
  1202. for i := range v {
  1203. v[i] = vs[i]
  1204. }
  1205. return predicate.Decision(func(s *sql.Selector) {
  1206. // if not arguments were provided, append the FALSE constants,
  1207. // since we can't apply "IN ()". This will make this predicate falsy.
  1208. if len(v) == 0 {
  1209. s.Where(sql.False())
  1210. return
  1211. }
  1212. s.Where(sql.In(s.C(FieldOrigin), v...))
  1213. })
  1214. }
  1215. // OriginNotIn applies the NotIn predicate on the "origin" field.
  1216. func OriginNotIn(vs ...string) predicate.Decision {
  1217. v := make([]interface{}, len(vs))
  1218. for i := range v {
  1219. v[i] = vs[i]
  1220. }
  1221. return predicate.Decision(func(s *sql.Selector) {
  1222. // if not arguments were provided, append the FALSE constants,
  1223. // since we can't apply "IN ()". This will make this predicate falsy.
  1224. if len(v) == 0 {
  1225. s.Where(sql.False())
  1226. return
  1227. }
  1228. s.Where(sql.NotIn(s.C(FieldOrigin), v...))
  1229. })
  1230. }
  1231. // OriginGT applies the GT predicate on the "origin" field.
  1232. func OriginGT(v string) predicate.Decision {
  1233. return predicate.Decision(func(s *sql.Selector) {
  1234. s.Where(sql.GT(s.C(FieldOrigin), v))
  1235. })
  1236. }
  1237. // OriginGTE applies the GTE predicate on the "origin" field.
  1238. func OriginGTE(v string) predicate.Decision {
  1239. return predicate.Decision(func(s *sql.Selector) {
  1240. s.Where(sql.GTE(s.C(FieldOrigin), v))
  1241. })
  1242. }
  1243. // OriginLT applies the LT predicate on the "origin" field.
  1244. func OriginLT(v string) predicate.Decision {
  1245. return predicate.Decision(func(s *sql.Selector) {
  1246. s.Where(sql.LT(s.C(FieldOrigin), v))
  1247. })
  1248. }
  1249. // OriginLTE applies the LTE predicate on the "origin" field.
  1250. func OriginLTE(v string) predicate.Decision {
  1251. return predicate.Decision(func(s *sql.Selector) {
  1252. s.Where(sql.LTE(s.C(FieldOrigin), v))
  1253. })
  1254. }
  1255. // OriginContains applies the Contains predicate on the "origin" field.
  1256. func OriginContains(v string) predicate.Decision {
  1257. return predicate.Decision(func(s *sql.Selector) {
  1258. s.Where(sql.Contains(s.C(FieldOrigin), v))
  1259. })
  1260. }
  1261. // OriginHasPrefix applies the HasPrefix predicate on the "origin" field.
  1262. func OriginHasPrefix(v string) predicate.Decision {
  1263. return predicate.Decision(func(s *sql.Selector) {
  1264. s.Where(sql.HasPrefix(s.C(FieldOrigin), v))
  1265. })
  1266. }
  1267. // OriginHasSuffix applies the HasSuffix predicate on the "origin" field.
  1268. func OriginHasSuffix(v string) predicate.Decision {
  1269. return predicate.Decision(func(s *sql.Selector) {
  1270. s.Where(sql.HasSuffix(s.C(FieldOrigin), v))
  1271. })
  1272. }
  1273. // OriginEqualFold applies the EqualFold predicate on the "origin" field.
  1274. func OriginEqualFold(v string) predicate.Decision {
  1275. return predicate.Decision(func(s *sql.Selector) {
  1276. s.Where(sql.EqualFold(s.C(FieldOrigin), v))
  1277. })
  1278. }
  1279. // OriginContainsFold applies the ContainsFold predicate on the "origin" field.
  1280. func OriginContainsFold(v string) predicate.Decision {
  1281. return predicate.Decision(func(s *sql.Selector) {
  1282. s.Where(sql.ContainsFold(s.C(FieldOrigin), v))
  1283. })
  1284. }
  1285. // SimulatedEQ applies the EQ predicate on the "simulated" field.
  1286. func SimulatedEQ(v bool) predicate.Decision {
  1287. return predicate.Decision(func(s *sql.Selector) {
  1288. s.Where(sql.EQ(s.C(FieldSimulated), v))
  1289. })
  1290. }
  1291. // SimulatedNEQ applies the NEQ predicate on the "simulated" field.
  1292. func SimulatedNEQ(v bool) predicate.Decision {
  1293. return predicate.Decision(func(s *sql.Selector) {
  1294. s.Where(sql.NEQ(s.C(FieldSimulated), v))
  1295. })
  1296. }
  1297. // HasOwner applies the HasEdge predicate on the "owner" edge.
  1298. func HasOwner() predicate.Decision {
  1299. return predicate.Decision(func(s *sql.Selector) {
  1300. step := sqlgraph.NewStep(
  1301. sqlgraph.From(Table, FieldID),
  1302. sqlgraph.To(OwnerTable, FieldID),
  1303. sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
  1304. )
  1305. sqlgraph.HasNeighbors(s, step)
  1306. })
  1307. }
  1308. // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
  1309. func HasOwnerWith(preds ...predicate.Alert) predicate.Decision {
  1310. return predicate.Decision(func(s *sql.Selector) {
  1311. step := sqlgraph.NewStep(
  1312. sqlgraph.From(Table, FieldID),
  1313. sqlgraph.To(OwnerInverseTable, FieldID),
  1314. sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
  1315. )
  1316. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  1317. for _, p := range preds {
  1318. p(s)
  1319. }
  1320. })
  1321. })
  1322. }
  1323. // And groups predicates with the AND operator between them.
  1324. func And(predicates ...predicate.Decision) predicate.Decision {
  1325. return predicate.Decision(func(s *sql.Selector) {
  1326. s1 := s.Clone().SetP(nil)
  1327. for _, p := range predicates {
  1328. p(s1)
  1329. }
  1330. s.Where(s1.P())
  1331. })
  1332. }
  1333. // Or groups predicates with the OR operator between them.
  1334. func Or(predicates ...predicate.Decision) predicate.Decision {
  1335. return predicate.Decision(func(s *sql.Selector) {
  1336. s1 := s.Clone().SetP(nil)
  1337. for i, p := range predicates {
  1338. if i > 0 {
  1339. s1.Or()
  1340. }
  1341. p(s1)
  1342. }
  1343. s.Where(s1.P())
  1344. })
  1345. }
  1346. // Not applies the not operator on the given predicate.
  1347. func Not(p predicate.Decision) predicate.Decision {
  1348. return predicate.Decision(func(s *sql.Selector) {
  1349. p(s.Not())
  1350. })
  1351. }