Validere custom_attribute_definition API

Manage Custom Attribute Definitions

OpenAPI Specification

validere-custom-attribute-definition-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  description: Activity Log
  title: CarbonHub activities custom_attribute_definition API
  version: 1.0.0
servers:
- url: https://api.validere.io
security:
- Staging: []
- Integration: []
- Local: []
tags:
- description: Manage Custom Attribute Definitions
  name: custom_attribute_definition
paths:
  /app/v1/custom_attribute_definition/{entity_type}:
    get:
      operationId: ListCustomAttributeDefinition
      parameters:
      - $ref: '#/components/parameters/CustomAttributeEntityType'
      - $ref: '#/components/parameters/PageSize'
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/SortByCustomAttributeDefinition'
      - $ref: '#/components/parameters/SortDirection'
      - $ref: '#/components/parameters/CustomAttributeDefinitionFieldName'
      - $ref: '#/components/parameters/CustomAttributeDefinitionEntitySubType'
      - $ref: '#/components/parameters/CustomAttributeDefinitionArchived'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedCustomAttributeDefinitionList'
          description: successful operation
      summary: List Custom Attribute Definitions
      tags:
      - custom_attribute_definition
    post:
      operationId: createCustomAttributeDefinition
      parameters:
      - $ref: '#/components/parameters/CustomAttributeEntityType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomAttributeDefinitionInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomAttributeDefinition'
          description: successful operation
      summary: Create a Custom Attribute Definition
      tags:
      - custom_attribute_definition
  /app/v1/custom_attribute_definition/{entity_type}/{field_name}:
    delete:
      operationId: deleteCustomAttributeDefinition
      parameters:
      - $ref: '#/components/parameters/CustomAttributeEntityType'
      - $ref: '#/components/parameters/CustomAttributeFieldName'
      responses:
        '200':
          description: successful operation
      summary: Delete a Custom Attribute Definition
      tags:
      - custom_attribute_definition
    put:
      operationId: updateCustomAttributeDefinition
      parameters:
      - $ref: '#/components/parameters/CustomAttributeEntityType'
      - $ref: '#/components/parameters/CustomAttributeFieldName'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomAttributeDefinitionUpdateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomAttributeDefinition'
          description: successful operation
      summary: Update a Custom Attribute Definition
      tags:
      - custom_attribute_definition
components:
  parameters:
    CustomAttributeFieldName:
      description: field name identifier for custom attribute
      example: attribute_1
      in: path
      name: field_name
      required: true
      schema:
        type: string
    SortByCustomAttributeDefinition:
      description: sort by
      in: query
      name: sort_by
      required: false
      schema:
        enum:
        - field_name
    PageSize:
      description: page size
      in: query
      name: page_size
      required: false
      schema:
        type: number
    Page:
      description: page number
      in: query
      name: page
      required: false
      schema:
        type: number
    CustomAttributeEntityType:
      description: Supported attribute type for custom attribute
      example: equipment
      in: path
      name: entity_type
      required: true
      schema:
        $ref: '#/components/schemas/schemas-CustomAttributeEntityType'
    CustomAttributeDefinitionFieldName:
      description: String to search for in field names
      in: query
      name: field_name
      required: false
      schema:
        type: string
    CustomAttributeDefinitionArchived:
      description: Set true to return archived attribute definitions
      in: query
      name: archived
      required: false
      schema:
        type: boolean
    SortDirection:
      description: sort direction
      example: desc
      in: query
      name: sort_direction
      required: false
      schema:
        enum:
        - asc
        - desc
        type: string
    CustomAttributeDefinitionEntitySubType:
      description: String to search for in entity subtype
      in: query
      name: entity_subtype
      required: false
      schema:
        type: string
  schemas:
    PagedCustomAttributeDefinitionList:
      allOf:
      - $ref: '#/components/schemas/Pagination'
      - properties:
          data:
            items:
              $ref: '#/components/schemas/CustomAttributeDefinition'
            type: array
        type: object
    CustomAttributeDefinition:
      properties:
        archived:
          type: boolean
        company_id:
          type: string
        data_type:
          $ref: '#/components/schemas/AttributeTypes'
        description:
          type: string
        display_name:
          type: string
        entity_type:
          $ref: '#/components/schemas/schemas-CustomAttributeEntityType'
        entity_subtype:
          type: string
          deprecated: true
        entity_subtypes:
          items:
            type: string
          type: array
        field_name:
          type: string
        is_required:
          type: boolean
        lookup_entity_type:
          $ref: '#/components/schemas/MeasurementSubjectEntityType'
        pick_list_values:
          items:
            type: string
          type: array
        unit:
          type: string
      type: object
    Pagination:
      properties:
        page_number:
          type: number
          example: 0
        page_size:
          type: number
          example: 10
        total_entries:
          type: number
          example: 58
        total_pages:
          type: number
          example: 6
      type: object
    CustomAttributeDefinitionUpdateInput:
      properties:
        archived:
          type: boolean
        description:
          type: string
        display_name:
          type: string
        is_required:
          type: boolean
        pick_list_values:
          items:
            type: string
          type: array
        unit:
          type: string
        entity_subtype:
          type: string
          deprecated: true
        entity_subtypes:
          items:
            type: string
          type: array
      type: object
    MeasurementSubjectEntityType:
      type: string
      enum:
      - equipment
      - device
      - facility
      - flow
      - asset_group
    schemas-CustomAttributeEntityType:
      type: string
      enum:
      - equipment
      - device
      - facility
      - flow
      - asset_group
    AttributeTypes:
      type: string
      enum:
      - number
      - string
      - geo_point
      - boolean
      - integer
      - pick-list
      - multi-pick-list
      - number-array
      - lookup
      - date
      - date-time
      - file
    CustomAttributeDefinitionInput:
      properties:
        data_type:
          $ref: '#/components/schemas/AttributeTypes'
        description:
          type: string
        display_name:
          type: string
        field_name:
          type: string
        is_required:
          type: boolean
        lookup_entity_type:
          $ref: '#/components/schemas/MeasurementSubjectEntityType'
        entity_subtype:
          type: string
          deprecated: true
        entity_subtypes:
          items:
            type: string
          type: array
        pick_list_values:
          items:
            type: string
          type: array
        unit:
          type: string
      required:
      - data_type
      - display_name
      - field_name
      type: object