| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "encoding/json"
- "fmt"
- "strings"
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "github.com/Wei-Shaw/sub2api/ent/account"
- "github.com/Wei-Shaw/sub2api/ent/proxy"
- )
- // Account is the model entity for the Account schema.
- type Account struct {
- config `json:"-"`
- // ID of the ent.
- ID int64 `json:"id,omitempty"`
- // CreatedAt holds the value of the "created_at" field.
- CreatedAt time.Time `json:"created_at,omitempty"`
- // UpdatedAt holds the value of the "updated_at" field.
- UpdatedAt time.Time `json:"updated_at,omitempty"`
- // DeletedAt holds the value of the "deleted_at" field.
- DeletedAt *time.Time `json:"deleted_at,omitempty"`
- // Name holds the value of the "name" field.
- Name string `json:"name,omitempty"`
- // Notes holds the value of the "notes" field.
- Notes *string `json:"notes,omitempty"`
- // Platform holds the value of the "platform" field.
- Platform string `json:"platform,omitempty"`
- // Type holds the value of the "type" field.
- Type string `json:"type,omitempty"`
- // Credentials holds the value of the "credentials" field.
- Credentials map[string]interface{} `json:"credentials,omitempty"`
- // Extra holds the value of the "extra" field.
- Extra map[string]interface{} `json:"extra,omitempty"`
- // ProxyID holds the value of the "proxy_id" field.
- ProxyID *int64 `json:"proxy_id,omitempty"`
- // Original proxy id replaced by expiry-fallback; for manual revert. NULL = not in fallback.
- ProxyFallbackOriginID *int64 `json:"proxy_fallback_origin_id,omitempty"`
- // Concurrency holds the value of the "concurrency" field.
- Concurrency int `json:"concurrency,omitempty"`
- // LoadFactor holds the value of the "load_factor" field.
- LoadFactor *int `json:"load_factor,omitempty"`
- // Priority holds the value of the "priority" field.
- Priority int `json:"priority,omitempty"`
- // RateMultiplier holds the value of the "rate_multiplier" field.
- RateMultiplier float64 `json:"rate_multiplier,omitempty"`
- // Status holds the value of the "status" field.
- Status string `json:"status,omitempty"`
- // ErrorMessage holds the value of the "error_message" field.
- ErrorMessage *string `json:"error_message,omitempty"`
- // LastUsedAt holds the value of the "last_used_at" field.
- LastUsedAt *time.Time `json:"last_used_at,omitempty"`
- // Account expiration time (NULL means no expiration).
- ExpiresAt *time.Time `json:"expires_at,omitempty"`
- // Auto pause scheduling when account expires.
- AutoPauseOnExpired bool `json:"auto_pause_on_expired,omitempty"`
- // Schedulable holds the value of the "schedulable" field.
- Schedulable bool `json:"schedulable,omitempty"`
- // RateLimitedAt holds the value of the "rate_limited_at" field.
- RateLimitedAt *time.Time `json:"rate_limited_at,omitempty"`
- // RateLimitResetAt holds the value of the "rate_limit_reset_at" field.
- RateLimitResetAt *time.Time `json:"rate_limit_reset_at,omitempty"`
- // OverloadUntil holds the value of the "overload_until" field.
- OverloadUntil *time.Time `json:"overload_until,omitempty"`
- // TempUnschedulableUntil holds the value of the "temp_unschedulable_until" field.
- TempUnschedulableUntil *time.Time `json:"temp_unschedulable_until,omitempty"`
- // TempUnschedulableReason holds the value of the "temp_unschedulable_reason" field.
- TempUnschedulableReason *string `json:"temp_unschedulable_reason,omitempty"`
- // SessionWindowStart holds the value of the "session_window_start" field.
- SessionWindowStart *time.Time `json:"session_window_start,omitempty"`
- // SessionWindowEnd holds the value of the "session_window_end" field.
- SessionWindowEnd *time.Time `json:"session_window_end,omitempty"`
- // SessionWindowStatus holds the value of the "session_window_status" field.
- SessionWindowStatus *string `json:"session_window_status,omitempty"`
- // Parent account id for a linked spark shadow (NULL = normal).
- ParentAccountID *int64 `json:"parent_account_id,omitempty"`
- // 'global' (default) or 'spark' (shadow reads codex_bengalfox).
- QuotaDimension account.QuotaDimension `json:"quota_dimension,omitempty"`
- // Edges holds the relations/edges for other nodes in the graph.
- // The values are being populated by the AccountQuery when eager-loading is set.
- Edges AccountEdges `json:"edges"`
- selectValues sql.SelectValues
- }
- // AccountEdges holds the relations/edges for other nodes in the graph.
- type AccountEdges struct {
- // Groups holds the value of the groups edge.
- Groups []*Group `json:"groups,omitempty"`
- // Proxy holds the value of the proxy edge.
- Proxy *Proxy `json:"proxy,omitempty"`
- // Parent holds the value of the parent edge.
- Parent *Account `json:"parent,omitempty"`
- // Children holds the value of the children edge.
- Children []*Account `json:"children,omitempty"`
- // UsageLogs holds the value of the usage_logs edge.
- UsageLogs []*UsageLog `json:"usage_logs,omitempty"`
- // AccountGroups holds the value of the account_groups edge.
- AccountGroups []*AccountGroup `json:"account_groups,omitempty"`
- // loadedTypes holds the information for reporting if a
- // type was loaded (or requested) in eager-loading or not.
- loadedTypes [6]bool
- }
- // GroupsOrErr returns the Groups value or an error if the edge
- // was not loaded in eager-loading.
- func (e AccountEdges) GroupsOrErr() ([]*Group, error) {
- if e.loadedTypes[0] {
- return e.Groups, nil
- }
- return nil, &NotLoadedError{edge: "groups"}
- }
- // ProxyOrErr returns the Proxy value or an error if the edge
- // was not loaded in eager-loading, or loaded but was not found.
- func (e AccountEdges) ProxyOrErr() (*Proxy, error) {
- if e.Proxy != nil {
- return e.Proxy, nil
- } else if e.loadedTypes[1] {
- return nil, &NotFoundError{label: proxy.Label}
- }
- return nil, &NotLoadedError{edge: "proxy"}
- }
- // ParentOrErr returns the Parent value or an error if the edge
- // was not loaded in eager-loading, or loaded but was not found.
- func (e AccountEdges) ParentOrErr() (*Account, error) {
- if e.Parent != nil {
- return e.Parent, nil
- } else if e.loadedTypes[2] {
- return nil, &NotFoundError{label: account.Label}
- }
- return nil, &NotLoadedError{edge: "parent"}
- }
- // ChildrenOrErr returns the Children value or an error if the edge
- // was not loaded in eager-loading.
- func (e AccountEdges) ChildrenOrErr() ([]*Account, error) {
- if e.loadedTypes[3] {
- return e.Children, nil
- }
- return nil, &NotLoadedError{edge: "children"}
- }
- // UsageLogsOrErr returns the UsageLogs value or an error if the edge
- // was not loaded in eager-loading.
- func (e AccountEdges) UsageLogsOrErr() ([]*UsageLog, error) {
- if e.loadedTypes[4] {
- return e.UsageLogs, nil
- }
- return nil, &NotLoadedError{edge: "usage_logs"}
- }
- // AccountGroupsOrErr returns the AccountGroups value or an error if the edge
- // was not loaded in eager-loading.
- func (e AccountEdges) AccountGroupsOrErr() ([]*AccountGroup, error) {
- if e.loadedTypes[5] {
- return e.AccountGroups, nil
- }
- return nil, &NotLoadedError{edge: "account_groups"}
- }
- // scanValues returns the types for scanning values from sql.Rows.
- func (*Account) scanValues(columns []string) ([]any, error) {
- values := make([]any, len(columns))
- for i := range columns {
- switch columns[i] {
- case account.FieldCredentials, account.FieldExtra:
- values[i] = new([]byte)
- case account.FieldAutoPauseOnExpired, account.FieldSchedulable:
- values[i] = new(sql.NullBool)
- case account.FieldRateMultiplier:
- values[i] = new(sql.NullFloat64)
- case account.FieldID, account.FieldProxyID, account.FieldProxyFallbackOriginID, account.FieldConcurrency, account.FieldLoadFactor, account.FieldPriority, account.FieldParentAccountID:
- values[i] = new(sql.NullInt64)
- case account.FieldName, account.FieldNotes, account.FieldPlatform, account.FieldType, account.FieldStatus, account.FieldErrorMessage, account.FieldTempUnschedulableReason, account.FieldSessionWindowStatus, account.FieldQuotaDimension:
- values[i] = new(sql.NullString)
- case account.FieldCreatedAt, account.FieldUpdatedAt, account.FieldDeletedAt, account.FieldLastUsedAt, account.FieldExpiresAt, account.FieldRateLimitedAt, account.FieldRateLimitResetAt, account.FieldOverloadUntil, account.FieldTempUnschedulableUntil, account.FieldSessionWindowStart, account.FieldSessionWindowEnd:
- values[i] = new(sql.NullTime)
- default:
- values[i] = new(sql.UnknownType)
- }
- }
- return values, nil
- }
- // assignValues assigns the values that were returned from sql.Rows (after scanning)
- // to the Account fields.
- func (_m *Account) assignValues(columns []string, values []any) error {
- if m, n := len(values), len(columns); m < n {
- return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
- }
- for i := range columns {
- switch columns[i] {
- case account.FieldID:
- value, ok := values[i].(*sql.NullInt64)
- if !ok {
- return fmt.Errorf("unexpected type %T for field id", value)
- }
- _m.ID = int64(value.Int64)
- case account.FieldCreatedAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field created_at", values[i])
- } else if value.Valid {
- _m.CreatedAt = value.Time
- }
- case account.FieldUpdatedAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field updated_at", values[i])
- } else if value.Valid {
- _m.UpdatedAt = value.Time
- }
- case account.FieldDeletedAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field deleted_at", values[i])
- } else if value.Valid {
- _m.DeletedAt = new(time.Time)
- *_m.DeletedAt = value.Time
- }
- case account.FieldName:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field name", values[i])
- } else if value.Valid {
- _m.Name = value.String
- }
- case account.FieldNotes:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field notes", values[i])
- } else if value.Valid {
- _m.Notes = new(string)
- *_m.Notes = value.String
- }
- case account.FieldPlatform:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field platform", values[i])
- } else if value.Valid {
- _m.Platform = value.String
- }
- case account.FieldType:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field type", values[i])
- } else if value.Valid {
- _m.Type = value.String
- }
- case account.FieldCredentials:
- if value, ok := values[i].(*[]byte); !ok {
- return fmt.Errorf("unexpected type %T for field credentials", values[i])
- } else if value != nil && len(*value) > 0 {
- if err := json.Unmarshal(*value, &_m.Credentials); err != nil {
- return fmt.Errorf("unmarshal field credentials: %w", err)
- }
- }
- case account.FieldExtra:
- if value, ok := values[i].(*[]byte); !ok {
- return fmt.Errorf("unexpected type %T for field extra", values[i])
- } else if value != nil && len(*value) > 0 {
- if err := json.Unmarshal(*value, &_m.Extra); err != nil {
- return fmt.Errorf("unmarshal field extra: %w", err)
- }
- }
- case account.FieldProxyID:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field proxy_id", values[i])
- } else if value.Valid {
- _m.ProxyID = new(int64)
- *_m.ProxyID = value.Int64
- }
- case account.FieldProxyFallbackOriginID:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field proxy_fallback_origin_id", values[i])
- } else if value.Valid {
- _m.ProxyFallbackOriginID = new(int64)
- *_m.ProxyFallbackOriginID = value.Int64
- }
- case account.FieldConcurrency:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field concurrency", values[i])
- } else if value.Valid {
- _m.Concurrency = int(value.Int64)
- }
- case account.FieldLoadFactor:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field load_factor", values[i])
- } else if value.Valid {
- _m.LoadFactor = new(int)
- *_m.LoadFactor = int(value.Int64)
- }
- case account.FieldPriority:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field priority", values[i])
- } else if value.Valid {
- _m.Priority = int(value.Int64)
- }
- case account.FieldRateMultiplier:
- if value, ok := values[i].(*sql.NullFloat64); !ok {
- return fmt.Errorf("unexpected type %T for field rate_multiplier", values[i])
- } else if value.Valid {
- _m.RateMultiplier = value.Float64
- }
- case account.FieldStatus:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field status", values[i])
- } else if value.Valid {
- _m.Status = value.String
- }
- case account.FieldErrorMessage:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field error_message", values[i])
- } else if value.Valid {
- _m.ErrorMessage = new(string)
- *_m.ErrorMessage = value.String
- }
- case account.FieldLastUsedAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field last_used_at", values[i])
- } else if value.Valid {
- _m.LastUsedAt = new(time.Time)
- *_m.LastUsedAt = value.Time
- }
- case account.FieldExpiresAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field expires_at", values[i])
- } else if value.Valid {
- _m.ExpiresAt = new(time.Time)
- *_m.ExpiresAt = value.Time
- }
- case account.FieldAutoPauseOnExpired:
- if value, ok := values[i].(*sql.NullBool); !ok {
- return fmt.Errorf("unexpected type %T for field auto_pause_on_expired", values[i])
- } else if value.Valid {
- _m.AutoPauseOnExpired = value.Bool
- }
- case account.FieldSchedulable:
- if value, ok := values[i].(*sql.NullBool); !ok {
- return fmt.Errorf("unexpected type %T for field schedulable", values[i])
- } else if value.Valid {
- _m.Schedulable = value.Bool
- }
- case account.FieldRateLimitedAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field rate_limited_at", values[i])
- } else if value.Valid {
- _m.RateLimitedAt = new(time.Time)
- *_m.RateLimitedAt = value.Time
- }
- case account.FieldRateLimitResetAt:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field rate_limit_reset_at", values[i])
- } else if value.Valid {
- _m.RateLimitResetAt = new(time.Time)
- *_m.RateLimitResetAt = value.Time
- }
- case account.FieldOverloadUntil:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field overload_until", values[i])
- } else if value.Valid {
- _m.OverloadUntil = new(time.Time)
- *_m.OverloadUntil = value.Time
- }
- case account.FieldTempUnschedulableUntil:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field temp_unschedulable_until", values[i])
- } else if value.Valid {
- _m.TempUnschedulableUntil = new(time.Time)
- *_m.TempUnschedulableUntil = value.Time
- }
- case account.FieldTempUnschedulableReason:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field temp_unschedulable_reason", values[i])
- } else if value.Valid {
- _m.TempUnschedulableReason = new(string)
- *_m.TempUnschedulableReason = value.String
- }
- case account.FieldSessionWindowStart:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field session_window_start", values[i])
- } else if value.Valid {
- _m.SessionWindowStart = new(time.Time)
- *_m.SessionWindowStart = value.Time
- }
- case account.FieldSessionWindowEnd:
- if value, ok := values[i].(*sql.NullTime); !ok {
- return fmt.Errorf("unexpected type %T for field session_window_end", values[i])
- } else if value.Valid {
- _m.SessionWindowEnd = new(time.Time)
- *_m.SessionWindowEnd = value.Time
- }
- case account.FieldSessionWindowStatus:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field session_window_status", values[i])
- } else if value.Valid {
- _m.SessionWindowStatus = new(string)
- *_m.SessionWindowStatus = value.String
- }
- case account.FieldParentAccountID:
- if value, ok := values[i].(*sql.NullInt64); !ok {
- return fmt.Errorf("unexpected type %T for field parent_account_id", values[i])
- } else if value.Valid {
- _m.ParentAccountID = new(int64)
- *_m.ParentAccountID = value.Int64
- }
- case account.FieldQuotaDimension:
- if value, ok := values[i].(*sql.NullString); !ok {
- return fmt.Errorf("unexpected type %T for field quota_dimension", values[i])
- } else if value.Valid {
- _m.QuotaDimension = account.QuotaDimension(value.String)
- }
- default:
- _m.selectValues.Set(columns[i], values[i])
- }
- }
- return nil
- }
- // Value returns the ent.Value that was dynamically selected and assigned to the Account.
- // This includes values selected through modifiers, order, etc.
- func (_m *Account) Value(name string) (ent.Value, error) {
- return _m.selectValues.Get(name)
- }
- // QueryGroups queries the "groups" edge of the Account entity.
- func (_m *Account) QueryGroups() *GroupQuery {
- return NewAccountClient(_m.config).QueryGroups(_m)
- }
- // QueryProxy queries the "proxy" edge of the Account entity.
- func (_m *Account) QueryProxy() *ProxyQuery {
- return NewAccountClient(_m.config).QueryProxy(_m)
- }
- // QueryParent queries the "parent" edge of the Account entity.
- func (_m *Account) QueryParent() *AccountQuery {
- return NewAccountClient(_m.config).QueryParent(_m)
- }
- // QueryChildren queries the "children" edge of the Account entity.
- func (_m *Account) QueryChildren() *AccountQuery {
- return NewAccountClient(_m.config).QueryChildren(_m)
- }
- // QueryUsageLogs queries the "usage_logs" edge of the Account entity.
- func (_m *Account) QueryUsageLogs() *UsageLogQuery {
- return NewAccountClient(_m.config).QueryUsageLogs(_m)
- }
- // QueryAccountGroups queries the "account_groups" edge of the Account entity.
- func (_m *Account) QueryAccountGroups() *AccountGroupQuery {
- return NewAccountClient(_m.config).QueryAccountGroups(_m)
- }
- // Update returns a builder for updating this Account.
- // Note that you need to call Account.Unwrap() before calling this method if this Account
- // was returned from a transaction, and the transaction was committed or rolled back.
- func (_m *Account) Update() *AccountUpdateOne {
- return NewAccountClient(_m.config).UpdateOne(_m)
- }
- // Unwrap unwraps the Account entity that was returned from a transaction after it was closed,
- // so that all future queries will be executed through the driver which created the transaction.
- func (_m *Account) Unwrap() *Account {
- _tx, ok := _m.config.driver.(*txDriver)
- if !ok {
- panic("ent: Account is not a transactional entity")
- }
- _m.config.driver = _tx.drv
- return _m
- }
- // String implements the fmt.Stringer.
- func (_m *Account) String() string {
- var builder strings.Builder
- builder.WriteString("Account(")
- builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
- builder.WriteString("created_at=")
- builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
- builder.WriteString(", ")
- builder.WriteString("updated_at=")
- builder.WriteString(_m.UpdatedAt.Format(time.ANSIC))
- builder.WriteString(", ")
- if v := _m.DeletedAt; v != nil {
- builder.WriteString("deleted_at=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- builder.WriteString("name=")
- builder.WriteString(_m.Name)
- builder.WriteString(", ")
- if v := _m.Notes; v != nil {
- builder.WriteString("notes=")
- builder.WriteString(*v)
- }
- builder.WriteString(", ")
- builder.WriteString("platform=")
- builder.WriteString(_m.Platform)
- builder.WriteString(", ")
- builder.WriteString("type=")
- builder.WriteString(_m.Type)
- builder.WriteString(", ")
- builder.WriteString("credentials=")
- builder.WriteString(fmt.Sprintf("%v", _m.Credentials))
- builder.WriteString(", ")
- builder.WriteString("extra=")
- builder.WriteString(fmt.Sprintf("%v", _m.Extra))
- builder.WriteString(", ")
- if v := _m.ProxyID; v != nil {
- builder.WriteString("proxy_id=")
- builder.WriteString(fmt.Sprintf("%v", *v))
- }
- builder.WriteString(", ")
- if v := _m.ProxyFallbackOriginID; v != nil {
- builder.WriteString("proxy_fallback_origin_id=")
- builder.WriteString(fmt.Sprintf("%v", *v))
- }
- builder.WriteString(", ")
- builder.WriteString("concurrency=")
- builder.WriteString(fmt.Sprintf("%v", _m.Concurrency))
- builder.WriteString(", ")
- if v := _m.LoadFactor; v != nil {
- builder.WriteString("load_factor=")
- builder.WriteString(fmt.Sprintf("%v", *v))
- }
- builder.WriteString(", ")
- builder.WriteString("priority=")
- builder.WriteString(fmt.Sprintf("%v", _m.Priority))
- builder.WriteString(", ")
- builder.WriteString("rate_multiplier=")
- builder.WriteString(fmt.Sprintf("%v", _m.RateMultiplier))
- builder.WriteString(", ")
- builder.WriteString("status=")
- builder.WriteString(_m.Status)
- builder.WriteString(", ")
- if v := _m.ErrorMessage; v != nil {
- builder.WriteString("error_message=")
- builder.WriteString(*v)
- }
- builder.WriteString(", ")
- if v := _m.LastUsedAt; v != nil {
- builder.WriteString("last_used_at=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.ExpiresAt; v != nil {
- builder.WriteString("expires_at=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- builder.WriteString("auto_pause_on_expired=")
- builder.WriteString(fmt.Sprintf("%v", _m.AutoPauseOnExpired))
- builder.WriteString(", ")
- builder.WriteString("schedulable=")
- builder.WriteString(fmt.Sprintf("%v", _m.Schedulable))
- builder.WriteString(", ")
- if v := _m.RateLimitedAt; v != nil {
- builder.WriteString("rate_limited_at=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.RateLimitResetAt; v != nil {
- builder.WriteString("rate_limit_reset_at=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.OverloadUntil; v != nil {
- builder.WriteString("overload_until=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.TempUnschedulableUntil; v != nil {
- builder.WriteString("temp_unschedulable_until=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.TempUnschedulableReason; v != nil {
- builder.WriteString("temp_unschedulable_reason=")
- builder.WriteString(*v)
- }
- builder.WriteString(", ")
- if v := _m.SessionWindowStart; v != nil {
- builder.WriteString("session_window_start=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.SessionWindowEnd; v != nil {
- builder.WriteString("session_window_end=")
- builder.WriteString(v.Format(time.ANSIC))
- }
- builder.WriteString(", ")
- if v := _m.SessionWindowStatus; v != nil {
- builder.WriteString("session_window_status=")
- builder.WriteString(*v)
- }
- builder.WriteString(", ")
- if v := _m.ParentAccountID; v != nil {
- builder.WriteString("parent_account_id=")
- builder.WriteString(fmt.Sprintf("%v", *v))
- }
- builder.WriteString(", ")
- builder.WriteString("quota_dimension=")
- builder.WriteString(fmt.Sprintf("%v", _m.QuotaDimension))
- builder.WriteByte(')')
- return builder.String()
- }
- // Accounts is a parsable slice of Account.
- type Accounts []*Account
|