openapi: 3.0.1
info:
  title: Data Lake API
  description: API's for defining and applying metadata as key value.
  version: 4.0.1
  x-visibility: external
servers:
  - url: /api/datalake/v4
tags:
  - name: Object Operations
    description: Data Lake object operations.
paths:
  /metadataCollections:
    post:
      tags:
      - Metadata Collections
      summary: Creates a Metadata Collection.
      description: |
        Detailed Description
        <table>
          Metadata Collection represents a group or collection of metadata keys. 
          This API allows admin users to create their own Metadata Collection (to be referred as <b>Custom Metadata Collection</b>) 
          and add metadata keys to it. By default, Metadata Collection is created in 'Draft' state which users can change later after 
          adding metadata keys to it and creating a rule. Keys defined in a metadata collection are unique within that metadata collection.
          <br><br>
          <b>Request Parameters</b><br>        
          <tr>
            <th align="center" width="10%">Parameter</th>
            <th align="center" width="10%">Type</th>
            <th align="center" width="30%">Values</th>
            <th align="center" width="60%">Description</th>
          </tr>
          <tr>
            <td align="center">metadataCollectionId</td>
            <td align="center">String</td>
            <td align="center">Any Alphanumeric String<br>
                          e.g. documentreview or document_review</td>
            <td align="left">Identifier of the Custom Metadata Collection. This should be unique for a tenant. Accepted regex pattern would be '^[a-z0-9_]*$' i.e. any string that contains only lower case letters, numbers, and underscores.</td>
          </tr>
          <tr>
            <td align="center">label</td>
            <td align="center">String</td>
            <td align="center">Any Alphanumeric String<br>
                          e.g. Document Review</td>
            <td align="left">Display name of the Custom Metadata Collection to be shown on User Interface for better readability. Preferably, it should be in sync with the metadataCollectionId for easy understanding. Accepted regex pattern would be '[a-zA-Z0-9 _]+' i.e. any string that contains only letters (uppercase or lowercase), numbers, spaces and underscores.</td>
          </tr>
          <tr>
            <td align="center">description</td>
            <td align="center">String</td>
            <td align="center">Any Alphanumeric String<br></td>
            <td align="left">Short description related to user and purpose of this Custom Metadata Collection. There are no constraints on description.</td>
          </tr>
        </table><br>
          <b>Response Parameters</b><br>        
        <table>
          <tr>
            <th align="left" width="30%">Parameter</th>
            <th align="left" width="70%">Description</th>
          </tr>
          <tr>
            <td align="left">metadataCollectionId</td>
            <td align="left">Identifier of the metadata collection. This is unique for a tenant. </td>
          </tr>
          <tr>
            <td align="left">label</td>
            <td align="left">Display name of the metadata collection. It is also shown on User Interface for better readability.This is unique for a tenant.</td>
          </tr>
          <tr>
            <td align="left">description</td>
            <td align="left">Short description related to user and purpose of metadata collection.</td>
          </tr>
          <tr>
            <td align="left">status</td>
            <td align="left">Status of metadata collection. By default, Custom Metadata Collection is created in Draft status.</td>
          </tr>
          <tr>
            <td align="left">etag</td>
            <td align="left">etag is a number indicating the version of the metadata collection. etag will be updated sequentially as metadata collection is updated. etag starts from 1.</td>
          </tr>
        </table><br>
        <b>Additional Information</b>
        <li>Custom Metadata Collection are not rendered (visible) to the users for addition of metadata values by default. They are govern by 'Rules' that are created for them. Rules are like condition to render (display) custom metadata collection based on selected values for metadata key (specifically Enum values)</li>
        <li>Global Metadata Collection is a default Metadata Collection created by the system for the admin users to metadata keys. Unlike Custom Metadata Collection, Global Metadata Collection is rendered (visible) to all objects and folders by default.</li>
        <li>Users cannot create a Custom Metadata Collection with name 'global','system' and 'default'. They are reserved for application use.</li>
        <br>
        Refer to metadata documentation for organization of metadata for more details.
      operationId: createmetadataCollection
      requestBody:
        description: request body to create used defined Metadata Collection.
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/createmetadataCollectionRequest'
        required: false
      responses:
        201:
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createmetadataCollectionResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>mandatoryFieldMissing</td>
                <td>missing mandatory field {fieldName}.</td>
              </tr>
              <tr>
                <td>invalidmetadataCollectionId</td>
                <td>metadata collection with id {metadataCollectionId} is not valid. It must be lower case alphabets including digits with _ (underscore) as a separator.Spaces are not allowed at beginning or at end or as word separator.</td>
              </tr>
              <tr>
                <td>duplicatemetadataCollectionId </td>
                <td>metadata collection with id {metadataCollectionId} is already exists.</td>
              </tr>
              <tr>
                <td>metadataCollectionIdInvalidLength  </td>
                <td>metadataCollectionId length must be minimum 3 characters and maximum 100 characters.</td>
              </tr>
              <tr>
                <td>reservedMetadataCollectionId </td>
                <td>metadata collection with id {metadataCollectionId} is reserved for application use. Reserved collection ids are {reservedMetadataCollectionIdList}</td>
              </tr>
              <tr>
                <td>invalidLabel</td>
                <td>provided label {label} is not valid. It must be alphabets including digits.Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>labelTooLong</td>
                <td>label must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>reservedCollectionLabels</td>
                <td>metadata collection label {label} is reserved for application use. Reserved labels are {reserveLabelList}.</td>
              </tr>
              <tr>
                <td>duplicateLabel </td>
                <td>provided label {label} is already exists</td>
              </tr>
              <tr>
                <td>invalidDescription</td>
                <td>provided description is not valid. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>descriptionTooLong</td>
                <td>description must not be longer than 255 characters.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
    get:
      tags:
      - Metadata Collections
      summary: List all Metadata Collections
      description: |
        Detailed Description
          List out all the metadata collections available in the application, custom (if created) as well as global (which is default created). If no metadata collection is available, empty list is returned. <br>
        <b>Note:</b> For Global metadata collection to be created, it is required for admin users to define at least one metadata key inside it.
      operationId: getAllmetadataCollections
      parameters:
      - name: page
        in: query
        description: Specifies the requested page index
        schema:
          type: integer
          default: 0
      - name: size
        in: query
        description: Specifies the number of elements in a page. Maximum supported
          value is 200.
        schema:
          type: integer
          default: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataCollectionGetAllResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
  /metadataCollections/{metadataCollectionId}:
    get:
      tags:
      - Metadata Collections
      summary: get metadata collection details for the given id
      description: |
        Detailed Description
        Provide details related to a metadata collection for the given metadata collection identifier.<br>
          <table>
            <b>Query Parameters</b><br>
            <tr>
              <th align="left" width="10%">Parameter</th>
              <th align="center" width="10%">Type</th>
              <th align="center" width="30%">Values</th>
              <th align="center" width="60%">Description</th>
            </tr>
            <tr>
              <td align="center">metadataCollectionId</td>
              <td align="center">String</td>
              <td align="center">Any Alphanumeric String<br>
                            e.g. documentReview or global</td>
              <td align="left">Identifier of the metadata collection (custom or global). For global metadata collection, use metadataCollectionId as 'global'.</td>
            </tr>
          </table>
      operationId: getmetadataCollectionById
      parameters:
      - name: metadataCollectionId
        in: path
        description: metadata collection id
        required: true
        schema:
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createmetadataCollectionResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
    patch:
      tags:
      - Metadata Collections
      summary: Update Metadata Collection for a given id
      description: |-
        Detailed Description
          Allows admin users to update details related to a metadata collection for the given metadata collection identifier. Metadata collection can be updated for following details based on its status<br>
          <table>
            <tr>
              <th align="left" width="20%">Metadata Collection</th>
              <th align="left" width="20%">Status</th>
              <th align="left" width="60%">Update Details</th>
            </tr>
            <tr>
              <td align="left">Global</td>
              <td align="left">Published</td>
              <td align="left">Cannot be updated</td>
            </tr>
            <tr>
              <td align="left">Custom</td>
              <td align="left">Draft</td>
              <td align="left">
                <li>Label and description can be updated or changed</li>
                <li>Status can be updated to Published.</li></td>
            </tr>
            <tr>
              <td align="left">Custom</td>
              <td align="left">Published</td>
              <td align="left">Label and description can be updated or changed</td>
            </tr>
          </table>
          <b>Note:</b> Once the stauts of metadata collection is Published, it cannot be changed back to Draft<br><br>
      operationId: updatemetadataCollection
      parameters:
      - name: metadataCollectionId
        in: path
        description: metadata collection name
        required: true
        schema:
          type: string
      - name: If-Match
        in: header
        description: etag of the resource
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        description: request body to update metadata collection item.
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/updatemetadataCollectionRequest'
        required: false
      responses:
        200:
          description: OK.
          headers:
            etag:
              description: etag of the resource
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createmetadataCollectionResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>reservedCollectionUpdateError  </td>
                <td>metadata collection with id {collectionId} is reserved for application use. Reserved metadata collection can not be updated.</td>
              </tr>
              <tr>
                <td>mandatoryEtagMissing  </td>
                <td>must provide If-Match value.</td>
              </tr>
              <tr>
                <td>conflictingETag</td>
                <td>conflicting ETag detected. Expected: {ExpectedValue}, Actual: {ActualValue}</td>
              </tr>
              <tr>
                <td>invalidLabel</td>
                <td>provided label {label} is not valid. It must be alphabets including digits.Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>labelTooLong</td>
                <td>label must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>invalidDescription</td>
                <td>provided description is not valid. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>descriptionTooLong</td>
                <td>description must not be longer than 255 characters.</td>
              </tr>
              <tr>
                <td>invalidStatus</td>
                <td>status can not be updated to DRAFT.</td>
              </tr>
              <tr>
                <td>invalidStatus</td>
                <td>metadata collection can not be published. At least one published key is required as part of collection.</td>
              </tr>
              <tr>
                <td>invalidStatus</td>
                <td>metadata collection can not be published. At least one rule should be associated with collection.</td>
              </tr>
              <tr>
                <td>invalidStatusValue</td>
                <td>provided status {providedValue} is not valid. Valid status values are {listOfSupportedValues}.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>Metadata collection with id {metadataCollectionId} not found</td>
              </tr>
            </table>
          content: {}
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
    delete:
      tags:
      - Metadata Collections
      summary: delete metadata collection details for the given id
      description: |
        Detailed Description
        Delete metadata collection if the collection is not yet publised.<br>
        <b>Note:</b> predefined metadata collections such as global and system can not be deleted. 
          <table>
            <b>Query Parameters</b><br>
            <tr>
              <th align="left" width="10%">Parameter</th>
              <th align="center" width="10%">Type</th>
              <th align="center" width="30%">Values</th>
              <th align="center" width="60%">Description</th>
            </tr>
            <tr>
              <td align="center">metadataCollectionId</td>
              <td align="center">String</td>
              <td align="center">Any Alphanumeric String<br>
                            e.g. documentReview or global</td>
              <td align="left">Identifier of the Metadata Collection (custom or global), if created.</td>
            </tr>
          </table>
      operationId: deletemetadataCollectionById
      parameters:
      - name: metadataCollectionId
        in: path
        description: metadata collection id
        required: true
        schema:
          type: string
      responses:
        204:
          description: OK
          content: {}
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>reservedCollectionDeleteError &nbsp</td>
                <td>metadata collection with id {reservedCollectionId} is reserved for internal use. Reserved metadata collection can not be deleted.</td>
              </tr>
              <tr>
                <td>publishedCollectionDeleteError &nbsp</td>
                <td>metadata collection with id {metadataCollectionId} is published. Published metadata collection can not be deleted.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata Collection with id {metadataCollectionId} not found.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.d
  /metadataCollections/{metadataCollectionId}/keys:
    post:
      tags:
      - Metadata Keys
      summary: Add Metadata key to Metadata Collection.
      description: |
        Detailed Description
        <table>
          Allows admin users to add metadata keys to metadata collection. By default, admin users can add keys directly to Global metadata collection (metadataCollectionId=global).<br>
          To add keys to Custom metadata collection, a Custom metadata collection should be created first.<br><br>
          <b>Request Parameter Details</b><br>        
          <tr>
            <th align="left" width="10%">Parameter</th>
            <th align="left" width="10%">Type</th>
            <th align="left" width="30%">Values</th>
            <th align="left" width="60%">Description</th>
          </tr>
          <tr>
            <td align="left">key</td>
            <td align="left">String</td>
            <td align="left">Any Alphanumeric String<br>
                          e.g. countryoforigin or country_of_origin</td>
            <td align="left">Identifier of a metadata key. <b>This should be unique within a metadata collection</b>. Accepted regex pattern would be '^[a-z0-9_]*$' i.e. any string that contains only lower case letters, numbers, and underscores.</td>
          </tr>
          <tr>
            <td align="left">label</td>
            <td align="left">String</td>
            <td align="left">Any Alphanumeric String<br>
                          e.g. Country of Origin</td>
            <td align="left">Display name of metadata key as label to be shown on User Interface for better readability. Preferably, it should be in sync with the key for easy understanding. Accepted regex pattern would be '[a-zA-Z0-9 _]+' i.e. any string that contains letters (uppercase or lowercase), numbers, spaces and underscores. This should be unique within a metadata collection</td>
          </tr>
          <tr>
            <td align="left">description</td>
            <td align="left">String</td>
            <td align="left">Any Alphanumeric String<br></td>
            <td align="left">Short description related to usage and purpose of this metadata key. There is no restriction on the description.</td>
          </tr>
          <tr>
            <td align="left">valueType</td>
            <td align="left">String</td>
            <td align="left">Enum, EnumList, String, StringList<br></td>
            <td align="left">Value type are the <b>datatype</b> definition that categorises the metadata values. Every metadata key defined should have a value type that carries additional information about the type.</b></td>
          </tr>
          <tr>
            <td align="left">fieldName</td>
            <td align="left">String</td>
            <td align="left">depends on value type<br></td>
            <td align="left">Field name is part of additional details. Based on the selected value type, further constraints can be applied on the metadata values. Possible values for fieldName based on selected value type would be<br>
              <table>
                <tr>
                  <th width="20%" align="left">Value type</th>
                  <th width="40%" align="left">Field Name</th>
                </tr>
                <tr>
                  <td align="left">String</td>
                  <td align="left">StringType, MinLength, MaxLength</td>
                </tr>
                <tr>
                  <td align="left">StringList</td>
                  <td align="left">StringListType, MinLength, MaxLength, MinSize, MaxSize</td>
                </tr>
                <tr>
                  <td align="left">Enum</td>
                  <td align="left">Options</td>
                </tr>
                <tr>
                  <td align="left">EnumList</td>
                  <td align="left">Options, MinSize, MaxSize</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td align="left">fieldValues</td>
            <td align="left">array</td>
            <td align="left">depends on fieldName<br></td>
            <td align="left">Field values are part od additional details which defines the nature of the constraints for selected field name. Supported value(s) based on the provided fieldName are
              <table>
                <tr>
                  <th width="20%" align="left">Field Name</th>
                  <th width="40%" align="left">Field Values</th>
                </tr>
                <tr>
                  <td align="left">StringType</td>
                  <td align="left">one of ALPHABETIC, NUMERIC and ALPHANUMERIC as acceptable character set for the string value</td>
                </tr>
                <tr>
                  <td align="left">MinLength</td>
                  <td align="left">Any number greater than 0 indicating acceptable minimum length for the string</td>
                </tr>
                <tr>
                  <td align="left">MaxLength</td>
                  <td align="left">Any number less that 100 indicating desired maximum length for the string value</td>
                </tr>
                <tr>
                  <td align="left">Options</td>
                  <td align="left">List of comma separated values in capital letters. Numbers and unserscores can be included but not at the start</td>
                </tr>
                <tr>
                  <td align="left">MinSize</td>
                  <td align="left">Any number indicating minimum number of values that can be provided or selected for value type StringList and EnumList respectively. For EnumList, this number cannot be greater than number of values provided as part of options</td>
                </tr>
                <tr>
                  <td align="left">MaxSize</td>
                  <td align="left">Any number indicating maximum number of values that can be provided or selected for the value type StringList or EnumList. For EnumList, this number cannot be greater than number of values provided as part of options</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td align="left">applyOn</td>
            <td align="left">Enum</td>
            <td align="left">OBJECTS_ONLY <br> FOLDERS_ONLY <br> FOLDERS_AND_OBJECTS <br></td>
            <td align="left">Indicates propagation of metadata values along with its override nature<br><br>
              <table>
                <tr>
                  <th width="20%" align="left">Value</th>
                  <th width="40%" align="left">Description</th>
                </tr>
                <tr>
                  <td align="left">OBJECTS_ONLY</td>
                  <td align="left">Indicates metadata information will be applicable only on objects i.e. files</td>
                </tr>
                <tr>
                  <td align="left">FOLDERS_ONLY</td>
                  <td align="left">Indicates that metadata information will be applicable on folders only. This will be propagated to all the folders and objects in the hierarchy below it. Further, this metadata information cannot be overriden on any folder and object in the hierarchy</td>
                </tr>
                <tr>
                  <td align="left">FOLDERS_AND_OBJECTS</td>
                  <td align="left">Indicates that metadata information will be applicable on any folder or object only. If applied on folders, this will be propagated to all the folders and objects in the hierarchy below it. Further, this metadata information can be overriden on any folder and object in the hierarchy</td>
                </tr>
              </table>            
            </td>
          </tr>
          <tr>
            <td align="left">isMandatory</td>
            <td align="left">boolean</td>
            <td align="left">true, false</td>
            <td align="left">Indicates if metadata value is mandatory or not. If <b>true</b>, users will have to input the value for this key.</td>
          </tr>
          <tr>
            <td align="left">isRuleKey</td>
            <td align="left">boolean</td>
            <td align="left">depends on value type<br>For Enum - true, false<br>For others - false
            </td>
            <td align="left">Indicates if rule can be created for this key to render any custom metadata collection. In this version, rule can be created only on Enum value type. It can only be enabled if key is part of global collection<br><i>Note: refer rule API for details related to rule</i></td>
          </tr>
          <tr>
            <td align="left">isSearchable</td>
            <td align="left">boolean</td>
            <td align="left">true, false</td>
            <td align="left">Indicates if key needs to be protected. If <b>false</b>, key will not be available in metadata search and policy editor to create access control policies</td>
          </tr>
          <tr>
            <td align="left">status</td>
            <td align="left">String</td>
            <td align="left">DRAFT, PUBLISHED</td>
            <td align="left">Status of the metadata key. Status plays role in the availability of key to add metadata value or create rule or update its configuration. 
            </td>
          </tr>
        </table>
      operationId: createGlobalMetadata
      parameters:
      - name: metadataCollectionId
        in: path
        description: metadata collection name
        required: true
        schema:
          type: string
      requestBody:
        description: request body to create global metadata keys
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/globalmetadataaddkeyrequest'
        required: false
      responses:
        201:
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataAddKeyResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>mandatoryFieldMissing</td>
                <td>missing mandatory field {fieldName}.</td>
              </tr>
              <tr>
                <td>invalidMetadataKey</td>
                <td>provided metadata key {key} is not valid. It must be lower case alphabets including digits with _ (underscore) as a separator. Spaces are not allowed at beginning or at end or as word separator.</td>
              </tr>
              <tr>
                <td>metadataKeyInvalidLength</td>
                <td>key length must be minimum 3 characters and maximum 100 characters.</td>
              </tr>
              <tr>
                <td>duplicateKey</td>
                <td>provided key {key} is already exists.</td>
              </tr>
              <tr>
                <td>invalidLabel</td>
                <td>provided label {label} is not valid. It must be alphabets including digits. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>labelTooLong</td>
                <td>label must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>duplicateLabel</td>
                <td>provided label {label} is already exists.</td>
              </tr>
              <tr>
                <td>invalidDescription</td>
                <td>provided description is not valid. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>descriptionTooLong</td>
                <td>description must not be longer than 255 characters.</td>
              </tr>
              <tr>
                <td>valueTypeNotSupported</td>
                <td>provided value type {valueType} is not supported. Supported value types are {supportedValueTypeList}</td>
              </tr>
              <tr>
                <td>mandatoryFieldNameMissing</td>
                <td>{fieldName} is mandatory in additionalDetails for {valurType} dataType</td>
              </tr>
              <tr>
                <td>invalidFieldName</td>
                <td>provided fieldName {fieldName} is not supported for value type {valueTypeName}. Suuported values are {supportedFieldNameList}</td>
              </tr>
              <tr>
                <td>duplicateOptions</td>
                <td>options contains duplicate entries.</td>
              </tr>
              <tr>
                <td>invalidFieldValue</td>
                <td>fieldValue provided is not valid for fieldName {fieldName}. {customErrorMessageForDifferentFields}</td>
              </tr>
              <tr>
                <td>invalidFieldValuesEnum</td>
                <td>provided field value {fieldValue} is not a supported Enum value. Enum value must be in the character set '^[A-Z]+(?:_{0,2}[A-Z]+)*$'.Spaces are not allowed at beginning or at end or as word separator.</td>
              </tr>
              <tr>
                <td>invalidFieldValuesStringType</td>
                <td>provided value {fieldValue} is not supported. Supported values are.</td>
              </tr>
              <tr>
                <td>invalidNumberOfInput</td>
                <td>number of inputs in fieldValues for filedName {fieldName} is invalid. Provided {providedCount}, expected {expectedCount}</td>
              </tr>
              <tr>
                <td>invalidApplyOn</td>
                <td>provided applyOn {applyOnValue} is not valid.  Valid applyOn values are {supportedValueList}</td>
              </tr>
              <tr>
                <td>applyOnNotSupportedForRuleKey</td>
                <td>provided applyOn {applyOnValue} is not supported for rule key. Supported applyOn values are {supportedValueList}</td>
              </tr>
              <tr>
                <td>invalidApplyOnForCollection</td>
                <td>provided applyOn {applyOnValue} is not supported for keys in custom collection. Supported applyOn values are {supportedValueList}</td>
              </tr>
              <tr>
                <td>applyOnMismatchForCollection</td>
                <td>key with applyOn {applyOnValueForExistingKey} already exists in the collection. key with applyOn {applyOnValueForNewKey} can not be added.</td>
              </tr>
              <tr>
                <td>applyOnMismatchForExistingRule</td>
                <td>There is an existing rule associated with collection {collectionId}. applyOn value for the rule key is {applyOnValueForExistingRuleKey} which is different from the applyOn provided in the request i.e. {applyOnValueForKeyBeingAdded}. Please provided applyOn value aligned with the existing rule.</td>
              </tr>
              <tr>
                <td>invalidStatus</td>
                <td>provided status {status} is not valid. Valid status values are {supportedValueList}</td>
              </tr>
              <tr>
                <td>valueTypeNotSupportedForRuleKey  </td>
                <td>provided value type {valueTypeName} is not supported for rule key. Supported value types are {supportedValueTypeForRuleKey}.</td>
              </tr>
              <tr>
                <td>onlyGlobalCollectionForRuleKey</td>
                <td>isRuleKey can only be enabled on keys part of global collection.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
              </tr>
            </table>
          content: {}
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
    get:
      tags:
      - Metadata Keys
      summary: List all metadata keys under the provided Metadata Collection id
      description: |
        Allows users (both admin and standard) to list all metadata keys under the provided metadata collection.
      operationId: getAllMetadataKeys
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: Specifies the requested page index
        schema:
          type: integer
          default: 0
      - name: size
        in: query
        description: Specifies the number of elements in a page. Maximum supported
          value is 200.
        schema:
          type: integer
          default: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataKeysGetAllResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
              </table>
            </html>
          content: {}
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
  /metadataCollections/{metadataCollectionId}/keys/{metadataKey}:
    get:
      tags:
      - Metadata Keys
      summary: Get metadata key details under the provided Metadata Collection for
        given metadata key
      description: |
        Allows users (both admin and standard) to get the details of a provided metadata key under the provided metadata collection.
      operationId: getMetadataKeyById
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: metadataKey
        in: path
        description: metadata key
        required: true
        schema:
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataAddKeyResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataKeyNotFound</td>
                  <td>MetadataKey with key {0} not found</td>
                </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
    delete:
      tags:
      - Metadata Keys
      summary: Delete metadata key details under the provided Metadata Collection
        for given metadata key
      description: |
        Allows tenant admin to delete metadata key under the provided Metadata Collection.
      operationId: deleteMetadataKeyById
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: metadataKey
        in: path
        description: metadata key
        required: true
        schema:
          type: string
      responses:
        204:
          description: OK
          content: {}
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>publishedKeyDeleteError &nbsp</td>
                <td>metadata with key {metadataKey} is published. published metadata key can not be deleted.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataKeyNotFound</td>
                  <td>MetadataKey with key {0} not found</td>
                </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.d
    patch:
      tags:
      - Metadata Keys
      summary: Update metadata key
      description: |
        Allows admin users to update metadata key configuration. Update details for metadata key will depend on the status of the key
        <table>
          <tr>
            <th width="20%" align="left">Parameter</th>
            <th width=40%" align="left">DRAFT Status</th>
            <th width=40%" align="left">PUBLISHED Status</th>
          </tr>
          <tr>
            <td>label & description</td>
            <td>Can be updated</td>
            <td>Can be updated</td>
          </tr>
          <tr>
            <td>Additional Details</td>
            <td>Can modify or remove existing constraints, or add new constraints</td>
            <td>
              <li>Can change existing fieldValues to extend the already defined range <br>e.g. MinValue can be reduced or MaxValue can be increased or<br> new Enum value can be added.</li>
              <li>Cannot remove any existing constraints</li>
            </td>
          </tr>
          <tr>
            <td>isMandatory</td>
            <td align="left">Can be updated to true or false</td>
            <td align="left">Can be updated to true or false</td>
          </tr>
          <tr>
            <td align="left">isRuleKey</td>
            <td align="left">Can be updated to true or false</td>
            <td>It is possible to change the value to true, but it can only be changed to false if there is no rule created with the key.</td>
          </tr>
          <tr>
            <td align="left">applyOn</td>
            <td align="left">Cannot be updated</td>
            <td>Cannot be updated</td>
          </tr>
          <tr>
            <td align="left">isSearchable</td>
            <td align="left">Can be updated to true or false</td>
            <td>Cannot be updated</td>
          </tr>
           <tr>
            <td align="left">status</td>
            <td align="left">Can be updated to PUBLISHED</td>
            <td>Cannot be updated</td>
          </tr>
        </table>
        <b>Note:Once the stauts of metadata key is Published, it cannot be changed back to Draft</b>
      operationId: updateMetadatakey
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: metadataKey
        in: path
        description: metadata key
        required: true
        schema:
          type: string
      - name: If-Match
        in: header
        description: etag of the resource
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        description: update global metadata key request
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/metadataUpdateKeyRequest'
        required: false
      responses:
        201:
          description: Updated.
          headers:
            etag:
              description: etag of the resource
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataAddKeyResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <td>invalidLabel</td>
                <td>label provided {label} is not valid. It must be alphabets including digits. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>labelTooLong</td>
                <td>label must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>duplicateLabel</td>
                <td>provided label {label} is already exists.</td>
              </tr>
              <tr>
                <td>invalidDescription</td>
                <td>provided description is not valid. Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>descriptionTooLong</td>
                <td>description must not be longer than 255 characters.</td>
              </tr>
              <tr>
                <td>invalidFieldName</td>
                <td>fieldName provided is not valid for value type {valueTypeName}. Suuported fieldName for valueType {valueTypeName} are {supportedFieldNameList}</td>
              </tr>
              <tr>
                <td>invalidFieldValue</td>
                <td>fieldValue provided is not valid for fieldName {fieldName}. {customErrorMessageForDifferentFields}</td>
              </tr>
              <tr>
                <td>invalidStatus</td>
                <td>provided status {status} is not valid. Valid status values are {supportedValueList}</td>
              </tr>
              <tr>
                <td>mandatoryFieldMissing</td>
                <td>Missing mandatory field {fieldName}.</td>
              </tr>
              <tr>
                <td>valueTypeNotSupportedForRuleKey</td>
                <td>provided value type {valueTypeName} is not supported for rule key. Supported value types for enabling metadata as rule key are {supportedValueTypeForRuleKey}.</td>
              </tr>
              <tr>
                <td>cannotUpdateIsSearchableForPublishedKey</td>
                <td>isSearchable can not be updated for published key.</td>
              </tr>
              <tr>
                <td>cannotUpdateApplyOnForPublishedKey</td>
                <td>applyOn can not be updated for published key.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataKeyNotFound</td>
                  <td>MetadataKey with key {0} not found</td>
                </tr>
              </table>
            </html>
          content: {}
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
  /metadataCollections/{metadataCollectionId}/metadataRules:
    post:
      tags:
      - Metadata Rules
      summary: Create metadata rules for metadata collection on global metadata key
        and value
      description: >-
        Allow tenant admin to define metadata rules so that metadata collection can be applied to an object/folder for a specefic value of metadata key.<br>
        <table>
        <br>Request Parameter Details
        <table>          
          <tr>
            <th align="left" width="10%">Parameter</th>
            <th align="left" width="10%">Type</th>
            <th align="left" width="30%">Values</th>
            <th align="left" width="60%">Description</th>
          </tr>
          <tr>
            <td align="left" width="10%">name</td>
            <td align="left" width="10%">String</td>
            <td align="left" width="30%">Any aplhanumeric value</td>
            <td align="left" width="60%">Name for the rule. Accepted regex pattern would be '[a-zA-Z0-9 _]+' i.e. any string that contains only letters (uppercase or lowercase), numbers, spaces and underscores./td>
          </tr>
          <tr>
            <td align="left" width="10%">key</td>
            <td align="left" width="10%">String</td>
            <td align="left" width="30%">As defined in Global collection</td>
            <td align="left" width="60%">Any key, with value type Enum, defined in global metadata collection with status Published and isRuleKey flag enabled.</td>
          </tr>
          <tr>
            <td align="left" width="10%">Value</td>
            <td align="left" width="10%">String</td>
            <td align="left" width="30%">As defined in global collection</td>
            <td align="left" width="60%">Any one of the Enum values of the selected key as defined in global metadata collection as part of key configuration</td>
          </tr>
        </table>
      operationId: createMetadataRules
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      requestBody:
        description: request body to create metadata rule
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/metadataRuleRequest'
        required: false
      responses:
        201:
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataRuleResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
               <tr>
                <td>mandatoryFieldMissing</td>
                <td>Missing mandatory field {fieldName}.</td>
              </tr>
              <tr>
                <td>invalidRuleName</td>
                <td>rule name provided {name} is not valid. It must be alphabets including digits.Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>ruleNameTooLong</td>
                <td>rule name must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>duplicateRuleName</td>
                <td>provided rule name {0} is already exists.</td>
              </tr>
              <tr>
                <td>keyNotEnabledForRule</td>
                <td>provided metadata key {Key} is not supported for metadata rule</td>
              </tr>
               <tr>
                <td>keyNotPublished</td>
                <td>provided key {metadataKeyId} is not published.</td>
              </tr>
              <tr>
                <td>invalidMetadataValue</td>
                <td>Invalid value {value} provided for metadata key {key}.</td>
              </tr>
              <tr>
                <td>keyDefinitionError</td>
                <td>definition for provided key {key} is not valid</td>
              </tr>
               <tr>
                <td>duplicateKeyValueRule</td>
                <td>metadata Rule with key {key} and value {value} combination already exists.</td>
              </tr>
               <tr>
                <td>applyOnMismatchForRule</td>
                <td>apply on for global key is not matching with applyOn for collection. applyOn for key is {applyOnForMetadataKey} whereas applyOn for collection is {applyOnForMetadataCollection}</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataKeyNotFound</td>
                  <td>MetadataKey with key {metadataKey} not found</td>
                </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        409:
          description: duplicateKeyName
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
    get:
      tags:
      - Metadata Rules
      summary: List all metadata rules
      description: |
        This API allows all the users to list all the rules related to the provided metadata collection. One metadata collection can have multiple rules defined for it.
      operationId: getAllMetadataRules
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: Specifies the requested page index
        schema:
          type: integer
          default: 0
      - name: size
        in: query
        description: Specifies the number of elements in a page. Maximum supported
          value is 200.
        schema:
          type: integer
          default: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataRuleGetAllResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r

  /metadataCollections/{metadataCollectionId}/metadataRules/{id}:
    get:
      tags:
      - Metadata Rules
      summary: Get metadata rule details for the given id
      description: |
        This API provides the details of the metadata rule for the provided rule identifier in a metadata collection.
      operationId: getMetadataRuleById
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: UUID for metadata rule
        required: true
        schema:
          maxLength: 32
          minLength: 32
          pattern: '[a-f0-9]{32}'
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataRuleResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataRuleFound</td>
                  <td>Metadata rule with id {ruleId} not found</td>
              </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
    delete:
      tags:
      - Metadata Rules
      summary: delete metadata rule for the given id
      description: |
        Allows admin users to delete the metadata rule for the given rule identifier within a metadata collection. Metadata rule can be deleted only if metadata collection is in DRAFT status.
      operationId: deleteMetadataRuleById
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: UUID for metadata rule
        required: true
        schema:
          maxLength: 32
          minLength: 32
          pattern: '[a-f0-9]{32}'
          type: string
      responses:
        204:
          description: OK
          content: {}
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
               <tr>
                <td>deleteRuleOnPublishedCollection   </td>
                <td>metadata rule can not be deleted. Metadata rule with id {ruleId} is associated with collection in published state.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataRuleFound</td>
                  <td>Metadata rule with id {ruleId} not found</td>
              </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.d
    patch:
      tags:
      - Metadata Rules
      summary: Update metadata rule for the given id
      description: "Allows admin users to update the metadata rule for the given rule\
        \ identifier within a metadata collection. Following details can be updated\
        \ for a metadata rule based on the status on metadata collection\n<table>\n\
        \  <tr>\n    <th width=\"20%\" align=\"left\">Parameter</th>\n    <th width=40%\"\
        \ align=\"left\">Metadata Collection<br> in DRAFT</th>\n    <th width=40%\"\
        \ align=\"left\">Metadata Collection <br> in PUBLISHED</th>\n  </tr>\n  <tr>\n\
        \    <td>name</td>\n    <td>Can be updated</td>\n    <td>Cannot be updated</td>\n\
        \  </tr>\n  <tr>\n    <td>key</td>\n    <td>Can be updated</td>\n    <td>Cannot\
        \ be updated</td>\n  </tr>\n  <tr>\n    <td>value</td>\n    <td>Can be updated</td>\n\
        \    <td>Cannot be updated</td>\n  </tr>\n</table>        \n"
      operationId: updateMetadataRuleById
      parameters:
      - name: metadataCollectionId
        in: path
        description: Metadata Collection id
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: UUID for metadata rule
        required: true
        schema:
          maxLength: 32
          minLength: 32
          pattern: '[a-f0-9]{32}'
          type: string
      - name: If-Match
        in: header
        description: etag of the resource
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        description: request body to create metadata rule
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/metadataRulePatchRequest'
        required: false
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataRuleResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>invalidRuleName</td>
                <td>rule name provided {name} is not valid. It must be alphabets including digits.Spaces are not allowed at beginning or at end.</td>
              </tr>
              <tr>
                <td>ruleNameTooLong</td>
                <td>rule name must not be longer than 100 characters.</td>
              </tr>
              <tr>
                <td>duplicateRuleName</td>
                <td>provided rule name {0} is already exists.</td>
              </tr>
              <tr>
                <td>keyNotEnabledForRule</td>
                <td>provided metadata key {Key} is not supported for metadata rule</td>
              </tr>
               <tr>
                <td>keyNotPublished</td>
                <td>provided key {metadataKeyId} is not published.</td>
              </tr>
              <tr>
                <td>invalidMetadataValue</td>
                <td>Invalid value {value} provided for metadata key {key}.</td>
              </tr>
              <tr>
                <td>keyDefinitionError</td>
                <td>definition for provided key {key} is not valid</td>
              </tr>
               <tr>
                <td>duplicateKeyValueRule</td>
                <td>metadata Rule with key {key} and value {value} combination already exists.</td>
              </tr>
               <tr>
                <td>applyOnMismatchForRule   </td>
                <td>apply on for global key is not matching with applyOn for collection. applyOn for key is {applyOnForMetadataKey} whereas applyOn for collection is {applyOnForMetadataCollection}</td>
              </tr>
               <tr>
                <td>updateRuleOnPublishedCollection   </td>
                <td>metadata rule can not be updated. Metadata rule with id {ruleId} is associated with collection in published state.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <html>
              <style>
                table, th, td {
                  border: 1px solid black;
                }
              </style>
              <table>
                <colgroup>
                  <col span="1" style="width: 30%;">
                  <col span="1" style="width: 70%;">
                </colgroup>
                <tr>
                  <th align="left">Code Suffix</th>
                  <th align="left">Message (parametrized)</th>
                </tr>
                <tr>
                  <td>metadataCollectionNotFound</td>
                  <td>metadata collection with id {metadataCollectionId} not found</td>
                </tr>
                <tr>
                  <td>metadataRuleFound</td>
                  <td>Metadata rule with id {0} not found</td>
              </tr>
              </table>
            </html>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.w
  /metadataKeys:
    get:
      tags:
      - Metadata Definitions
      summary: List all searchable and published metadata keys defined for tenant.
      description: |
        Detailed Description
        <table>
        Metadata keys are defined within Integrated Data Lake for Metadata Management by admin user which captures the required details and the constraints on the metadata information (values) that can be entered by the standard user. Once metadata keys are defined, users can enter the metadata values on objects and folders. Values entered are validated as per the defined constraints.<br><br>
          <b>Request Parameters</b><br>        
          <tr>
            <th align="center" width="10%">Parameter</th>
            <th align="center" width="10%">Type</th>
            <th align="center" width="20%">Values</th>
            <th align="center" width="60%">Description</th>
          </tr>
          <tr>
            <td align="center">category </td>
            <td align="center">String </td>
            <td align="center">All, Global, Custom, System <br>
                          Default Value = All</td>
            <td align="left">Metadata information within Integrated Data Lake is organized into collection called as Metadata Collection. Every metadata key defined should be included in a Metadata Collection. Following are the possible Metadata Collections <br>
              <li>Global → This is a default metadata collection which is system created. Users can used this Metadata Collection to add their metadata keys. Keys defines in Global Metadata Collection are available on all the objects and folders. Metadata keys defined in Global Metadata Collections can be fetched by providing category value as "Global"</li>
              <li>Custom → This is user defined Metadata Collection. Users can create their own Metadata Collection by providing any name of their choice and add keys to it. Custom Metadata Collections are controlled and rendered based on defined rules. Metadata keys defined in all the Custom Metadata Collections can be fetched by providing category value as "Custom"</li>
              <li>System → This is again system created Metadata Collection used to hold keys related to system metadata. Users cannot create nor add keys to System Metadata Collection. Metadata keys defined in System Metadata Collections can be fetched by providing category value as "System"</li>
            </td>
          </tr>
          <tr>
            <td align="center">page </td>
            <td align="center">Integer </td>
            <td align="center">Any Number <br>
                          Default Value = 0</td>
            <td align="left">Specifies the requested page index </td>
          </tr>
          <tr>
            <td align="center">size </td>
            <td align="center">Integer </td>
            <td align="center">Any Number <br>
                          Default Value = 100</td>
            <td align="left">Specifies the number of elements in a page </td>
          </tr>
        </table><br>
        <b>Response Parameters</b>
        <table>
          <tr>
            <th align="left" width="30%">Parameter</th>
            <th align="left" width="60%">Description</th>
          </tr>
          <tr>
            <td>key</td>
            <td>Identifier of the metadata key. This value is always unique in a given Metadata Collections. Normally key is in lower case with '_' (underscore) as separator. Spaces are not allowed in the key</td>
          </tr>
          <tr>
            <td>metadataCollectionId</td>
            <td>Identifier for a Metadata Collection to which the key belongs. Every key is identified by its Metadata Collection</td>
          </tr>        
          <tr>
            <td>label</td>
            <td>Name or the display name for the metadata key. This is preferably same as key for easy understanding and readability. It accepts characters and digits with space as a separator</td>
          </tr>
          <tr>
            <td>valueType</td>
            <td>Data Type for the key. Currently suppoerted data types are <b>String, Enum, StringList and EnumList</b></td>
          </tr>
          <tr>
            <td>supportedOperators</td>
            <td>This is an array of operators supported by underlying search engine to perform search operations using the key. Search operator will differ based on the value type</td>
          </tr>
          <tr>
            <td>fieldName</td>
            <td>One of the constraints applied on the key. Possible value can be
              <li>For String → Alphabetic, Aplhanumeric, Numeric, min value & max value</li>
              <li>For String List → Alphabetic, Aplhanumeric, Numeric, min value & max value along with minLength and maxLength</li>
              <li>For Numeric → minValue & maxValue</li>
              <li>For Enum → options</li>
            </td>
          </tr>
          <tr>
            <td>fieldNameLabel</td>
            <td>Display name for the fieldName for better readability</td>
          </tr>
          <tr>
            <td>fieldValues</td>
            <td>Values as per selected fieldName, e.g.
              <li>For String → String, indicating string values are accepted</li>
              <li>For minValue → Number, indicating the minimum value</li>
              <li>For Enum → List of Enum values</li>
            </td>
          </tr>
          <tr>
            <td>baseDataType</td>
            <td>Indicate the data type of the field values.
              e.g. data type for min and max value would be "Number" and that for Enum and String would be "String"
            </td>
          </tr>
        </table><br><br>
        <b>Additional Information</b><br>
          <li>Following search operators are supported in the initial phase <br>
             eq → Equal     ne → Not Equal    gt → Greater than     ge → Greater than equal      lt → Less than      <br> 
             le → Less than equal      contains → IN</li><br>
          <li>Searcheable Keys → Certain metadata keys can be configured as searcheable and non-searcheable to maintain the confidentiality and avoid exposure to all. Only the keys that are <b>configured as searcheable</b> will be fetched and returned</li><br>
          <li>Metadata Status → Metadata keys as well as Metadata Collection can exist in with Draft state or Published State. In Draft state, metadata keys as well as Metadata Collection can be updated or deleted. So only those keys and Metadata Collection which are in <b>Published</b> state will be fetched and returned</li>
      operationId: getAllMetadataDefinition
      parameters:
      - name: category
        in: query
        description: To get meta data keys for the meta data types. Supported values
          are Global, Custom, System and All
        schema:
          type: string
          default: All
      - name: page
        in: query
        description: Specifies the requested page index
        schema:
          type: integer
          default: 0
      - name: size
        in: query
        description: Specifies the number of elements in a page. Maximum supported
          value is 200.
        schema:
          type: integer
          default: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataGetAllResponseList'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled  </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.mkv.r
  /objectMetadata/{path}:
    put:
      tags:
      - Object Metadata Key Value Pair Operations
      summary: For the specified path, add or modify meta data values to the keys
        set by the tenant administrator.
      description: |
         Detailed Description
         <table> The user is permitted to include meta data values for the metadata keys that have been specified by the tenant administrator. This operation can be performed on the designated object path.
         <br><br>
         <b>Note**</b> If the object is not available, metadata values cannot be applied, resulting in an "objectNotFound" error being thrown.
          <br><br>
                <b>Constraints</b><br> 
                <br>
                 <tr>
                  <th align="left" width="30%">Parameter</th>
                  <th align="left" width="30%">Constraint type</th>
                  <th align="left" width="60%">Description</th>
                </tr>
                <tr>
                 <td>key</td>
                  <td>Mandatory global keys</td>
                  <td>User must provide values for all the mandatory global keys.</td>
                </tr>
                <tr>
                 <td>key</td>
                  <td>Optional global keys</td>
                  <td>User can provide values for the optional global keys as well.</td>
                </tr>
                <tr>
                  <td>key</td>
                  <td>Custom keys and values</td>
                  <td>As per the rule created by the tenant admin, the user is required to input key values for the custom metadata collection included.</td>
                </tr>
                <tr>
                  <td>values</td>
                  <td>Value of key</td>
                  <td>The assessment of value relies on the limitations set on the key.</td>
                </tr>
                <tr>
                  <td>path</td>
                  <td>Path value</td>
                  <td>If the path includes special characters that need to be URL-encoded, it should be done accordingly.
                  </td>
                </tr>
              </table><br>
      operationId: addMetadataKeys
      parameters:
      - name: path
        in: path
        description: path of an object denoting folders and object name. e.g. basefolder/subfolder/objectname.objectext
        required: true
        schema:
          maxLength: 500
          minLength: 1
          type: string
      requestBody:
        description: addMetaDataRequest
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/objectMetaDataRequest'
        required: true
      responses:
        201:
          description: Created
          content: {}
        400:
          description: |
            Bad request. Possible errors:
            <br><br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>parameterPathTooLong</td>
                <td>Parameter complete path, which is, the default path {defaultpath} and input path must be no longer than 1024 characters..</td>
              </tr>
              <tr>
                <td>badRequest</td>
                <td>The request was malformed or missing required fields.</td>
              </tr>              
              <tr>
                <td>mandatoryFieldMissing</td>
                <td>missing mandatory field {[fieldName]}</td>
              </tr>
              <tr>
                <td>missingMandatoryKeys</td>
                <td>missing mandatory keys {[metadataKeys]}</td>
              </tr>
              <tr>
                <td>metaDataKeyIsNotPublished  </td>
                <td>metadata key {metadataKey} is not published.</td>
              </tr>
              <tr>
                <td>metaDataCollectionIsNotPublished  </td>
                <td>metadata collection with id {collectionId} is not published.</td>
              </tr>
              <tr>
                <td>metaDataKeyDoesNotExist</td>
                <td>provided metadata key {key} does not exist in metadata collection with id {collectionId}.</td>
              </tr>
              <tr>
                <td>keyAllowedForFolderOnly</td>
                <td>key {metadataKey} allowed only for folder.</td>
              </tr>
              <tr>
                <td>keyNotAlignedWithDefinedRules</td>
                <td>key {metadataKey} is not aligned with any rule..</td>
              </tr>
              <tr>
                <td>invalidValueForKey</td>
                <td>value provided for key {metadataKey} violates the constraint {constraint}: Actual: {actualValues}, Expected: {expectedValues}</td>
              </tr>
              <tr>
                <td>ruleMetaDataNotProvided</td>
                <td>as per rule key value must be provided for keys {metadataKeys}</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>objectNotFound</td>
                <td>Either the object not found or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content: {}
        409:
          description: duplicateKeyName
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.w
    get:
      tags:
      - Object Metadata Key Value Pair Operations
      summary: Get Metadata key value pairs for the object.
      description: Get Metadata for the object.  If path contains
        special characters which require URL encoding, it should be done as appropriate.
      operationId: retrieveObjectMetadataKeyValuePairs
      parameters:
      - name: path
        in: path
        description: path of an object denoting folders and object name. e.g. basefolder/subfolder/objectname.objectext
        required: true
        schema:
          maxLength: 500
          minLength: 1
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/objectMetaDataResponse'
        400:
          description: "Bad request. Possible errors:\n<br>\n<table>\n  <colgroup>\n\
            \    <col span=\"1\" style=\"width: 30%;\">\n    <col span=\"1\" style=\"\
            width: 70%;\">\n  </colgroup>\n  <tr>\n    <th align=\"left\">Code Suffix</th>\n\
            \    <th align=\"left\">Message (parametrized)</th>\n  </tr>\n  <tr>\n\
            \    <td>parameterPathTooLong</td>\n    <td>Parameter complete path, which\
            \ is, the default path {defaultpath} and input path must be no longer\
            \ than 1024 characters.</td>\n  </tr>\n  <tr>\n    <td>parameterPathInvalid</td>\n\
            \    <td>Provided parameter path is invalid.</td>\n  </tr>\n</table>\n"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>objectNotFound</td>
                <td>Either the object not found or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.r
  /folderMetadataJobs:
    post:
      tags:
      - Folder Metadata Key Value Pair Operations
      summary: Create folder metadata jobs
      description: |
         <b>Detailed Description</b>
         <table> The user is permitted to include meta data values for the metadata keys that have been specified by the tenant administrator. This operation can be performed on the designated folder path.
         <br><br>
         <b>Note**</b> If the folder path is not available, metadata values cannot be applied, resulting in an "folderDoesNotExist" error being thrown.
          <br><br>
                <b>Constraints</b><br> 
                <br><br>
                 <tr>
                  <th align="left" width="30%">Parameter</th>
                  <th align="left" width="30%">Constraint type</th>
                  <th align="left" width="60%">Description</th>
                </tr>
                <tr>
                 <td>key</td>
                  <td>Mandatory global keys</td>
                  <td>User must provide values for all the mandatory global keys.</td>
                </tr>
                <tr>
                 <td>key</td>
                  <td>Optional global keys</td>
                  <td>User can provide values for the optional global keys as well.</td>
                </tr>
                <tr>
                  <td>key</td>
                  <td>Custom keys and values</td>
                  <td>As per the rule created by the tenant admin, the user is required to input key values for the custom metadata collection included.</td>
                </tr>
                <tr>
                  <td>values</td>
                  <td>Value of key</td>
                  <td>The assessment of value relies on the limitations set on the key.</td>
                </tr>
                <tr>
                  <td>path</td>
                  <td>Path value</td>
                  <td>If the path includes special characters that need to be URL-encoded, it should be done accordingly.
                  </td>
                </tr>
              </table><br>
      operationId: createFolderMetadataJob
      requestBody:
        description: Folder metadata job request payload
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/FolderMetadataJobsRequest'
        required: true
      responses:
        202:
          description: Folder metadata create or update job accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderMetadataJobsResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>parameterPathTooLong</td>
                <td>Parameter complete path, which is the default path {defaultpath} and input path must be no longer than 1024 characters.</td>
              </tr>
              <tr>
                <td>parameterPathInvalid</td>
                <td>Provided parameter path is invalid.</td>
              </tr>
              <tr>
                <td>badRequest</td>
                <td>The request was malformed or missing required fields.</td>
              </tr>              
              <tr>
                <td>mandatoryFieldMissing</td>
                <td>missing mandatory field {[fieldName]}</td>
              </tr>
               <tr>
                <td>missingMandatoryKeys</td>
                <td>missing mandatory keys {[metadataKeys]}</td>
              </tr>
              <tr>
                <td>metaDataKeyIsNotPublished  </td>
                <td>metadata key {metadataKey} is not published.</td>
              </tr>
              <tr>
                <td>metaDataKeyDoesNotExist</td>
                <td>Key with name {metadataKey} does not exist.</td>
              </tr>
              <tr>
                <td>keyAllowedForObjectOnly</td>
                <td>key {metadataKey} allowed only for objects.</td>
              </tr>
              <tr>
                <td>invalidValueForKey</td>
                <td>value provided for key {metadataKey} violates the constraint {constraint}: Actual: {actualValues}, Expected: {expectedValues}.</td>
              </tr>
              <tr>
                <td>ruleMetaDataNotProvided</td>
                <td>as per rule key value must be provided for keys {metadataKeys}</td>
              </tr>
              <tr>
                <td>folderMetadataJobInProgress</td>
                <td>Folder metadata job on path {path} is already in progress.</td>
              </tr>
              <tr>
                <td>keyOverridingNotAllowed</td>
                <td>provided metadata key {metadataKey} in metadata collection with id {collectionId} trying to override value present at parent folder.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>folderDoesNotExist</td>
                <td>Either the folder does not exist or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content: {}
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.w
    get:
      tags:
      - Folder Metadata Key Value Pair Operations
      summary: Get All Folder Metadata Jobs
      description: |-
        Get All Folder Metadata Jobs.
        Jobs in response will be sorted with updated timestamp.
      operationId: getFolderMetadataJobList
      parameters:
      - name: page
        in: query
        description: Specifies the requested page index
        schema:
          type: integer
          default: 0
      - name: size
        in: query
        schema:
          type: integer
          default: 10
          maximum: 200
        description: |
          Specifies the number of elements in a page
          
          <br>
          Example for using page and size parameters
          The default value of page and size is 0 and 10 respectively. The max value of size can be 200. To access the more jobs one can call the API with incremented page number.
          <br>
          <br>
          <b><h4>/folderMetadataJobs?page=1&size=200</h4></b>
          
          The above URI will display the next 200 jobs. For more jobs, page number has to be incremented.

      - name: filter
        in: query
        description: |
          JSON-based filter expression. Supported keys:
          * <b>path</b> - This will compare for the equality of path for which folder metadata key-values are applied.

          * <b>status</b> - This can take one or more string values. All folder metadata jobs with their status matching any of the given value will be returned.

          * If both "path" and "status" keys are given in the filter, then all folder metadata jobs matching both the conditions will be returned.

          Decoded example value:

              {"path": "myfolder1/myfolder2/", "status": ["IN_PROGRESS"]}
        schema:
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderMetadataJobsResponseList'
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>invalidFilter</td>
                <td>Filter provided is invalid.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.r
  /folderMetadataJobs/{id}:
    get:
      tags:
      - Folder Metadata Key Value Pair Operations
      summary: Get Folder Metadata Job by Id
      description: Get folder level metadata job by Id
      operationId: getFolderMetadataJob
      parameters:
      - name: id
        in: path
        description: Unique id for getting status of the folder metadata job.
        required: true
        schema:
          maxLength: 32
          minLength: 32
          pattern: '[a-f0-9]{32}'
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderMetadataJobsResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>folderMetadataJobNotFound</td>
                <td>Folder metadata job not found.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.r
  /folderMetadata:
    get:
      tags:
      - Folder Metadata Key Value Pair Operations
      summary: Get Folder Metadata present at the root path
      description: Get folder level metadata present at the root path
      operationId: getRootFolderMetadata
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderMetadataResponse'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.r
  /folderMetadata/{path}:
    get:
      tags:
      - Folder Metadata Key Value Pair Operations
      summary: Get Folder Metadata by path
      description: Get folder level metadata by path
      operationId: getFolderMetadata
      parameters:
      - name: path
        in: path
        description: Path on which folder metadata key-values to get
        required: true
        schema:
          maxLength: 32
          minLength: 32
          pattern: '[a-f0-9]{32}'
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderMetadataResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              
              <tr>
                <td>parameterPathTooLong</td>
                <td>Parameter complete path, which is the combination of default path {defaultpath} and input path must be no longer than 1024 characters.</td>
              </tr>
              <tr>
                <td>parameterPathInvalid</td>
                <td>Provided parameter path is invalid.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>folderDoesNotExist</td>
                <td>Either the folder does not exist for the given path {} or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
        - datalakeservice:
            - dl.ds.r
  /objects/{path}:
    put:
      tags:
        - Object Operations
      summary: Upload an object along with metadata key values.
      description: |
        Create or update an object for the specified path with the provided
        content and optional metadata values as per metadata keys defined by the
        tenant admin.
        
        <b>Note: </b> Only files of size upto 100 MB will be accepted. 
        <br><br>
        <b>Metadata Constraints</b>
         <br>
        <table> 
        <tr>
        <th align="left" width="30%">Parameter</th>
        <th align="left" width="30%">Constraint type</th>
        <th align="left" width="60%">Description</th>
        </tr>
        <tr>
        <td>key</td>
        <td>Mandatory global keys</td>
        <td>User needs to provide values for all the mandatory global keys.</td>
        </tr>
        <tr>
        <td>key</td>
        <td>Optional global keys</td>
        <td>User can provide values for the optional global keys as well.</td>
        </tr>
        <tr>
        <td>values</td>
        <td>Value of key</td>
        <td>Value is evaluated based on constraints defined on key.</td>
        </tr>
        <tr>
        <td>key</td>
        <td>Custom keys and values</td>
        <td>User needs to provide the values for custom keys as per the
        rule configured by the IDL admin.</td>
        </tr>
        <tr> 
        <td>path</td>
        <td>Path value</td>
        <td>If path contains special characters which require
        URL encoding, it should be done as appropriate.</td>
        </tr>
        </table><br>

      operationId: putObject
      parameters:
        - name: path
          in: path
          description: Path of an object denoting object name. e.g. basefolder/subfolder/objectname.objectext
          required: true
          schema:
            maxLength: 1024
            minLength: 1
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - content
              properties:
                metadata:
                  $ref: '#/components/schemas/objectMetaDataRequest'
                content:
                  type: string
                  description: Object content to be uploaded
                  format: binary
            encoding:
              metadata:
                contentType: application/json
              content:
                contentType: application/octet-stream
      responses:
        200:
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/objectMetaDataKeyValueResponse'
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
                <td>parameterPathTooLong</td>
                <td>Parameter complete path, which is the default path {defaultpath} and input path must be no longer than 1024 characters.</td>
              </tr>
              <tr>
                <td>parameterPathInvalid</td>
                <td>Provided parameter path is invalid.</td>
              </tr>
              <tr>
                <td>badRequest</td>
                <td>The request was malformed or missing required fields.</td>
              </tr>              
               <tr>
                <td>missingMandatoryKeys</td>
                <td>missing mandatory keys {[metadataKeys]}.</td>
              </tr>
              <tr>
                <td>metaDataKeyIsNotPublished</td>
                <td>metadata key {metadataKey} is not published.</td>
              </tr>
              <tr>
                <td>metaDataCollectionIsNotPublished</td>
                <td>metadata collection with id {collectionId} is not published.</td>
              </tr>
              <tr>
                <td>metaDataKeyDoesNotExist</td>
                <td>provided metadata key {key} does not exist in metadata collection with id {collectionId}.</td>
              </tr>
              <tr>
                <td>keyAllowedForFolderOnly</td>
                <td>key {metadataKey} allowed only for folder.</td>
              </tr>
              <tr>
                <td>keyNotAlignedWithDefinedRules</td>
                <td>key {metadataKey} is not aligned with any rule.</td>
              </tr>
              <tr>
                <td>invalidValueForKey</td>
                <td>value provided for key {metadataKey} violates the constraint {constraint}: Actual: {actualValues}, Expected: {expectedValues}</td>
              </tr>
              <tr>
                <td>ruleMetaDataNotProvided</td>
                <td>as per rule key value must be provided for keys {metadataKeys}.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>accessDenied</td>
                <td>Access denied for creating object at {}. Please ask Tenant Admin to define the access policy.</td>
              </tr>              
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the appropriate resource package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        413:
          description: Request Entity Too Large
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
        - datalakeservice:
            - dl.ds.w
    get:
      tags:
        - Object Operations
      summary: Download object.
      description: Download the object from the specified path
      operationId: getObject
      parameters:
        - name: path
          in: path
          description: Path of an object denoting object name. e.g. basefolder/subfolder/objectname.objectext
          required: true
          schema:
            maxLength: 1024
            minLength: 1
            type: string
      responses:
        200:
          description: Object content
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>parameterPathTooLong </td>
                <td>Parameter complete path, which is, the default path {defaultpath} and input path must be no longer than 1024 characters.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the appropriate resource package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>objectNotFound</td>
                <td>Either the object not found or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
        - datalakeservice:
            - dl.ds.r
  /folders:
    post:
      tags:
      - Folder Operations
      summary: Create an empty folder along with metadata key values.
      description: |
        Create an empty folder for the specified path and optional metadata values as per metadata keys defined by the IDL admin.
        If path contains special characters which require URL encoding in character-set UTF-8.
        <br>
        <B>Note:</b> Operation may create a folder hierarchy if any folder hierarchy does not exist.
        
        <br><br>
        <b>Constraints</b>
         <br>
        <table> 
        <tr>
        <th align="left" width="30%">Parameter</th>
        <th align="left" width="30%">Constraint type</th>
        <th align="left" width="60%">Description</th>
        </tr>
        <tr>
        <td>metadataKeyValues</td>
        <td>Conditional Mandatory</td>
        <td>This field is mandatory only when folder level mandatory meta data keys are defined by admin.</td>
        </tr>
        <tr>
        <tr>
        <td>key</td>
        <td>Mandatory and optional keys</td>
        <td>
          <B>Mandatory global keys </B> :User needs to provide values for all the mandatory global keys.
          <br>
          <B>Optional global keys </B> :User can provide values for the optional global keys as well.
          <br>
          <B>Custom keys and values </B> :User needs to provide the values for custom keys as per the
        rule configured by the IDL admin.
        </td>
        </tr>
        <td>values</td>
        <td>Value of key</td>
        <td>Value is evaluated based on constraints defined on key.</td>
        </tr>
        <tr> 
        <td>path</td>
        <td>Path value</td>
        <td>If path contains special characters which require
        URL encoding, it should be done as appropriate.</td>
        </tr>
        </table><br>
        
      operationId: postEmptyFolder

      requestBody:
        content:
          application/json:
            schema:
                  $ref: '#/components/schemas/folderMetaDataRequest'

      responses:
        201:
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/folderMetaDataKeyValueResponse'        
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 40%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
                <td>parameterPathTooLong</td>
                <td>Parameter complete path, which is the default path {defaultpath} and input path must be no longer than 1024 characters.</td>
              </tr>
              <tr>
                <td>parameterPathInvalid</td>
                <td>Provided parameter path is invalid.</td>
              </tr>
              <tr>
                <td>badRequest</td>
                <td>The request was malformed or missing required fields.</td>
              </tr>              
              <tr>
                <td>folderAlreadyExist</td>
                <td>Folder already exist for the given path {}.</td>
              </tr>
               <tr>
                <td>missingMandatoryKeys</td>
                <td>missing mandatory keys {[metadataKeys]}.</td>
              </tr>
              <tr>
                <td>metaDataKeyIsNotPublished</td>
                <td>metadata key {metadataKey} is not published.</td>
              </tr>
              <tr>
                <td>metaDataCollectionIsNotPublished</td>
                <td>metadata collection with id {collectionId} is not published.</td>
              </tr>
               <tr>
                <td>metaDataCollectionIdDoesNotExist</td>
                <td>collection with id {collectionId} does not exist.</td>
              </tr>
              <tr>
                <td>metaDataKeyDoesNotExist</td>
                <td>provided metadata key {key} does not exist in metadata collection with id {collectionId}.
                </td>
              </tr>
              <tr>
                <td>keyAllowedForObjectrOnly</td>
                <td>key {metadataKey} allowed only for object.</td>
              </tr>
              <tr>
                <td>keyNotAlignedWithDefinedRules</td>
                <td>key {metadataKey} is not aligned with any rule.</td>
              </tr>
               <tr>
                <td>keyOverridingNotAllowed</td>
                <td>key {metadataKey} is not allowed to override.</td>
              </tr>
              <tr>
                <td>invalidValueForKey</td>
                <td>value provided for key {metadataKey} violates the constraint {constraint}: Actual: {actualValues}, Expected: {expectedValues}</td>
              </tr>
              <tr>
                <td>ruleMetaDataNotProvided</td>
                <td>as per rule key value must be provided for keys {metadataKeys}.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>accessDenied</td>
                <td>Access denied for creating folder at {0}. Please ask Tenant Admin to define the access policy.</td>
              </tr>              
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the appropriate resource package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'                   
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.w
  /folders/{path}:
    delete:
      tags:
      - Folder Operations
      summary: Delete an empty folder.
      description: |
        Delete an empty folder along with the meta data key values from the specified path.
        If path contains special characters which require URL encoding in character-set UTF-8.
        <br>
        <B>Note:</b>Operation is applied only on leaf folder. There is no impact on folder hierarchy.
 
      operationId: deleteFolder
      parameters:
      - name: path
        in: path
        description: Path of an folder denoting folder name. e.g. basefolder/subfolder
        required: true
        schema:
          maxLength: 1024
          minLength: 1
          type: string
      responses:
        204:
          description: No Content
        400:
          description: |
            Bad request. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
               <tr>
              <td>folderIsNotEmpty</td>
                <td>folder is not empty.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        403:
          description: |
            Forbidden. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
              <tr>
                <td>resourcePackNotEnabled </td>
                <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the appropriate resource package.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        404:
          description: |
            Not Found. Possible errors:
            <br>
            <table>
              <colgroup>
                <col span="1" style="width: 30%;">
                <col span="1" style="width: 70%;">
              </colgroup>
              <tr>
                <th align="left">Code Suffix</th>
                <th align="left">Message (parametrized)</th>
              </tr>
               <tr>
                <td>folderDoesNotExist</td>
                <td>Either the folder does not exist or you don't have access to perform this operation.</td>
              </tr>
            </table>
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        429:
          description: |
            Too many requests

            Too many requests that can be arised based on subsequent case:

            - User has sent too many requests in a given amount of time

            A Retry-After header might be included to this response indicating how long in 'seconds' to wait before making a new request.
          headers:
            Retry-After:
              description: Time in seconds to wait before making a new request
              schema:
                type: integer
        503:
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'                    
        default:
          description: Other error with any status code and response body format.
          content: {}
      security:
      - datalakeservice:
        - dl.ds.w
components:
  schemas:
    Errors:
      type: object
      properties:
        errors:
          type: array
          description: Concrete error codes and messages are defined at operation
            error response descriptions in this API specification.
          items:
            type: object
            properties:
              code:
                type: string
                description: Unique error code. Every code is bound to one message.
                format: mdsp.core.datalake.<suffix>
                example: mdsp.core.datalake.exampleCode
              logref:
                type: string
                description: Logging correlation ID for debugging purposes.
                example: 0bff7e7a-cd25-4576-9908-4180ef086174
              message:
                type: string
                description: Human readable error message in English.
                example: Example error message.
              messageParameters:
                type: array
                description: |
                  In case an error message is parametrized, the parameter names and values are returned for, e.g., localization purposes. The parametrized error messages are defined at the operation error response descriptions in this API specification. Parameters are denoted by named placeholders '{\<parameter name\>}' in the  message specifications. At runtime, returned message placeholders are substituted by actual parameter values.
                example:
                - name: exampleParameterName
                  value: "100"
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of message parameter as specified in parametrized
                        error message.
                    value:
                      type: string
                      description: Value of message parameter as substituted in returned
                        error message.
                  description: Message parameter
      description: Error response body model.
    folderMetaDataRequest:
      required:
      - path
      type: object
      properties:
        path:
          type: string
          description: Folder path in Data Lake
          example: /folder1/test1
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairRequest'
    folderMetaDataKeyValueResponse:
      type: object
      properties:
        path:
          type: string
          description: Folder path in Data Lake
          example: /folder1/test1
        lastModified:
          type: string
          description: Last Modified Time of the Object
          format: date-time
          example: 2018-10-03T09:21:36.559Z
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairResponse'
    createmetadataCollectionRequest:
      required:
      - label
      - metadataCollectionId
      type: object
      properties:
        metadataCollectionId:
          maxLength: 100
          type: string
          description: unique identifier for custom Metadata Collection
          example: document_review
        label:
          maxLength: 100
          type: string
          description: display name for the custom Metadata Collection
          example: Document Review
        description:
          maxLength: 255
          type: string
          description: description of custom Metadata Collection and its usage
          example: usage and purpose of custom Metadata Collection
    updatemetadataCollectionRequest:
      type: object
      properties:
        label:
          maxLength: 100
          type: string
          description: display name for the custom Metadata Collection
          example: Document Review
        description:
          maxLength: 255
          type: string
          description: description of custom Metadata Collection
          example: usage and purpose of custom Metadata Collection
        status:
          type: string
          enum:
          - DRAFT
          - PUBLISHED
    createmetadataCollectionResponse:
      required:
      - etag
      - label
      - metadataCollectionId
      - status
      type: object
      properties:
        metadataCollectionId:
          type: string
          description: unique identifier for custom Metadata Collection
          example: document_review
        label:
          type: string
          description: display name for the custom Metadata Collection
          example: Document Reeview
        description:
          type: string
          description: description of custom Metadata Collection
          example: usage and purpose of custom Metadata Collection
        status:
          type: string
          enum:
          - DRAFT
          - PUBLISHED
        etag:
          type: number
          example: 1.0
    metadataCollectionGetAllResponse:
      type: object
      properties:
        metadataCollections:
          type: array
          items:
            $ref: '#/components/schemas/createmetadataCollectionResponse'
        page:
          $ref: '#/components/schemas/Page'
    globalmetadataaddkeyrequest:
      required:
      - applyOn
      - key
      - label
      - valueType
      type: object
      properties:
        key:
          maxLength: 100
          type: string
          description: name of metadata key
          example: country_of_origin
        label:
          maxLength: 100
          type: string
          description: Label for the key
          example: Country of Origin
        description:
          maxLength: 255
          type: string
          example: description of metadata key and its usage
        valueType:
          type: string
          description: data type of value corresponding to key
          example: String
        additionalDetails:
          $ref: '#/components/schemas/additionalDetails'
        applyOn:
          type: string
          description: kind of resources metadata field is applicable
          enum:
          - OBJECTS_ONLY
          - FOLDERS_ONLY
          - OBJECTS_AND_FOLDERS
        isMandatory:
          type: boolean
          description: true if key is mandatory, false otherwise
          example: true
        isRuleKey:
          type: boolean
          description: true if key is a rule key, false otherwise
          example: false
        isSearchable:
          type: boolean
          description: true if searching is allowed on key, false otherwise
          example: false
        status:
          type: string
          enum:
          - DRAFT
          - PUBLISHED
    metadataUpdateKeyRequest:
      type: object
      properties:
        label:
          type: string
          description: Label for the key
          example: Business Sensitivity
        description:
          type: string
          example: description of metadata key and its usage
        additionalDetails:
          $ref: '#/components/schemas/additionalDetails'
        isMandatory:
          type: boolean
          description: true if key is mandatory, false otherwise
          example: true
        isRuleKey:
          type: boolean
          description: true if key is a rule key, false otherwise
          example: false
        status:
          type: string
          enum:
          - DRAFT
          - PUBLISHED
    metadataAddKeyResponse:
      required:
      - etag
      - key
      - valueType
      type: object
      properties:
        key:
          type: string
          description: name of metadata key
          example: country_of_origin
        label:
          type: string
          description: Label for the key
          example: Country of Origin
        description:
          type: string
          example: description of metadata key and its usage
        valueType:
          type: string
          description: data type of value corresponding to key
          example: String
        additionalDetails:
          $ref: '#/components/schemas/additionalDetails'
        applyOn:
          type: string
          description: kind of resources metadata field is applicable
          enum:
          - OBJECTS_ONLY
          - FOLDERS_ONLY
          - OBJECTS_AND_FOLDERS
        isMandatory:
          type: boolean
          description: true if key is mandatory, false otherwise
          example: true
        isRuleKey:
          type: boolean
          description: true if key is a rule key, false otherwise
          example: false
        isSearchable:
          type: boolean
          description: true if searching is allowed on key, false otherwise
          example: false
        status:
          type: string
          enum:
          - DRAFT
          - PUBLISHED
        etag:
          type: number
          example: 1.0
    metadataKeysGetAllResponse:
      type: object
      properties:
        metadataKeys:
          type: array
          items:
            $ref: '#/components/schemas/metadataAddKeyResponse'
        page:
          $ref: '#/components/schemas/Page'
    additionalDetails:
      type: array
      items:
        $ref: '#/components/schemas/additionalDetail'
    additionalDetail:
      type: object
      properties:
        fieldName:
          type: string
          example: StringType
        fieldValues:
          type: array
          items:
            type: string
            example: ALPHABETIC
    metadataGetAllResponseList:
      type: object
      properties:
        metadataKeys:
          type: array
          items:
            $ref: '#/components/schemas/metadataGetAllResposnse'
        page:
          $ref: '#/components/schemas/Page'
    metadataGetAllResposnse:
      type: object
      properties:
        key:
          type: string
          description: name of metadata key
          example: countryOfOriginGlobal
        metadataCollectionId:
          type: string
          description: Id of Metadata Collection
          example: Global
        metadataCollectionLabel:
          type: string
          description: Label for the metadata collection
          example: Global collection         
        valueType:
          type: string
          description: data type of value corresponding to key
          example: String
        label:
          type: string
          description: Label for the key
          example: Country of origin
        description:
          type: string
          example: Represents the country of manufacture, production or design
        supportedOperators:
          type: array
          example:
          - eq
          - ne
          items:
            type: string
        additionalDetails:
          $ref: '#/components/schemas/internaladditionalDetails'
    internaladditionalDetails:
      type: array
      items:
        $ref: '#/components/schemas/internaladditionalDetail'
    internaladditionalDetail:
      type: object
      properties:
        fieldName:
          type: string
          example: minValue
        fieldNameLabel:
          type: string
          example: minimum value
        fieldValues:
          type: array
          items:
            type: string
            example: "3"
        baseDataType:
          type: string
          example: number
    metadataRuleRequest:
      required:
      - key
      - name
      - value
      type: object
      properties:
        name:
          type: string
          description: name of metadata rule
          example: Document Review Rule
        key:
          type: string
          description: metadata key
          example: business_senstivity
        value:
          type: string
          description: suported value corresponding to key
          example: STRICTLY_PRIVATE
    metadataRulePatchRequest:
      type: object
      properties:
        name:
          type: string
          description: name of metadata rule
          example: Document Review Rule
        key:
          type: string
          description: metadata key
          example: business_senstivity
        value:
          type: string
          description: suported value corresponding to key
          example: STRICTLY_PRIVATE
    metadataRuleResponse:
      required:
      - etag
      - id
      - key
      - name
      - value
      type: object
      properties:
        id:
          type: string
          description: uuid of the rule
          example: 0860f696-af41-4d8d-a104-c1dd508de97a
        name:
          type: string
          description: name of metadata rule
          example: Document Review Rule
        key:
          type: string
          description: metadata key
          example: business_senstivity
        value:
          type: string
          description: suported value corresponding to key
          example: STRICTLY_PRIVATE
        etag:
          type: number
          example: 1.0
    metadataRuleGetAllResponse:
      type: object
      properties:
        metadataRules:
          type: array
          items:
            $ref: '#/components/schemas/metadataRuleResponse'
        page:
          $ref: '#/components/schemas/Page'
    objectMetaDataRequest:
      required:
      - metadataKeyValues
      type: object
      properties:
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairRequest'
    objectMetaDataResponse:
      type: object
      properties:
        name:
          type: string
          description: Object Name
          example: test1.csv
        location:
          type: string
          description: Object location in Data Lake
          example: ten=punvs1/folder1/test1/test1.csv
        path:
          type: string
          description: Object path in Data Lake
          example: /folder1/test1/test1.csv
        size:
          type: number
          description: Size of the Object
          example: 25.0
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairResponse'
        lastModified:
          type: string
          description: Last Modified Time of the Object
          format: date-time
          example: 2018-10-03T09:21:36.559Z
      example:
        name: test1.csv
        location: ten=punvs1/folder1/test1/test1.csv
        path: Folder/test1.csv
        size: 25
        lastModified: 2018-10-03T09:21:36.559Z
        metadataKeyValues:
        - key: country_of_origin
          metadataCollectionId: document_review
          values:
          - IN
          isPropagated: true
        - key: business_sensitivity
          metadataCollectionId: global
          values:
          - PRIVATE
          isPropagated: true
    metadataKeyValuePairRequest:
      required:
      - key
      - metadataCollectionId
      - values
      type: object
      properties:
        key:
          type: string
          description: name of metadata key
          example: country_of_origin
        metadataCollectionId:
          type: string
          description: identifier of the metadata collection. This is unique for a tenant.
          example: document_review
        values:
          type: array
          description: Array of Metadata Values.
          example:
          - IN
          items:
            type: string
    metadataKeyValuePairResponse:
      required:
      - isPropagated
      - key
      - metadataCollectionId
      - values
      type: object
      properties:
        key:
          type: string
          description: name of metadata key
          example: country_of_origin
        metadataCollectionId:
          type: string
          description: metadataCollectionId for the key
          example: document_review
        values:
          type: array
          description: Array of Metadata Values.
          example:
          - IN
          items:
            type: string
        isPropagated:
          type: boolean
          description: flag if metadata is propogated from parent folder or applied
            explicitly
          example: true
    FolderMetadataJobsRequest:
      required:
      - metadataKeyValues
      - path
      type: object
      properties:
        path:
          type: string
          description: Folder path on which folder metadata key-values will be applied.
          example: myfolder1/myfolder2/
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairRequest'
    FolderMetadataJobsResponse:
      required:
      - created
      - id
      - metadataKeyValues
      - path
      - status
      type: object
      properties:
        id:
          type: string
          description: Unique id for the folder metadata jobs
          example: 304a896c-a23a-11e9-a2a3-2a2ae2dbcce4
        path:
          type: string
          description: Path in folder metadata job
          example: myfolder1/myfolder2/
        status:
          type: string
          description: status for the folder metadata job
          example: IN_PROGRESS
          default: IN_PROGRESS
          enum:
          - IN_PROGRESS
          - COMPLETED_WITH_ERRORS
          - COMPLETED
          - FAILED
        message:
          type: string
          description: message in case of job failure or partial success
        created:
          type: string
          description: Date when folder metadata job was created
          example: 2020-09-09T08:08:51Z
        updated:
          type: string
          description: Date when folder metadata job last updated
          example: 2020-09-09T08:08:51Z
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairResponse'
        progressDetails:
          $ref: '#/components/schemas/FolderMetadataJobsProgressDetails'
    FolderMetadataJobsProgressDetails:
      type: object
      properties:
        completedObjects:
          type: integer
          description: Count of objects (files) which are updated for the given path
            in the particular job
        failedObjects:
          type: integer
          description: Count of objects (files) which are failed for the given path
            in the particular job
    FolderMetadataJobsListResponseItem:
      required:
      - created
      - id
      - path
      - status
      type: object
      properties:
        id:
          type: string
          description: Unique id for the folder metadata jobs
          example: 304a896c-a23a-11e9-a2a3-2a2ae2dbcce4
        path:
          type: string
          description: Path in folder metadata job
          example: myfolder1/myfolder2/
        status:
          type: string
          description: status for the folder metadata job
          example: IN_PROGRESS
          default: IN_PROGRESS
          enum:
          - IN_PROGRESS
          - COMPLETED_WITH_ERRORS
          - COMPLETED
          - FAILED
        message:
          type: string
          description: message in case of job failure or partial success
        created:
          type: string
          description: Date when folder metadata job was created
          example: 2020-09-09T08:08:51Z
    FolderMetadataJobsResponseList:
      type: object
      properties:
        folderMetadataJobs:
          type: array
          items:
            $ref: '#/components/schemas/FolderMetadataJobsListResponseItem'
        page:
          $ref: '#/components/schemas/Page'
      description: List of folder metadata jobs
    FolderMetadataResponse:
      required:
      - created
      - metadataKeyValues
      - path
      type: object
      properties:
        path:
          type: string
          description: Path for folder metadata job
          example: myfolder1/myfolder2/
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairResponse'
        created:
          type: string
          description: Date when folder metadata was created
          example: 2020-09-09T08:08:51Z
        updated:
          type: string
          description: Date when folder metadata was updated
          example: 2020-09-09T09:08:51Z
    Page:
      type: object
      properties:
        size:
          type: integer
        totalElements:
          type: integer
        totalPages:
          type: integer
        number:
          type: integer
    objectMetaDataKeyValueResponse:
      type: object
      properties:
        name:
          type: string
          description: Object Name
          example: test1.csv
        path:
          type: string
          description: Object path in Data Lake
          example: /folder1/test1/test1.csv
        location:
          type: string
          description: Object location in Data Lake
          example: ten=punvs1/folder1/test1/test1.csv
        lastModified:
          type: string
          description: Last Modified Time of the Object
          format: date-time
          example: 2018-10-03T09:21:36.559Z
        size:
          type: number
          description: Size of the Object in bytes
          example: 25
        metadataKeyValues:
          type: array
          items:
            $ref: '#/components/schemas/metadataKeyValuePairResponse'
  responses:
    ForbiddenErrorResponse:
      description: |
        Forbidden. Possible errors:
        <br>
        <table>
          <colgroup>
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 70%;">
          </colgroup>
          <tr>
            <th align="left">Code Suffix</th>
            <th align="left">Message (parametrized)</th>
          </tr>
          <tr>
            <td>resourcePackNotEnabled  </td>
            <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
          </tr>
        </table>
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Errors'
    ResourcePackNotEnableErrorResponse:
      description: |
        Forbidden. Possible errors:
        <br>
        <table>
          <colgroup>
            <col span="1" style="width: 30%;">
            <col span="1" style="width: 70%;">
          </colgroup>
          <tr>
            <th align="left">Code Suffix</th>
            <th align="left">Message (parametrized)</th>
          </tr>
          <tr>
            <td>resourcePackNotEnabled  </td>
            <td>You do not have sufficient resources to work with this application. Please contact your administrator or purchase the IIoT Cloud Resource Package.</td>
          </tr>
        </table>
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Errors'
  parameters:
    page:
      name: page
      in: query
      description: Specifies the requested page index
      schema:
        type: integer
        default: 0
    size:
      name: size
      in: query
      description: Specifies the number of elements in a page. Maximum supported value
        is 200.
      schema:
        type: integer
        default: 100
    ifMatchMandatory:
      name: If-Match
      in: header
      description: etag of the resource
      required: true
      schema:
        type: integer
        format: int32
  securitySchemes:
    datalakeservice:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://oauth.simple.api/authorization
          tokenUrl: https://oauth.simple.api/token
          scopes:
            dl.mkv.w: define metadata collection and keys
            dl.mkv.r: read metadata collection and keys
            dl.mkv.d: read metadata collection and keys
            dl.ds.r: read object
            dl.ds.w: write object
