<commit_before>

paths:
  '/api/workspaces/{namespace}/{name}/snapshots':
    post:
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/DataRepoSnapshotReference'
        '404':
          description: Workspace or snapshot not found
          schema:
            $ref: '#/definitions/ErrorReport'
        '500':
          description: Rawls Internal Error
          schema:
            $ref: '#/definitions/ErrorReport'
      description: "Add a reference to a snapshot in the Terra Data Repo"
      tags:
        - snapshots
      summary: Create a snapshot
      operationId: createDataRepoSnapshot
      parameters:
        - in: path
          description: The workspace namespace
          name: namespace
          required: true
          type: string
        - in: path
          description: The workspace name
          name: name
          required: true
          type: string
        - in: body
          description: Reference to the Data Repo snapshot
          name: dataRepoSnapshot
          required: true
          schema:
            $ref: '#/definitions/DataRepoSnapshot'
  '/api/workspaces/{namespace}/{name}/snapshots/{snapshotId}':
    get:
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataRepoSnapshotReference'
        '404':
          description: Workspace or snapshot not found
          schema:
            $ref: '#/definitions/ErrorReport'
        '500':
          description: Rawls Internal Error
          schema:
            $ref: '#/definitions/ErrorReport'
      description: "Get a reference to a snapshot in the Terra Data Repo"
      tags:
        - snapshots
      summary: Get a snapshot
      operationId: getDataRepoSnapshot
      parameters:
        - in: path
          description: The workspace namespace
          name: namespace
          required: true
          type: string
        - in: path
          description: The workspace name
          name: name
          required: true
          type: string
        - in: path
          description: The snapshot ID
          name: snapshotId
          required: true
          type: string

tags:
  - name: snapshots
    description: Data Repo snapshot API

definitions:
  DataRepoSnapshot:
    description: A Data Repo snapshot
    properties:
      snapshotId:
        type: string
        description: The ID of the snapshot in Terra Data Repo
      name:
        type: string
        description: The name of the snapshot

  DataRepoSnapshotReference:
    description: A Data Reference definition from Workspace Manager
    properties:
      referenceId:
        type: string
      name:
        type: string
      workspaceId:
        type: string
      referenceType:
        type: string
      reference:
        type: object
      cloningInstructions:
        type: string<commit_msg>fix swagger merge for tags, add security for snapshot apis (#1210)<commit_after>

paths:
  '/api/workspaces/{namespace}/{name}/snapshots':
    post:
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/DataRepoSnapshotReference'
        '404':
          description: Workspace or snapshot not found
          schema:
            $ref: '#/definitions/ErrorReport'
        '500':
          description: Rawls Internal Error
          schema:
            $ref: '#/definitions/ErrorReport'
      description: "Add a reference to a snapshot in the Terra Data Repo"
      tags:
        - snapshots
      summary: Create a snapshot
      operationId: createDataRepoSnapshot
      parameters:
        - in: path
          description: The workspace namespace
          name: namespace
          required: true
          type: string
        - in: path
          description: The workspace name
          name: name
          required: true
          type: string
        - in: body
          description: Reference to the Data Repo snapshot
          name: dataRepoSnapshot
          required: true
          schema:
            $ref: '#/definitions/DataRepoSnapshot'
      security:
        - authorization:
            - openid
            - email
            - profile
  '/api/workspaces/{namespace}/{name}/snapshots/{snapshotId}':
    get:
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataRepoSnapshotReference'
        '404':
          description: Workspace or snapshot not found
          schema:
            $ref: '#/definitions/ErrorReport'
        '500':
          description: Rawls Internal Error
          schema:
            $ref: '#/definitions/ErrorReport'
      description: "Get a reference to a snapshot in the Terra Data Repo"
      tags:
        - snapshots
      summary: Get a snapshot
      operationId: getDataRepoSnapshot
      parameters:
        - in: path
          description: The workspace namespace
          name: namespace
          required: true
          type: string
        - in: path
          description: The workspace name
          name: name
          required: true
          type: string
        - in: path
          description: The snapshot ID
          name: snapshotId
          required: true
          type: string
      security:
        - authorization:
            - openid
            - email
            - profile

definitions:
  DataRepoSnapshot:
    description: A Data Repo snapshot
    properties:
      snapshotId:
        type: string
        description: The ID of the snapshot in Terra Data Repo
      name:
        type: string
        description: The name of the snapshot

  DataRepoSnapshotReference:
    description: A Data Reference definition from Workspace Manager
    properties:
      referenceId:
        type: string
      name:
        type: string
      workspaceId:
        type: string
      referenceType:
        type: string
      reference:
        type: object
      cloningInstructions:
        type: string
{'fraction_non_alphanumeric': 0.0666445623342175, 'fraction_numerical': 0.006631299734748011, 'mean_word_length': 1.6460526315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4886694', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1465, 'n_words': 491}