Skip to content

Commit

Permalink
Add usage limit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Dec 12, 2024
1 parent 4ce8515 commit 873d5fa
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parameters/path/usageLimitId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: usageLimitId
in: path
required: true
description: The id of the usage limit
schema:
type: string
12 changes: 12 additions & 0 deletions src/resources/customers/deleteUsageLimit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
delete:
summary: Delete Usage Limit
description: Delete Usage Limit for the custoemr
tags:
- Customers
- Usage
parameters:
- $ref: "../../parameters/path/customerId.yaml"
- $ref: "../../parameters/path/usageLimitId.yaml"
responses:
'200':
description: "Deleted Limit"
62 changes: 62 additions & 0 deletions src/resources/customers/usageLimits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
get:
summary: Fetch Customer Usage Limits
operationId: getCustomerUsageLimitsById
description: Usage Limits for a specific customer
tags:
- Customers
- Usage
parameters:
- $ref: "../../parameters/path/customerId.yaml"
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "../../schemas/UsageLimit.yaml"
has_more:
type: boolean
last_key:
type: string
format: uuid
'404':
$ref: "../../responses/NullResponse.yaml"
default:
$ref: "../../responses/UnexpectedError.yaml"
post:
summary: Create Usage Limit
description: Create Usage Limit for the custoemr
tags:
- Customers
- Usage
parameters:
- $ref: "../../parameters/path/customerId.yaml"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- amount
- action
properties:
amount:
type: integer
example: 2000
action:
type: string
enum: ['WARNING', 'DISABLE']
example: 'WARNING'
responses:
'201':
description: "Usage Limit"
content:
application/json:
schema:
$ref: "../../schemas/UsageLimit.yaml"
13 changes: 13 additions & 0 deletions src/schemas/UsageLimit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type: object
required:
- name
properties:
id:
type: string
format: uuid
amount:
type: integer
example: "SaaS"
action:
type: string
enum: ['WARNING', 'DISABLE']

0 comments on commit 873d5fa

Please sign in to comment.