openapi: 3.1.0
info:
  title: HPE GreenLake for Reporting
  description: >-
    The HPE GreenLake for Reporting service provides a collection of RESTful
    APIs for generating reports, retrieving supported columns and filters,
    monitoring asynchronous operations, and querying the status of reports.
  license:
    name: HPE License
    url: https://www.hpe.com/us/en/software/licensing.html
  version: v1
servers:
  - url: https://global.api.greenlake.hpe.com
security:
  - BearerAuth: []
paths:
  /reporting/v1/statuses:
    get:
      summary: Get statuses of all the reports belonging to a workspace
      tags:
        - Report Status
      description: >
        This API is designed to fetch the status of all reports for a specific
        workspace. Only reports belonging to the workspace ID and username are
        returned. This API supports pagination, allowing you to use offset and
        limit parameters.
      parameters:
        - name: filter
          in: query
          required: true
          schema:
            type: string
            description: >
              Limit the resources operated on by an endpoint or when used with a
              multiple-GET endpoint,

              return only the subset of resources that match the filter. The
              filter grammar is a subset

              of OData 4.0.


              **NOTE:** The filter query parameter must use [URL
              encoding](https://en.wikipedia.org/wiki/URL_encoding).

              Most clients do this automatically with inputs provided to them
              specifically as query parameters. Encoding must be done manually
              for any query parameters provided as part of the URL.  

              The reserved characters `!` `#` `$` `&` `'` `(` `)` `*` `+` `,`
              `/` `:` `;` `=` `?` `@` `[` `]` must be encoded with percent
              encoded equivalents.


              For example, the value `P06760-B21+2M212504P8` must be encoded as
              `P06760-B21%2B2M212504P8` when it is used in a query parameter.


              | CLASS     |  EXAMPLES                                          |

              |-----------|----------------------------------------------------|

              | Types     | integer, decimal, timestamp, string, boolean, null |

              | Operations| eq, ne, gt, ge, lt, le, in                         |

              | Logic     | and, or, not                                       |
          examples:
            equals:
              summary: Filter with equality check
              description: |
                Return results where a property equals a value.
                \<property> eq \<value>
              value: type eq 'REPORT'
        - name: sort
          in: query
          required: true
          schema:
            type: string
          description: >-
            The order in which to return the resources in the collection.The
            value of the sort query parameter is a comma separated list of sort
            expressions. Each sort expression is a property name optionally
            followed by a direction indicator asc (ascending) or desc
            (descending).The first sort expression in the list defines the
            primary sort order, the second defines the secondary sort order, and
            so on. If a direction indicator is omitted the default direction is
            ascending.
          examples:
            name-asc:
              summary: Ascending by name
              description: Order ascending by name
              value: name asc
            name-createdAt-desc:
              summary: Ascending by name and then by descending by createdAt
              description: >-
                Order resources ascending by name and then by descending by
                createdAt
              value: name,createdAt desc
        - name: limit
          in: query
          description: The maximum number of reports to return.
          required: false
          schema:
            type: integer
            default: 10
            maximum: 100
            minimum: 0
          example: 50
        - name: offset
          in: query
          description: Zero-based resource offset to start the response from.
          required: false
          schema:
            type: integer
            default: 0
          example: 20
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Number of items returned
                    required:
                      - count
                  limit:
                    type: integer
                    description: The maximum number of reports to return.
                  offset:
                    type: integer
                    description: Zero-based resource offset
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier of the report
                          format: uuid
                        type:
                          type: string
                          description: Type of the resource
                        name:
                          type: string
                          description: The display name of the report.
                        description:
                          type: string
                          description: A description of the report supplied by a user.
                        resourceUri:
                          type: string
                          description: URI to the report metadata resource itself.
                        status:
                          type: string
                          description: >-
                            The current status of the report generation stage,
                            indicating whether the report stage is, for example,
                            in progress or completed.
                        stage:
                          type: string
                          description: The current stage in the report generation process.
                        message:
                          type: string
                          description: >-
                            Short description of the progress, which may be
                            empty.
                        isExpired:
                          type: string
                          description: >-
                            A boolean that declares if the report has expired or
                            not.
                        reportType:
                          type: string
                          description: The type of report.
                        reportDownloadUrl:
                          type: string
                          description: The URL at which you can view the report.
                        userName:
                          type: string
                          description: The username of whoever created the report.
                        recipientEmailId:
                          type: string
                          description: The email address the report was sent to.
                        startTime:
                          type: string
                          format: date-time
                          description: The date and time the report request was initiated.
                        statusTimestamp:
                          type: string
                          format: date-time
                          description: The date and time the report status last changed.
                        createdAt:
                          type: string
                          format: date-time
                          description: The date and time the report was created.
                      required:
                        - id
                        - type
                        - status
                        - stage
                        - message
                        - reportType
                        - userName
                        - recipientEmailId
                        - startTime
                        - statusTimestamp
                    required:
                      - items
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
              examples:
                Invalid limit:
                  value:
                    httpStatusCode: 400
                    errorCode: GLP_GL_REPORTING_BAD_REQUEST_ERROR
                    message: >-
                      Invalid 'limit' value. It must be integers within the
                      specified limits.
                    debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                Invalid filter:
                  value:
                    httpStatusCode: 400
                    errorCode: GLP_GL_REPORTING_BAD_REQUEST_ERROR
                    message: Invalid filter. Use filter=type eq 'REPORT'.
                    debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '401':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 401
                  errorCode: HPE_GL_REPORTING_AUTHORIZATION_ERROR
                  message: Not authorized to get report statuses"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
                example:
                  httpStatusCode: 404
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: >-
                    Report status not found. No reports match the given
                    criteria.
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
                example:
                  httpStatusCode: 500
                  errorCode: HPE_GL_REPORTING_INTERNAL_SERVER_ERROR
                  message: Failed to fetch status
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
  /reporting/v1/statuses/{id}:
    get:
      summary: Get Report Status by ID
      tags:
        - Report Status
      description: >
        Retrieve the status of a specific report by passing the report status
        ID.
      parameters:
        - name: id
          in: path
          description: The report status identifier.
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^[a-zA-Z0-9-]+$
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier of the report
                    format: uuid
                  type:
                    type: string
                    description: Type of the resource
                  name:
                    type: string
                  description:
                    type: string
                  resourceUri:
                    type: string
                    description: URI to the report status resource itself.
                  status:
                    type: string
                    description: >-
                      The current status of the report generation stage,
                      indicating whether the stage is, for example, in progress
                      or completed.
                  stage:
                    type: string
                    description: The current stage in the report generation process.
                  message:
                    type: string
                    description: >-
                      A short description of the current progress. This field
                      may be empty.
                  isExpired:
                    type: string
                    description: A boolean that declares if the report has expired or not.
                  reportType:
                    type: string
                    description: The type of report.
                  reportDownloadUrl:
                    type: string
                    description: The URL at which you can view the report.
                  userName:
                    type: string
                    description: The username of whoever created the report.
                  recipientEmailId:
                    type: string
                    description: The email address the report was sent to.
                  startTime:
                    type: string
                    description: The date and time the report request was initiated.
                    format: date-time
                  statusTimestamp:
                    type: string
                    description: The date and time the report request was initiated.
                    format: date-time
                  createdAt:
                    type: string
                    description: The date and time the report request was initiated.
                    format: date-time
                required:
                  - id
                  - type
                  - status
                  - stage
                  - message
                  - reportType
                  - userName
                  - recipientEmailId
                  - startTime
                  - statusTimestamp
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
                example:
                  httpStatusCode: 400
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: >-
                    Invalid characters in 'id'. Only alphanumeric and hyphens
                    are allowed.
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 401
                  errorCode: HPE_GL_REPORTING_FORBIDDEN_ERROR
                  message: >-
                    Not authorized to get report status of id =
                    "1fa85f64-5434-9980-b3fc-3c963f44fgh9"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
                example:
                  httpStatusCode: 404
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: >-
                    Report status not found. No reports match the given
                    criteria.
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  httpStatusCode:
                    type: integer
                    description: HTTP equivalent status code
                  errorCode:
                    type: string
                    description: >-
                      A unique machine-friendly, but human-readable identifier
                      for the error
                  message:
                    type: string
                    description: User-friendly error message
                  debugId:
                    type: string
                    description: Unique identifier for the instance of this error
                required:
                  - httpStatusCode
                  - errorCode
                  - message
                  - debugId
                example:
                  httpStatusCode: 500
                  errorCode: HPE_GL_REPORTING_INTERNAL_SERVER_ERROR
                  message: Failed to fetch status
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
  /reporting/v1/report-exports:
    post:
      summary: Report exports
      tags:
        - Report exports
      description: >
        Use this API to asynchronously generate reports across supported report
        types. After you submit your report generation requests, they are
        processed in the background. Once complete, you receive a unique URI in
        the response header.  <br><br>**NOTE:** You need to specify the columns
        you want to return in the report, and apply filter criteria to refine
        the data returned. To find out what columns and filter criteria are
        available, call the Report Exports Metadata API.
      requestBody:
        $ref: '#/components/requestBodies/generateReportRequest'
      responses:
        '202':
          description: Request accepted
          headers:
            Location:
              description: URL where the generated resource can be accessed
              schema:
                type: string
                format: uri
              example: >-
                /reporting/v1alpha1/async-operations/1fa85f64-5434-9980-b3fc-3c963f44fgh9
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/generateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 400
                  errorCode: GLP_GL_REPORTING_INVALID_ATTRIBUTE_ERROR
                  message: Invalid column name "SUBSCRIPTION_KEY1"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 401
                  errorCode: HPE_GL_REPORTING_AUTHORIZATION_ERROR
                  message: Not authorized to initiate report export
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 403
                  errorCode: HPE_GL_REPORTING_FORBIDDEN_ERROR
                  message: >-
                    Incorrect permissions to initiate report export for report
                    type "subscriptions"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 404
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: Invalid datasource "subscription1"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 500
                  errorCode: HPE_GL_REPORTING_INTERNAL_SERVER_ERROR
                  message: Failed to initiate report exports
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
  /reporting/v1/async-operations/{id}:
    get:
      summary: Asynchronous operation details
      tags:
        - Async operations
      description: >

        Retrieve information about asynchronous operations within the reporting
        service. Provide the unique identifier of the operation in the parameter
        to monitor the progress of asynchronous tasks.  This API returns the
        following attributes:

          - `status`—Indicates the current status of the asynchronous task.
          - `startedAt`—Specifies the timestamp when the operation was initiated.
          - `endedAt`—Indicates the timestamp when the operation was completed.
          - `logMessages`—Provides a list of progress updates for the asynchronous operation.
          - `progressPercent`—Represents the progress of the operation as a percentage value ranging from 0 to 100.
          - `sourceResourceUri`—References the source URI that triggered the asynchronous task.
          - `results`—The results array provides a link to /reporting/v1/statuses/{id} to get the complete details of the report status.
      parameters:
        - name: id
          in: path
          schema:
            type: string
            format: uuid
            pattern: ^[a-zA-Z0-9-]+$
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          description: The unique identifier returned by an asynchronous API call.
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/asyncOperationResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 401
                  errorCode: HPE_GL_REPORTING_AUTHORIZATION_ERROR
                  message: Not authorized to get async operation details
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 403
                  errorCode: HPE_GL_REPORTING_FORBIDDEN_ERROR
                  message: >-
                    Incorrect permission to retrieve report of id =
                    "1fa85f64-5434-9980-b3fc-3c963f44fgh9"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 404
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: 'Invalid id: 4ca85f64-9878-1234-b3fc-2c963f66afy7'
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 500
                  errorCode: HPE_GL_REPORTING_INTERNAL_SERVER_ERROR
                  message: Failed to retrieve async operation details
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
  /reporting/v1/report-exports-metadata:
    get:
      summary: Report exports metadata
      tags:
        - Report exports
      description: >
        This API is a support tool that assists with generating a report. Use it
        to find the supported columns, filter criteria, and values for a report
        type.  In a response, the API returns:

          - `columns`&mdash;An array containing the supported columns.
          - `filterCriteria`&mdash;An array comprising of filter names and their corresponding data types.
          - `supportedOperators`&mdash;A collection of supported operators assisting you in selecting the correct operator to use in a filter attribute. The following operators are supported:
            - `EQ`&mdash;Checks if a field is equal to a value.
            - `NE`&mdash;Checks if a field is not equal to a value.
            - `LT`&mdash;Checks if a field is less than a value.
            - `LE`&mdash;Checks if a field is less than or equal to a value.
            - `GT`&mdash;Checks if a field is greater than a value.
            - `GE`&mdash;Checks if a field is greater than or equals to a value.
            - `IN`&mdash;Checks if a value is in a list.
      parameters:
        - name: filter
          in: query
          description: >
            Limit the resources operated on by an endpoint or when used with a
            multiple-GET endpoint,

            return only the subset of resources that match the filter. The
            filter grammar is a subset

            of OData 4.0.


            **NOTE:** The filter query parameter must use [URL
            encoding](https://en.wikipedia.org/wiki/URL_encoding).

            Most clients do this automatically with inputs provided to them
            specifically as query parameters. Encoding must be done manually for
            any query parameters provided as part of the URL.  

            The reserved characters `!` `#` `$` `&` `'` `(` `)` `*` `+` `,` `/`
            `:` `;` `=` `?` `@` `[` `]` must be encoded with percent encoded
            equivalents.


            For example: the value `P06760-B21+2M212504P8` must be encoded as
            `P06760-B21%2B2M212504P8` when it is used in a query parameter.


            | CLASS     |  EXAMPLES                                          |

            |-----------|----------------------------------------------------|

            | Types     | integer, decimal, timestamp, string, boolean, null |

            | Operations| eq, ne, gt, ge, lt, le, in                         |

            | Logic     | and, or, not                                       |
          required: true
          schema:
            type: string
          examples:
            equals:
              summary: Filter with multiple operations
              description: |
                Return activities where a property equals a value.
                \<property> eq \<value>
              value: name ne Subscriptions and group eq Device inventory
        - name: select
          in: query
          description: >-
            The select query parameter is used to limit the properties returned
            for a resource. The value of the select query parameter is a
            comma-separated list of properties.
          required: true
          schema:
            type: string
          example:
            equals:
              summary: select with equality check
              description: |
                Return activities where a property equals a value.
              value: select=name
        - name: sort
          in: query
          description: >-
            The order in which to return the resources in the collection. The
            value of the sort query parameter is a comma separated list of sort
            expressions. Each sort expression is a property name optionally
            followed by a direction indicator asc (ascending) or desc
            (descending). The first sort expression in the list defines the
            primary sort order, the second defines the secondary sort order, and
            so on. If a direction indicator is omitted, the default direction is
            ascending.
          required: true
          schema:
            type: string
          examples:
            name-asc:
              summary: Ascending by name
              description: Order ascending by name
              value: name asc
            name-createdAt-desc:
              summary: Ascending by name and then by descending by createdAt
              description: >-
                Order resources ascending by name and then by descending by
                createdAt
              value: name,createdAt desc
        - name: limit
          in: query
          description: The maximum number of reports to return.
          required: false
          schema:
            type: integer
            minimum: 0
            default: 10
            maximum: 100
          example: 10
        - name: offset
          in: query
          description: Zero-based resource offset to start the response from.
          required: false
          schema:
            type: integer
            default: 0
          example: 20
      responses:
        '200':
          description: Request accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/generateDocResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 400
                  errorCode: GLP_GL_REPORTING_INVALID_ATTRIBUTE_ERROR
                  message: 'Invalid attribute: type1'
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 401
                  errorCode: HPE_GL_REPORTING_AUTHORIZATION_ERROR
                  message: Not authorized to retrieve report export metadata
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 403
                  errorCode: HPE_GL_REPORTING_FORBIDDEN_ERROR
                  message: >-
                    Incorrect permission to retrieve report export metadata for
                    report type "subscriptions"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 404
                  errorCode: HPE_GL_REPORTING_NOT_FOUND_ERROR
                  message: Invalid type "subscription1"
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
                example:
                  httpStatusCode: 500
                  errorCode: HPE_GL_REPORTING_INTERNAL_SERVER_ERROR
                  message: Failed to retrieve report exports metadata
                  debugId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    error:
      type: object
      properties:
        httpStatusCode:
          type: integer
          description: HTTP equivalent status code
        errorCode:
          type: string
          description: >-
            A unique machine-friendly, but human-readable identifier for the
            error
        message:
          type: string
          description: User-friendly error message
        debugId:
          type: string
          description: Unique identifier for the instance of this error
      required:
        - httpStatusCode
        - errorCode
        - message
        - debugId
    filterCriteria:
      type: object
      properties:
        key:
          type: string
        operator:
          enum:
            - EQ
            - NE
            - GT
            - GE
            - LT
            - LE
            - IN
        value:
          type: string
    queryElements:
      type: object
      properties:
        columns:
          type: array
          description: An array containing the supported columns.
          items:
            type: string
        filterCriteria:
          type: array
          description: >-
            An array comprising of filter names and their corresponding data
            types.
          $ref: '#/components/schemas/filterCriteria'
    delivery:
      type: object
      properties:
        format:
          enum:
            - CSV
            - TXT
            - PDF
            - EXCEL
          description: The file type of the report.
        email:
          type: object
          properties:
            subject:
              type: string
              description: The subject line of the email.
            recipients:
              type: array
              description: The email address of the recipients of the report.
              items:
                type: string
                description: The email address of the recipients of the report.
    enrollment:
      type: object
      properties:
        delivery:
          $ref: '#/components/schemas/delivery'
    reportDefinition:
      type: object
      properties:
        queryElements:
          $ref: '#/components/schemas/queryElements'
        enrollment:
          $ref: '#/components/schemas/enrollment'
    generateReportBody:
      type: object
      properties:
        name:
          type: string
          description: The name of the report.
        description:
          type: string
          description: A short summary of the report.
        kind:
          type: string
        type:
          type: string
          description: The type of the resource.
        definition:
          $ref: '#/components/schemas/reportDefinition'
    generateResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: UUID of generated resource
        name:
          type: string
          format: string
          description: The name of the resource
    asyncOperationResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The primary identifier for the resource.
        type:
          type: string
          description: The type of the resource.
        state:
          type: string
          description: The state of the operation.
        startedAt:
          type: string
          description: The date and time the operation entered the `RUNNING` state.
          format: date-time
        endedAt:
          type: string
          description: >-
            The date and time the operation completed in the `SUCCEEDED`,
            `FAILED`, or `CANCELLED` states.
          format: date-time
        logMessages:
          type: array
          description: List of progress update objects. This array can be empty.
          items:
            type: object
            properties:
              timestamp:
                type: string
                description: The date and time the log messag was created.
                format: date-time
              message:
                type: string
                description: The log message describing the progress update.
        progressPercent:
          type: integer
          description: Percent progress of the operation as an integer value of 0 to 100.
          format: int64
        sourceResourceUri:
          type: string
          description: >-
            The URI reference to the resource or resource collection that
            initiated the operation
        results:
          type: array
          description: >-
            List of references to resources (other than the source resource)
            which were created, updated, or deleted during the operation.
          items:
            type: object
            properties:
              resourceUri:
                type: string
                description: URI to the effected resources.
              name:
                type: string
                description: The name of the effect resource.
        error:
          type: object
          properties:
            message:
              type: string
              description: User-friendly error message
            timestamp:
              type: string
              description: The date and time the error message was created.
              format: date-time
            debugId:
              type: string
              description: Unique identifier for the instance of this error
      required:
        - id
        - type
        - state
        - startAt
        - endAt
        - logMessages
        - progressPercent
        - sourceResourceUri
    reportDoc:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the report.
        kind:
          type: string
        type:
          type: string
          description: The type of the resource.
        name:
          type: string
          description: The name of the report.
        columns:
          type: array
          items:
            type: object
            properties:
              displayName:
                type: string
                description: The display name of the column.
              name:
                type: string
                description: The internal name of the column.
              dataType:
                type: string
                description: The classification of data accepted by the column.
            required:
              - displayName
              - name
              - dataType
        filterCriteria:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: The name of the filter criteria.
              dataType:
                type: string
                description: The classification of data accepted by the column.
              supportedOperators:
                type: array
                description: >-
                  The classification of the logical operator supported by the
                  filter criteria.
                items:
                  type: string
            required:
              - name
              - dataType
              - supportedOperators
      required:
        - id
        - kind
        - type
        - name
        - columns
        - filterCriteria
    generateDocResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/reportDoc'
        count:
          type: integer
          description: Number of items returned
        total:
          type: integer
          description: >-
            Total number of items in the collection that match the filter query,
            if one was provided in the request.
        offset:
          type: integer
          description: Zero-based resource offset to start the response from
      required:
        - items
        - count
        - total
        - offset
  requestBodies:
    generateReportRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/generateReportBody'
