batchimagejob.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. // Code generated by ent, DO NOT EDIT.
  2. package batchimagejob
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the batchimagejob type in the database.
  9. Label = "batch_image_job"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldBatchID holds the string denoting the batch_id field in the database.
  13. FieldBatchID = "batch_id"
  14. // FieldUserID holds the string denoting the user_id field in the database.
  15. FieldUserID = "user_id"
  16. // FieldAPIKeyID holds the string denoting the api_key_id field in the database.
  17. FieldAPIKeyID = "api_key_id"
  18. // FieldAccountID holds the string denoting the account_id field in the database.
  19. FieldAccountID = "account_id"
  20. // FieldProvider holds the string denoting the provider field in the database.
  21. FieldProvider = "provider"
  22. // FieldModel holds the string denoting the model field in the database.
  23. FieldModel = "model"
  24. // FieldTaskName holds the string denoting the task_name field in the database.
  25. FieldTaskName = "task_name"
  26. // FieldStatus holds the string denoting the status field in the database.
  27. FieldStatus = "status"
  28. // FieldProviderJobName holds the string denoting the provider_job_name field in the database.
  29. FieldProviderJobName = "provider_job_name"
  30. // FieldProviderInputRef holds the string denoting the provider_input_ref field in the database.
  31. FieldProviderInputRef = "provider_input_ref"
  32. // FieldProviderOutputRef holds the string denoting the provider_output_ref field in the database.
  33. FieldProviderOutputRef = "provider_output_ref"
  34. // FieldGcsInputURI holds the string denoting the gcs_input_uri field in the database.
  35. FieldGcsInputURI = "gcs_input_uri"
  36. // FieldGcsOutputURI holds the string denoting the gcs_output_uri field in the database.
  37. FieldGcsOutputURI = "gcs_output_uri"
  38. // FieldItemCount holds the string denoting the item_count field in the database.
  39. FieldItemCount = "item_count"
  40. // FieldSuccessCount holds the string denoting the success_count field in the database.
  41. FieldSuccessCount = "success_count"
  42. // FieldFailCount holds the string denoting the fail_count field in the database.
  43. FieldFailCount = "fail_count"
  44. // FieldCancelledCount holds the string denoting the cancelled_count field in the database.
  45. FieldCancelledCount = "cancelled_count"
  46. // FieldEstimatedCost holds the string denoting the estimated_cost field in the database.
  47. FieldEstimatedCost = "estimated_cost"
  48. // FieldHoldAmount holds the string denoting the hold_amount field in the database.
  49. FieldHoldAmount = "hold_amount"
  50. // FieldActualCost holds the string denoting the actual_cost field in the database.
  51. FieldActualCost = "actual_cost"
  52. // FieldCurrency holds the string denoting the currency field in the database.
  53. FieldCurrency = "currency"
  54. // FieldHoldID holds the string denoting the hold_id field in the database.
  55. FieldHoldID = "hold_id"
  56. // FieldIdempotencyKey holds the string denoting the idempotency_key field in the database.
  57. FieldIdempotencyKey = "idempotency_key"
  58. // FieldRequestHash holds the string denoting the request_hash field in the database.
  59. FieldRequestHash = "request_hash"
  60. // FieldManifestHash holds the string denoting the manifest_hash field in the database.
  61. FieldManifestHash = "manifest_hash"
  62. // FieldRetryCount holds the string denoting the retry_count field in the database.
  63. FieldRetryCount = "retry_count"
  64. // FieldVersion holds the string denoting the version field in the database.
  65. FieldVersion = "version"
  66. // FieldOutputExpiresAt holds the string denoting the output_expires_at field in the database.
  67. FieldOutputExpiresAt = "output_expires_at"
  68. // FieldInputDeletedAt holds the string denoting the input_deleted_at field in the database.
  69. FieldInputDeletedAt = "input_deleted_at"
  70. // FieldOutputDeletedAt holds the string denoting the output_deleted_at field in the database.
  71. FieldOutputDeletedAt = "output_deleted_at"
  72. // FieldDownloadedAt holds the string denoting the downloaded_at field in the database.
  73. FieldDownloadedAt = "downloaded_at"
  74. // FieldUserDeletedAt holds the string denoting the user_deleted_at field in the database.
  75. FieldUserDeletedAt = "user_deleted_at"
  76. // FieldLastErrorCode holds the string denoting the last_error_code field in the database.
  77. FieldLastErrorCode = "last_error_code"
  78. // FieldLastErrorMessage holds the string denoting the last_error_message field in the database.
  79. FieldLastErrorMessage = "last_error_message"
  80. // FieldCreatedAt holds the string denoting the created_at field in the database.
  81. FieldCreatedAt = "created_at"
  82. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  83. FieldUpdatedAt = "updated_at"
  84. // FieldSubmittedAt holds the string denoting the submitted_at field in the database.
  85. FieldSubmittedAt = "submitted_at"
  86. // FieldStartedAt holds the string denoting the started_at field in the database.
  87. FieldStartedAt = "started_at"
  88. // FieldFinishedAt holds the string denoting the finished_at field in the database.
  89. FieldFinishedAt = "finished_at"
  90. // FieldSettledAt holds the string denoting the settled_at field in the database.
  91. FieldSettledAt = "settled_at"
  92. // Table holds the table name of the batchimagejob in the database.
  93. Table = "batch_image_jobs"
  94. )
  95. // Columns holds all SQL columns for batchimagejob fields.
  96. var Columns = []string{
  97. FieldID,
  98. FieldBatchID,
  99. FieldUserID,
  100. FieldAPIKeyID,
  101. FieldAccountID,
  102. FieldProvider,
  103. FieldModel,
  104. FieldTaskName,
  105. FieldStatus,
  106. FieldProviderJobName,
  107. FieldProviderInputRef,
  108. FieldProviderOutputRef,
  109. FieldGcsInputURI,
  110. FieldGcsOutputURI,
  111. FieldItemCount,
  112. FieldSuccessCount,
  113. FieldFailCount,
  114. FieldCancelledCount,
  115. FieldEstimatedCost,
  116. FieldHoldAmount,
  117. FieldActualCost,
  118. FieldCurrency,
  119. FieldHoldID,
  120. FieldIdempotencyKey,
  121. FieldRequestHash,
  122. FieldManifestHash,
  123. FieldRetryCount,
  124. FieldVersion,
  125. FieldOutputExpiresAt,
  126. FieldInputDeletedAt,
  127. FieldOutputDeletedAt,
  128. FieldDownloadedAt,
  129. FieldUserDeletedAt,
  130. FieldLastErrorCode,
  131. FieldLastErrorMessage,
  132. FieldCreatedAt,
  133. FieldUpdatedAt,
  134. FieldSubmittedAt,
  135. FieldStartedAt,
  136. FieldFinishedAt,
  137. FieldSettledAt,
  138. }
  139. // ValidColumn reports if the column name is valid (part of the table columns).
  140. func ValidColumn(column string) bool {
  141. for i := range Columns {
  142. if column == Columns[i] {
  143. return true
  144. }
  145. }
  146. return false
  147. }
  148. var (
  149. // BatchIDValidator is a validator for the "batch_id" field. It is called by the builders before save.
  150. BatchIDValidator func(string) error
  151. // ProviderValidator is a validator for the "provider" field. It is called by the builders before save.
  152. ProviderValidator func(string) error
  153. // ModelValidator is a validator for the "model" field. It is called by the builders before save.
  154. ModelValidator func(string) error
  155. // DefaultTaskName holds the default value on creation for the "task_name" field.
  156. DefaultTaskName string
  157. // TaskNameValidator is a validator for the "task_name" field. It is called by the builders before save.
  158. TaskNameValidator func(string) error
  159. // DefaultStatus holds the default value on creation for the "status" field.
  160. DefaultStatus string
  161. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  162. StatusValidator func(string) error
  163. // ProviderJobNameValidator is a validator for the "provider_job_name" field. It is called by the builders before save.
  164. ProviderJobNameValidator func(string) error
  165. // ProviderInputRefValidator is a validator for the "provider_input_ref" field. It is called by the builders before save.
  166. ProviderInputRefValidator func(string) error
  167. // ProviderOutputRefValidator is a validator for the "provider_output_ref" field. It is called by the builders before save.
  168. ProviderOutputRefValidator func(string) error
  169. // GcsInputURIValidator is a validator for the "gcs_input_uri" field. It is called by the builders before save.
  170. GcsInputURIValidator func(string) error
  171. // GcsOutputURIValidator is a validator for the "gcs_output_uri" field. It is called by the builders before save.
  172. GcsOutputURIValidator func(string) error
  173. // DefaultSuccessCount holds the default value on creation for the "success_count" field.
  174. DefaultSuccessCount int
  175. // DefaultFailCount holds the default value on creation for the "fail_count" field.
  176. DefaultFailCount int
  177. // DefaultCancelledCount holds the default value on creation for the "cancelled_count" field.
  178. DefaultCancelledCount int
  179. // DefaultEstimatedCost holds the default value on creation for the "estimated_cost" field.
  180. DefaultEstimatedCost float64
  181. // DefaultCurrency holds the default value on creation for the "currency" field.
  182. DefaultCurrency string
  183. // CurrencyValidator is a validator for the "currency" field. It is called by the builders before save.
  184. CurrencyValidator func(string) error
  185. // HoldIDValidator is a validator for the "hold_id" field. It is called by the builders before save.
  186. HoldIDValidator func(string) error
  187. // IdempotencyKeyValidator is a validator for the "idempotency_key" field. It is called by the builders before save.
  188. IdempotencyKeyValidator func(string) error
  189. // RequestHashValidator is a validator for the "request_hash" field. It is called by the builders before save.
  190. RequestHashValidator func(string) error
  191. // ManifestHashValidator is a validator for the "manifest_hash" field. It is called by the builders before save.
  192. ManifestHashValidator func(string) error
  193. // DefaultRetryCount holds the default value on creation for the "retry_count" field.
  194. DefaultRetryCount int
  195. // DefaultVersion holds the default value on creation for the "version" field.
  196. DefaultVersion int
  197. // LastErrorCodeValidator is a validator for the "last_error_code" field. It is called by the builders before save.
  198. LastErrorCodeValidator func(string) error
  199. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  200. DefaultCreatedAt func() time.Time
  201. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  202. DefaultUpdatedAt func() time.Time
  203. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  204. UpdateDefaultUpdatedAt func() time.Time
  205. )
  206. // OrderOption defines the ordering options for the BatchImageJob queries.
  207. type OrderOption func(*sql.Selector)
  208. // ByID orders the results by the id field.
  209. func ByID(opts ...sql.OrderTermOption) OrderOption {
  210. return sql.OrderByField(FieldID, opts...).ToFunc()
  211. }
  212. // ByBatchID orders the results by the batch_id field.
  213. func ByBatchID(opts ...sql.OrderTermOption) OrderOption {
  214. return sql.OrderByField(FieldBatchID, opts...).ToFunc()
  215. }
  216. // ByUserID orders the results by the user_id field.
  217. func ByUserID(opts ...sql.OrderTermOption) OrderOption {
  218. return sql.OrderByField(FieldUserID, opts...).ToFunc()
  219. }
  220. // ByAPIKeyID orders the results by the api_key_id field.
  221. func ByAPIKeyID(opts ...sql.OrderTermOption) OrderOption {
  222. return sql.OrderByField(FieldAPIKeyID, opts...).ToFunc()
  223. }
  224. // ByAccountID orders the results by the account_id field.
  225. func ByAccountID(opts ...sql.OrderTermOption) OrderOption {
  226. return sql.OrderByField(FieldAccountID, opts...).ToFunc()
  227. }
  228. // ByProvider orders the results by the provider field.
  229. func ByProvider(opts ...sql.OrderTermOption) OrderOption {
  230. return sql.OrderByField(FieldProvider, opts...).ToFunc()
  231. }
  232. // ByModel orders the results by the model field.
  233. func ByModel(opts ...sql.OrderTermOption) OrderOption {
  234. return sql.OrderByField(FieldModel, opts...).ToFunc()
  235. }
  236. // ByTaskName orders the results by the task_name field.
  237. func ByTaskName(opts ...sql.OrderTermOption) OrderOption {
  238. return sql.OrderByField(FieldTaskName, opts...).ToFunc()
  239. }
  240. // ByStatus orders the results by the status field.
  241. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  242. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  243. }
  244. // ByProviderJobName orders the results by the provider_job_name field.
  245. func ByProviderJobName(opts ...sql.OrderTermOption) OrderOption {
  246. return sql.OrderByField(FieldProviderJobName, opts...).ToFunc()
  247. }
  248. // ByProviderInputRef orders the results by the provider_input_ref field.
  249. func ByProviderInputRef(opts ...sql.OrderTermOption) OrderOption {
  250. return sql.OrderByField(FieldProviderInputRef, opts...).ToFunc()
  251. }
  252. // ByProviderOutputRef orders the results by the provider_output_ref field.
  253. func ByProviderOutputRef(opts ...sql.OrderTermOption) OrderOption {
  254. return sql.OrderByField(FieldProviderOutputRef, opts...).ToFunc()
  255. }
  256. // ByGcsInputURI orders the results by the gcs_input_uri field.
  257. func ByGcsInputURI(opts ...sql.OrderTermOption) OrderOption {
  258. return sql.OrderByField(FieldGcsInputURI, opts...).ToFunc()
  259. }
  260. // ByGcsOutputURI orders the results by the gcs_output_uri field.
  261. func ByGcsOutputURI(opts ...sql.OrderTermOption) OrderOption {
  262. return sql.OrderByField(FieldGcsOutputURI, opts...).ToFunc()
  263. }
  264. // ByItemCount orders the results by the item_count field.
  265. func ByItemCount(opts ...sql.OrderTermOption) OrderOption {
  266. return sql.OrderByField(FieldItemCount, opts...).ToFunc()
  267. }
  268. // BySuccessCount orders the results by the success_count field.
  269. func BySuccessCount(opts ...sql.OrderTermOption) OrderOption {
  270. return sql.OrderByField(FieldSuccessCount, opts...).ToFunc()
  271. }
  272. // ByFailCount orders the results by the fail_count field.
  273. func ByFailCount(opts ...sql.OrderTermOption) OrderOption {
  274. return sql.OrderByField(FieldFailCount, opts...).ToFunc()
  275. }
  276. // ByCancelledCount orders the results by the cancelled_count field.
  277. func ByCancelledCount(opts ...sql.OrderTermOption) OrderOption {
  278. return sql.OrderByField(FieldCancelledCount, opts...).ToFunc()
  279. }
  280. // ByEstimatedCost orders the results by the estimated_cost field.
  281. func ByEstimatedCost(opts ...sql.OrderTermOption) OrderOption {
  282. return sql.OrderByField(FieldEstimatedCost, opts...).ToFunc()
  283. }
  284. // ByHoldAmount orders the results by the hold_amount field.
  285. func ByHoldAmount(opts ...sql.OrderTermOption) OrderOption {
  286. return sql.OrderByField(FieldHoldAmount, opts...).ToFunc()
  287. }
  288. // ByActualCost orders the results by the actual_cost field.
  289. func ByActualCost(opts ...sql.OrderTermOption) OrderOption {
  290. return sql.OrderByField(FieldActualCost, opts...).ToFunc()
  291. }
  292. // ByCurrency orders the results by the currency field.
  293. func ByCurrency(opts ...sql.OrderTermOption) OrderOption {
  294. return sql.OrderByField(FieldCurrency, opts...).ToFunc()
  295. }
  296. // ByHoldID orders the results by the hold_id field.
  297. func ByHoldID(opts ...sql.OrderTermOption) OrderOption {
  298. return sql.OrderByField(FieldHoldID, opts...).ToFunc()
  299. }
  300. // ByIdempotencyKey orders the results by the idempotency_key field.
  301. func ByIdempotencyKey(opts ...sql.OrderTermOption) OrderOption {
  302. return sql.OrderByField(FieldIdempotencyKey, opts...).ToFunc()
  303. }
  304. // ByRequestHash orders the results by the request_hash field.
  305. func ByRequestHash(opts ...sql.OrderTermOption) OrderOption {
  306. return sql.OrderByField(FieldRequestHash, opts...).ToFunc()
  307. }
  308. // ByManifestHash orders the results by the manifest_hash field.
  309. func ByManifestHash(opts ...sql.OrderTermOption) OrderOption {
  310. return sql.OrderByField(FieldManifestHash, opts...).ToFunc()
  311. }
  312. // ByRetryCount orders the results by the retry_count field.
  313. func ByRetryCount(opts ...sql.OrderTermOption) OrderOption {
  314. return sql.OrderByField(FieldRetryCount, opts...).ToFunc()
  315. }
  316. // ByVersion orders the results by the version field.
  317. func ByVersion(opts ...sql.OrderTermOption) OrderOption {
  318. return sql.OrderByField(FieldVersion, opts...).ToFunc()
  319. }
  320. // ByOutputExpiresAt orders the results by the output_expires_at field.
  321. func ByOutputExpiresAt(opts ...sql.OrderTermOption) OrderOption {
  322. return sql.OrderByField(FieldOutputExpiresAt, opts...).ToFunc()
  323. }
  324. // ByInputDeletedAt orders the results by the input_deleted_at field.
  325. func ByInputDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  326. return sql.OrderByField(FieldInputDeletedAt, opts...).ToFunc()
  327. }
  328. // ByOutputDeletedAt orders the results by the output_deleted_at field.
  329. func ByOutputDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  330. return sql.OrderByField(FieldOutputDeletedAt, opts...).ToFunc()
  331. }
  332. // ByDownloadedAt orders the results by the downloaded_at field.
  333. func ByDownloadedAt(opts ...sql.OrderTermOption) OrderOption {
  334. return sql.OrderByField(FieldDownloadedAt, opts...).ToFunc()
  335. }
  336. // ByUserDeletedAt orders the results by the user_deleted_at field.
  337. func ByUserDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  338. return sql.OrderByField(FieldUserDeletedAt, opts...).ToFunc()
  339. }
  340. // ByLastErrorCode orders the results by the last_error_code field.
  341. func ByLastErrorCode(opts ...sql.OrderTermOption) OrderOption {
  342. return sql.OrderByField(FieldLastErrorCode, opts...).ToFunc()
  343. }
  344. // ByLastErrorMessage orders the results by the last_error_message field.
  345. func ByLastErrorMessage(opts ...sql.OrderTermOption) OrderOption {
  346. return sql.OrderByField(FieldLastErrorMessage, opts...).ToFunc()
  347. }
  348. // ByCreatedAt orders the results by the created_at field.
  349. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  350. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  351. }
  352. // ByUpdatedAt orders the results by the updated_at field.
  353. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  354. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  355. }
  356. // BySubmittedAt orders the results by the submitted_at field.
  357. func BySubmittedAt(opts ...sql.OrderTermOption) OrderOption {
  358. return sql.OrderByField(FieldSubmittedAt, opts...).ToFunc()
  359. }
  360. // ByStartedAt orders the results by the started_at field.
  361. func ByStartedAt(opts ...sql.OrderTermOption) OrderOption {
  362. return sql.OrderByField(FieldStartedAt, opts...).ToFunc()
  363. }
  364. // ByFinishedAt orders the results by the finished_at field.
  365. func ByFinishedAt(opts ...sql.OrderTermOption) OrderOption {
  366. return sql.OrderByField(FieldFinishedAt, opts...).ToFunc()
  367. }
  368. // BySettledAt orders the results by the settled_at field.
  369. func BySettledAt(opts ...sql.OrderTermOption) OrderOption {
  370. return sql.OrderByField(FieldSettledAt, opts...).ToFunc()
  371. }