Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6435,6 +6435,20 @@ types:
docs: Total number of predictions
source:
openapi: openapi/openapi.yaml
PaginatedStateModelList:
properties:
count: integer
next:
type: optional<string>
validation:
format: uri
previous:
type: optional<string>
validation:
format: uri
results: list<StateModel>
source:
openapi: openapi/openapi.yaml
Pause:
docs: |-
A ModelSerializer that takes additional arguments for
Expand Down Expand Up @@ -8040,6 +8054,25 @@ types:
* `PR` - Predicting
source:
openapi: openapi/openapi.yaml
StateModel:
docs: |-
Serializer for FSM state models.

Uses Serializer instead of ModelSerializer because BaseState is abstract.
Works with any concrete state model that inherits from BaseState.
properties:
context_data: unknown
created_at: datetime
id:
type: string
validation:
format: uuid
previous_state: optional<string>
state: string
transition_name: optional<string>
triggered_by: optional<TriggeredBy>
source:
openapi: openapi/openapi.yaml
Status7BfEnum:
enum:
- created
Expand Down Expand Up @@ -8326,6 +8359,21 @@ types:
* `other` - Other
source:
openapi: openapi/openapi.yaml
TriggeredBy:
docs: |-
A ModelSerializer that takes additional arguments for
"fields", "omit" and "expand" in order to
control which fields are displayed, and whether to replace simple
values with complex, nested serializations
properties:
email:
type: optional<string>
validation:
format: email
maxLength: 254
id: integer
source:
openapi: openapi/openapi.yaml
TypeEnum:
enum:
- AN
Expand Down
80 changes: 80 additions & 0 deletions .mock/definition/fsm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
imports:
root: __package__.yml
service:
auth: false
base-path: ''
endpoints:
state_history:
path: /api/fsm/entities/{entity_name}/{entity_id}/history
method: GET
auth: true
docs: Get the state history of an entity
pagination:
offset: $request.page
results: $response.results
source:
openapi: openapi/openapi.yaml
path-parameters:
entity_id: integer
entity_name: string
display-name: Get entity state history
request:
name: FsmStateHistoryRequest
query-parameters:
created_at_from:
type: optional<string>
docs: >-
Filter for state history items created at or after the ISO 8601
formatted date (YYYY-MM-DDTHH:MM:SS)
created_at_to:
type: optional<string>
docs: >-
Filter for state history items created at or before the ISO 8601
formatted date (YYYY-MM-DDTHH:MM:SS)
ordering:
type: optional<string>
docs: Which field to use when ordering the results.
page:
type: optional<integer>
docs: A page number within the paginated result set.
page_size:
type: optional<integer>
docs: Number of results to return per page.
previous_state:
type: optional<string>
docs: Filter previous_state by exact match (case-insensitive)
state:
type: optional<string>
docs: Filter state by exact match (case-insensitive)
transition_name:
type: optional<string>
docs: Filter transition_name by exact match (case-insensitive)
triggered_by:
type: optional<double>
docs: Filter triggered_by by exact match
response:
docs: ''
type: root.PaginatedStateModelList
examples:
- path-parameters:
entity_id: 1
entity_name: entity_name
response:
body:
count: 123
next: http://api.example.org/accounts/?page=4
previous: http://api.example.org/accounts/?page=2
results:
- context_data:
key: value
created_at: '2024-01-15T09:30:00Z'
id: id
previous_state: previous_state
state: state
transition_name: transition_name
triggered_by:
id: 1
audiences:
- internal
source:
openapi: openapi/openapi.yaml
165 changes: 165 additions & 0 deletions .mock/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3966,6 +3966,88 @@ paths:
- Data Manager
x-fern-audiences:
- internal
/api/fsm/entities/{entity_name}/{entity_id}/history:
get:
description: Get the state history of an entity
operationId: api_fsm_entities_history_list
parameters:
- description: Filter for state history items created at or after the ISO 8601 formatted date (YYYY-MM-DDTHH:MM:SS)
in: query
name: created_at_from
schema:
type: string
- description: Filter for state history items created at or before the ISO 8601 formatted date (YYYY-MM-DDTHH:MM:SS)
in: query
name: created_at_to
schema:
type: string
- in: path
name: entity_id
required: true
schema:
type: integer
- in: path
name: entity_name
required: true
schema:
type: string
- description: Which field to use when ordering the results.
in: query
name: ordering
required: false
schema:
type: string
- description: A page number within the paginated result set.
in: query
name: page
required: false
schema:
type: integer
- description: Number of results to return per page.
in: query
name: page_size
required: false
schema:
type: integer
- description: Filter previous_state by exact match (case-insensitive)
in: query
name: previous_state
schema:
type: string
- description: Filter state by exact match (case-insensitive)
in: query
name: state
schema:
type: string
- description: Filter transition_name by exact match (case-insensitive)
in: query
name: transition_name
schema:
type: string
- description: Filter triggered_by by exact match
in: query
name: triggered_by
schema:
type: number
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedStateModelList'
description: ''
security:
- Token: []
summary: Get entity state history
tags:
- FSM
x-fern-audiences:
- internal
x-fern-pagination:
offset: $request.page
results: $response.results
x-fern-sdk-group-name: fsm
x-fern-sdk-method-name: state_history
/api/import/file-upload/{id}:
delete:
description: Delete a specific uploaded file.
Expand Down Expand Up @@ -27970,6 +28052,29 @@ components:
- total_annotations
- total_predictions
type: object
PaginatedStateModelList:
properties:
count:
example: 123
type: integer
next:
example: http://api.example.org/accounts/?page=4
format: uri
nullable: true
type: string
previous:
example: http://api.example.org/accounts/?page=2
format: uri
nullable: true
type: string
results:
items:
$ref: '#/components/schemas/StateModel'
type: array
required:
- count
- results
type: object
PatchedAnnotationReviewRequest:
description: |-
AnnotationReview Serializer with FSM state support.
Expand Down Expand Up @@ -31925,6 +32030,48 @@ components:
- TR
- PR
type: string
StateModel:
description: |-
Serializer for FSM state models.

Uses Serializer instead of ModelSerializer because BaseState is abstract.
Works with any concrete state model that inherits from BaseState.
properties:
context_data:
readOnly: true
created_at:
format: date-time
readOnly: true
type: string
id:
format: uuid
readOnly: true
type: string
previous_state:
nullable: true
readOnly: true
type: string
state:
readOnly: true
type: string
transition_name:
nullable: true
readOnly: true
type: string
triggered_by:
allOf:
- $ref: '#/components/schemas/TriggeredBy'
nullable: true
readOnly: true
required:
- context_data
- created_at
- id
- previous_state
- state
- transition_name
- triggered_by
type: object
Status7bfEnum:
description: |-
* `created` - Created
Expand Down Expand Up @@ -32342,6 +32489,24 @@ components:
- data_scientist
- other
type: string
TriggeredBy:
description: |-
A ModelSerializer that takes additional arguments for
"fields", "omit" and "expand" in order to
control which fields are displayed, and whether to replace simple
values with complex, nested serializations
properties:
email:
format: email
maxLength: 254
title: Email address
type: string
id:
readOnly: true
type: integer
required:
- id
type: object
TypeEnum:
description: |-
* `AN` - Annotate
Expand Down
Loading