# Datasets_ReviewRepairProposals

`POST /v1/accounts/{account}/datasets/{dataset}/repairProposals:review`

Accepts or rejects repair proposals: named ones, every open
one of some takes, or every open one of the dataset. Accept is one
RepairPoses call adding them all, on the same dataset, and answers what
it answered (on a merged dataset, member by member); its refusals are
this call's. An open applied proposal is left out of the call (its add
is held already), and no call is made when only those are selected.
RepairPoses refuses the batch whole: one proposal gone stale (a
re-ingest since its check ran), on a take whose pose trails its video
(an open handheld_pose_late finding) or overlapping another check's
refuses every add, so an accept of `all` keeps refusing until the check
runs again or the take's pose timing is fixed; accept the others by
take or by name. A rejected proposal accepted is
open again once RepairPoses admits its repair (on a merged dataset, once
its member is CURRENT or RUNNING); refused, it stays rejected. Reject
closes the open proposals and starts nothing; a later run of the check
that proposes the same repair on the same data (the same take identity)
leaves it rejected. An applied proposal is the record of its accept: a
reject by take or of all leaves it open. A person or an API key
rejects; no model does. Undoing an accepted repair is a RepairPoses
remove.

INVALID_ARGUMENT unless exactly one of `proposals`, `episodes` and
`all` is set, for a proposal or episode not under `parent`, or for an
accept that would add more than RepairPoses' 200 adds a request, before
any is added ("repairs refused: ", as a RepairPoses refusal reads):
accept them by take or by name. PERMISSION_DENIED for a reject by a caller that is neither a person nor
an API key. NOT_FOUND for a named proposal the dataset does not hold.
FAILED_PRECONDITION for a named proposal a later run of its check
replaced, a reject naming an applied one, or a rejected one whose key
another open proposal holds. ABORTED when a merged dataset's members
changed since the call read them.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header

## Parameters

- `account` (path, string, required): The account id.
- `dataset` (path, string, required): The dataset id.

## Request body

Required: `application/json` `qualia.v1.ReviewRepairProposalsRequest`

## Responses

- `200` OK: `application/json` `qualia.v1.ReviewRepairProposalsResponse`
- `default` Default error response: `application/json` `google.rpc.Status`

## Schemas

```yaml
qualia.v1.ReviewRepairProposalsRequest:
  required:
    - parent
    - decision
  type: object
  properties:
    parent:
      type: string
      description: |-
        accounts/{account}/datasets/{dataset}: a handheld (UMI) upload, or a
        merged dataset of them.
    proposals:
      type: array
      items:
        type: string
      description: The proposals, open or rejected, by name under `parent`.
    episodes:
      type: array
      items:
        type: string
      description: "The takes, by episode name under `parent`: every open proposal of each."
    all:
      type: boolean
      description: Every open proposal of the dataset.
    decision:
      enum:
        - DECISION_UNSPECIFIED
        - ACCEPT
        - REJECT
      type: string
      description: Accept or reject.
      format: enum
  description: |-
    Request for Datasets.ReviewRepairProposals. Exactly one of `proposals`,
    `episodes` and `all`.
qualia.v1.ReviewRepairProposalsResponse:
  type: object
  properties:
    reviewed:
      readOnly: true
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.RepairProposal"
      description: |-
        The proposals decided, as they stand now; a reject by take or of all
        leaves applied ones out. An accepted one is applied once its
        publication lands.
    repair:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.RepairPosesResponse"
      description: |-
        What RepairPoses answered an accept; unset for a reject, and for an
        accept with nothing to add (no open proposal, or only applied ones).
  description: Response for Datasets.ReviewRepairProposals.
qualia.v1.RepairProposal:
  type: object
  properties:
    name:
      type: string
      description: accounts/{account}/datasets/{dataset}/repairProposals/{repair_proposal}
    repair:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.PoseRepair"
      description: |-
        The repair, as a RepairPoses add on the dataset it was read through:
        its episode named there, with the take_identity (and for a STEP the
        repair_identity) the check's run read.
    check:
      readOnly: true
      type: string
      description: The check that proposed it, by its code.
    reason:
      readOnly: true
      type: string
      description: Why the check proposes it, in its words.
    state:
      readOnly: true
      enum:
        - STATE_UNSPECIFIED
        - PROPOSED
        - REJECTED
      type: string
      description: Where it stands.
      format: enum
    applied:
      readOnly: true
      type: boolean
      description: |-
        The upload's published repairs hold this repair (its key, kind and
        values): accepted and landed, or made by hand. Removing it is a
        RepairPoses remove.
    createTime:
      readOnly: true
      type: string
      description: When the check proposed it.
      format: date-time
  description: |-
    A pose or jaw repair a check proposes on a handheld (UMI) take,
    named under the dataset it was read through: the take's upload, or a
    merged dataset holding it. Its take keeps at most one open proposal per
    hand, target and frames.
qualia.v1.PoseRepair:
  required:
    - episode
    - hand
    - target
    - startFrame
    - endFrame
  type: object
  properties:
    episode:
      type: string
      description: |-
        The take: accounts/{account}/datasets/{dataset}/episodes/{episode}, an
        episode of the request's dataset (on a merged dataset, its episode name,
        as SampleEpisodeSeries read it). A split piece's frames are its own and
        are moved onto its take's; a cut piece cannot be repaired.
    hand:
      enum:
        - SIDE_UNSPECIFIED
        - SIDE_LEFT
        - SIDE_RIGHT
      type: string
      description: LEFT or RIGHT.
      format: enum
    kind:
      enum:
        - KIND_UNSPECIFIED
        - INTERPOLATE
        - UNDO_FILL
        - STEP
      type: string
      description: "What it does: required on adds, not read on removes."
      format: enum
    target:
      enum:
        - TARGET_UNSPECIFIED
        - POSITION
        - ROTATION
        - JAW
      type: string
      description: What it edits.
      format: enum
    startFrame:
      type: string
      description: |-
        The frames [start_frame, end_frame) of the take as recorded, not of a
        trimmed window (add a trim's start, window_start_seconds times fps, to a
        trimmed read's frames). An interpolation starts at 1 or later and ends
        before the take's last frame: its anchors are the frames either side.
        A step's is the frame it starts at, 2 or later and before the take's
        last frame.
    endFrame:
      type: string
      description: |-
        The end of the frames, exclusive. A step's is start_frame + 1, on adds
        and removes alike: its key is its frame.
    takeIdentity:
      type: string
      description: |-
        Required on adds, not read on removes: the
        SampleEpisodeSeriesResponse.take_identity of the read the repair was
        drawn on. An add without one is INVALID_ARGUMENT.
    shift:
      type: array
      items:
        type: number
        format: double
      description: |-
        A POSITION step's shift in metres, x, y and z: exactly three numbers on
        a position step's add, empty otherwise. Not read on removes.
    turn:
      type: array
      items:
        type: number
        format: double
      description: |-
        A ROTATION step's turn, a rotation vector (axis times angle) in radians
        composed on the left of the hand's rotation: exactly three numbers on a
        rotation step's add, empty otherwise. Not read on removes.
    repairIdentity:
      type: string
      description: |-
        Required on STEP adds, not read otherwise: the
        SampleEpisodeSeriesResponse.repair_identity of the read the step was
        measured on. A step is measured with the take's earlier steps applied,
        so one whose take's repairs changed since is ABORTED; a STEP add without
        it is INVALID_ARGUMENT. A STEP the upload already holds with the same
        values is not checked: its retry is a no-op.
  description: One pose or jaw repair of one hand over take frames.
qualia.v1.RepairPosesResponse:
  type: object
  properties:
    operationId:
      readOnly: true
      type: string
      description: |-
        The publication's operation id, polled as ResolvePoses' is. Empty when
        no_op is set.
    noOp:
      readOnly: true
      type: boolean
      description: |-
        True when the composed repairs are the published ones: nothing to wait
        for. On a merged dataset, when every member's are.
    members:
      readOnly: true
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.MemberPoseRepair"
      description: |-
        On a merged dataset, one per member upload whose takes the request
        names, in membership order; operation_id is then empty. Empty for an
        upload.
  description: Response for Datasets.RepairPoses.
qualia.v1.MemberPoseRepair:
  type: object
  properties:
    upload:
      readOnly: true
      type: string
      description: The member upload.
    displayName:
      readOnly: true
      type: string
      description: The member upload's display name.
    state:
      readOnly: true
      enum:
        - STATE_UNSPECIFIED
        - CURRENT
        - RUNNING
        - BUSY
        - REFUSED
      type: string
      description: What its publication did.
      format: enum
    reason:
      readOnly: true
      type: string
      description: Why it is BUSY or REFUSED.
    operationId:
      readOnly: true
      type: string
      description: |-
        Its publication's operation id when RUNNING, polled at the upload's
        reingests/{operation_id} as ResolvePoses' is.
  description: One member upload's part of Datasets.RepairPoses on a merged dataset.
google.rpc.Status:
  oneOf:
    - $ref: "#/components/schemas/ApiError"
    - $ref: "#/components/schemas/GatewayError"
  description: "The body of a failed call: one of the two shapes below."
ApiError:
  title: API error
  type: object
  required:
    - code
    - message
    - retryable
    - details
  properties:
    code:
      type: string
      description: The gRPC code name in upper case, e.g. `NOT_FOUND`.
    message:
      type: string
    retryable:
      type: boolean
      description: Whether the same call may succeed if retried.
    details:
      type: array
      items:
        type: object
      description: "Empty, except when a dataset copy or move is refused: then one `google.rpc.ErrorInfo` with the refusal's `reason` code, its `domain` and, in `metadata`, the datasets it names."
  description: A refusal from the API itself.
GatewayError:
  title: Gateway error
  type: object
  required:
    - detail
  properties:
    detail:
      type: string
      description: What went wrong.
  description: A refusal from the gateway before the call reaches the API, for example `401` bad or missing API key, `403` key lacks the scope or environment closed, `413` body too large.
```
