channelmonitorrequesttemplate.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. // Code generated by ent, DO NOT EDIT.
  2. package channelmonitorrequesttemplate
  3. import (
  4. "fmt"
  5. "time"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the channelmonitorrequesttemplate type in the database.
  11. Label = "channel_monitor_request_template"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldName holds the string denoting the name field in the database.
  19. FieldName = "name"
  20. // FieldProvider holds the string denoting the provider field in the database.
  21. FieldProvider = "provider"
  22. // FieldAPIMode holds the string denoting the api_mode field in the database.
  23. FieldAPIMode = "api_mode"
  24. // FieldDescription holds the string denoting the description field in the database.
  25. FieldDescription = "description"
  26. // FieldExtraHeaders holds the string denoting the extra_headers field in the database.
  27. FieldExtraHeaders = "extra_headers"
  28. // FieldBodyOverrideMode holds the string denoting the body_override_mode field in the database.
  29. FieldBodyOverrideMode = "body_override_mode"
  30. // FieldBodyOverride holds the string denoting the body_override field in the database.
  31. FieldBodyOverride = "body_override"
  32. // EdgeMonitors holds the string denoting the monitors edge name in mutations.
  33. EdgeMonitors = "monitors"
  34. // Table holds the table name of the channelmonitorrequesttemplate in the database.
  35. Table = "channel_monitor_request_templates"
  36. // MonitorsTable is the table that holds the monitors relation/edge.
  37. MonitorsTable = "channel_monitors"
  38. // MonitorsInverseTable is the table name for the ChannelMonitor entity.
  39. // It exists in this package in order to avoid circular dependency with the "channelmonitor" package.
  40. MonitorsInverseTable = "channel_monitors"
  41. // MonitorsColumn is the table column denoting the monitors relation/edge.
  42. MonitorsColumn = "template_id"
  43. )
  44. // Columns holds all SQL columns for channelmonitorrequesttemplate fields.
  45. var Columns = []string{
  46. FieldID,
  47. FieldCreatedAt,
  48. FieldUpdatedAt,
  49. FieldName,
  50. FieldProvider,
  51. FieldAPIMode,
  52. FieldDescription,
  53. FieldExtraHeaders,
  54. FieldBodyOverrideMode,
  55. FieldBodyOverride,
  56. }
  57. // ValidColumn reports if the column name is valid (part of the table columns).
  58. func ValidColumn(column string) bool {
  59. for i := range Columns {
  60. if column == Columns[i] {
  61. return true
  62. }
  63. }
  64. return false
  65. }
  66. var (
  67. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  68. DefaultCreatedAt func() time.Time
  69. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  70. DefaultUpdatedAt func() time.Time
  71. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  72. UpdateDefaultUpdatedAt func() time.Time
  73. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  74. NameValidator func(string) error
  75. // DefaultAPIMode holds the default value on creation for the "api_mode" field.
  76. DefaultAPIMode string
  77. // APIModeValidator is a validator for the "api_mode" field. It is called by the builders before save.
  78. APIModeValidator func(string) error
  79. // DefaultDescription holds the default value on creation for the "description" field.
  80. DefaultDescription string
  81. // DescriptionValidator is a validator for the "description" field. It is called by the builders before save.
  82. DescriptionValidator func(string) error
  83. // DefaultExtraHeaders holds the default value on creation for the "extra_headers" field.
  84. DefaultExtraHeaders map[string]string
  85. // DefaultBodyOverrideMode holds the default value on creation for the "body_override_mode" field.
  86. DefaultBodyOverrideMode string
  87. // BodyOverrideModeValidator is a validator for the "body_override_mode" field. It is called by the builders before save.
  88. BodyOverrideModeValidator func(string) error
  89. )
  90. // Provider defines the type for the "provider" enum field.
  91. type Provider string
  92. // Provider values.
  93. const (
  94. ProviderOpenai Provider = "openai"
  95. ProviderAnthropic Provider = "anthropic"
  96. ProviderGemini Provider = "gemini"
  97. ProviderGrok Provider = "grok"
  98. ProviderAntigravity Provider = "antigravity"
  99. ProviderKimi Provider = "kimi"
  100. ProviderZhipu Provider = "zhipu"
  101. ProviderDeepseek Provider = "deepseek"
  102. ProviderMinimax Provider = "minimax"
  103. )
  104. func (pr Provider) String() string {
  105. return string(pr)
  106. }
  107. // ProviderValidator is a validator for the "provider" field enum values. It is called by the builders before save.
  108. func ProviderValidator(pr Provider) error {
  109. switch pr {
  110. case ProviderOpenai, ProviderAnthropic, ProviderGemini, ProviderGrok, ProviderAntigravity, ProviderKimi, ProviderZhipu, ProviderDeepseek, ProviderMinimax:
  111. return nil
  112. default:
  113. return fmt.Errorf("channelmonitorrequesttemplate: invalid enum value for provider field: %q", pr)
  114. }
  115. }
  116. // OrderOption defines the ordering options for the ChannelMonitorRequestTemplate queries.
  117. type OrderOption func(*sql.Selector)
  118. // ByID orders the results by the id field.
  119. func ByID(opts ...sql.OrderTermOption) OrderOption {
  120. return sql.OrderByField(FieldID, opts...).ToFunc()
  121. }
  122. // ByCreatedAt orders the results by the created_at field.
  123. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  124. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  125. }
  126. // ByUpdatedAt orders the results by the updated_at field.
  127. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  128. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  129. }
  130. // ByName orders the results by the name field.
  131. func ByName(opts ...sql.OrderTermOption) OrderOption {
  132. return sql.OrderByField(FieldName, opts...).ToFunc()
  133. }
  134. // ByProvider orders the results by the provider field.
  135. func ByProvider(opts ...sql.OrderTermOption) OrderOption {
  136. return sql.OrderByField(FieldProvider, opts...).ToFunc()
  137. }
  138. // ByAPIMode orders the results by the api_mode field.
  139. func ByAPIMode(opts ...sql.OrderTermOption) OrderOption {
  140. return sql.OrderByField(FieldAPIMode, opts...).ToFunc()
  141. }
  142. // ByDescription orders the results by the description field.
  143. func ByDescription(opts ...sql.OrderTermOption) OrderOption {
  144. return sql.OrderByField(FieldDescription, opts...).ToFunc()
  145. }
  146. // ByBodyOverrideMode orders the results by the body_override_mode field.
  147. func ByBodyOverrideMode(opts ...sql.OrderTermOption) OrderOption {
  148. return sql.OrderByField(FieldBodyOverrideMode, opts...).ToFunc()
  149. }
  150. // ByMonitorsCount orders the results by monitors count.
  151. func ByMonitorsCount(opts ...sql.OrderTermOption) OrderOption {
  152. return func(s *sql.Selector) {
  153. sqlgraph.OrderByNeighborsCount(s, newMonitorsStep(), opts...)
  154. }
  155. }
  156. // ByMonitors orders the results by monitors terms.
  157. func ByMonitors(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  158. return func(s *sql.Selector) {
  159. sqlgraph.OrderByNeighborTerms(s, newMonitorsStep(), append([]sql.OrderTerm{term}, terms...)...)
  160. }
  161. }
  162. func newMonitorsStep() *sqlgraph.Step {
  163. return sqlgraph.NewStep(
  164. sqlgraph.From(Table, FieldID),
  165. sqlgraph.To(MonitorsInverseTable, FieldID),
  166. sqlgraph.Edge(sqlgraph.O2M, true, MonitorsTable, MonitorsColumn),
  167. )
  168. }