diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index a62319374..ee5197b90 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -6435,6 +6435,20 @@ types: docs: Total number of predictions source: openapi: openapi/openapi.yaml + PaginatedStateModelList: + properties: + count: integer + next: + type: optional + validation: + format: uri + previous: + type: optional + validation: + format: uri + results: list + source: + openapi: openapi/openapi.yaml Pause: docs: |- A ModelSerializer that takes additional arguments for @@ -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 + state: string + transition_name: optional + triggered_by: optional + source: + openapi: openapi/openapi.yaml Status7BfEnum: enum: - created @@ -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 + validation: + format: email + maxLength: 254 + id: integer + source: + openapi: openapi/openapi.yaml TypeEnum: enum: - AN diff --git a/.mock/definition/fsm.yml b/.mock/definition/fsm.yml new file mode 100644 index 000000000..c1c213620 --- /dev/null +++ b/.mock/definition/fsm.yml @@ -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 + 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 + docs: >- + Filter for state history items created at or before the ISO 8601 + formatted date (YYYY-MM-DDTHH:MM:SS) + ordering: + type: optional + docs: Which field to use when ordering the results. + page: + type: optional + docs: A page number within the paginated result set. + page_size: + type: optional + docs: Number of results to return per page. + previous_state: + type: optional + docs: Filter previous_state by exact match (case-insensitive) + state: + type: optional + docs: Filter state by exact match (case-insensitive) + transition_name: + type: optional + docs: Filter transition_name by exact match (case-insensitive) + triggered_by: + type: optional + 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 diff --git a/.mock/openapi/openapi.yaml b/.mock/openapi/openapi.yaml index 315a2c037..800d09bee 100644 --- a/.mock/openapi/openapi.yaml +++ b/.mock/openapi/openapi.yaml @@ -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. @@ -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. @@ -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 @@ -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