-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b4e8e2
commit 53a72b8
Showing
6 changed files
with
123 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* eslint-disable */ | ||
// quota-control v0.1.0 b4b7dfcf9ec0caa2d786bc56bfcb6127a0eb915d | ||
// quota-control v0.1.0 8550ef3b468c2264c0fa011d79d50062d38b1138 | ||
// -- | ||
// Code generated by [email protected] with [email protected] generator. DO NOT EDIT. | ||
// | ||
|
@@ -12,7 +12,7 @@ export const WebRPCVersion = "v1" | |
export const WebRPCSchemaVersion = "v0.1.0" | ||
|
||
// Schema hash generated from your RIDL schema | ||
export const WebRPCSchemaHash = "b4b7dfcf9ec0caa2d786bc56bfcb6127a0eb915d" | ||
export const WebRPCSchemaHash = "8550ef3b468c2264c0fa011d79d50062d38b1138" | ||
|
||
// | ||
// Types | ||
|
@@ -115,6 +115,7 @@ export interface QuotaControl { | |
clearAccessQuotaCache(args: ClearAccessQuotaCacheArgs, headers?: object, signal?: AbortSignal): Promise<ClearAccessQuotaCacheReturn> | ||
getAccountUsage(args: GetAccountUsageArgs, headers?: object, signal?: AbortSignal): Promise<GetAccountUsageReturn> | ||
getAccessKeyUsage(args: GetAccessKeyUsageArgs, headers?: object, signal?: AbortSignal): Promise<GetAccessKeyUsageReturn> | ||
getAsyncUsage(args: GetAsyncUsageArgs, headers?: object, signal?: AbortSignal): Promise<GetAsyncUsageReturn> | ||
prepareUsage(args: PrepareUsageArgs, headers?: object, signal?: AbortSignal): Promise<PrepareUsageReturn> | ||
clearUsage(args: ClearUsageArgs, headers?: object, signal?: AbortSignal): Promise<ClearUsageReturn> | ||
notifyEvent(args: NotifyEventArgs, headers?: object, signal?: AbortSignal): Promise<NotifyEventReturn> | ||
|
@@ -239,6 +240,16 @@ export interface GetAccessKeyUsageArgs { | |
export interface GetAccessKeyUsageReturn { | ||
usage: AccessUsage | ||
} | ||
export interface GetAsyncUsageArgs { | ||
projectID: number | ||
service?: Service | ||
from?: string | ||
to?: string | ||
} | ||
|
||
export interface GetAsyncUsageReturn { | ||
usage: AccessUsage | ||
} | ||
export interface PrepareUsageArgs { | ||
projectID: number | ||
cycle: Cycle | ||
|
@@ -516,6 +527,20 @@ export class QuotaControl implements QuotaControl { | |
}) | ||
} | ||
|
||
getAsyncUsage = (args: GetAsyncUsageArgs, headers?: object, signal?: AbortSignal): Promise<GetAsyncUsageReturn> => { | ||
return this.fetch( | ||
this.url('GetAsyncUsage'), | ||
createHTTPRequest(args, headers, signal)).then((res) => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
usage: <AccessUsage>(_data.usage), | ||
} | ||
}) | ||
}, (error) => { | ||
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) | ||
}) | ||
} | ||
|
||
prepareUsage = (args: PrepareUsageArgs, headers?: object, signal?: AbortSignal): Promise<PrepareUsageReturn> => { | ||
return this.fetch( | ||
this.url('PrepareUsage'), | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:generate go run github.com/webrpc/webrpc/cmd/webrpc-gen -schema=proto.ridl [email protected] -pkg=proto -server -client -out=./proto.gen.go | ||
//go:generate go run github.com/webrpc/webrpc/cmd/webrpc-gen -schema=proto.ridl [email protected] -client -out=./clients/quotacontrol.gen.ts | ||
package proto | ||
|
||
import ( | ||
|
@@ -6,9 +8,6 @@ import ( | |
"time" | ||
) | ||
|
||
//go:generate go run github.com/webrpc/webrpc/cmd/webrpc-gen -schema=proto.ridl [email protected] -pkg=proto -server -client -out=./proto.gen.go | ||
//go:generate go run github.com/webrpc/webrpc/cmd/webrpc-gen -schema=proto.ridl [email protected] -client -out=./clients/quotacontrol.gen.ts | ||
|
||
func Ptr[T any](v T) *T { | ||
return &v | ||
} | ||
|
@@ -200,5 +199,4 @@ func (c *Cycle) Advance(now time.Time) { | |
c.Start = c.Start.AddDate(0, 1, 0) | ||
c.End = c.End.AddDate(0, 1, 0) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters