openapi: 3.0.3
info:
  title: Report Images
  description: The reportImages API delivers SVG images representing elements of a report. The images are suitable to the current user, taking row-level-permissions and other factors into consideration.
  version: "2"
  contact:
    name: SAS Developers
    url: https://developer.sas.com
    email: devex@sas.com
tags:
  - name: Jobs
    description: Asynchronous jobs for obtaining images.
  - name: ThumbnailProvider
    description: Asynchronous jobs conforming to the Thumbnail Provider contract.
  - name: Images
    description: Get prepared images.
  - name: Root
    description: This API's root.
  - name: Admin
    description: Operations restricted to an administrative user.
paths:
  /:
    get:
      tags:
        - Root
      summary: Get the top-level links
      description: The root links for this service. <p>Users receive:</p> <ul> <li>"createJob" -- initiates a job using a request body.</li> <li>"createJobWithParams" -- initiates a job using request parameters.</li> </ul> <p>Administrators also receive:</p> <ul> <li>"deleteForReport" and "deleteAll" -- delete cached images.</li> </ul> The links are extended for administrators.
      operationId: root
      responses:
        "200":
          description: The service's links.
          content:
            application/vnd.sas.api+json:
              schema:
                $ref: "#/components/schemas/api"
            application/json:
              schema:
                $ref: "#/components/schemas/api"
          headers:
            Content-Type:
              schema:
                type: string
  /jobs#requestParams:
    post:
      tags:
        - Jobs
      summary: Get report images via request parameters
      description: Creates an asynchronous job for obtaining SVG images for the report. To specify report elements to render, use [POST /jobs](#op:createJob).
      operationId: createJobWithParams
      parameters:
        - $ref: "#/components/parameters/reportUri"
        - $ref: "#/components/parameters/layoutType"
        - $ref: "#/components/parameters/selectionType"
        - $ref: "#/components/parameters/size"
        - $ref: "#/components/parameters/wait"
        - $ref: "#/components/parameters/refresh"
        - $ref: "#/components/parameters/sectionIndex"
        - $ref: "#/components/parameters/renderLimit"
        - $ref: "#/components/parameters/visualElementNames"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Accept-Locale"
      responses:
        "201":
          description: The job has both been created and is in the "completed" state; the image(s) are ready.
          headers:
            Location:
              description: Location of the completed job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "202":
          description: The job has been created, but has not completed.
          headers:
            Location:
              description: Location of the running job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "400":
          $ref: "#/components/responses/badRequestError"
        "404":
          $ref: "#/components/responses/reportNotFound"
  /jobs#requestBody:
    post:
      tags:
        - Jobs
      summary: Get report images using request body
      description: Creates an asynchronous job for obtaining SVG images for the report. All the functionality of the [create job with parameters](#op:createJobWithParams) operation is supported, plus the ability to specify a list of report elements to render, each with its own size.
      operationId: createJob
      parameters:
        - $ref: "#/components/parameters/wait"
        - $ref: "#/components/parameters/refresh"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Accept-Locale"
      requestBody:
        content:
          application/vnd.sas.report.images.job.request+json:
            schema:
              $ref: "#/components/schemas/jobRequest"
          application/json:
            schema:
              $ref: "#/components/schemas/jobRequest"
        description: The job details here parallel those in the operation that uses request parameters. In addition, supports an array of name/size pairs to specify multiple renderings.
        required: true
      responses:
        "201":
          description: The requested job has both been created, and is in the "completed" state; the image(s) are ready.
          headers:
            Location:
              description: Location of the completed job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "202":
          description: The requested job has been created but has not completed.
          headers:
            Location:
              description: Location of the running job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "400":
          $ref: "#/components/responses/badRequestError"
        "404":
          $ref: "#/components/responses/reportNotFound"
  /jobs#requestBodyThumbnail:
    post:
      tags:
        - ThumbnailProvider
      summary: Get thumbnail images
      description: Creates an asynchronous job, but honors the media types and contract for a "thumbnail provider".
      operationId: createJobThumbnailProvider
      parameters:
        - $ref: "#/components/parameters/wait"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Accept-Locale"
      requestBody:
        content:
          application/vnd.sas.thumbnails.job.request+json:
            schema:
              $ref: "#/components/schemas/thumbnailRequest"
          application/vnd.sas.thumbnails.job.request+json;version=1:
            schema:
              $ref: "#/components/schemas/thumbnailRequest"
        description: The thumbnail job details.
        required: true
      responses:
        "201":
          description: The job was created and is in the "completed" state. The thumbnails(s) are ready.
          headers:
            Location:
              description: Location of the completed thumbnail job.
              schema:
                type: string
          content:
            application/vnd.sas.thumbnails.job+json:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
            application/vnd.sas.thumbnails.job+json;version=1:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
        "202":
          description: The requested job was created but has not completed. Some of the images can be in the "completed" state. Some images might have a "staleThumbnail" link.
          headers:
            Location:
              description: Location of the running job.
              schema:
                type: string
          content:
            application/vnd.sas.thumbnails.job+json:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
            application/vnd.sas.thumbnails.job+json;version=1:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
        "400":
          description: Bad request. The request body is not well formed.
          content:
            application/vnd.sas.error+json;version=2:
              schema:
                $ref: "#/components/schemas/error2"
            application/json:
              schema:
                $ref: "#/components/schemas/error2"
          headers:
            Content-Type:
              schema:
                type: string
        "404":
          $ref: "#/components/responses/reportNotFound"
  /jobs#reportInBody:
    post:
      tags:
        - Jobs
      summary: Get report images via report in request body
      description: This operation is identical to [POST /jobs (createJobWithParams)](#op:createJobWithParams), except instead of supplying the reportUri parameter, you supply the BIRD report (in JSON or XML) in the request body. <p> This operation should be used by a client that has edited the BIRD report. </p> <p> To access this operation, the "Content-Type" *must* be "application/vnd.sas.report.content+json" or "application/vnd.sas.report.content+xml". </p> This operation does not benefit from cache-based performance.
      operationId: createJobReportInBody
      parameters:
        - $ref: "#/components/parameters/layoutType"
        - $ref: "#/components/parameters/selectionType"
        - $ref: "#/components/parameters/size"
        - $ref: "#/components/parameters/wait"
        - $ref: "#/components/parameters/refresh"
        - $ref: "#/components/parameters/sectionIndex"
        - $ref: "#/components/parameters/renderLimit"
        - $ref: "#/components/parameters/visualElementNames"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Accept-Locale"
      requestBody:
        content:
          application/vnd.sas.report.content+json:
            schema:
              type: string
          application/vnd.sas.report.content+xml:
            schema:
              type: string
        description: The report from which to generate images (JSON or XML, per Content-Type header).
        required: true
      responses:
        "201":
          description: The job has both been created and is in the "completed" state; the image(s) are ready.
          headers:
            Location:
              description: Location of the completed job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "202":
          description: The requested job has been created but has not completed.
          headers:
            Location:
              description: Location of the running job.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "400":
          $ref: "#/components/responses/badRequestError"
        "404":
          $ref: "#/components/responses/reportNotFound"
  "/jobs/{jobId}":
    get:
      tags:
        - Jobs
      summary: Get specified job
      description: Returns the asynchronous job.
      operationId: getJob
      parameters:
        - name: jobId
          in: path
          required: true
          description: The jobId.
          schema:
            type: string
        - $ref: "#/components/parameters/wait"
      responses:
        "200":
          description: The requested job, which may be in a terminal state. Terminal states are "completed" and "failed".
          headers:
            Content-Type:
              schema:
                type: string
            Last-Modified:
              description: If present, this header contains the current datetime.
              schema:
                type: string
          content:
            application/vnd.sas.report.images.job+json:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=1:
              schema:
                $ref: "#/components/schemas/job"
            application/vnd.sas.report.images.job+json;version=2:
              schema:
                $ref: "#/components/schemas/job"
            application/json:
              schema:
                $ref: "#/components/schemas/job"
        "404":
          $ref: "#/components/responses/jobNotFound"
        "500":
          $ref: "#/components/responses/dependentServicesError"
  "/jobs/{jobId}#getThumbnailJob":
    get:
      tags:
        - ThumbnailProvider
      summary: Get thumbnail provider job
      description: Returns the asynchronous job in the media type for "thumbnail provider".
      operationId: getJobThumbnailProvider
      parameters:
        - name: jobId
          in: path
          required: true
          description: the jobId
          schema:
            type: string
        - $ref: "#/components/parameters/wait"
      responses:
        "200":
          description: The requested thumbnail job, which may be in a terminal state. Terminal states are "completed" and "failed".
          headers:
            Content-Type:
              schema:
                type: string
          content:
            application/vnd.sas.thumbnails.job+json:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
            application/vnd.sas.thumbnails.job+json;version=1:
              schema:
                $ref: "#/components/schemas/thumbnailJob"
        "404":
          $ref: "#/components/responses/jobNotFound"
        "500":
          $ref: "#/components/responses/dependentServicesError"
  "/jobs/{jobId}/state":
    get:
      tags:
        - Jobs
      summary: Get the state of the job
      description: Get the state of the specified job.
      operationId: getJobState
      parameters:
        - name: jobId
          in: path
          required: true
          description: The jobId.
          schema:
            type: string
      responses:
        "200":
          description: The job state.
          headers:
            Content-Type:
              description: The content type of the response, `text/plain`.
              schema:
                type: string
          content:
            text/plain:
              schema:
                type: string
        "404":
          $ref: "#/components/responses/jobNotFound"
  /directImage:
    get:
      tags:
        - Jobs
      summary: Return the report image
      description: This operation hides the job architecture and *directly* generates and returns the image.  It blocks synchronously until the image is ready or timeout occurs (default 10 seconds). If a timeout occurs, a redirect is returned to the browser, redirecting back to this operation for browser liveness purposes.  <p> Use of this operation is discouraged. Using more than one can starve a browser's requests queue, as some browsers are limited to 6 active queries per site. Also, the redirect technique employed can fail in the browser after too many redirects, as some browsers allow only 10 redirects. </p> <p> Any client capable of following the job pattern should NOT use this direct operation. </p> Parameters `reportUri` and `size` are required.
      operationId: getImageDirectly
      parameters:
        - $ref: "#/components/parameters/reportUri"
        - $ref: "#/components/parameters/layoutType"
        - $ref: "#/components/parameters/selectionType"
        - $ref: "#/components/parameters/refresh"
        - $ref: "#/components/parameters/sectionIndex"
        - $ref: "#/components/parameters/visualElementName"
        - name: size
          in: query
          required: false
          description: The size of the rendered image. Format is <code><em>width</em><strong>x</strong><em>height</em></code>, with no spaces. For example, "300x200".
          schema:
            type: string
            default: 268x151
        - name: wait
          in: query
          required: false
          description: The number of seconds to wait for the result. When this expires, a "redirect" is returned to continue the waiting process. Use caution when setting; some browsers abort after 10 redirects.
          schema:
            type: number
            format: float
            default: 10
      responses:
        "200":
          description: The SVG image is returned.
          headers:
            ETag:
              description: The entity tag for this image.
              schema:
                type: string
            Cache-Control:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
            Expires:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
            Pragma:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
          content:
            image/svg+xml:
              schema:
                type: string
                format: binary
        "303":
          description: The operation could not be completed before the wait time expired. This redirect (See Other) continues the process of waiting for the image.  It is used (rather than extending the wait period) to provide some liveness to the browser's transmit queue.  Note that this redirect is common, clients that cannot follow a redirect must either not use this method or specify a very long timeout.
          headers:
            Location:
              description: A URI back to this service to wait for this image.
              schema:
                type: string
          content:
            "*/*":
              schema:
                type: string
        "400":
          $ref: "#/components/responses/badRequestError"
        "404":
          $ref: "#/components/responses/jobNotFound"
        "500":
          $ref: "#/components/responses/dependentServicesError"
  "/images/{imageId}.svg":
    get:
      tags:
        - Images
      summary: Get image
      description: This operation is used by [POST /jobs](#op:createJob) to return the `GET` links. <p> This operation uses an explicit format modifier ('.svg').  Doing so is to support the primary use case of embedding the link in a web page or other such context where the client cannot pass an 'Accept:' header to specify the image type. </p> <p> This URL is secured, and valid only for the current user. </p> By protocol, SVG images are always XML. The media type is always 'image/svg+xml'.
      operationId: getImage
      parameters:
        - name: imageId
          in: path
          required: true
          description: The system-generated ID returned with the completed job (in the 'image' link).
          schema:
            type: string
        - name: If-None-Match
          in: header
          required: false
          description: Optional ETag. On a match, 304 (not modified) is returned.
          schema:
            type: string
      responses:
        "200":
          description: The image is returned. Caching headers (Cache-Control, Expires, Pragma) are returned encouraging the browser to cache this image.
          headers:
            ETag:
              description: The entity tag for this image.
              schema:
                type: string
            Cache-Control:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
            Expires:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
            Pragma:
              description: Header returned encouraging the browser to cache this image.
              schema:
                type: string
          content:
            image/svg+xml:
              schema:
                type: string
                format: binary
        "304":
          description: If the client-supplied entity tag (If-None-Match) matches the current state, the client's image is current.   Nothing is then returned.
          content:
            "*/*":
              schema:
                type: string
        "404":
          description: Either the imageId cannot be found, or the underlying image is not in the database. <p> If a user other than the one who generated the image uses this link, it is considered a security violation, and a 404 is returned so that the caller does not know the link is an otherwise-valid value. </p>
          content:
            application/vnd.sas.error+json;version=2:
              schema:
                $ref: "#/components/schemas/error2"
            application/json:
              schema:
                $ref: "#/components/schemas/error2"
          headers:
            Content-Type:
              schema:
                type: string
  /images:
    delete:
      tags:
        - Admin
      summary: Delete cached images
      description: Enables administrators to remove cached images for a single report or all cached images.
      operationId: deleteImages
      parameters:
        - name: reportUri
          in: query
          required: false
          description: If supplied, deletes the cached images associated with the report. Otherwise, **all** cached images are deleted.
          schema:
            type: string
            format: uri
      responses:
        "204":
          description: The operation was successful, nothing to return.
        "403":
          description: This operation is restricted to administrators (by default, members of group "ApplicationAdministrators").
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/error2"
          headers:
            Content-Type:
              schema:
                type: string
servers:
  - url: http://example.com/reportImages
    description: This is an example base URL.
components:
  parameters:
    reportUri:
      name: reportUri
      in: query
      required: true
      description: The report from which to generate images.
      schema:
        type: string
    layoutType:
      name: layoutType
      in: query
      required: false
      description: The type of image to render. <ul> <li><code>thumbnail</code> -- selects a suitable report element and reduces the detail to better render at a smaller size. </li> <li><code>normal</code> -- selects a suitable report element, but there is no reduction of detail.</li> <li><code>entireSection</code> -- the entire section (page).</li> </ul>
      schema:
        type: string
        enum:
          - thumbnail
          - normal
          - entireSection
        default: thumbnail
    selectionType:
      name: selectionType
      in: query
      required: false
      description: The selected operation. <ul> <li><code>report</code> -- get a single image, representing the entire report. <li><code>perSection</code> -- get one image per section. <li><code>visualElements</code> -- specify the visual elements to render in parameter <code>visualElementNames</code> or <code>visualElementName</code> for the /directImage operation. </ul>
      schema:
        type: string
        enum:
          - report
          - perSection
          - visualElements
        default: report
    visualElementNames:
      name: visualElementNames
      in: query
      required: false
      description: If "selectionType=visualElements" is specified, this parameter lists the element names to render. Separate multiple elements with commas.
      schema:
        type: string
    visualElementName:
      name: visualElementName
      in: query
      required: false
      description: The report element to render.
      schema:
        type: string
    size:
      name: size
      in: query
      required: true
      description: The size of the rendered image. Format is <code><em>width</em><strong>x</strong><em>height</em></code>, with no spaces. For example, "268x151".
      schema:
        type: string
    wait:
      name: wait
      in: query
      required: false
      description: The number of seconds to wait for an update before returning from the "long poll". The maximum is 30 seconds.
      schema:
        type: number
        format: float
        default: 0.5
    refresh:
      name: refresh
      in: query
      required: false
      description: If true, bypass caches and generate a new image.
      schema:
        type: boolean
        default: false
    sectionIndex:
      name: sectionIndex
      in: query
      required: false
      description: The section to render. This parameter applies when <code>layoutType==entireSection</code>.
      schema:
        type: integer
        format: int32
        default: 0
    renderLimit:
      name: renderLimit
      in: query
      required: false
      description: Limit how many images to render. For no limit, set to -1. Clients can specify "1" to quickly get the first image and how many remaining images are available.
      schema:
        type: integer
        format: int32
        default: -1
    Accept-Language:
      name: Accept-Language
      in: header
      description: The user's locale. For non-thumbnail operations, this locale is a factor for both rendering and caching. For thumbnail requests, typically only the right-to-left aspect is considered. Thumbnails do not typically include localizable content, and consequently are shareable among users with different locales. For details, see <a href="https://tools.ietf.org/html/rfc7231#section-5.3.5" target="_blank">Accept-Language</a>.
      required: false
      schema:
        type: string
    Accept-Locale:
      name: Accept-Locale
      in: header
      description: A "format locale" distinct from the user's language (Accept-Language). Usage and syntax is similar to Accept-Language.
      required: false
      schema:
        type: string
  responses:
    badRequestError:
      description: The request was invalid.
      content:
        application/vnd.sas.error+json;version=2:
          schema:
            $ref: "#/components/schemas/error2"
        application/json:
          schema:
            $ref: "#/components/schemas/error2"
      headers:
        Content-Type:
          schema:
            type: string
    reportNotFound:
      description: The report could not be found.
      content:
        application/vnd.sas.error+json;version=2:
          schema:
            $ref: "#/components/schemas/error2"
        application/json:
          schema:
            $ref: "#/components/schemas/error2"
      headers:
        Content-Type:
          schema:
            type: string
    jobNotFound:
      description: The job could not be found.
      content:
        application/vnd.sas.error+json;version=2:
          schema:
            $ref: "#/components/schemas/error2"
        application/json:
          schema:
            $ref: "#/components/schemas/error2"
      headers:
        Content-Type:
          schema:
            type: string
    dependentServicesError:
      description: An internal service error was returned by one of the services that this operation uses. The response object contains error text and codes to diagnose it.
      content:
        application/vnd.sas.error+json;version=2:
          schema:
            $ref: "#/components/schemas/error2"
        application/json:
          schema:
            $ref: "#/components/schemas/error2"
      headers:
        Content-Type:
          schema:
            type: string
  schemas:
    error2:
      title: Error
      type: object
      description: The representation of an error.
      x-sas-media-type:
        name: application/vnd.sas.error
        version: 2
      required:
        - httpStatusCode
        - version
      properties:
        message:
          type: string
          description: The message for the error.
        id:
          type: string
          description: The string ID for the error.
        errorCode:
          type: integer
          description: The numeric ID for the error.
        httpStatusCode:
          type: integer
          description: The HTTP status code for the error.
        details:
          type: array
          description: Messages that provide additional details about the cause of the error.
          items:
            type: string
        remediation:
          type: string
          description: A message that describes how to resolve the error.
        errors:
          type: array
          description: Any additional errors that occurred.
          items:
            $ref: "#/components/schemas/error2"
        links:
          type: array
          description: The links that apply to the error.
          items:
            $ref: "#/components/schemas/link"
        version:
          type: integer
          description: The version number of the error representation. This representation is version 2.
    link:
      title: Link
      type: object
      description: A link to a related operation or resource.
      required:
        - rel
      properties:
        method:
          type: string
          description: The HTTP method for the link.
        rel:
          type: string
          description: The relationship of the link to the resource.
        uri:
          type: string
          description: The relative URI for the link.
        href:
          type: string
          description: The URL for the link.
        title:
          type: string
          description: The title for the link.
        type:
          type: string
          description: The media type or link type for the link.
        itemType:
          type: string
          description: If this is a link to a container, `itemType` is the media type or link type for the items in the container.
        responseType:
          type: string
          description: The media type or link type of the response body for a `PUT`, `POST`, or `PATCH` operation.
        responseItemType:
          type: string
          description: The media type or link type of the items in the response body for a `PUT`, `POST`, or `PATCH` operation.
    job:
      title: The operation to create image(s)
      description: Primary media type of this service. This media type represents the job to obtain the requested image(s). When the job is completed, the images element contains one object per image returned. Each object contains metadata about the image such as section, name, and size, and also a link to get the actual image and other relevant links. After the "report analysis" phase is complete, the metadata for each image is available (excepting the URI to get the image). A client can use this metadata to know that image 1 is a pie chart, image 2 is a bar chart, and image 3 is a table, possibly showing a facsimile if several seconds pass and the job has not completed.
      x-sas-media-type:
        name: application/vnd.sas.report.images.job
        version: 2
      required:
        - id
        - state
        - creationTimeStamp
        - version
      properties:
        id:
          type: string
          description: The unique identifier of this job.
        state:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
          description: The overall state of this job.  "Completed" and "failed" are the terminal states.
        duration:
          type: number
          format: float
          description: How many seconds to complete this job. Returned with completed and failed jobs.
        creationTimeStamp:
          type: string
          description: When the job was created.
          format: date-time
        pagingState:
          $ref: "#/components/schemas/pagingState"
        error:
          $ref: "#/components/schemas/error2"
        images:
          type: array
          description: An array of image detail, one array for each image this job produces. After the report analysis phase completes, this array contains the image metadata, missing only the retrieval link to be complete.
          items:
            $ref: "#/components/schemas/imageDetail"
        links:
          type: array
          description: An array of links to related resources and actions.
          items:
            $ref: "#/components/schemas/link"
        version:
          type: integer
          format: int32
          description: This media type's schema version number. This representation is version 2. If the client specifies version=1, the "modifiedTimeStamp" member is not included with the associated images, and an early return with a "cached" image will not occur.
      example:
        id: d145d576-78d0-42d4-a5fc-569cd0533903
        version: 2
        state: running
        durationMSec: 155
        creationTimeStamp: 2017-11-17T18:46:59.774000Z
        links:
          - method: GET
            rel: self
            href: /reportImages/jobs/d145d576-78d0-42d4-a5fc-569cd0533903
            uri: /reportImages/jobs/d145d576-78d0-42d4-a5fc-569cd0533903
            type: application/vnd.sas.report.images.job+json
          - method: GET
            rel: state
            href: /reportImages/jobs/d145d576-78d0-42d4-a5fc-569cd0533903/state
            uri: /reportImages/jobs/d145d576-78d0-42d4-a5fc-569cd0533903/state
            type: text/plain
        images:
          - sectionIndex: 0
            sectionName: vi6
            sectionLabel: Page 1
            elementName: ve41
            modifiedTimeStamp: 2017-11-16T18:19:23.600000Z
            visualType: Table
            size: 268x151
            state: completed
            links:
              - method: GET
                rel: image
                href: /reportImages/images/K738605462B1380786238.svg
                uri: /reportImages/images/K738605462B1380786238.svg
                type: image/svg+xml
              - method: POST
                rel: render
                href: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
                uri: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
                type: application/vnd.sas.report.images.job
              - method: POST
                rel: resize
                href: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
                uri: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
                type: application/vnd.sas.report.images.job
          - sectionIndex: 1
            sectionName: vi47
            sectionLabel: Page 2
            elementName: ve50
            modifiedTimeStamp: 2017-11-12T14:05:13.450000Z
            visualType: pie
            size: 268x151
            state: running
            links:
              - method: GET
                rel: staleImage
                href: /reportImages/images/K738605462B1234567890.svg
                uri: /reportImages/images/K738605462B1234567890.svg
                type: image/svg+xml
              - method: POST
                rel: render
                href: /reportImages/jobs?elementId=ve50&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
                uri: /reportImages/jobs?elementId=ve50&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
                type: application/vnd.sas.report.images.job
              - method: POST
                rel: resize
                href: /reportImages/jobs?elementId=ve50&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
                uri: /reportImages/jobs?elementId=ve50&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
                type: application/vnd.sas.report.images.job
    imageDetail:
      title: Describes an individual image
      description: Metadata about the image, including state and links. Terminal states are "completed" and "failed". Completed images have link relation "image" to download the image; the URI is suitable for a browser's IMG tag.
      required:
        - sectionIndex
        - sectionName
        - sectionLabel
        - elementName
        - visualType
        - size
        - state
      properties:
        sectionIndex:
          type: integer
          format: int32
          description: The section (page, 0-based) of this report from which this image came.
        sectionName:
          type: string
          description: The internal name of the section.
        sectionLabel:
          type: string
          description: The user label of the section.
        elementName:
          type: string
          description: The internal name of the element this image represents.
        visualType:
          type: string
          description: 'The type of the element. For a graph it is the graphType. For example: "pie" or "bar". For a section, it is "Section". For a composite (such as linear regression) the type is "Composite".  For a table or crosstable, the type is "Table" and "Crosstab", respectively.  For a text-only element, it is "Text". These types come from the report definition.'
        size:
          type: string
          description: The requested size. For example, "268x151".
        state:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - ignored
          description: "The state of this job.  Terminal states: completed, failed, ignored."
        modifiedTimeStamp:
          type: string
          description: The timestamp in `YYYY-MM-DDThh:mm:ss.sssZ` format of when the referenced image was last updated. This member is  present only when a link to an image is also present (either `image` or `staleImage`), and indicates the modified time of that image. This member was not available in version 1 of this media type.
          format: date-time
        error:
          $ref: "#/components/schemas/error2"
        links:
          type: array
          description: An array of links for retrieving the image or initiating a new job. Expect link relations  "image", "render", and "resize". The "image" URI is how the SVG image is retrieved.
          items:
            $ref: "#/components/schemas/link"
      example:
        sectionIndex: 0
        sectionName: vi6
        sectionLabel: Page 1
        elementName: ve41
        modifiedTimeStamp: 2017-11-16T18:19:23.600000Z
        visualType: Table
        size: 268x151
        state: completed
        links:
          - method: GET
            rel: image
            href: /reportImages/images/K738605462B1380786238.svg
            uri: /reportImages/images/K738605462B1380786238.svg
            type: image/svg+xml
          - method: GET
            rel: staleImage
            href: /reportImages/images/K738605462B1234567890.svg
            uri: /reportImages/images/K738605462B1234567890.svg
            type: image/svg+xml
          - method: POST
            rel: render
            href: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
            uri: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size=268x151
            type: application/vnd.sas.report.images.job
          - method: POST
            rel: resize
            href: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
            uri: /reportImages/jobs?elementId=ve41&reportUri=/reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f&layoutType=thumbnail&size={size}
            type: application/vnd.sas.report.images.job
    jobRequest:
      type: object
      title: Job request details
      description: This represents the input to create the job to get the image(s). Parameters "reportUri" and "size" are required. A version of the [createJob resource](#op:createJobWithParams) exists that takes all of these values as request parameters.
      x-sas-media-type:
        name: application/vnd.sas.report.images.job.request
        version: 2
      required:
        - reportUri
      properties:
        reportUri:
          type: string
          description: The report from which to generate images.
        layoutType:
          type: string
          enum:
            - thumbnail
            - normal
            - entireSection
          default: thumbnail
          description: The type of image.
        selectionType:
          type: string
          enum:
            - report
            - perSection
            - visualElements
            - paging
          default: report
          description: >-
            The type of operation selected.

            -"report" gets a single image that represents the entire report.

            -"perSection" gets one image per section.

            -"visualElements" enables the caller to specify the visual elements to render (in parameter "visualElementNames").
        size:
          type: string
          description: The image size. Format is <code><em>width</em><strong>x</strong><em>height</em></code>, with no spaces. For example, "268x151".
        specificVisualElements:
          type: array
          description: An array of name/size pairs, each representing a visual element to render.
          items:
            $ref: "#/components/schemas/nameAndSize"
        sectionIndex:
          type: integer
          format: int32
          default: 0
          description: The section (page) to render. Applies only when layoutType==entireSection.
        refresh:
          type: boolean
          default: false
          description: If true, bypass caches and generate a new image.
        renderLimit:
          type: integer
          format: int32
          default: -1
          description: Limit how many images to render. For no limit, set to -1. Clients can specify "1" to quickly get the first image and how many remaining images are available.
        pagingOptions:
          $ref: "#/components/schemas/pagingOptions"
        version:
          type: integer
          format: int32
          description: This media type's schema version number. This representation is version 2.
      example:
        version: 2
        reportUri: /reports/reports/ffdfe936-80a9-4969-a786-4a314df13f3f
        layoutType: thumbnail
        size: 268x151
        refresh: true
    nameAndSize:
      type: object
      title: Report element name and size.
      required:
        - name
        - size
      properties:
        name:
          type: string
          description: The report element name.
        size:
          type: string
          description: The image size. For example, "268x151".
      example:
        name: ve41
        size: 268x151
    pagingOptions:
      title: Paging Options
      description: >
        Paging details for page-oriented requests. Note when included in a request, must be null if "returnMultiple" is false, must not be null if "returnMultiple" is true.
      type: object
      required:
        - start
        - limit
      properties:
        start:
          type: integer
          description: Start index, 0-based, of the first thumbnail to return.
        limit:
          type: integer
          description: Number of thumbnails to return in a single "page".
    pagingState:
      title: Paging State
      description: Object returned if paging had been requested
      type: object
      required:
        - start
        - limit
        - count
      properties:
        start:
          type: integer
          description: start index (0-based) of the first thumbnai.
        limit:
          type: integer
          description: number of thumbnails returned in a single "page"
        count:
          type: integer
          description: number of available thumbnails.
    thumbnailRequest:
      title: Thumbnail Request
      description: A request to create a new job that creates or delivers a thumbnail.
      x-sas-media-type:
        name: application/vnd.sas.thumbnails.job.request
      required:
        - acceptItem
        - resourceUri
      properties:
        acceptItem:
          type: string
          description: >
            A media type string listing acceptable media types, possibly with quality values. Example: "image/*,text/plain;q=0.9,text/csv;q=0.8".
        resourceUri:
          type: string
          description: URI to the resource for which a thumbnail is needed.
        resourceType:
          type: string
          description: The SAS type of the resource for which a thumbnail is needed.
        detailLevel:
          type: string
          description: The expected level of detail. (default is "low")
          default: low
          enum:
            - low
            - high
        scope:
          type: string
          description: Whether a single element is to be represented, or the entire page. (default is "element")
          default: element
          enum:
            - element
            - page
        returnMultiple:
          type: boolean
          description: Whether a single thumbnail is to be returned (false) or multiple thumbnails (true). (default is false)
          default: false
        refresh:
          type: boolean
          description: Whether the freshest possible result is requested. (default is false)
          default: false
        sizingOptions:
          $ref: "#/components/schemas/sizingOptions"
        accessibilityOptions:
          $ref: "#/components/schemas/accessibilityOptions"
        themeId:
          type: string
          description: The client's current theme.
        pagingOptions:
          $ref: "#/components/schemas/pagingOptions"
        version:
          type: integer
          format: int32
          description: The version number of the thumbnail representation. This representation is version 1.
    api:
      title: API
      description: The list of links to top-level resources and operations available from the root of the API.
      x-sas-media-type:
        name: application/vnd.sas.api
        version: 1
      required:
        - version
        - links
      properties:
        version:
          type: integer
          description: The version number of the API representation. This is version 1.
          minimum: 1
        links:
          description: The API's top-level links.
          type: array
          items:
            $ref: "#/components/schemas/link"
    thumbnailJob:
      title: Thumbnail Job
      description: The representation of a thumbnail job.
      x-sas-media-type:
        name: application/vnd.sas.thumbnails.job
        version: 1
      required:
        - id
        - state
        - links
        - version
      properties:
        id:
          type: string
          description: The generated id for this job.
        state:
          type: string
          description: The state of this job.
          enum:
            - pending
            - running
            - completed
            - failed
        thumbnails:
          type: array
          description: Thumbnail objects, typically 1 unless paging had been requested.
          items:
            $ref: "#/components/schemas/thumbnail"
        error:
          $ref: "#/components/schemas/error2"
        duration:
          type: number
          format: float
          description: duration, in seconds, of the job.
        defaultThumbnailSasThemesIconKey:
          type: string
          description: >
            A number of fully themed "icons" are available within SAS Clients. If provided, this is that representation and should be used in preference to the the image specified by link relation "defaultThumbnailImage".
        pagingState:
          $ref: "#/components/schemas/pagingState"
        links:
          type: array
          description: Link relations for this job. Expect 'self' and 'defaultThumbnailImage'.
          items:
            $ref: "#/components/schemas/link"
        version:
          type: integer
          format: int32
          description: The version number of the thumbnail job. This representation is version 1.
    sizingOptions:
      title: Sizing Options
      description: >
        Sizing options; providers should honor values suitable to the type of object for which they provide thumbnails, and clients should supply values suitable to their presentation needs.
      type: object
      properties:
        viewWidth:
          type: integer
          description: CSS Pixel image width.
        viewHeight:
          type: integer
          description: CSS Pixel image height.
        devicePixelRatio:
          type: number
          format: float
          default: 1
          description: device pixel ratio; some mobile devices support values greater than 1. (default is 1.0)
        maxTextCharacters:
          type: integer
          description: if plain text is returned, the maximum number of characters to return.
        maxTableColumns:
          type: integer
          description: if a table or other CSV presentation is returned, the maximum number of columns to return.
        maxTableRows:
          type: integer
          description: if a table or other CSV presentation is returned, the maximum number of rows to return.
    thumbnail:
      title: Thumbnail
      description: Information for retrieving a thumbnail.
      required:
        - state
      properties:
        state:
          type: string
          description: the state of this thumbnail
          enum:
            - pending
            - running
            - completed
            - failed
        error:
          $ref: "#/components/schemas/error2"
        modifiedTimeStamp:
          type: string
          description: The timestamp in `EEE, dd MMM yyyy HH:mm:ss GMT` format when the thumbnail was last modified.
          format: date-time
        links:
          type: array
          description: >
            Link relations for this thumbnail. Expect: 'thumbnail' (the thumbnail to pick up) and 'staleThumbnail' (an older thumbnail that can be picked up while a more current thumbnail is being prepared)
          items:
            $ref: "#/components/schemas/link"
    accessibilityOptions:
      title: Accessibility Options
      description: This object describes accessibility requests; providers are not required to honor this
      type: object
      properties:
        highContrast:
          type: boolean
          default: false
          description: indicates whether "high contrast" visual adjustments are desired. (default is false)
