### Synopsys Cloud OpenLink API Specification
### Version 20231020.001

### Copyright and Proprietary Information Notice 
#© 2023 Synopsys, Inc. This Synopsys Cloud OpenLink Application Programming Interface (API) and all associated documentation are proprietary to Synopsys, Inc. and may only be used pursuant to the terms and conditions of a written agreement with Synopsys, Inc.

### Disclaimer
#Synopsys, Inc., and its licensors make no warranty of any kind, express or implied, with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. 

### Trademarks
#Synopsys and certain Synopsys product names are trademarks of Synopsys, as set forth at
#https://www.synopsys.com/company/legal/trademarks-brands.html. All other product or company names may be trademarks of their respective owners .

### Third-Party Links
#Any links to third-party websites included in this document are for your convenience only. Synopsys does not endorse and is not responsible for such websites and their practices, including privacy practices, availability, and content.


openapi: 3.0.0
paths:
  /vendor-api/get-entitlements:
    post:
      operationId: OpenLinkApiController_getEntitlements
      parameters:
        - name: x-api-key
          in: header
          description: Api Key
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EntitlementsRequestDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EntitlementsResponse"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /vendor-api/get-licenses:
    post:
      operationId: OpenLinkApiController_getLicenses
      parameters:
        - name: x-api-key
          in: header
          description: Api Key
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProvideLicenseRequestDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProvideLicenseResponse"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /vendor-api/oauth2/token:
    post:
      operationId: OpenLinkApiController_getToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Oauth2ClientInfo"
      responses:
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
info:
  title: Synopsys® Cloud OpenLink API Specification
  description: OpenAPI 3.0.0 specification of the Synopsys OpenLink API
  version: 1.0.0
  contact: {}
tags:
  - name: saas
    description: ""
servers:
  - url: http://localhost:2000
    description: Gateway
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    Customer:
      type: object
      properties:
        name:
          type: string
          description: Customer Name
          example: Big Chip Semi
        dunsNumber:
          type: string
          description: Customer DUNS Number
          example: "161499579"
        synopsysCustomerId:
          type: string
          description: Synopsys Customer Id
          example: 5a8649c7-129e-447b-afb2-77b778e66ac3
        vendorCustomerInfo:
          type: object
          description: Vendor Specific Customer Details
          example:
            thirdPartyContractId: 0242ac120002
      required:
        - name
        - dunsNumber
        - synopsysCustomerId
    EntitlementsRequestDto:
      type: object
      properties:
        customer:
          description: Customer identification
          allOf:
            - $ref: "#/components/schemas/Customer"
      required:
        - customer
    Limit:
      type: object
      properties:
        key:
          type: string
          description: Key name of the parameter
          example: lang
        mix:
          type: string
          description: Minimum value/datestring for for the property named by key
          example: 0
        max:
          type: string
          description: Maxiumum value/datestring for for the property named by key
          example: 5
      required:
        - key
        - mix
        - max
    Option:
      type: object
      properties:
        title:
          type: string
          description: Title for this option
          example: Quantity
        value:
          type: object
          description: Value to be send if this option is selected
          example: 10
        limit:
          description: "List limits on other parameters applied by this selection "
          type: array
          items:
            $ref: "#/components/schemas/Limit"
      required:
        - title
        - value
    Parameter:
      type: object
      properties:
        title:
          type: string
          description: Title of the parameter
          example: EDA Tool X
        key:
          type: string
          description: Key name of the parameter
          example: part_name
        list:
          description: List options to be selected for this parameter
          type: array
          items:
            $ref: "#/components/schemas/Option"
        required:
          type: boolean
          description: Is the parameter mandatory?
        type:
          type: string
          description: Parameter type
          enum:
            - String
            - Number
            - Date
            - Boolean
            - LmHostId
            - HostName
            - CustomerEmail
            - Email
        encoding:
          type: string
          description: Is this the parameter an array/list?
          enum:
            - BodyParam
            - UrlQueryParam
          default: BodyParam
          example: BodyParam
        value:
          type: string
          description: Chosen value
      required:
        - title
        - key
    VendorCustomerInfo:
      type: object
      properties:
        params:
          description: "Body parameters to be filled in under "
          type: array
          items:
            $ref: "#/components/schemas/Parameter"
    ApiBase:
      type: object
      properties:
        url:
          type: string
          description: Remote Url (POST) to trigger item action
          example: https://vendor.com/api/get-license
        header:
          type: object
          description: Fixed header to be send on item url request
          example: &a1
            x-my-header: xyz
        staticBody:
          type: object
          description: Fixed body parameters merged into the body to be send on item url
            request
          example: &a2
            origin: synopsys
      required:
        - url
    Oauth2ClientInfo:
      type: object
      properties:
        url:
          type: string
          description: Remote Url (POST) to trigger item action
          example: https://vendor.com/api/get-license
        header:
          type: object
          description: Fixed header to be send on item url request
          example: *a1
        staticBody:
          type: object
          description: Fixed body parameters merged into the body to be send on item url
            request
          example: *a2
        clientId:
          type: string
          description: OAuth2 client Id
          example: 6779ef20e75817b79602
        clientSecret:
          type: string
          description: OAuth2 client secret
          example: dl9aUnVyOWdtQ3gxTTlobGU5N2ZWQUd5amdCcUsya2hWdVlMZmZOLWVOZw==
      required:
        - url
        - clientId
        - clientSecret
    ApiKeyAuthInfo:
      type: object
      properties:
        header:
          type: string
          description: API key header name
          example: x-api-key
        value:
          type: string
          description: API key value
          example: 9114dd77-912e-4179-a8c5-0a8de9dd44cc
      required:
        - header
        - value
    VendorApiRegistration:
      type: object
      properties:
        auth:
          type: string
          description: "Vendor API authentication method "
          enum:
            - API-KEY
            - OAUTH2
          example: OAUTH2
        entitlementApi:
          description: API information to retrieve entitlements
          allOf:
            - $ref: "#/components/schemas/ApiBase"
        oAuthApi:
          description: "API & client information for OAUTH2 based authentication "
          allOf:
            - $ref: "#/components/schemas/Oauth2ClientInfo"
        apiKey:
          description: API Key authentication information
          allOf:
            - $ref: "#/components/schemas/ApiKeyAuthInfo"
        customerInfo:
          description: Additional details to be known from the customer from the vendor
          allOf:
            - $ref: "#/components/schemas/VendorCustomerInfo"
      required:
        - auth
        - entitlementApi
    LicenseEntitlementItem:
      type: object
      properties:
        title:
          type: string
          description: Title of the entitlement
          example: EDA Tool A
        aux:
          type: object
          description: Internal identification of the entitlement
          example: '{"part":"part-xyz"}'
        qtyMax:
          type: number
          description: Maximum available quantity
          example: 5
        termEndDate:
          type: string
          description: License term end date as ISO date string
          example: 2024-08-01T00:00:00.000Z
      required:
        - title
    LicenseEntitlements:
      type: object
      properties:
        title:
          type: string
          description: Title
          example: Available entitlements for EDA Tools
        description:
          type: string
          description: Description
          example: Configure & Request Digital Design EDA Tools Licenses
        kind:
          type: string
          description: Provide kind
          enum:
            - ProvideLicense
        licenseRequestApi:
          description: License request API
          allOf:
            - $ref: "#/components/schemas/ApiBase"
        licenseEntitlements:
          description: List of license entitlements
          type: array
          items:
            $ref: "#/components/schemas/LicenseEntitlementItem"
      required:
        - title
        - kind
        - licenseRequestApi
    ItemConfigBase:
      type: object
      properties:
        title:
          type: string
          description: Title
          example: Available entitlements for EDA Tools
        description:
          type: string
          description: Description
          example: Configure & Request Digital Design EDA Tools Licenses
        params:
          description: Body parameters to be send on item url request
          type: array
          items:
            $ref: "#/components/schemas/Parameter"
      required:
        - title
    ItemBase:
      type: object
      properties:
        title:
          type: string
          description: Title
          example: Available entitlements for EDA Tools
        description:
          type: string
          description: Description
          example: Configure & Request Digital Design EDA Tools Licenses
      required:
        - title
    EntitlementsResponse:
      type: object
      properties:
        customer:
          description: Customer identification
          allOf:
            - $ref: "#/components/schemas/Customer"
        provides:
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/LicenseEntitlements"
      required:
        - customer
        - provides
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error Code
          example: LICGEN001
        message:
          type: string
          description: Error Message
          example: License generation failed
        statusCode:
          type: number
          description: HTTP Response Code (4xx, 5xx)
          example: 400
        tid:
          type: string
          description: Trace Id for correlation with vendor server logs
          example: eec85dab-6de8-4f1f-8234-6df676bdb834
        errors:
          type: string
          description: Error details. E.g. validation errors of provided parameters
          example:
            - message: LmHostId is missing but required
      required:
        - code
        - message
        - statusCode
        - tid
        - errors
    LicenseRequestItem:
      type: object
      properties:
        title:
          type: string
          description: Title of the entitlement
          example: EDA Tool A
        aux:
          type: object
          description: Internal identification of the entitlement
          example: '{"part":"part-xyz"}'
        qty:
          type: number
          description: Maximum available quantity
          example: 5
      required:
        - title
    LicenseHostInfo:
      type: object
      properties:
        id:
          type: string
          description: Host Id
          example: 001125c4a904
        name:
          type: string
          description: Host name
          example: big-machine
      required:
        - id
        - name
    ProvideLicenseRequestDto:
      type: object
      properties:
        customer:
          description: Customer identification
          allOf:
            - $ref: "#/components/schemas/Customer"
        licenseRequests:
          description: List of requested licenses
          type: array
          items:
            $ref: "#/components/schemas/LicenseRequestItem"
        host:
          description: Host information
          allOf:
            - $ref: "#/components/schemas/LicenseHostInfo"
      required:
        - customer
        - host
    ProvideSyncDataItemResponse:
      type: object
      properties:
        fileName:
          type: string
          description: Filename
          example: license_12345.lic
        fileType:
          type: string
          description: Filetype
          example: License
        data:
          type: string
          description: The base64 encoded file data
          example: <Buffer 48 61 6c 6c 6f>
          format: byte
        downloadType:
          type: string
          description: Sync
          enum:
            - Sync
          example: Sync
      required:
        - fileName
        - fileType
        - data
        - downloadType
    ProvideAsyncDataItemResponse:
      type: object
      properties:
        fileName:
          type: string
          description: Filename
          example: license_12345.lic
        fileType:
          type: string
          description: Filetype
          example: License
        downloadApi:
          description: Download API
          allOf:
            - $ref: "#/components/schemas/ApiBase"
        pollStartDateTime:
          type: string
          description: ISO date-time string from which the URL can be tried to download from
          example: 2023-07-12T09:40:18.000Z
        pollIntervalSec:
          type: number
          description: Seconds between poll intervals
          example: 30
        downloadType:
          type: string
          description: Async download
          enum:
            - Sync
          example: Async
      required:
        - fileName
        - fileType
        - downloadApi
        - downloadType
    FilesEntitlementResponse:
      type: object
      properties:
        files:
          type: array
          items: &a3
            oneOf:
              - $ref: "#/components/schemas/ProvideSyncDataItemResponse"
              - $ref: "#/components/schemas/ProvideAsyncDataItemResponse"
      required:
        - files
    ProvideLicenseResponse:
      type: object
      properties:
        files:
          type: array
          items: *a3
      required:
        - files
