Skip to content

Commit 5c16d72

Browse files
authored
docs: Add PPE-related properties to OpenAPI spec (#1492)
- closes #1368
1 parent 1b14a63 commit 5c16d72

11 files changed

+142
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title: ActorChargeEvent
2+
type: object
3+
required:
4+
- eventPriceUsd
5+
- eventTitle
6+
- eventDescription
7+
properties:
8+
eventPriceUsd:
9+
type: number
10+
eventTitle:
11+
type: string
12+
eventDescription:
13+
type: string
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title: ActorRunPricingInfo
2+
discriminator:
3+
propertyName: pricingModel
4+
mapping:
5+
PAY_PER_EVENT: ./PayPerEventActorPricingInfo.yaml
6+
PRICE_PER_DATASET_ITEM: ./PricePerDatasetItemActorPricingInfo.yaml
7+
FLAT_PRICE_PER_MONTH: ./FlatPricePerMonthActorPricingInfo.yaml
8+
FREE: ./FreeActorPricingInfo.yaml
9+
oneOf:
10+
- $ref: ./PayPerEventActorPricingInfo.yaml
11+
- $ref: ./PricePerDatasetItemActorPricingInfo.yaml
12+
- $ref: ./FlatPricePerMonthActorPricingInfo.yaml
13+
- $ref: ./FreeActorPricingInfo.yaml
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
title: CommonActorPricingInfo
2+
type: object
3+
required:
4+
- apifyMarginPercentage
5+
- createdAt
6+
- startedAt
7+
properties:
8+
apifyMarginPercentage:
9+
type: number
10+
description: "In [0, 1], fraction of pricePerUnitUsd that goes to Apify"
11+
createdAt:
12+
type: string
13+
format: date-time
14+
description: "When this pricing info record has been created"
15+
startedAt:
16+
type: string
17+
format: date-time
18+
description: "Since when is this pricing info record effective for a given Actor"
19+
notifiedAboutFutureChangeAt:
20+
type: string
21+
format: date-time
22+
nullable: true
23+
x-internal: true
24+
notifiedAboutChangeAt:
25+
type: string
26+
format: date-time
27+
nullable: true
28+
x-internal: true
29+
reasonForChange:
30+
type: string
31+
nullable: true
32+
x-internal: true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
title: FlatPricePerMonthActorPricingInfo
2+
allOf:
3+
- $ref: "./CommonActorPricingInfo.yaml"
4+
- type: object
5+
required:
6+
- pricingModel
7+
- pricePerUnitUsd
8+
- trialMinutes
9+
properties:
10+
pricingModel:
11+
type: string
12+
enum: [FLAT_PRICE_PER_MONTH]
13+
trialMinutes:
14+
type: number
15+
description: "For how long this Actor can be used for free in trial period"
16+
pricePerUnitUsd:
17+
type: number
18+
description: "Monthly flat price in USD"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
title: FreeActorPricingInfo
2+
allOf:
3+
- $ref: "./CommonActorPricingInfo.yaml"
4+
- type: object
5+
required:
6+
- pricingModel
7+
properties:
8+
pricingModel:
9+
type: string
10+
enum: [FREE]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
title: PayPerEventActorPricingInfo
2+
allOf:
3+
- $ref: "./CommonActorPricingInfo.yaml"
4+
- type: object
5+
required:
6+
- pricingModel
7+
- pricingPerEvent
8+
properties:
9+
pricingModel:
10+
type: string
11+
enum: [PAY_PER_EVENT]
12+
pricingPerEvent:
13+
type: object
14+
properties:
15+
actorChargeEvents:
16+
type: object
17+
additionalProperties:
18+
$ref: ./ActorChargeEvent.yaml
19+
minimalMaxTotalChargeUsd:
20+
type: number
21+
nullable: true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
title: PricePerDatasetItemActorPricingInfo
2+
allOf:
3+
- $ref: "./CommonActorPricingInfo.yaml"
4+
- type: object
5+
required:
6+
- pricingModel
7+
- pricePerUnitUsd
8+
- unitName
9+
properties:
10+
pricingModel:
11+
type: string
12+
enum: [PRICE_PER_DATASET_ITEM]
13+
unitName:
14+
type: string
15+
description: "Name of the unit that is being charged"
16+
pricePerUnitUsd:
17+
type: number

apify-api/openapi/components/schemas/actor-runs/Run.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ properties:
4949
example: false
5050
meta:
5151
$ref: ./RunMeta.yaml
52+
pricingInfo:
53+
$ref: ../actor-pricing-info/ActorRunPricingInfo.yaml
5254
stats:
5355
$ref: ./RunStats.yaml
56+
chargedEventCounts:
57+
type: object
58+
additionalProperties:
59+
$ref: ../actor-pricing-info/ActorChargeEvent.yaml
5460
options:
5561
$ref: ./RunOptions.yaml
5662
buildId:

apify-api/openapi/components/schemas/actors/Actor.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ properties:
4949
items:
5050
$ref: "./Version.yaml"
5151
description: ''
52+
pricingInfos:
53+
type: array
54+
items:
55+
$ref: ../actor-pricing-info/ActorRunPricingInfo.yaml
5256
defaultRunOptions:
5357
$ref: ./DefaultRunOptions.yaml
5458
exampleRunInput:

apify-api/openapi/components/schemas/actors/CreateActorRequest.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ properties:
3535
$ref: "./Version.yaml"
3636
description: ''
3737
nullable: true
38+
pricingInfos:
39+
type: array
40+
items:
41+
$ref: ../actor-pricing-info/ActorRunPricingInfo.yaml
3842
categories:
3943
type: array
4044
items:

0 commit comments

Comments
 (0)