group.go 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. // Code generated by ent, DO NOT EDIT.
  2. package group
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. "github.com/Wei-Shaw/sub2api/internal/domain"
  9. )
  10. const (
  11. // Label holds the string label denoting the group type in the database.
  12. Label = "group"
  13. // FieldID holds the string denoting the id field in the database.
  14. FieldID = "id"
  15. // FieldCreatedAt holds the string denoting the created_at field in the database.
  16. FieldCreatedAt = "created_at"
  17. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  18. FieldUpdatedAt = "updated_at"
  19. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  20. FieldDeletedAt = "deleted_at"
  21. // FieldName holds the string denoting the name field in the database.
  22. FieldName = "name"
  23. // FieldDescription holds the string denoting the description field in the database.
  24. FieldDescription = "description"
  25. // FieldRateMultiplier holds the string denoting the rate_multiplier field in the database.
  26. FieldRateMultiplier = "rate_multiplier"
  27. // FieldPeakRateEnabled holds the string denoting the peak_rate_enabled field in the database.
  28. FieldPeakRateEnabled = "peak_rate_enabled"
  29. // FieldPeakStart holds the string denoting the peak_start field in the database.
  30. FieldPeakStart = "peak_start"
  31. // FieldPeakEnd holds the string denoting the peak_end field in the database.
  32. FieldPeakEnd = "peak_end"
  33. // FieldPeakRateMultiplier holds the string denoting the peak_rate_multiplier field in the database.
  34. FieldPeakRateMultiplier = "peak_rate_multiplier"
  35. // FieldIsExclusive holds the string denoting the is_exclusive field in the database.
  36. FieldIsExclusive = "is_exclusive"
  37. // FieldSecurityPolicyEnabled holds the string denoting the security_policy_enabled field in the database.
  38. FieldSecurityPolicyEnabled = "security_policy_enabled"
  39. // FieldSecurityPolicyMode holds the string denoting the security_policy_mode field in the database.
  40. FieldSecurityPolicyMode = "security_policy_mode"
  41. // FieldSecurityPolicyEmailEnabled holds the string denoting the security_policy_email_enabled field in the database.
  42. FieldSecurityPolicyEmailEnabled = "security_policy_email_enabled"
  43. // FieldStatus holds the string denoting the status field in the database.
  44. FieldStatus = "status"
  45. // FieldDuplicateOperationID holds the string denoting the duplicate_operation_id field in the database.
  46. FieldDuplicateOperationID = "duplicate_operation_id"
  47. // FieldPlatform holds the string denoting the platform field in the database.
  48. FieldPlatform = "platform"
  49. // FieldSubscriptionType holds the string denoting the subscription_type field in the database.
  50. FieldSubscriptionType = "subscription_type"
  51. // FieldDailyLimitUsd holds the string denoting the daily_limit_usd field in the database.
  52. FieldDailyLimitUsd = "daily_limit_usd"
  53. // FieldWeeklyLimitUsd holds the string denoting the weekly_limit_usd field in the database.
  54. FieldWeeklyLimitUsd = "weekly_limit_usd"
  55. // FieldMonthlyLimitUsd holds the string denoting the monthly_limit_usd field in the database.
  56. FieldMonthlyLimitUsd = "monthly_limit_usd"
  57. // FieldDefaultValidityDays holds the string denoting the default_validity_days field in the database.
  58. FieldDefaultValidityDays = "default_validity_days"
  59. // FieldAllowImageGeneration holds the string denoting the allow_image_generation field in the database.
  60. FieldAllowImageGeneration = "allow_image_generation"
  61. // FieldAllowBatchImageGeneration holds the string denoting the allow_batch_image_generation field in the database.
  62. FieldAllowBatchImageGeneration = "allow_batch_image_generation"
  63. // FieldImageRateIndependent holds the string denoting the image_rate_independent field in the database.
  64. FieldImageRateIndependent = "image_rate_independent"
  65. // FieldImageRateMultiplier holds the string denoting the image_rate_multiplier field in the database.
  66. FieldImageRateMultiplier = "image_rate_multiplier"
  67. // FieldImagePrice1k holds the string denoting the image_price_1k field in the database.
  68. FieldImagePrice1k = "image_price_1k"
  69. // FieldImagePrice2k holds the string denoting the image_price_2k field in the database.
  70. FieldImagePrice2k = "image_price_2k"
  71. // FieldImagePrice4k holds the string denoting the image_price_4k field in the database.
  72. FieldImagePrice4k = "image_price_4k"
  73. // FieldBatchImageDiscountMultiplier holds the string denoting the batch_image_discount_multiplier field in the database.
  74. FieldBatchImageDiscountMultiplier = "batch_image_discount_multiplier"
  75. // FieldBatchImageHoldMultiplier holds the string denoting the batch_image_hold_multiplier field in the database.
  76. FieldBatchImageHoldMultiplier = "batch_image_hold_multiplier"
  77. // FieldVideoRateIndependent holds the string denoting the video_rate_independent field in the database.
  78. FieldVideoRateIndependent = "video_rate_independent"
  79. // FieldVideoRateMultiplier holds the string denoting the video_rate_multiplier field in the database.
  80. FieldVideoRateMultiplier = "video_rate_multiplier"
  81. // FieldVideoPrice480p holds the string denoting the video_price_480p field in the database.
  82. FieldVideoPrice480p = "video_price_480p"
  83. // FieldVideoPrice720p holds the string denoting the video_price_720p field in the database.
  84. FieldVideoPrice720p = "video_price_720p"
  85. // FieldVideoPrice1080p holds the string denoting the video_price_1080p field in the database.
  86. FieldVideoPrice1080p = "video_price_1080p"
  87. // FieldVideoModelPrices holds the string denoting the video_model_prices field in the database.
  88. FieldVideoModelPrices = "video_model_prices"
  89. // FieldWebSearchPricePerCall holds the string denoting the web_search_price_per_call field in the database.
  90. FieldWebSearchPricePerCall = "web_search_price_per_call"
  91. // FieldSearchPricePer1k holds the string denoting the search_price_per_1k field in the database.
  92. FieldSearchPricePer1k = "search_price_per_1k"
  93. // FieldAudioRealtimePricePerMin holds the string denoting the audio_realtime_price_per_min field in the database.
  94. FieldAudioRealtimePricePerMin = "audio_realtime_price_per_min"
  95. // FieldAudioTtsPricePerMillionChars holds the string denoting the audio_tts_price_per_million_chars field in the database.
  96. FieldAudioTtsPricePerMillionChars = "audio_tts_price_per_million_chars"
  97. // FieldAudioSttPricePerHour holds the string denoting the audio_stt_price_per_hour field in the database.
  98. FieldAudioSttPricePerHour = "audio_stt_price_per_hour"
  99. // FieldLongContextPricingEnabled holds the string denoting the long_context_pricing_enabled field in the database.
  100. FieldLongContextPricingEnabled = "long_context_pricing_enabled"
  101. // FieldModelPricing holds the string denoting the model_pricing field in the database.
  102. FieldModelPricing = "model_pricing"
  103. // FieldClaudeCodeOnly holds the string denoting the claude_code_only field in the database.
  104. FieldClaudeCodeOnly = "claude_code_only"
  105. // FieldFallbackGroupID holds the string denoting the fallback_group_id field in the database.
  106. FieldFallbackGroupID = "fallback_group_id"
  107. // FieldFallbackGroupIDOnInvalidRequest holds the string denoting the fallback_group_id_on_invalid_request field in the database.
  108. FieldFallbackGroupIDOnInvalidRequest = "fallback_group_id_on_invalid_request"
  109. // FieldModelRouting holds the string denoting the model_routing field in the database.
  110. FieldModelRouting = "model_routing"
  111. // FieldModelRoutingEnabled holds the string denoting the model_routing_enabled field in the database.
  112. FieldModelRoutingEnabled = "model_routing_enabled"
  113. // FieldMcpXMLInject holds the string denoting the mcp_xml_inject field in the database.
  114. FieldMcpXMLInject = "mcp_xml_inject"
  115. // FieldSupportedModelScopes holds the string denoting the supported_model_scopes field in the database.
  116. FieldSupportedModelScopes = "supported_model_scopes"
  117. // FieldSortOrder holds the string denoting the sort_order field in the database.
  118. FieldSortOrder = "sort_order"
  119. // FieldAllowMessagesDispatch holds the string denoting the allow_messages_dispatch field in the database.
  120. FieldAllowMessagesDispatch = "allow_messages_dispatch"
  121. // FieldAllowLive holds the string denoting the allow_live field in the database.
  122. FieldAllowLive = "allow_live"
  123. // FieldForceOpenaiFast holds the string denoting the force_openai_fast field in the database.
  124. FieldForceOpenaiFast = "force_openai_fast"
  125. // FieldFreeOpenaiFast holds the string denoting the free_openai_fast field in the database.
  126. FieldFreeOpenaiFast = "free_openai_fast"
  127. // FieldRequireOauthOnly holds the string denoting the require_oauth_only field in the database.
  128. FieldRequireOauthOnly = "require_oauth_only"
  129. // FieldRequirePrivacySet holds the string denoting the require_privacy_set field in the database.
  130. FieldRequirePrivacySet = "require_privacy_set"
  131. // FieldDefaultMappedModel holds the string denoting the default_mapped_model field in the database.
  132. FieldDefaultMappedModel = "default_mapped_model"
  133. // FieldMessagesDispatchModelConfig holds the string denoting the messages_dispatch_model_config field in the database.
  134. FieldMessagesDispatchModelConfig = "messages_dispatch_model_config"
  135. // FieldModelAllowlist holds the string denoting the model_allowlist field in the database.
  136. FieldModelAllowlist = "model_allowlist"
  137. // FieldCodexModelsManifestConfig holds the string denoting the codex_models_manifest_config field in the database.
  138. FieldCodexModelsManifestConfig = "codex_models_manifest_config"
  139. // FieldRpmLimit holds the string denoting the rpm_limit field in the database.
  140. FieldRpmLimit = "rpm_limit"
  141. // FieldMaxReasoningEffort holds the string denoting the max_reasoning_effort field in the database.
  142. FieldMaxReasoningEffort = "max_reasoning_effort"
  143. // FieldMaxReasoningEffortOverLimit holds the string denoting the max_reasoning_effort_over_limit field in the database.
  144. FieldMaxReasoningEffortOverLimit = "max_reasoning_effort_over_limit"
  145. // FieldReasoningEffortMappings holds the string denoting the reasoning_effort_mappings field in the database.
  146. FieldReasoningEffortMappings = "reasoning_effort_mappings"
  147. // FieldProfitControlEnabled holds the string denoting the profit_control_enabled field in the database.
  148. FieldProfitControlEnabled = "profit_control_enabled"
  149. // FieldProfitMinMargin holds the string denoting the profit_min_margin field in the database.
  150. FieldProfitMinMargin = "profit_min_margin"
  151. // FieldProfitSafetyBuffer holds the string denoting the profit_safety_buffer field in the database.
  152. FieldProfitSafetyBuffer = "profit_safety_buffer"
  153. // EdgeAPIKeys holds the string denoting the api_keys edge name in mutations.
  154. EdgeAPIKeys = "api_keys"
  155. // EdgeRedeemCodes holds the string denoting the redeem_codes edge name in mutations.
  156. EdgeRedeemCodes = "redeem_codes"
  157. // EdgeSubscriptions holds the string denoting the subscriptions edge name in mutations.
  158. EdgeSubscriptions = "subscriptions"
  159. // EdgeUsageLogs holds the string denoting the usage_logs edge name in mutations.
  160. EdgeUsageLogs = "usage_logs"
  161. // EdgeAccounts holds the string denoting the accounts edge name in mutations.
  162. EdgeAccounts = "accounts"
  163. // EdgeAllowedUsers holds the string denoting the allowed_users edge name in mutations.
  164. EdgeAllowedUsers = "allowed_users"
  165. // EdgeAccountGroups holds the string denoting the account_groups edge name in mutations.
  166. EdgeAccountGroups = "account_groups"
  167. // EdgeUserAllowedGroups holds the string denoting the user_allowed_groups edge name in mutations.
  168. EdgeUserAllowedGroups = "user_allowed_groups"
  169. // Table holds the table name of the group in the database.
  170. Table = "groups"
  171. // APIKeysTable is the table that holds the api_keys relation/edge.
  172. APIKeysTable = "api_keys"
  173. // APIKeysInverseTable is the table name for the APIKey entity.
  174. // It exists in this package in order to avoid circular dependency with the "apikey" package.
  175. APIKeysInverseTable = "api_keys"
  176. // APIKeysColumn is the table column denoting the api_keys relation/edge.
  177. APIKeysColumn = "group_id"
  178. // RedeemCodesTable is the table that holds the redeem_codes relation/edge.
  179. RedeemCodesTable = "redeem_codes"
  180. // RedeemCodesInverseTable is the table name for the RedeemCode entity.
  181. // It exists in this package in order to avoid circular dependency with the "redeemcode" package.
  182. RedeemCodesInverseTable = "redeem_codes"
  183. // RedeemCodesColumn is the table column denoting the redeem_codes relation/edge.
  184. RedeemCodesColumn = "group_id"
  185. // SubscriptionsTable is the table that holds the subscriptions relation/edge.
  186. SubscriptionsTable = "user_subscriptions"
  187. // SubscriptionsInverseTable is the table name for the UserSubscription entity.
  188. // It exists in this package in order to avoid circular dependency with the "usersubscription" package.
  189. SubscriptionsInverseTable = "user_subscriptions"
  190. // SubscriptionsColumn is the table column denoting the subscriptions relation/edge.
  191. SubscriptionsColumn = "group_id"
  192. // UsageLogsTable is the table that holds the usage_logs relation/edge.
  193. UsageLogsTable = "usage_logs"
  194. // UsageLogsInverseTable is the table name for the UsageLog entity.
  195. // It exists in this package in order to avoid circular dependency with the "usagelog" package.
  196. UsageLogsInverseTable = "usage_logs"
  197. // UsageLogsColumn is the table column denoting the usage_logs relation/edge.
  198. UsageLogsColumn = "group_id"
  199. // AccountsTable is the table that holds the accounts relation/edge. The primary key declared below.
  200. AccountsTable = "account_groups"
  201. // AccountsInverseTable is the table name for the Account entity.
  202. // It exists in this package in order to avoid circular dependency with the "account" package.
  203. AccountsInverseTable = "accounts"
  204. // AllowedUsersTable is the table that holds the allowed_users relation/edge. The primary key declared below.
  205. AllowedUsersTable = "user_allowed_groups"
  206. // AllowedUsersInverseTable is the table name for the User entity.
  207. // It exists in this package in order to avoid circular dependency with the "user" package.
  208. AllowedUsersInverseTable = "users"
  209. // AccountGroupsTable is the table that holds the account_groups relation/edge.
  210. AccountGroupsTable = "account_groups"
  211. // AccountGroupsInverseTable is the table name for the AccountGroup entity.
  212. // It exists in this package in order to avoid circular dependency with the "accountgroup" package.
  213. AccountGroupsInverseTable = "account_groups"
  214. // AccountGroupsColumn is the table column denoting the account_groups relation/edge.
  215. AccountGroupsColumn = "group_id"
  216. // UserAllowedGroupsTable is the table that holds the user_allowed_groups relation/edge.
  217. UserAllowedGroupsTable = "user_allowed_groups"
  218. // UserAllowedGroupsInverseTable is the table name for the UserAllowedGroup entity.
  219. // It exists in this package in order to avoid circular dependency with the "userallowedgroup" package.
  220. UserAllowedGroupsInverseTable = "user_allowed_groups"
  221. // UserAllowedGroupsColumn is the table column denoting the user_allowed_groups relation/edge.
  222. UserAllowedGroupsColumn = "group_id"
  223. )
  224. // Columns holds all SQL columns for group fields.
  225. var Columns = []string{
  226. FieldID,
  227. FieldCreatedAt,
  228. FieldUpdatedAt,
  229. FieldDeletedAt,
  230. FieldName,
  231. FieldDescription,
  232. FieldRateMultiplier,
  233. FieldPeakRateEnabled,
  234. FieldPeakStart,
  235. FieldPeakEnd,
  236. FieldPeakRateMultiplier,
  237. FieldIsExclusive,
  238. FieldSecurityPolicyEnabled,
  239. FieldSecurityPolicyMode,
  240. FieldSecurityPolicyEmailEnabled,
  241. FieldStatus,
  242. FieldDuplicateOperationID,
  243. FieldPlatform,
  244. FieldSubscriptionType,
  245. FieldDailyLimitUsd,
  246. FieldWeeklyLimitUsd,
  247. FieldMonthlyLimitUsd,
  248. FieldDefaultValidityDays,
  249. FieldAllowImageGeneration,
  250. FieldAllowBatchImageGeneration,
  251. FieldImageRateIndependent,
  252. FieldImageRateMultiplier,
  253. FieldImagePrice1k,
  254. FieldImagePrice2k,
  255. FieldImagePrice4k,
  256. FieldBatchImageDiscountMultiplier,
  257. FieldBatchImageHoldMultiplier,
  258. FieldVideoRateIndependent,
  259. FieldVideoRateMultiplier,
  260. FieldVideoPrice480p,
  261. FieldVideoPrice720p,
  262. FieldVideoPrice1080p,
  263. FieldVideoModelPrices,
  264. FieldWebSearchPricePerCall,
  265. FieldSearchPricePer1k,
  266. FieldAudioRealtimePricePerMin,
  267. FieldAudioTtsPricePerMillionChars,
  268. FieldAudioSttPricePerHour,
  269. FieldLongContextPricingEnabled,
  270. FieldModelPricing,
  271. FieldClaudeCodeOnly,
  272. FieldFallbackGroupID,
  273. FieldFallbackGroupIDOnInvalidRequest,
  274. FieldModelRouting,
  275. FieldModelRoutingEnabled,
  276. FieldMcpXMLInject,
  277. FieldSupportedModelScopes,
  278. FieldSortOrder,
  279. FieldAllowMessagesDispatch,
  280. FieldAllowLive,
  281. FieldForceOpenaiFast,
  282. FieldFreeOpenaiFast,
  283. FieldRequireOauthOnly,
  284. FieldRequirePrivacySet,
  285. FieldDefaultMappedModel,
  286. FieldMessagesDispatchModelConfig,
  287. FieldModelAllowlist,
  288. FieldCodexModelsManifestConfig,
  289. FieldRpmLimit,
  290. FieldMaxReasoningEffort,
  291. FieldMaxReasoningEffortOverLimit,
  292. FieldReasoningEffortMappings,
  293. FieldProfitControlEnabled,
  294. FieldProfitMinMargin,
  295. FieldProfitSafetyBuffer,
  296. }
  297. var (
  298. // AccountsPrimaryKey and AccountsColumn2 are the table columns denoting the
  299. // primary key for the accounts relation (M2M).
  300. AccountsPrimaryKey = []string{"account_id", "group_id"}
  301. // AllowedUsersPrimaryKey and AllowedUsersColumn2 are the table columns denoting the
  302. // primary key for the allowed_users relation (M2M).
  303. AllowedUsersPrimaryKey = []string{"user_id", "group_id"}
  304. )
  305. // ValidColumn reports if the column name is valid (part of the table columns).
  306. func ValidColumn(column string) bool {
  307. for i := range Columns {
  308. if column == Columns[i] {
  309. return true
  310. }
  311. }
  312. return false
  313. }
  314. // Note that the variables below are initialized by the runtime
  315. // package on the initialization of the application. Therefore,
  316. // it should be imported in the main as follows:
  317. //
  318. // import _ "github.com/Wei-Shaw/sub2api/ent/runtime"
  319. var (
  320. Hooks [1]ent.Hook
  321. Interceptors [1]ent.Interceptor
  322. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  323. DefaultCreatedAt func() time.Time
  324. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  325. DefaultUpdatedAt func() time.Time
  326. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  327. UpdateDefaultUpdatedAt func() time.Time
  328. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  329. NameValidator func(string) error
  330. // DefaultRateMultiplier holds the default value on creation for the "rate_multiplier" field.
  331. DefaultRateMultiplier float64
  332. // DefaultPeakRateEnabled holds the default value on creation for the "peak_rate_enabled" field.
  333. DefaultPeakRateEnabled bool
  334. // DefaultPeakStart holds the default value on creation for the "peak_start" field.
  335. DefaultPeakStart string
  336. // PeakStartValidator is a validator for the "peak_start" field. It is called by the builders before save.
  337. PeakStartValidator func(string) error
  338. // DefaultPeakEnd holds the default value on creation for the "peak_end" field.
  339. DefaultPeakEnd string
  340. // PeakEndValidator is a validator for the "peak_end" field. It is called by the builders before save.
  341. PeakEndValidator func(string) error
  342. // DefaultPeakRateMultiplier holds the default value on creation for the "peak_rate_multiplier" field.
  343. DefaultPeakRateMultiplier float64
  344. // DefaultIsExclusive holds the default value on creation for the "is_exclusive" field.
  345. DefaultIsExclusive bool
  346. // DefaultSecurityPolicyEnabled holds the default value on creation for the "security_policy_enabled" field.
  347. DefaultSecurityPolicyEnabled bool
  348. // DefaultSecurityPolicyMode holds the default value on creation for the "security_policy_mode" field.
  349. DefaultSecurityPolicyMode string
  350. // SecurityPolicyModeValidator is a validator for the "security_policy_mode" field. It is called by the builders before save.
  351. SecurityPolicyModeValidator func(string) error
  352. // DefaultSecurityPolicyEmailEnabled holds the default value on creation for the "security_policy_email_enabled" field.
  353. DefaultSecurityPolicyEmailEnabled bool
  354. // DefaultStatus holds the default value on creation for the "status" field.
  355. DefaultStatus string
  356. // StatusValidator is a validator for the "status" field. It is called by the builders before save.
  357. StatusValidator func(string) error
  358. // DuplicateOperationIDValidator is a validator for the "duplicate_operation_id" field. It is called by the builders before save.
  359. DuplicateOperationIDValidator func(string) error
  360. // DefaultPlatform holds the default value on creation for the "platform" field.
  361. DefaultPlatform string
  362. // PlatformValidator is a validator for the "platform" field. It is called by the builders before save.
  363. PlatformValidator func(string) error
  364. // DefaultSubscriptionType holds the default value on creation for the "subscription_type" field.
  365. DefaultSubscriptionType string
  366. // SubscriptionTypeValidator is a validator for the "subscription_type" field. It is called by the builders before save.
  367. SubscriptionTypeValidator func(string) error
  368. // DefaultDefaultValidityDays holds the default value on creation for the "default_validity_days" field.
  369. DefaultDefaultValidityDays int
  370. // DefaultAllowImageGeneration holds the default value on creation for the "allow_image_generation" field.
  371. DefaultAllowImageGeneration bool
  372. // DefaultAllowBatchImageGeneration holds the default value on creation for the "allow_batch_image_generation" field.
  373. DefaultAllowBatchImageGeneration bool
  374. // DefaultImageRateIndependent holds the default value on creation for the "image_rate_independent" field.
  375. DefaultImageRateIndependent bool
  376. // DefaultImageRateMultiplier holds the default value on creation for the "image_rate_multiplier" field.
  377. DefaultImageRateMultiplier float64
  378. // DefaultBatchImageDiscountMultiplier holds the default value on creation for the "batch_image_discount_multiplier" field.
  379. DefaultBatchImageDiscountMultiplier float64
  380. // DefaultBatchImageHoldMultiplier holds the default value on creation for the "batch_image_hold_multiplier" field.
  381. DefaultBatchImageHoldMultiplier float64
  382. // DefaultVideoRateIndependent holds the default value on creation for the "video_rate_independent" field.
  383. DefaultVideoRateIndependent bool
  384. // DefaultVideoRateMultiplier holds the default value on creation for the "video_rate_multiplier" field.
  385. DefaultVideoRateMultiplier float64
  386. // SearchPricePer1kValidator is a validator for the "search_price_per_1k" field. It is called by the builders before save.
  387. SearchPricePer1kValidator func(float64) error
  388. // AudioRealtimePricePerMinValidator is a validator for the "audio_realtime_price_per_min" field. It is called by the builders before save.
  389. AudioRealtimePricePerMinValidator func(float64) error
  390. // AudioTtsPricePerMillionCharsValidator is a validator for the "audio_tts_price_per_million_chars" field. It is called by the builders before save.
  391. AudioTtsPricePerMillionCharsValidator func(float64) error
  392. // AudioSttPricePerHourValidator is a validator for the "audio_stt_price_per_hour" field. It is called by the builders before save.
  393. AudioSttPricePerHourValidator func(float64) error
  394. // DefaultLongContextPricingEnabled holds the default value on creation for the "long_context_pricing_enabled" field.
  395. DefaultLongContextPricingEnabled bool
  396. // DefaultClaudeCodeOnly holds the default value on creation for the "claude_code_only" field.
  397. DefaultClaudeCodeOnly bool
  398. // DefaultModelRoutingEnabled holds the default value on creation for the "model_routing_enabled" field.
  399. DefaultModelRoutingEnabled bool
  400. // DefaultMcpXMLInject holds the default value on creation for the "mcp_xml_inject" field.
  401. DefaultMcpXMLInject bool
  402. // DefaultSupportedModelScopes holds the default value on creation for the "supported_model_scopes" field.
  403. DefaultSupportedModelScopes []string
  404. // DefaultSortOrder holds the default value on creation for the "sort_order" field.
  405. DefaultSortOrder int
  406. // DefaultAllowMessagesDispatch holds the default value on creation for the "allow_messages_dispatch" field.
  407. DefaultAllowMessagesDispatch bool
  408. // DefaultAllowLive holds the default value on creation for the "allow_live" field.
  409. DefaultAllowLive bool
  410. // DefaultForceOpenaiFast holds the default value on creation for the "force_openai_fast" field.
  411. DefaultForceOpenaiFast bool
  412. // DefaultFreeOpenaiFast holds the default value on creation for the "free_openai_fast" field.
  413. DefaultFreeOpenaiFast bool
  414. // DefaultRequireOauthOnly holds the default value on creation for the "require_oauth_only" field.
  415. DefaultRequireOauthOnly bool
  416. // DefaultRequirePrivacySet holds the default value on creation for the "require_privacy_set" field.
  417. DefaultRequirePrivacySet bool
  418. // DefaultDefaultMappedModel holds the default value on creation for the "default_mapped_model" field.
  419. DefaultDefaultMappedModel string
  420. // DefaultMappedModelValidator is a validator for the "default_mapped_model" field. It is called by the builders before save.
  421. DefaultMappedModelValidator func(string) error
  422. // DefaultMessagesDispatchModelConfig holds the default value on creation for the "messages_dispatch_model_config" field.
  423. DefaultMessagesDispatchModelConfig domain.OpenAIMessagesDispatchModelConfig
  424. // DefaultModelAllowlist holds the default value on creation for the "model_allowlist" field.
  425. DefaultModelAllowlist domain.GroupModelAllowlist
  426. // DefaultCodexModelsManifestConfig holds the default value on creation for the "codex_models_manifest_config" field.
  427. DefaultCodexModelsManifestConfig domain.GroupCodexModelsManifestConfig
  428. // DefaultRpmLimit holds the default value on creation for the "rpm_limit" field.
  429. DefaultRpmLimit int
  430. // DefaultMaxReasoningEffort holds the default value on creation for the "max_reasoning_effort" field.
  431. DefaultMaxReasoningEffort string
  432. // MaxReasoningEffortValidator is a validator for the "max_reasoning_effort" field. It is called by the builders before save.
  433. MaxReasoningEffortValidator func(string) error
  434. // DefaultMaxReasoningEffortOverLimit holds the default value on creation for the "max_reasoning_effort_over_limit" field.
  435. DefaultMaxReasoningEffortOverLimit string
  436. // MaxReasoningEffortOverLimitValidator is a validator for the "max_reasoning_effort_over_limit" field. It is called by the builders before save.
  437. MaxReasoningEffortOverLimitValidator func(string) error
  438. // DefaultReasoningEffortMappings holds the default value on creation for the "reasoning_effort_mappings" field.
  439. DefaultReasoningEffortMappings []domain.ReasoningEffortMapping
  440. // DefaultProfitControlEnabled holds the default value on creation for the "profit_control_enabled" field.
  441. DefaultProfitControlEnabled bool
  442. // DefaultProfitMinMargin holds the default value on creation for the "profit_min_margin" field.
  443. DefaultProfitMinMargin float64
  444. // DefaultProfitSafetyBuffer holds the default value on creation for the "profit_safety_buffer" field.
  445. DefaultProfitSafetyBuffer float64
  446. )
  447. // OrderOption defines the ordering options for the Group queries.
  448. type OrderOption func(*sql.Selector)
  449. // ByID orders the results by the id field.
  450. func ByID(opts ...sql.OrderTermOption) OrderOption {
  451. return sql.OrderByField(FieldID, opts...).ToFunc()
  452. }
  453. // ByCreatedAt orders the results by the created_at field.
  454. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  455. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  456. }
  457. // ByUpdatedAt orders the results by the updated_at field.
  458. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  459. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  460. }
  461. // ByDeletedAt orders the results by the deleted_at field.
  462. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  463. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  464. }
  465. // ByName orders the results by the name field.
  466. func ByName(opts ...sql.OrderTermOption) OrderOption {
  467. return sql.OrderByField(FieldName, opts...).ToFunc()
  468. }
  469. // ByDescription orders the results by the description field.
  470. func ByDescription(opts ...sql.OrderTermOption) OrderOption {
  471. return sql.OrderByField(FieldDescription, opts...).ToFunc()
  472. }
  473. // ByRateMultiplier orders the results by the rate_multiplier field.
  474. func ByRateMultiplier(opts ...sql.OrderTermOption) OrderOption {
  475. return sql.OrderByField(FieldRateMultiplier, opts...).ToFunc()
  476. }
  477. // ByPeakRateEnabled orders the results by the peak_rate_enabled field.
  478. func ByPeakRateEnabled(opts ...sql.OrderTermOption) OrderOption {
  479. return sql.OrderByField(FieldPeakRateEnabled, opts...).ToFunc()
  480. }
  481. // ByPeakStart orders the results by the peak_start field.
  482. func ByPeakStart(opts ...sql.OrderTermOption) OrderOption {
  483. return sql.OrderByField(FieldPeakStart, opts...).ToFunc()
  484. }
  485. // ByPeakEnd orders the results by the peak_end field.
  486. func ByPeakEnd(opts ...sql.OrderTermOption) OrderOption {
  487. return sql.OrderByField(FieldPeakEnd, opts...).ToFunc()
  488. }
  489. // ByPeakRateMultiplier orders the results by the peak_rate_multiplier field.
  490. func ByPeakRateMultiplier(opts ...sql.OrderTermOption) OrderOption {
  491. return sql.OrderByField(FieldPeakRateMultiplier, opts...).ToFunc()
  492. }
  493. // ByIsExclusive orders the results by the is_exclusive field.
  494. func ByIsExclusive(opts ...sql.OrderTermOption) OrderOption {
  495. return sql.OrderByField(FieldIsExclusive, opts...).ToFunc()
  496. }
  497. // BySecurityPolicyEnabled orders the results by the security_policy_enabled field.
  498. func BySecurityPolicyEnabled(opts ...sql.OrderTermOption) OrderOption {
  499. return sql.OrderByField(FieldSecurityPolicyEnabled, opts...).ToFunc()
  500. }
  501. // BySecurityPolicyMode orders the results by the security_policy_mode field.
  502. func BySecurityPolicyMode(opts ...sql.OrderTermOption) OrderOption {
  503. return sql.OrderByField(FieldSecurityPolicyMode, opts...).ToFunc()
  504. }
  505. // BySecurityPolicyEmailEnabled orders the results by the security_policy_email_enabled field.
  506. func BySecurityPolicyEmailEnabled(opts ...sql.OrderTermOption) OrderOption {
  507. return sql.OrderByField(FieldSecurityPolicyEmailEnabled, opts...).ToFunc()
  508. }
  509. // ByStatus orders the results by the status field.
  510. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  511. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  512. }
  513. // ByDuplicateOperationID orders the results by the duplicate_operation_id field.
  514. func ByDuplicateOperationID(opts ...sql.OrderTermOption) OrderOption {
  515. return sql.OrderByField(FieldDuplicateOperationID, opts...).ToFunc()
  516. }
  517. // ByPlatform orders the results by the platform field.
  518. func ByPlatform(opts ...sql.OrderTermOption) OrderOption {
  519. return sql.OrderByField(FieldPlatform, opts...).ToFunc()
  520. }
  521. // BySubscriptionType orders the results by the subscription_type field.
  522. func BySubscriptionType(opts ...sql.OrderTermOption) OrderOption {
  523. return sql.OrderByField(FieldSubscriptionType, opts...).ToFunc()
  524. }
  525. // ByDailyLimitUsd orders the results by the daily_limit_usd field.
  526. func ByDailyLimitUsd(opts ...sql.OrderTermOption) OrderOption {
  527. return sql.OrderByField(FieldDailyLimitUsd, opts...).ToFunc()
  528. }
  529. // ByWeeklyLimitUsd orders the results by the weekly_limit_usd field.
  530. func ByWeeklyLimitUsd(opts ...sql.OrderTermOption) OrderOption {
  531. return sql.OrderByField(FieldWeeklyLimitUsd, opts...).ToFunc()
  532. }
  533. // ByMonthlyLimitUsd orders the results by the monthly_limit_usd field.
  534. func ByMonthlyLimitUsd(opts ...sql.OrderTermOption) OrderOption {
  535. return sql.OrderByField(FieldMonthlyLimitUsd, opts...).ToFunc()
  536. }
  537. // ByDefaultValidityDays orders the results by the default_validity_days field.
  538. func ByDefaultValidityDays(opts ...sql.OrderTermOption) OrderOption {
  539. return sql.OrderByField(FieldDefaultValidityDays, opts...).ToFunc()
  540. }
  541. // ByAllowImageGeneration orders the results by the allow_image_generation field.
  542. func ByAllowImageGeneration(opts ...sql.OrderTermOption) OrderOption {
  543. return sql.OrderByField(FieldAllowImageGeneration, opts...).ToFunc()
  544. }
  545. // ByAllowBatchImageGeneration orders the results by the allow_batch_image_generation field.
  546. func ByAllowBatchImageGeneration(opts ...sql.OrderTermOption) OrderOption {
  547. return sql.OrderByField(FieldAllowBatchImageGeneration, opts...).ToFunc()
  548. }
  549. // ByImageRateIndependent orders the results by the image_rate_independent field.
  550. func ByImageRateIndependent(opts ...sql.OrderTermOption) OrderOption {
  551. return sql.OrderByField(FieldImageRateIndependent, opts...).ToFunc()
  552. }
  553. // ByImageRateMultiplier orders the results by the image_rate_multiplier field.
  554. func ByImageRateMultiplier(opts ...sql.OrderTermOption) OrderOption {
  555. return sql.OrderByField(FieldImageRateMultiplier, opts...).ToFunc()
  556. }
  557. // ByImagePrice1k orders the results by the image_price_1k field.
  558. func ByImagePrice1k(opts ...sql.OrderTermOption) OrderOption {
  559. return sql.OrderByField(FieldImagePrice1k, opts...).ToFunc()
  560. }
  561. // ByImagePrice2k orders the results by the image_price_2k field.
  562. func ByImagePrice2k(opts ...sql.OrderTermOption) OrderOption {
  563. return sql.OrderByField(FieldImagePrice2k, opts...).ToFunc()
  564. }
  565. // ByImagePrice4k orders the results by the image_price_4k field.
  566. func ByImagePrice4k(opts ...sql.OrderTermOption) OrderOption {
  567. return sql.OrderByField(FieldImagePrice4k, opts...).ToFunc()
  568. }
  569. // ByBatchImageDiscountMultiplier orders the results by the batch_image_discount_multiplier field.
  570. func ByBatchImageDiscountMultiplier(opts ...sql.OrderTermOption) OrderOption {
  571. return sql.OrderByField(FieldBatchImageDiscountMultiplier, opts...).ToFunc()
  572. }
  573. // ByBatchImageHoldMultiplier orders the results by the batch_image_hold_multiplier field.
  574. func ByBatchImageHoldMultiplier(opts ...sql.OrderTermOption) OrderOption {
  575. return sql.OrderByField(FieldBatchImageHoldMultiplier, opts...).ToFunc()
  576. }
  577. // ByVideoRateIndependent orders the results by the video_rate_independent field.
  578. func ByVideoRateIndependent(opts ...sql.OrderTermOption) OrderOption {
  579. return sql.OrderByField(FieldVideoRateIndependent, opts...).ToFunc()
  580. }
  581. // ByVideoRateMultiplier orders the results by the video_rate_multiplier field.
  582. func ByVideoRateMultiplier(opts ...sql.OrderTermOption) OrderOption {
  583. return sql.OrderByField(FieldVideoRateMultiplier, opts...).ToFunc()
  584. }
  585. // ByVideoPrice480p orders the results by the video_price_480p field.
  586. func ByVideoPrice480p(opts ...sql.OrderTermOption) OrderOption {
  587. return sql.OrderByField(FieldVideoPrice480p, opts...).ToFunc()
  588. }
  589. // ByVideoPrice720p orders the results by the video_price_720p field.
  590. func ByVideoPrice720p(opts ...sql.OrderTermOption) OrderOption {
  591. return sql.OrderByField(FieldVideoPrice720p, opts...).ToFunc()
  592. }
  593. // ByVideoPrice1080p orders the results by the video_price_1080p field.
  594. func ByVideoPrice1080p(opts ...sql.OrderTermOption) OrderOption {
  595. return sql.OrderByField(FieldVideoPrice1080p, opts...).ToFunc()
  596. }
  597. // ByWebSearchPricePerCall orders the results by the web_search_price_per_call field.
  598. func ByWebSearchPricePerCall(opts ...sql.OrderTermOption) OrderOption {
  599. return sql.OrderByField(FieldWebSearchPricePerCall, opts...).ToFunc()
  600. }
  601. // BySearchPricePer1k orders the results by the search_price_per_1k field.
  602. func BySearchPricePer1k(opts ...sql.OrderTermOption) OrderOption {
  603. return sql.OrderByField(FieldSearchPricePer1k, opts...).ToFunc()
  604. }
  605. // ByAudioRealtimePricePerMin orders the results by the audio_realtime_price_per_min field.
  606. func ByAudioRealtimePricePerMin(opts ...sql.OrderTermOption) OrderOption {
  607. return sql.OrderByField(FieldAudioRealtimePricePerMin, opts...).ToFunc()
  608. }
  609. // ByAudioTtsPricePerMillionChars orders the results by the audio_tts_price_per_million_chars field.
  610. func ByAudioTtsPricePerMillionChars(opts ...sql.OrderTermOption) OrderOption {
  611. return sql.OrderByField(FieldAudioTtsPricePerMillionChars, opts...).ToFunc()
  612. }
  613. // ByAudioSttPricePerHour orders the results by the audio_stt_price_per_hour field.
  614. func ByAudioSttPricePerHour(opts ...sql.OrderTermOption) OrderOption {
  615. return sql.OrderByField(FieldAudioSttPricePerHour, opts...).ToFunc()
  616. }
  617. // ByLongContextPricingEnabled orders the results by the long_context_pricing_enabled field.
  618. func ByLongContextPricingEnabled(opts ...sql.OrderTermOption) OrderOption {
  619. return sql.OrderByField(FieldLongContextPricingEnabled, opts...).ToFunc()
  620. }
  621. // ByClaudeCodeOnly orders the results by the claude_code_only field.
  622. func ByClaudeCodeOnly(opts ...sql.OrderTermOption) OrderOption {
  623. return sql.OrderByField(FieldClaudeCodeOnly, opts...).ToFunc()
  624. }
  625. // ByFallbackGroupID orders the results by the fallback_group_id field.
  626. func ByFallbackGroupID(opts ...sql.OrderTermOption) OrderOption {
  627. return sql.OrderByField(FieldFallbackGroupID, opts...).ToFunc()
  628. }
  629. // ByFallbackGroupIDOnInvalidRequest orders the results by the fallback_group_id_on_invalid_request field.
  630. func ByFallbackGroupIDOnInvalidRequest(opts ...sql.OrderTermOption) OrderOption {
  631. return sql.OrderByField(FieldFallbackGroupIDOnInvalidRequest, opts...).ToFunc()
  632. }
  633. // ByModelRoutingEnabled orders the results by the model_routing_enabled field.
  634. func ByModelRoutingEnabled(opts ...sql.OrderTermOption) OrderOption {
  635. return sql.OrderByField(FieldModelRoutingEnabled, opts...).ToFunc()
  636. }
  637. // ByMcpXMLInject orders the results by the mcp_xml_inject field.
  638. func ByMcpXMLInject(opts ...sql.OrderTermOption) OrderOption {
  639. return sql.OrderByField(FieldMcpXMLInject, opts...).ToFunc()
  640. }
  641. // BySortOrder orders the results by the sort_order field.
  642. func BySortOrder(opts ...sql.OrderTermOption) OrderOption {
  643. return sql.OrderByField(FieldSortOrder, opts...).ToFunc()
  644. }
  645. // ByAllowMessagesDispatch orders the results by the allow_messages_dispatch field.
  646. func ByAllowMessagesDispatch(opts ...sql.OrderTermOption) OrderOption {
  647. return sql.OrderByField(FieldAllowMessagesDispatch, opts...).ToFunc()
  648. }
  649. // ByAllowLive orders the results by the allow_live field.
  650. func ByAllowLive(opts ...sql.OrderTermOption) OrderOption {
  651. return sql.OrderByField(FieldAllowLive, opts...).ToFunc()
  652. }
  653. // ByForceOpenaiFast orders the results by the force_openai_fast field.
  654. func ByForceOpenaiFast(opts ...sql.OrderTermOption) OrderOption {
  655. return sql.OrderByField(FieldForceOpenaiFast, opts...).ToFunc()
  656. }
  657. // ByFreeOpenaiFast orders the results by the free_openai_fast field.
  658. func ByFreeOpenaiFast(opts ...sql.OrderTermOption) OrderOption {
  659. return sql.OrderByField(FieldFreeOpenaiFast, opts...).ToFunc()
  660. }
  661. // ByRequireOauthOnly orders the results by the require_oauth_only field.
  662. func ByRequireOauthOnly(opts ...sql.OrderTermOption) OrderOption {
  663. return sql.OrderByField(FieldRequireOauthOnly, opts...).ToFunc()
  664. }
  665. // ByRequirePrivacySet orders the results by the require_privacy_set field.
  666. func ByRequirePrivacySet(opts ...sql.OrderTermOption) OrderOption {
  667. return sql.OrderByField(FieldRequirePrivacySet, opts...).ToFunc()
  668. }
  669. // ByDefaultMappedModel orders the results by the default_mapped_model field.
  670. func ByDefaultMappedModel(opts ...sql.OrderTermOption) OrderOption {
  671. return sql.OrderByField(FieldDefaultMappedModel, opts...).ToFunc()
  672. }
  673. // ByRpmLimit orders the results by the rpm_limit field.
  674. func ByRpmLimit(opts ...sql.OrderTermOption) OrderOption {
  675. return sql.OrderByField(FieldRpmLimit, opts...).ToFunc()
  676. }
  677. // ByMaxReasoningEffort orders the results by the max_reasoning_effort field.
  678. func ByMaxReasoningEffort(opts ...sql.OrderTermOption) OrderOption {
  679. return sql.OrderByField(FieldMaxReasoningEffort, opts...).ToFunc()
  680. }
  681. // ByMaxReasoningEffortOverLimit orders the results by the max_reasoning_effort_over_limit field.
  682. func ByMaxReasoningEffortOverLimit(opts ...sql.OrderTermOption) OrderOption {
  683. return sql.OrderByField(FieldMaxReasoningEffortOverLimit, opts...).ToFunc()
  684. }
  685. // ByProfitControlEnabled orders the results by the profit_control_enabled field.
  686. func ByProfitControlEnabled(opts ...sql.OrderTermOption) OrderOption {
  687. return sql.OrderByField(FieldProfitControlEnabled, opts...).ToFunc()
  688. }
  689. // ByProfitMinMargin orders the results by the profit_min_margin field.
  690. func ByProfitMinMargin(opts ...sql.OrderTermOption) OrderOption {
  691. return sql.OrderByField(FieldProfitMinMargin, opts...).ToFunc()
  692. }
  693. // ByProfitSafetyBuffer orders the results by the profit_safety_buffer field.
  694. func ByProfitSafetyBuffer(opts ...sql.OrderTermOption) OrderOption {
  695. return sql.OrderByField(FieldProfitSafetyBuffer, opts...).ToFunc()
  696. }
  697. // ByAPIKeysCount orders the results by api_keys count.
  698. func ByAPIKeysCount(opts ...sql.OrderTermOption) OrderOption {
  699. return func(s *sql.Selector) {
  700. sqlgraph.OrderByNeighborsCount(s, newAPIKeysStep(), opts...)
  701. }
  702. }
  703. // ByAPIKeys orders the results by api_keys terms.
  704. func ByAPIKeys(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  705. return func(s *sql.Selector) {
  706. sqlgraph.OrderByNeighborTerms(s, newAPIKeysStep(), append([]sql.OrderTerm{term}, terms...)...)
  707. }
  708. }
  709. // ByRedeemCodesCount orders the results by redeem_codes count.
  710. func ByRedeemCodesCount(opts ...sql.OrderTermOption) OrderOption {
  711. return func(s *sql.Selector) {
  712. sqlgraph.OrderByNeighborsCount(s, newRedeemCodesStep(), opts...)
  713. }
  714. }
  715. // ByRedeemCodes orders the results by redeem_codes terms.
  716. func ByRedeemCodes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  717. return func(s *sql.Selector) {
  718. sqlgraph.OrderByNeighborTerms(s, newRedeemCodesStep(), append([]sql.OrderTerm{term}, terms...)...)
  719. }
  720. }
  721. // BySubscriptionsCount orders the results by subscriptions count.
  722. func BySubscriptionsCount(opts ...sql.OrderTermOption) OrderOption {
  723. return func(s *sql.Selector) {
  724. sqlgraph.OrderByNeighborsCount(s, newSubscriptionsStep(), opts...)
  725. }
  726. }
  727. // BySubscriptions orders the results by subscriptions terms.
  728. func BySubscriptions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  729. return func(s *sql.Selector) {
  730. sqlgraph.OrderByNeighborTerms(s, newSubscriptionsStep(), append([]sql.OrderTerm{term}, terms...)...)
  731. }
  732. }
  733. // ByUsageLogsCount orders the results by usage_logs count.
  734. func ByUsageLogsCount(opts ...sql.OrderTermOption) OrderOption {
  735. return func(s *sql.Selector) {
  736. sqlgraph.OrderByNeighborsCount(s, newUsageLogsStep(), opts...)
  737. }
  738. }
  739. // ByUsageLogs orders the results by usage_logs terms.
  740. func ByUsageLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  741. return func(s *sql.Selector) {
  742. sqlgraph.OrderByNeighborTerms(s, newUsageLogsStep(), append([]sql.OrderTerm{term}, terms...)...)
  743. }
  744. }
  745. // ByAccountsCount orders the results by accounts count.
  746. func ByAccountsCount(opts ...sql.OrderTermOption) OrderOption {
  747. return func(s *sql.Selector) {
  748. sqlgraph.OrderByNeighborsCount(s, newAccountsStep(), opts...)
  749. }
  750. }
  751. // ByAccounts orders the results by accounts terms.
  752. func ByAccounts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  753. return func(s *sql.Selector) {
  754. sqlgraph.OrderByNeighborTerms(s, newAccountsStep(), append([]sql.OrderTerm{term}, terms...)...)
  755. }
  756. }
  757. // ByAllowedUsersCount orders the results by allowed_users count.
  758. func ByAllowedUsersCount(opts ...sql.OrderTermOption) OrderOption {
  759. return func(s *sql.Selector) {
  760. sqlgraph.OrderByNeighborsCount(s, newAllowedUsersStep(), opts...)
  761. }
  762. }
  763. // ByAllowedUsers orders the results by allowed_users terms.
  764. func ByAllowedUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  765. return func(s *sql.Selector) {
  766. sqlgraph.OrderByNeighborTerms(s, newAllowedUsersStep(), append([]sql.OrderTerm{term}, terms...)...)
  767. }
  768. }
  769. // ByAccountGroupsCount orders the results by account_groups count.
  770. func ByAccountGroupsCount(opts ...sql.OrderTermOption) OrderOption {
  771. return func(s *sql.Selector) {
  772. sqlgraph.OrderByNeighborsCount(s, newAccountGroupsStep(), opts...)
  773. }
  774. }
  775. // ByAccountGroups orders the results by account_groups terms.
  776. func ByAccountGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  777. return func(s *sql.Selector) {
  778. sqlgraph.OrderByNeighborTerms(s, newAccountGroupsStep(), append([]sql.OrderTerm{term}, terms...)...)
  779. }
  780. }
  781. // ByUserAllowedGroupsCount orders the results by user_allowed_groups count.
  782. func ByUserAllowedGroupsCount(opts ...sql.OrderTermOption) OrderOption {
  783. return func(s *sql.Selector) {
  784. sqlgraph.OrderByNeighborsCount(s, newUserAllowedGroupsStep(), opts...)
  785. }
  786. }
  787. // ByUserAllowedGroups orders the results by user_allowed_groups terms.
  788. func ByUserAllowedGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  789. return func(s *sql.Selector) {
  790. sqlgraph.OrderByNeighborTerms(s, newUserAllowedGroupsStep(), append([]sql.OrderTerm{term}, terms...)...)
  791. }
  792. }
  793. func newAPIKeysStep() *sqlgraph.Step {
  794. return sqlgraph.NewStep(
  795. sqlgraph.From(Table, FieldID),
  796. sqlgraph.To(APIKeysInverseTable, FieldID),
  797. sqlgraph.Edge(sqlgraph.O2M, false, APIKeysTable, APIKeysColumn),
  798. )
  799. }
  800. func newRedeemCodesStep() *sqlgraph.Step {
  801. return sqlgraph.NewStep(
  802. sqlgraph.From(Table, FieldID),
  803. sqlgraph.To(RedeemCodesInverseTable, FieldID),
  804. sqlgraph.Edge(sqlgraph.O2M, false, RedeemCodesTable, RedeemCodesColumn),
  805. )
  806. }
  807. func newSubscriptionsStep() *sqlgraph.Step {
  808. return sqlgraph.NewStep(
  809. sqlgraph.From(Table, FieldID),
  810. sqlgraph.To(SubscriptionsInverseTable, FieldID),
  811. sqlgraph.Edge(sqlgraph.O2M, false, SubscriptionsTable, SubscriptionsColumn),
  812. )
  813. }
  814. func newUsageLogsStep() *sqlgraph.Step {
  815. return sqlgraph.NewStep(
  816. sqlgraph.From(Table, FieldID),
  817. sqlgraph.To(UsageLogsInverseTable, FieldID),
  818. sqlgraph.Edge(sqlgraph.O2M, false, UsageLogsTable, UsageLogsColumn),
  819. )
  820. }
  821. func newAccountsStep() *sqlgraph.Step {
  822. return sqlgraph.NewStep(
  823. sqlgraph.From(Table, FieldID),
  824. sqlgraph.To(AccountsInverseTable, FieldID),
  825. sqlgraph.Edge(sqlgraph.M2M, true, AccountsTable, AccountsPrimaryKey...),
  826. )
  827. }
  828. func newAllowedUsersStep() *sqlgraph.Step {
  829. return sqlgraph.NewStep(
  830. sqlgraph.From(Table, FieldID),
  831. sqlgraph.To(AllowedUsersInverseTable, FieldID),
  832. sqlgraph.Edge(sqlgraph.M2M, true, AllowedUsersTable, AllowedUsersPrimaryKey...),
  833. )
  834. }
  835. func newAccountGroupsStep() *sqlgraph.Step {
  836. return sqlgraph.NewStep(
  837. sqlgraph.From(Table, FieldID),
  838. sqlgraph.To(AccountGroupsInverseTable, AccountGroupsColumn),
  839. sqlgraph.Edge(sqlgraph.O2M, true, AccountGroupsTable, AccountGroupsColumn),
  840. )
  841. }
  842. func newUserAllowedGroupsStep() *sqlgraph.Step {
  843. return sqlgraph.NewStep(
  844. sqlgraph.From(Table, FieldID),
  845. sqlgraph.To(UserAllowedGroupsInverseTable, UserAllowedGroupsColumn),
  846. sqlgraph.Edge(sqlgraph.O2M, true, UserAllowedGroupsTable, UserAllowedGroupsColumn),
  847. )
  848. }