openapi: 3.0.3
servers:
  - url: https://api.sas.com/mysas
    description: SAS Viya Orders API URL
info:
  description: SAS Viya Orders API
  title: SAS Viya Orders
  version: "1"
  contact:
    name: SAS Developers
    url: https://developer.sas.com
    email: devex@sas.com
  license:
    name: SAS Institute Inc.
components:
  securitySchemes:
    ClientId:
      type: apiKey
      in: header
      name: ClientId
      description: Client ID for authentication
    ClientSecret:
      type: apiKey
      in: header
      name: ClientSecret
      description: Client Secret for authentication
  schemas:
    error:
      description: Error object
      properties:
        details:
          description: A collection of strings that provide detailed information about the cause of the error
          items:
            type: string
          type: array
        errorCode:
          description: An optional error code that can be set to indicate the error more precisely
          format: int64
          type: integer
        errors:
          description: A nested array of root causes or related errors
          items:
            $ref: "#/components/schemas/error"
          type: array
        httpStatusCode:
          description: The HTTP status code (e.g., 404)
          format: int64
          type: integer
        id:
          description: An optional mnemonic string representing the error status
          type: string
        links:
          description: A collection of Link objects
          items:
            $ref: "#/components/schemas/link"
          type: array
        message:
          description: The message text
          type: string
        remediation:
          description: An optional string that indicates possible remedial steps
          type: string
        version:
          description: The version of the Error object
          format: int64
          type: integer
      type: object
    link:
      description: Link object
      properties:
        href:
          description: The absolute URL for the resource.
          type: string
        method:
          description: The HTTP method for the resource.
          type: string
        rel:
          description: A relationship to the requested resource.
          type: string
        type:
          description: The media type for the resource.
          type: string
        uri:
          description: The relative URI (Uniform Resource Identifier) for the resource.
          type: string
      type: object
tags:
  - name: Orders
    description: Orders endpoints.
paths:
  "/orders/{orderNumber}/certificates":
    head:
      operationId: headersForCertificates
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Certificates as a ZIP file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets a certificates file
      description: Gets a certificates file for the given order.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
    get:
      operationId: getCertificates
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Certificates as a ZIP file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets a certificates file
      description: Gets a certificates file for the given order.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
  "/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/deploymentAssets":
    head:
      operationId: headersForDepAssets
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
        - description: The Cadence Version string.
          in: path
          name: cadenceVersion
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The deployment assets as a TGZ file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets the deployment assets
      description: Gets the deployment assets for the given order at the given cadence name and version.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
    get:
      operationId: getDepAssets
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
        - description: The Cadence Version string.
          in: path
          name: cadenceVersion
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The deployment assets as a TGZ file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets the deployment assets
      description: Gets the deployment assets for the given order at the given cadence name and version.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
  "/orders/{orderNumber}/cadenceNames/{cadenceName}/deploymentAssets":
    head:
      operationId: headersForDepAssetsShort
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
      responses:
        "200":
          description: the deployment assets as a TGZ file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets the deployment assets
      description: Gets the deployment assets for the given order at the latest version of the given cadence name.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
    get:
      operationId: getDepAssetsShort
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
      responses:
        "200":
          description: the deployment assets as a TGZ file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets the deployment assets
      description: Gets the deployment assets for the given order at the latest version of the given cadence name.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
  "/orders/{orderNumber}/cadenceNames/{cadenceName}/cadenceVersions/{cadenceVersion}/license":
    head:
      operationId: headersForLicense
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
        - description: The Cadence Version string.
          in: path
          name: cadenceVersion
          required: true
          schema:
            type: string
      responses:
        "200":
          description: License as a .jwt file (contains a JWT)
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets a license file
      description: Gets a license file for the given order at the given cadence name / version.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
    get:
      operationId: getLicense
      parameters:
        - description: The Order Number string.
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: The Cadence Name string.
          in: path
          name: cadenceName
          required: true
          schema:
            type: string
        - description: The Cadence Version string.
          in: path
          name: cadenceVersion
          required: true
          schema:
            type: string
      responses:
        "200":
          description: License as a .jwt file (contains a JWT)
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error"
      summary: Gets a license file
      description: Gets a license file for the given order at the given cadence name / version.
      security:
        - ClientId: []
          ClientSecret: []
      tags:
        - Orders
