All schemas

ieu.association

Canonical URL: http://schematalog.com/api/schemas/ieu.association/versions/1.0

Published: 05 June 2023 20:23

Properties
Parameter Description Type Required Nullable Default Example
association_id Unique identifier of the Association UUID Required "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
battery_id The battery unique identifier. UUID Optional Yes null
device_id Unique identifier of the Device UUID Required "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
driver_id Unique identifier of the Driver UUID Optional Yes null "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
external_id device source unique id String Optional Yes
message_id The message unique identifier UUID Required
message_type The message type. String Optional "ieu.association"
offset Integer Optional
source_id The source unique identifier. Entity id in this case. String Required
source_message_type The type of message sent by the source String Optional
source_type String Optional Yes
tags The list of associated tags. List Optional Yes []
tenant_id The tenant/club for this message String Required
time Time of the message ISO 8601 Timestamp Required "2020-05-22T10:30:55+00:00"
vehicle_id Unique identifier of the Vehicle UUID Optional Yes null "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
JSON
{
  "type": "object",
  "properties": {
    "device_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier of the Device",
      "example": "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
    },
    "driver_id": {
      "type": "string",
      "format": "uuid",
      "default": null,
      "nullable": true,
      "description": "Unique identifier of the Driver",
      "example": "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
    },
    "vehicle_id": {
      "type": "string",
      "format": "uuid",
      "default": null,
      "nullable": true,
      "description": "Unique identifier of the Vehicle",
      "example": "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
    },
    "tags": {
      "type": "array",
      "default": [],
      "nullable": true,
      "description": "The list of associated tags.",
      "items": {
        "type": "string"
      }
    },
    "time": {
      "type": "string",
      "format": "date-time",
      "description": "Time of the message",
      "example": "2020-05-22T10:30:55+00:00"
    },
    "tenant_id": {
      "type": "string",
      "description": "The tenant/club for this message"
    },
    "association_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier of the Association",
      "example": "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
    },
    "source_id": {
      "type": "string",
      "description": "The source unique identifier. Entity id in this case."
    },
    "external_id": {
      "type": "string",
      "nullable": true,
      "description": "device source unique id"
    },
    "source_type": {
      "type": "string",
      "nullable": true
    },
    "battery_id": {
      "type": "string",
      "format": "uuid",
      "default": null,
      "nullable": true,
      "description": "The battery unique identifier."
    },
    "message_id": {
      "type": "string",
      "format": "uuid",
      "description": "The message unique identifier"
    },
    "message_type": {
      "type": "string",
      "default": "ieu.association",
      "description": "The message type."
    },
    "source_message_type": {
      "type": "string",
      "description": "The type of message sent by the source"
    },
    "offset": {
      "type": "integer"
    }
  },
  "required": [
    "association_id",
    "device_id",
    "message_id",
    "source_id",
    "tenant_id",
    "time"
  ],
  "$id": "http://schematalog.com/api/schemas/ieu.association/versions/1.0",
  "title": "ieu.association"
}
YAML
$id: http://schematalog.com/api/schemas/ieu.association/versions/1.0
properties:
  association_id:
    description: Unique identifier of the Association
    example: 2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC
    format: uuid
    type: string
  battery_id:
    default: null
    description: The battery unique identifier.
    format: uuid
    nullable: true
    type: string
  device_id:
    description: Unique identifier of the Device
    example: 2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC
    format: uuid
    type: string
  driver_id:
    default: null
    description: Unique identifier of the Driver
    example: 2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC
    format: uuid
    nullable: true
    type: string
  external_id:
    description: device source unique id
    nullable: true
    type: string
  message_id:
    description: The message unique identifier
    format: uuid
    type: string
  message_type:
    default: ieu.association
    description: The message type.
    type: string
  offset:
    type: integer
  source_id:
    description: The source unique identifier. Entity id in this case.
    type: string
  source_message_type:
    description: The type of message sent by the source
    type: string
  source_type:
    nullable: true
    type: string
  tags:
    default: []
    description: The list of associated tags.
    items:
      type: string
    nullable: true
    type: array
  tenant_id:
    description: The tenant/club for this message
    type: string
  time:
    description: Time of the message
    example: '2020-05-22T10:30:55+00:00'
    format: date-time
    type: string
  vehicle_id:
    default: null
    description: Unique identifier of the Vehicle
    example: 2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC
    format: uuid
    nullable: true
    type: string
required:
- association_id
- device_id
- message_id
- source_id
- tenant_id
- time
title: ieu.association
type: object
Python Code
from __future__ import annotations

from typing import List, Optional
from uuid import UUID

from pydantic import AwareDatetime, BaseModel, Field


class IeuAssociation(BaseModel):
    device_id: UUID = Field(
        ...,
        description='Unique identifier of the Device',
        examples=['2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC'],
    )
    driver_id: Optional[UUID] = Field(
        None,
        description='Unique identifier of the Driver',
        examples=['2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC'],
    )
    vehicle_id: Optional[UUID] = Field(
        None,
        description='Unique identifier of the Vehicle',
        examples=['2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC'],
    )
    tags: Optional[List[str]] = Field([], description='The list of associated tags.')
    time: AwareDatetime = Field(
        ..., description='Time of the message', examples=['2020-05-22T10:30:55+00:00']
    )
    tenant_id: str = Field(..., description='The tenant/club for this message')
    association_id: UUID = Field(
        ...,
        description='Unique identifier of the Association',
        examples=['2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC'],
    )
    source_id: str = Field(
        ..., description='The source unique identifier. Entity id in this case.'
    )
    external_id: Optional[str] = Field(None, description='device source unique id')
    source_type: Optional[str] = None
    battery_id: Optional[UUID] = Field(
        None, description='The battery unique identifier.'
    )
    message_id: UUID = Field(..., description='The message unique identifier')
    message_type: Optional[str] = Field(
        'ieu.association', description='The message type.'
    )
    source_message_type: Optional[str] = Field(
        None, description='The type of message sent by the source'
    )
    offset: Optional[int] = None
AVRO Schema
{
  "type": "record",
  "name": "document",
  "namespace": "ieu.association",
  "fields": [
    {
      "name": "device_id",
      "type": "string",
      "doc": "Unique identifier of the Device"
    },
    {
      "name": "driver_id",
      "type": [
        "null",
        "string"
      ],
      "doc": "Unique identifier of the Driver"
    },
    {
      "name": "vehicle_id",
      "type": [
        "null",
        "string"
      ],
      "doc": "Unique identifier of the Vehicle"
    },
    {
      "name": "tags",
      "type": [
        "null",
        {
          "doc": "The list of associated tags.",
          "type": "array",
          "items": "string"
        }
      ],
      "doc": "The list of associated tags."
    },
    {
      "name": "time",
      "type": "int",
      "doc": "Time of the message"
    },
    {
      "name": "tenant_id",
      "type": "string",
      "doc": "The tenant/club for this message"
    },
    {
      "name": "association_id",
      "type": "string",
      "doc": "Unique identifier of the Association"
    },
    {
      "name": "source_id",
      "type": "string",
      "doc": "The source unique identifier. Entity id in this case."
    },
    {
      "name": "external_id",
      "type": [
        "null",
        "string"
      ],
      "doc": "device source unique id"
    },
    {
      "name": "source_type",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "battery_id",
      "type": [
        "null",
        "string"
      ],
      "doc": "The battery unique identifier."
    },
    {
      "name": "message_id",
      "type": "string",
      "doc": "The message unique identifier"
    },
    {
      "name": "message_type",
      "type": [
        "null",
        "string"
      ],
      "default": "ieu.association",
      "doc": "The message type."
    },
    {
      "name": "source_message_type",
      "type": [
        "null",
        "string"
      ],
      "doc": "The type of message sent by the source"
    },
    {
      "name": "offset",
      "type": [
        "null",
        "int"
      ]
    }
  ]
}