github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/svc/request/reportrtusage.go (about) 1 package request 2 3 type ReportRuntimeUsage struct { 4 pid int 5 exec string 6 source string 7 dimensionsJson string 8 } 9 10 func NewReportRuntimeUsage(pid int, exec, source string, dimensionsJson string) *ReportRuntimeUsage { 11 return &ReportRuntimeUsage{ 12 pid: pid, 13 exec: exec, 14 source: source, 15 dimensionsJson: dimensionsJson, 16 } 17 } 18 19 func (e *ReportRuntimeUsage) Query() string { 20 return `query($pid: Int!, $exec: String!, $source: String!, $dimensionsJson: String!) { 21 reportRuntimeUsage(pid: $pid, exec: $exec, source: $source, dimensionsJson: $dimensionsJson) { 22 received 23 } 24 }` 25 } 26 27 func (e *ReportRuntimeUsage) Vars() (map[string]interface{}, error) { 28 return map[string]interface{}{ 29 "pid": e.pid, 30 "exec": e.exec, 31 "source": e.source, 32 "dimensionsJson": e.dimensionsJson, 33 }, nil 34 }