get:
  summary: Get the last build results of a package of a project.
  description: |
    Get the last build results of a package of a project.

    Since the schema of the output of this endpoint depends on the value of the `lastsuccess` parameter,
    the case where `lastsuccess` is not set to `1` is documented under this [other endpoint](#/Build/get_build__project_name___result).
  security:
    - basic_authentication: []
  parameters:
    - $ref: '../components/parameters/project_name.yaml'
    - in: query
      name: lastsuccess
      schema:
        type: string
      description: |
        Set to `1` to show the last build results.

        Since the schema of the output of this endpoint depends on the value of the `lastsuccess` parameter,
        the case where `lastsuccess` is not set to `1` is documented under this [other endpoint](#/Build/get_build__project_name___result).
      example: 1
    - in: query
      required: true
      name: package
      schema:
        type: string
      description: Name of the package. Limit results to the specified package.
      example: 'obs-server'
    - in: query
      required: true
      name: pathproject
      schema:
        type: string
      description: Name of the project. Limit results to the specified project path.
      example: 'home:Admin'
  responses:
    '200':
      description: OK
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/lastsuccess.yaml'
          example:
            repository:
              - name: openSUSE_Factory
                arch:
                  - arch: x86_64
                    result: failed
                  - arch: i586
                    result: unknown
              - name: containment
                arch:
                  - arch: x86_64
                    result: disabled
                  - arch: i586
                    result: disabled
              - name: '16.0'
                arch:
                  - arch: x86_64
                    result: failed
                  - arch: i586
                    result: failed
    '400':
      description: Bad Request.
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          examples:
            pathproject Not Provided:
              description: Not passing a value to `pathproject`.
              value:
                code: missing_parameter
                summary: "param is missing or the value is empty: pathproject"
    '401':
      $ref: '../components/responses/unauthorized.yaml'
    '404':
      $ref: '../components/responses/unknown_project.yaml'
  tags:
    - Build
