MCPcopy Index your code
hub / github.com/coder/coder / GetChatCostPerModel

Method GetChatCostPerModel

coderd/database/dbauthz/dbauthz.go:2855–2861  ·  view source on GitHub ↗
(ctx context.Context, arg database.GetChatCostPerModelParams)

Source from the content-addressed store, hash-verified

2853}
2854
2855func (q *querier) GetChatCostPerModel(ctx context.Context, arg database.GetChatCostPerModelParams) ([]database.GetChatCostPerModelRow, error) {
2856 // See GetChatCostPerChat for the authorization rationale.
2857 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceChat.WithOwner(arg.OwnerID.String()).AnyOrganization()); err != nil {
2858 return nil, err
2859 }
2860 return q.db.GetChatCostPerModel(ctx, arg)
2861}
2862
2863func (q *querier) GetChatCostPerUser(ctx context.Context, arg database.GetChatCostPerUserParams) ([]database.GetChatCostPerUserRow, error) {
2864 if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceChat); err != nil {

Callers

nothing calls this directly

Calls 5

authorizeContextMethod · 0.95
AnyOrganizationMethod · 0.80
WithOwnerMethod · 0.80
GetChatCostPerModelMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected