openapi: 3.1.0
info:
  version: 1.0.0
  title: My API
servers:
  - url: v1
paths:
  /v0/openapi:
    get:
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /v0/user:
    get:
      summary: Retrieve the current user
      description: Retrieve the currently authenticated user's information.
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
  /v0/orgs:
    get:
      summary: List organizations
      description: List organizations accessible to the current authentication method.
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Org'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                required:
                  - data
                  - has_more
  /v0/orgs/{org}:
    get:
      summary: Retrieve an organization
      description: Retrieve an organization by name.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Org'
  /v0/projects:
    get:
      summary: List projects
      description: List projects in an organization, from oldest to newest.
      parameters:
        - in: query
          name: org
          schema:
            type: string
        - in: query
          name: cursor
          schema:
            type: string
            description: Pagination cursor from a previous response
        - in: query
          name: limit
          schema:
            type: number
            exclusiveMinimum: 0
            maximum: 100
            default: 10
            description: 'Maximum number of projects to return, defaults to 10 (maximum: 100).'
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                required:
                  - data
                  - has_more
    post:
      summary: Create project
      description: Create a new project.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type: string
                  description: Project name/slug
                org:
                  type: string
                  description: Organization name
                display_name:
                  type: string
                  description: Human-readable project name
                targets:
                  type: array
                  items:
                    $ref: '#/components/schemas/Target'
                  minItems: 1
                  description: Targets to generate for
                revision:
                  type: object
                  propertyNames:
                    type: string
                    description: File path
                  additionalProperties:
                    $ref: '#/components/schemas/FileInput'
                  description: File contents to commit
              required:
                - slug
                - org
                - display_name
                - targets
                - revision
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /v0/projects/{project}:
    get:
      summary: Retrieve project
      description: Retrieve a project by name.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
    patch:
      summary: Update project
      description: Update a project's properties.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type:
                    - string
                    - 'null'
              description: A project is a collection of SDKs generated from the same set of config files.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /v0/projects/{project}/generate_commit_message:
    post:
      summary: Generate an AI commit message for a specific SDK
      description: Generates an AI commit message by comparing two git refs in the SDK repository.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: query
          name: target
          schema:
            type: string
            enum:
              - python
              - node
              - typescript
              - java
              - kotlin
              - go
              - ruby
              - terraform
              - cli
              - csharp
              - php
              - openapi
              - sql
            description: Language target
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                base_ref:
                  type: string
                  description: Base ref for comparison
                head_ref:
                  type: string
                  description: Head ref for comparison
              required:
                - base_ref
                - head_ref
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  ai_commit_message:
                    type: string
                required:
                  - ai_commit_message
  /v0/projects/{project}/branches:
    get:
      summary: List project branches
      description: Retrieve a project branch by name.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: query
          name: cursor
          schema:
            type: string
            description: Pagination cursor from a previous response
        - in: query
          name: limit
          schema:
            type: number
            exclusiveMinimum: 0
            maximum: 100
            default: 10
            description: 'Maximum number of items to return, defaults to 10 (maximum: 100).'
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProjectBranchMinimal'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                required:
                  - data
                  - has_more
    post:
      summary: Create a new project branch
      description: |-
        Create a new branch for a project.

        The branch inherits the config files from the revision pointed to by the
        `branch_from` parameter. In addition, if the revision is a branch name,
        the branch will also inherit custom code changes from that branch.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                branch:
                  type: string
                  description: Branch name
                branch_from:
                  type: string
                  description: Branch or commit SHA to branch from
                force:
                  type: boolean
                  default: false
                  description: Whether to throw an error if the branch already exists. Defaults to false.
              required:
                - branch
                - branch_from
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranch'
  /v0/projects/{project}/branches/{branch}:
    delete:
      summary: Delete a project branch
      description: Delete a project branch by name.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: path
          name: branch
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties: {}
    get:
      summary: Retrieve a project branch
      description: Retrieve a project branch by name.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: path
          name: branch
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranch'
  /v0/projects/{project}/branches/{branch}/rebase:
    put:
      summary: Rebase a project branch
      description: |-
        Rebase a project branch.

        The branch is rebased onto the `base` branch or commit SHA, inheriting
        any config and custom code changes.

        If `files` is provided, the auto-rebase is skipped: the branch is
        hard-reset to `base` and the provided files are committed on top.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: path
          name: branch
          schema:
            type: string
          required: true
        - in: query
          name: base
          schema:
            type: string
            default: main
            description: The branch or commit SHA to rebase onto. Defaults to "main".
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                files:
                  type: object
                  propertyNames:
                    type: string
                    description: File path
                  additionalProperties:
                    $ref: '#/components/schemas/FileInput'
                  description: |-
                    File contents to commit directly on top of `base`. When provided, the
                    auto-rebase is skipped and the branch is hard-reset to `base` before the
                    files are committed.
                commit_message:
                  type: string
                  description: Optional commit message to use when `files` is provided.
              default: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranch'
  /v0/projects/{project}/branches/{branch}/reset:
    put:
      description: |-
        Reset a project branch.

        If `branch` === `main`, the branch is reset to `target_config_sha`. Otherwise, the
        branch is reset to `main`.
      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: path
          name: branch
          schema:
            type: string
          required: true
        - in: query
          name: target_config_sha
          schema:
            type: string
            description: >-
              The commit SHA to reset the main branch to. Required if resetting the main branch; disallowed
              otherwise.
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranch'
  /v0/projects/{project}/configs:
    get:
      summary: Retrieve configuration files
      description: |2-

            Retrieve the configuration files for a given project.

      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
        - in: query
          name: branch
          schema:
            type: string
            default: main
            description: Branch name, defaults to "main".
        - in: query
          name: include
          schema:
            type: string
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                propertyNames:
                  type: string
                  description: File path
                additionalProperties:
                  type: object
                  properties:
                    content:
                      type: string
                      description: The file content
                  required:
                    - content
                description: Config files contents
  /v0/projects/{project}/configs/guess:
    post:
      summary: Generate config suggestions
      description: |2-

            Generate suggestions for changes to config files based on an OpenAPI spec.

      parameters:
        - in: path
          name: project
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                branch:
                  type: string
                  default: main
                  description: Branch name
                spec:
                  type: string
                  description: OpenAPI spec
              required:
                - spec
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                propertyNames:
                  type: string
                  description: File path
                additionalProperties:
                  type: object
                  properties:
                    content:
                      type: string
                      description: The file content
                  required:
                    - content
                description: Config files contents
  /v0/builds:
    get:
      summary: List project builds
      description: |-
        List user-triggered builds for a given project.

        An optional revision can be specified to filter by config commit SHA, or
        hashes of file contents.
      parameters:
        - in: query
          name: project
          schema:
            type: string
            description: Project name
          required: true
        - in: query
          name: branch
          schema:
            type: string
            description: Branch name
        - in: query
          name: revision
          schema:
            anyOf:
              - type: string
                description: A config commit SHA used for the build
              - type: object
                propertyNames:
                  type: string
                  description: File path
                additionalProperties:
                  type: object
                  properties:
                    hash:
                      type: string
                      description: File content hash
                  required:
                    - hash
                description: Hash of the files used for the build
            default: {}
        - in: query
          name: cursor
          schema:
            type: string
            description: Pagination cursor from a previous response.
        - in: query
          name: limit
          schema:
            type: number
            exclusiveMinimum: 0
            maximum: 100
            default: 10
            description: 'Maximum number of builds to return, defaults to 10 (maximum: 100).'
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Build'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                required:
                  - data
                  - has_more
    post:
      summary: Create build
      description: |-
        Create a build, on top of a project branch, against a given input revision.

        The project branch will be modified so that its latest set of config files
        points to the one specified by the input revision.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: Project name
                branch:
                  type: string
                  description: |-
                    The project branch to use for the build. If not specified, the
                    branch is inferred from the `revision`, and will 400 when that
                    is not possible.
                revision:
                  anyOf:
                    - type: object
                      properties:
                        merge:
                          type: string
                          description: A merge command in the format "base..head"
                        files:
                          type: object
                          propertyNames:
                            type: string
                            description: File path
                          additionalProperties:
                            $ref: '#/components/schemas/FileInput'
                          description: File contents to commit directly
                      required:
                        - merge
                        - files
                      description: |-
                        A merge command combined with explicit file contents. The files are committed
                        to the merge target (`base`) without performing an auto-merge.
                    - type: string
                      description: A branch name, commit SHA, or merge command in the format "base..head"
                    - type: object
                      propertyNames:
                        type: string
                        description: File path
                      additionalProperties:
                        $ref: '#/components/schemas/FileInput'
                      description: File contents to commit directly
                  description: |-
                    Specifies what to build: a branch name, commit SHA, merge command
                    ("base..head"), or file contents.
                targets:
                  type: array
                  items:
                    $ref: '#/components/schemas/Target'
                  description: |-
                    Optional list of SDK targets to build. If not specified, all configured
                    targets will be built.
                commit_message:
                  type: string
                  description: Optional commit message to use when creating a new commit.
                target_commit_messages:
                  type: object
                  properties:
                    node: &ref_0
                      type: string
                    typescript: *ref_0
                    python: *ref_0
                    go: *ref_0
                    java: *ref_0
                    kotlin: *ref_0
                    ruby: *ref_0
                    terraform: *ref_0
                    cli: *ref_0
                    php: *ref_0
                    csharp: *ref_0
                    sql: *ref_0
                    openapi: *ref_0
                  additionalProperties: false
                  description: |-
                    Optional commit messages to use for each SDK when making a new commit.
                    SDKs not represented in this object will fallback to the optional
                    `commit_message` parameter, or will fallback further to the default
                    commit message.
                allow_empty:
                  type: boolean
                  default: false
                  description: Whether to allow empty commits (no changes). Defaults to false.
                enable_ai_commit_message:
                  type: boolean
                  description: |-
                    Whether to generate AI-powered commit messages for the build.
                    Cannot be combined with `commit_message` or `target_commit_messages`.
              required:
                - project
                - revision
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Build'
  /v0/builds/{buildId}:
    get:
      summary: Retrieve build
      description: Retrieve a build by its ID.
      parameters:
        - in: path
          name: buildId
          schema:
            type: string
            description: Build ID
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Build'
  /v0/build_target_outputs:
    get:
      summary: Download build target output
      description: |-
        Retrieve a method to download an output for a given build target.

        If the requested type of output is `source`, and the requested output
        method is `url`, a download link to a tarball of the source files is
        returned. If the requested output method is `git`, a Git remote, ref,
        and access token (if necessary) is returned.

        Otherwise, the possible types of outputs are specific to the requested
        target, and the output method _must_ be `url`. See the documentation for
        `type` for more information.
      parameters:
        - in: query
          name: build_id
          schema:
            type: string
            description: Build ID
          required: true
        - in: query
          name: target
          schema:
            type: string
            enum: &ref_1
              - node
              - typescript
              - python
              - go
              - java
              - kotlin
              - ruby
              - terraform
              - cli
              - php
              - csharp
              - sql
              - openapi
            description: SDK language target name
          required: true
        - in: query
          name: type
          schema:
            anyOf:
              - type: string
                enum:
                  - source
                description: The raw source code generated by Stainless
              - type: string
                enum:
                  - dist
                description: 'TypeScript: compiled dist tarball'
              - type: string
                enum:
                  - wheel
                description: 'Python: wheel distribution package'
              - type: string
                enum:
                  - openapi-with-transforms
                description: 'OpenAPI: spec with transforms applied'
              - type: string
                enum:
                  - openapi-with-code-samples
                description: 'OpenAPI: spec with code samples'
              - type: string
                enum:
                  - openapi-sdk-spec
                description: 'OpenAPI: internal SDK specification JSON'
              - type: string
                enum:
                  - file
                description: 'File: Gets an arbitrary file from the source, used with the "path" parameter'
          required: true
        - in: query
          name: path
          schema:
            type: string
            description: 'The path of the file to get when used with "type": "file".'
        - in: query
          name: output
          schema:
            type: string
            enum:
              - url
              - git
            default: url
            description: 'Output format: url (download URL) or git (temporary access token).'
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      output:
                        type: string
                        enum:
                          - url
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - source
                            description: The raw source code generated by Stainless
                          - type: string
                            enum:
                              - dist
                            description: 'TypeScript: compiled dist tarball'
                          - type: string
                            enum:
                              - wheel
                            description: 'Python: wheel distribution package'
                          - type: string
                            enum:
                              - openapi-with-transforms
                            description: 'OpenAPI: spec with transforms applied'
                          - type: string
                            enum:
                              - openapi-with-code-samples
                            description: 'OpenAPI: spec with code samples'
                          - type: string
                            enum:
                              - openapi-sdk-spec
                            description: 'OpenAPI: internal SDK specification JSON'
                          - type: string
                            enum:
                              - file
                            description: 'File: Gets an arbitrary file from the source, used with the "path" parameter'
                      target:
                        $ref: '#/components/schemas/Target'
                      url:
                        type: string
                        description: URL for direct download
                      path:
                        type: string
                        description: The path of the file, which is only present when using with the type "file" option.
                    required:
                      - output
                      - type
                      - target
                      - url
                  - type: object
                    properties:
                      output:
                        type: string
                        enum:
                          - git
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - source
                            description: The raw source code generated by Stainless
                          - type: string
                            enum:
                              - dist
                            description: 'TypeScript: compiled dist tarball'
                          - type: string
                            enum:
                              - wheel
                            description: 'Python: wheel distribution package'
                          - type: string
                            enum:
                              - openapi-with-transforms
                            description: 'OpenAPI: spec with transforms applied'
                          - type: string
                            enum:
                              - openapi-with-code-samples
                            description: 'OpenAPI: spec with code samples'
                          - type: string
                            enum:
                              - openapi-sdk-spec
                            description: 'OpenAPI: internal SDK specification JSON'
                          - type: string
                            enum:
                              - file
                            description: 'File: Gets an arbitrary file from the source, used with the "path" parameter'
                      target:
                        $ref: '#/components/schemas/Target'
                      token:
                        type: string
                        description: Temporary GitHub access token
                      url:
                        type: string
                        description: URL to git remote
                      ref:
                        type: string
                        description: Git reference (commit SHA, branch, or tag)
                    required:
                      - output
                      - type
                      - target
                      - token
                      - url
                      - ref
                discriminator:
                  propertyName: output
  /v0/builds/compare:
    post:
      summary: Creates two comparable builds
      description: |-
        Create two builds whose outputs can be directly compared with each other.

        Created builds _modify_ their project branches so that their latest sets of
        config files point to the ones specified by the input revision.

        This endpoint is useful because a build has more inputs than the set of
        config files it uses, so comparing two builds directly may return spurious
        differences. Builds made via this endpoint are guaranteed to have
        differences arising from the set of config files, and any custom code.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: Project name
                base:
                  type: object
                  properties:
                    revision:
                      anyOf:
                        - type: object
                          properties:
                            merge:
                              type: string
                              description: A merge command in the format "base..head"
                            files:
                              type: object
                              propertyNames:
                                type: string
                                description: File path
                              additionalProperties:
                                $ref: '#/components/schemas/FileInput'
                              description: File contents to commit directly
                          required:
                            - merge
                            - files
                          description: |-
                            A merge command combined with explicit file contents. The files are committed
                            to the merge target (`base`) without performing an auto-merge.
                        - type: string
                          description: A branch name, commit SHA, or merge command in the format "base..head"
                        - type: object
                          propertyNames:
                            type: string
                            description: File path
                          additionalProperties:
                            $ref: '#/components/schemas/FileInput'
                          description: File contents to commit directly
                      description: 'Specifies what to build: a branch name, a commit SHA, or file contents.'
                    branch:
                      type: string
                      description: |-
                        Branch to use. When using a branch name as revision, this must match or be
                        omitted.
                    commit_message:
                      type: string
                      description: Optional commit message to use when creating a new commit.
                  required:
                    - revision
                    - branch
                  description: Parameters for the base build
                head:
                  type: object
                  properties:
                    revision:
                      anyOf:
                        - type: object
                          properties:
                            merge:
                              type: string
                              description: A merge command in the format "base..head"
                            files:
                              type: object
                              propertyNames:
                                type: string
                                description: File path
                              additionalProperties:
                                $ref: '#/components/schemas/FileInput'
                              description: File contents to commit directly
                          required:
                            - merge
                            - files
                          description: |-
                            A merge command combined with explicit file contents. The files are committed
                            to the merge target (`base`) without performing an auto-merge.
                        - type: string
                          description: A branch name, commit SHA, or merge command in the format "base..head"
                        - type: object
                          propertyNames:
                            type: string
                            description: File path
                          additionalProperties:
                            $ref: '#/components/schemas/FileInput'
                          description: File contents to commit directly
                      description: 'Specifies what to build: a branch name, a commit SHA, or file contents.'
                    branch:
                      type: string
                      description: |-
                        Branch to use. When using a branch name as revision, this must match or be
                        omitted.
                    commit_message:
                      type: string
                      description: Optional commit message to use when creating a new commit.
                  required:
                    - revision
                    - branch
                  description: Parameters for the head build
                targets:
                  type: array
                  items:
                    $ref: '#/components/schemas/Target'
                  description: |-
                    Optional list of SDK targets to build. If not specified, all configured
                    targets will be built.
              required:
                - project
                - base
                - head
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  base:
                    $ref: '#/components/schemas/Build'
                  head:
                    $ref: '#/components/schemas/Build'
                required:
                  - base
                  - head
  /v0/builds/{buildId}/diagnostics:
    get:
      summary: Get diagnostics for a build
      description: |-
        Get the list of diagnostics for a given build.

        If no language targets are specified, diagnostics for all languages are returned.
      parameters:
        - in: path
          name: buildId
          schema:
            type: string
            description: Build ID
          required: true
        - in: query
          name: targets
          schema:
            type: string
            description: Optional comma-delimited list of language targets to filter diagnostics by
        - in: query
          name: severity
          schema:
            type: string
            enum:
              - fatal
              - error
              - warning
              - note
            description: Includes the given severity and above (fatal > error > warning > note).
        - in: query
          name: cursor
          schema:
            type: string
            description: Pagination cursor from a previous response
        - in: query
          name: limit
          schema:
            type: number
            exclusiveMinimum: 0
            maximum: 100
            default: 100
            description: 'Maximum number of diagnostics to return, defaults to 100 (maximum: 100)'
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BuildDiagnostic'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                required:
                  - data
                  - has_more
  /v0/projects/{projectName}/snippets/request:
    post:
      parameters:
        - in: path
          name: projectName
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                language:
                  $ref: '#/components/schemas/Target'
                version:
                  type: string
                  enum:
                    - next
                    - latest_released
                request:
                  anyOf:
                    - type: object
                      properties:
                        method:
                          type: string
                        path:
                          type: string
                        parameters:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              in:
                                type: string
                                enum:
                                  - path
                                  - query
                                  - header
                                  - cookie
                              value: {}
                            required:
                              - name
                              - in
                        body:
                          type: object
                          properties:
                            fileParam:
                              type: string
                            filePath:
                              type: string
                      required:
                        - method
                        - path
                        - parameters
                    - type: object
                      properties:
                        method:
                          type: string
                        url:
                          type: string
                        postData:
                          allOf:
                            - type: object
                              properties:
                                mimeType:
                                  type: string
                              required:
                                - mimeType
                            - anyOf:
                                - type: object
                                  properties:
                                    text:
                                      type: string
                                  required:
                                    - text
                                - type: object
                                  properties:
                                    params:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                        required:
                                          - name
                                  required:
                                    - params
                        queryString:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              value: {}
                            required:
                              - name
                      required:
                        - method
                        - url
                        - queryString
              required:
                - language
                - version
                - request
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  snippet:
                    type: string
                required:
                  - snippet
  /v0/spec/application/{clientId}/{projectName}:
    get:
      summary: Retrieve decorated spec
      description: |2-

            Retrieve the decorated spec for a given application and project.

      parameters:
        - in: path
          name: projectName
          schema:
            type: string
          required: true
        - in: path
          name: clientId
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json: {}
      responses:
        '200':
          description: success
          content:
            application/json:
              schema: {}
components:
  schemas:
    User:
      type: object
      properties:
        object:
          type: string
          enum:
            - user
        id:
          type: string
        email:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        github:
          type:
            - object
            - 'null'
          properties:
            username:
              type: string
          required:
            - username
      required:
        - object
        - id
        - email
        - name
        - github
    Org:
      type: object
      properties:
        object:
          type: string
          enum:
            - org
        slug:
          type: string
        display_name:
          type:
            - string
            - 'null'
        enable_ai_commit_messages:
          type: boolean
      required:
        - object
        - slug
        - display_name
        - enable_ai_commit_messages
    Project:
      type: object
      properties:
        object:
          type: string
          enum:
            - project
        slug:
          type: string
        display_name:
          type:
            - string
            - 'null'
        org:
          type: string
        config_repo:
          type: string
        targets:
          type: array
          items:
            $ref: '#/components/schemas/Target'
      required:
        - object
        - slug
        - display_name
        - org
        - config_repo
        - targets
      description: A project is a collection of SDKs generated from the same set of config files.
    Target:
      type: string
      enum: *ref_1
    ProjectBranch:
      type: object
      properties:
        object:
          type: string
          enum:
            - project_branch
        branch:
          type: string
          description: Branch name
        org:
          type: string
        project:
          type: string
          description: Project name
        config_commit:
          type: object
          properties:
            sha:
              type: string
            repo:
              type: object
              properties:
                host:
                  type: string
                owner:
                  type: string
                name:
                  type: string
                branch:
                  type: string
              required:
                - host
                - owner
                - name
                - branch
            tree_oid:
              type:
                - string
                - 'null'
            stats:
              type:
                - object
                - 'null'
              properties:
                additions:
                  type: integer
                  minimum: 0
                deletions:
                  type: integer
                  minimum: 0
                total:
                  type: integer
                  minimum: 0
              required:
                - additions
                - deletions
                - total
          required:
            - sha
            - repo
            - tree_oid
            - stats
          description: |-
            A Git commit that points to the latest set of config files on a given
            branch.
        latest_build:
          oneOf:
            - $ref: '#/components/schemas/Build'
            - type: 'null'
      required:
        - object
        - branch
        - org
        - project
        - config_commit
        - latest_build
      description: |-
        A project branch names a line of development for a project. Like a Git
        branch, it points to a Git commit with a set of config files. In addition, a
        project branch also points to a set of custom code changes, corresponding to
        Git branches in the staging repos.
    ProjectBranchMinimal:
      type: object
      properties:
        object:
          type: string
          enum:
            - project_branch
        branch:
          type: string
          description: Branch name
        org:
          type: string
        project:
          type: string
          description: Project name
        config_commit:
          type: object
          properties:
            sha:
              type: string
            repo:
              type: object
              properties:
                host:
                  type: string
                owner:
                  type: string
                name:
                  type: string
                branch:
                  type: string
              required:
                - host
                - owner
                - name
                - branch
            tree_oid:
              type:
                - string
                - 'null'
            stats:
              type:
                - object
                - 'null'
              properties:
                additions:
                  type: integer
                  minimum: 0
                deletions:
                  type: integer
                  minimum: 0
                total:
                  type: integer
                  minimum: 0
              required:
                - additions
                - deletions
                - total
          required:
            - sha
            - repo
            - tree_oid
            - stats
          description: |-
            A Git commit that points to the latest set of config files on a given
            branch.
        latest_build_id:
          type: string
      required:
        - object
        - branch
        - org
        - project
        - config_commit
        - latest_build_id
      description: |-
        A project branch names a line of development for a project. Like a Git
        branch, it points to a Git commit with a set of config files. In addition, a
        project branch also points to a set of custom code changes, corresponding to
        Git branches in the staging repos.
    Build:
      type: object
      properties:
        object:
          type: string
          enum:
            - build
        id:
          type: string
          description: Build ID
        updated_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        project:
          type: string
        org:
          type: string
        config_commit:
          type: string
        documented_spec:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - content
                content:
                  type: string
              required:
                - type
                - content
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - url
                url:
                  type: string
                expires:
                  type: string
                  format: date-time
              required:
                - type
                - url
                - expires
            - type: 'null'
        targets:
          type: object
          properties:
            node: &ref_2
              $ref: '#/components/schemas/BuildTarget'
            typescript: *ref_2
            python: *ref_2
            go: *ref_2
            java: *ref_2
            kotlin: *ref_2
            ruby: *ref_2
            terraform: *ref_2
            cli: *ref_2
            php: *ref_2
            csharp: *ref_2
            sql: *ref_2
            openapi: *ref_2
          additionalProperties: false
      required:
        - object
        - id
        - updated_at
        - created_at
        - project
        - org
        - config_commit
        - documented_spec
        - targets
    BuildTarget:
      type: object
      properties:
        object:
          type: string
          enum:
            - build_target
        status:
          type: string
          enum:
            - not_started
            - codegen
            - postgen
            - completed
        commit:
          $ref: '#/components/schemas/CommitStep'
        lint:
          $ref: '#/components/schemas/CheckStep'
        test:
          $ref: '#/components/schemas/CheckStep'
        build:
          $ref: '#/components/schemas/CheckStep'
        install_url:
          type:
            - string
            - 'null'
      required:
        - object
        - status
        - commit
        - install_url
    FileInput:
      anyOf:
        - type: object
          properties:
            content:
              type: string
              description: File content
          required:
            - content
        - type: object
          properties:
            url:
              type: string
              description: URL to fetch file content from
          required:
            - url
    RevisionInput:
      anyOf:
        - type: object
          properties:
            merge:
              type: string
              description: A merge command in the format "base..head"
            files:
              type: object
              propertyNames:
                type: string
                description: File path
              additionalProperties:
                $ref: '#/components/schemas/FileInput'
              description: File contents to commit directly
          required:
            - merge
            - files
          description: |-
            A merge command combined with explicit file contents. The files are committed
            to the merge target (`base`) without performing an auto-merge.
        - type: string
          description: A branch name, commit SHA, or merge command in the format "base..head"
        - type: object
          propertyNames:
            type: string
            description: File path
          additionalProperties:
            $ref: '#/components/schemas/FileInput'
          description: File contents to commit directly
    Commit:
      type: object
      properties:
        sha:
          type: string
        repo:
          type: object
          properties:
            host:
              type: string
            owner:
              type: string
            name:
              type: string
            branch:
              type: string
          required:
            - host
            - owner
            - name
            - branch
        tree_oid:
          type:
            - string
            - 'null'
        stats:
          type:
            - object
            - 'null'
          properties:
            additions:
              type: integer
              minimum: 0
            deletions:
              type: integer
              minimum: 0
            total:
              type: integer
              minimum: 0
          required:
            - additions
            - deletions
            - total
      required:
        - sha
        - repo
        - tree_oid
        - stats
    CommitConclusion:
      type: string
      enum:
        - error
        - warning
        - note
        - success
        - merge_conflict
        - upstream_merge_conflict
        - fatal
        - payment_required
        - cancelled
        - timed_out
        - noop
        - version_bump
    CommitStep:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - not_started
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - waiting
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - queued
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - in_progress
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
            completed:
              type: object
              properties:
                conclusion:
                  $ref: '#/components/schemas/CommitConclusion'
                merge_conflict_pr:
                  type:
                    - object
                    - 'null'
                  properties:
                    number:
                      type: number
                    repo:
                      type: object
                      properties:
                        host:
                          type: string
                        owner:
                          type: string
                        name:
                          type: string
                      required:
                        - host
                        - owner
                        - name
                  required:
                    - number
                    - repo
                commit:
                  oneOf:
                    - $ref: '#/components/schemas/Commit'
                    - type: 'null'
                completed_at:
                  type: string
                  format: date-time
              required:
                - conclusion
                - merge_conflict_pr
                - commit
                - completed_at
              description: deprecated
            conclusion:
              $ref: '#/components/schemas/CommitConclusion'
            merge_conflict_pr:
              type:
                - object
                - 'null'
              properties:
                number:
                  type: number
                repo:
                  type: object
                  properties:
                    host:
                      type: string
                    owner:
                      type: string
                    name:
                      type: string
                  required:
                    - host
                    - owner
                    - name
              required:
                - number
                - repo
            commit:
              oneOf:
                - $ref: '#/components/schemas/Commit'
                - type: 'null'
            completed_at:
              type: string
              format: date-time
          required:
            - status
            - completed
            - conclusion
            - merge_conflict_pr
            - commit
            - completed_at
      discriminator:
        propertyName: status
    CheckStep:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - not_started
          required:
            - status
        - type: object
          properties:
            status:
              type: string
              enum:
                - waiting
            url:
              type:
                - string
                - 'null'
          required:
            - status
            - url
        - type: object
          properties:
            status:
              type: string
              enum:
                - queued
            url:
              type:
                - string
                - 'null'
          required:
            - status
            - url
        - type: object
          properties:
            status:
              type: string
              enum:
                - in_progress
            url:
              type:
                - string
                - 'null'
          required:
            - status
            - url
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
            completed:
              type: object
              properties:
                conclusion:
                  $ref: '#/components/schemas/CheckConclusion'
                url:
                  type:
                    - string
                    - 'null'
              required:
                - conclusion
                - url
              description: deprecated
            conclusion:
              $ref: '#/components/schemas/CheckConclusion'
            url:
              type:
                - string
                - 'null'
          required:
            - status
            - completed
            - conclusion
            - url
      discriminator:
        propertyName: status
    CheckConclusion:
      type: string
      enum:
        - success
        - failure
        - skipped
        - cancelled
        - action_required
        - neutral
        - timed_out
    BuildDiagnostic:
      type: object
      properties:
        code:
          type: string
          description: The kind of diagnostic.
        level:
          type: string
          enum:
            - fatal
            - error
            - warning
            - note
          description: The severity of the diagnostic.
        ignored:
          type: boolean
          description: Whether the diagnostic is ignored in the Stainless config.
        message:
          type: string
          description: A description of the diagnostic.
        more:
          oneOf:
            - $ref: '#/components/schemas/BuildDiagnosticMore'
            - type: 'null'
        oas_ref:
          type: string
          description: A JSON pointer to a relevant field in the OpenAPI spec.
        config_ref:
          type: string
          description: A JSON pointer to a relevant field in the Stainless config.
      required:
        - code
        - level
        - ignored
        - message
        - more
    BuildDiagnosticMore:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - markdown
            markdown:
              type: string
          required:
            - type
            - markdown
        - type: object
          properties:
            type:
              type: string
              enum:
                - raw
            raw:
              type: string
          required:
            - type
            - raw
      discriminator:
        propertyName: type
