All schemas

ieu.device

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

Published: 05 June 2023 21:55

Properties
Parameter Description Type Required Nullable Default Example
allowed Is the platform allowing incoming messages from this device? Boolean Optional false
carrier Mobile Network Operator String Optional "" "PT"
configuration Device configuration. Will appear in device's status String Optional "" 59284
created Time of the creation of this entity / first activity recorded ISO 8601 Timestamp Optional "2020-05-22T10:30:55+00:00"
data_provider Name of the provider of the data, a third party such as TM8 or BMW. String Optional "bmw"
device_id Unique identifier of the Device UUID Required "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
external_id Identifier used by the device when it communicates with us. For example tm8's serial number is how tm8 identifies its devices with IEU. Is unique per 'type' of source. String Required 358636083051333
firmware Device firmware version. Will appear in device's status String Optional "" "6.00.043_hfe"
first_connected First time this device was connected on the platform ISO 8601 Timestamp Optional Yes null "2020-05-22T10:30:55+00:00"
iccid SIM identifier: Integrated Circuit Card IDentifier.https://en.wikipedia.org/wiki/SIM_card#ICCID String Optional "" 8935201641404020569
imei International mobile equipment identity. 15 digits. Must be a valid IMEI as per: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity#Check_digit_computation String Optional "" 353386066783073
message_id The message unique identifier UUID Required
message_type The message type String Required "ieu.device"
model Device model String Optional "" "T10PL7201"
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 The source type of the message received by the service String Required
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"
type Type of device. Messages sent by this device will be harmonised with this value as 'source_type' String Optional Yes
JSON
{
  "type": "object",
  "properties": {
    "firmware": {
      "type": "string",
      "default": "",
      "description": "Device firmware version. Will appear in device's status",
      "example": "6.00.043_hfe"
    },
    "configuration": {
      "type": "string",
      "default": "",
      "description": "Device configuration. Will appear in device's status",
      "example": "59284"
    },
    "external_id": {
      "type": "string",
      "description": "Identifier used by the device when it communicates with us. For example tm8's serial number is how tm8 identifies its devices with IEU. Is unique per 'type' of source.",
      "example": "358636083051333"
    },
    "type": {
      "type": "string",
      "nullable": true,
      "description": "Type of device. Messages sent by this device will be harmonised with this value as 'source_type'"
    },
    "model": {
      "type": "string",
      "default": "",
      "description": "Device model",
      "example": "T10PL7201"
    },
    "imei": {
      "type": "string",
      "default": "",
      "description": "International mobile equipment identity. 15 digits. Must be a valid IMEI as per: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity#Check_digit_computation",
      "example": "353386066783073"
    },
    "iccid": {
      "type": "string",
      "default": "",
      "description": "SIM identifier: Integrated Circuit Card IDentifier.https://en.wikipedia.org/wiki/SIM_card#ICCID",
      "example": "8935201641404020569"
    },
    "carrier": {
      "type": "string",
      "default": "",
      "description": "Mobile Network Operator",
      "example": "PT"
    },
    "allowed": {
      "type": "boolean",
      "default": false,
      "description": "Is the platform allowing incoming messages from this device?"
    },
    "data_provider": {
      "type": "string",
      "description": "Name of the provider of the data, a third party such as TM8 or BMW.",
      "example": "bmw"
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "Time of the creation of this entity / first activity recorded",
      "example": "2020-05-22T10:30:55+00:00"
    },
    "time": {
      "type": "string",
      "format": "date-time",
      "description": "Time of the message",
      "example": "2020-05-22T10:30:55+00:00"
    },
    "first_connected": {
      "type": "string",
      "format": "date-time",
      "default": null,
      "nullable": true,
      "description": "First time this device was connected on the platform",
      "example": "2020-05-22T10:30:55+00:00"
    },
    "device_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier of the Device",
      "example": "2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC"
    },
    "source_id": {
      "type": "string",
      "description": "The source unique identifier. Entity id in this case."
    },
    "tenant_id": {
      "type": "string",
      "description": "The tenant/club for this message"
    },
    "source_type": {
      "type": "string",
      "description": "The source type of the message received by the service"
    },
    "message_id": {
      "type": "string",
      "format": "uuid",
      "description": "The message unique identifier"
    },
    "message_type": {
      "type": "string",
      "default": "ieu.device",
      "description": "The message type"
    },
    "source_message_type": {
      "type": "string",
      "description": "The type of message sent by the source"
    }
  },
  "required": [
    "device_id",
    "external_id",
    "message_id",
    "message_type",
    "source_id",
    "source_type",
    "tenant_id",
    "time"
  ],
  "$id": "http://schematalog.com/api/schemas/ieu.device/versions/1.0",
  "title": "ieu.device"
}
YAML
$id: http://schematalog.com/api/schemas/ieu.device/versions/1.0
properties:
  allowed:
    default: false
    description: Is the platform allowing incoming messages from this device?
    type: boolean
  carrier:
    default: ''
    description: Mobile Network Operator
    example: PT
    type: string
  configuration:
    default: ''
    description: Device configuration. Will appear in device's status
    example: '59284'
    type: string
  created:
    description: Time of the creation of this entity / first activity recorded
    example: '2020-05-22T10:30:55+00:00'
    format: date-time
    type: string
  data_provider:
    description: Name of the provider of the data, a third party such as TM8 or BMW.
    example: bmw
    type: string
  device_id:
    description: Unique identifier of the Device
    example: 2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC
    format: uuid
    type: string
  external_id:
    description: Identifier used by the device when it communicates with us. For example
      tm8's serial number is how tm8 identifies its devices with IEU. Is unique per
      'type' of source.
    example: '358636083051333'
    type: string
  firmware:
    default: ''
    description: Device firmware version. Will appear in device's status
    example: 6.00.043_hfe
    type: string
  first_connected:
    default: null
    description: First time this device was connected on the platform
    example: '2020-05-22T10:30:55+00:00'
    format: date-time
    nullable: true
    type: string
  iccid:
    default: ''
    description: 'SIM identifier: Integrated Circuit Card IDentifier.https://en.wikipedia.org/wiki/SIM_card#ICCID'
    example: '8935201641404020569'
    type: string
  imei:
    default: ''
    description: 'International mobile equipment identity. 15 digits. Must be a valid
      IMEI as per: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity#Check_digit_computation'
    example: '353386066783073'
    type: string
  message_id:
    description: The message unique identifier
    format: uuid
    type: string
  message_type:
    default: ieu.device
    description: The message type
    type: string
  model:
    default: ''
    description: Device model
    example: T10PL7201
    type: string
  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:
    description: The source type of the message received by the service
    type: string
  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
  type:
    description: Type of device. Messages sent by this device will be harmonised with
      this value as 'source_type'
    nullable: true
    type: string
required:
- device_id
- external_id
- message_id
- message_type
- source_id
- source_type
- tenant_id
- time
title: ieu.device
type: object
Python Code
from __future__ import annotations

from typing import Optional
from uuid import UUID

from pydantic import AwareDatetime, BaseModel, Field


class IeuDevice(BaseModel):
    firmware: Optional[str] = Field(
        '',
        description="Device firmware version. Will appear in device's status",
        examples=['6.00.043_hfe'],
    )
    configuration: Optional[str] = Field(
        '',
        description="Device configuration. Will appear in device's status",
        examples=['59284'],
    )
    external_id: str = Field(
        ...,
        description="Identifier used by the device when it communicates with us. For example tm8's serial number is how tm8 identifies its devices with IEU. Is unique per 'type' of source.",
        examples=['358636083051333'],
    )
    type: Optional[str] = Field(
        None,
        description="Type of device. Messages sent by this device will be harmonised with this value as 'source_type'",
    )
    model: Optional[str] = Field('', description='Device model', examples=['T10PL7201'])
    imei: Optional[str] = Field(
        '',
        description='International mobile equipment identity. 15 digits. Must be a valid IMEI as per: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity#Check_digit_computation',
        examples=['353386066783073'],
    )
    iccid: Optional[str] = Field(
        '',
        description='SIM identifier: Integrated Circuit Card IDentifier.https://en.wikipedia.org/wiki/SIM_card#ICCID',
        examples=['8935201641404020569'],
    )
    carrier: Optional[str] = Field(
        '', description='Mobile Network Operator', examples=['PT']
    )
    allowed: Optional[bool] = Field(
        False,
        description='Is the platform allowing incoming messages from this device?',
    )
    data_provider: Optional[str] = Field(
        None,
        description='Name of the provider of the data, a third party such as TM8 or BMW.',
        examples=['bmw'],
    )
    created: Optional[AwareDatetime] = Field(
        None,
        description='Time of the creation of this entity / first activity recorded',
        examples=['2020-05-22T10:30:55+00:00'],
    )
    time: AwareDatetime = Field(
        ..., description='Time of the message', examples=['2020-05-22T10:30:55+00:00']
    )
    first_connected: Optional[AwareDatetime] = Field(
        None,
        description='First time this device was connected on the platform',
        examples=['2020-05-22T10:30:55+00:00'],
    )
    device_id: UUID = Field(
        ...,
        description='Unique identifier of the Device',
        examples=['2CB26F5A-9EF2-4530-8B02-A93DFE63F6CC'],
    )
    source_id: str = Field(
        ..., description='The source unique identifier. Entity id in this case.'
    )
    tenant_id: str = Field(..., description='The tenant/club for this message')
    source_type: str = Field(
        ..., description='The source type of the message received by the service'
    )
    message_id: UUID = Field(..., description='The message unique identifier')
    message_type: str = Field(..., description='The message type')
    source_message_type: Optional[str] = Field(
        None, description='The type of message sent by the source'
    )
AVRO Schema
{
  "type": "record",
  "name": "document",
  "namespace": "ieu.device",
  "fields": [
    {
      "name": "firmware",
      "type": [
        "null",
        "string"
      ],
      "doc": "Device firmware version. Will appear in device's status"
    },
    {
      "name": "configuration",
      "type": [
        "null",
        "string"
      ],
      "doc": "Device configuration. Will appear in device's status"
    },
    {
      "name": "external_id",
      "type": "string",
      "doc": "Identifier used by the device when it communicates with us. For example tm8's serial number is how tm8 identifies its devices with IEU. Is unique per 'type' of source."
    },
    {
      "name": "type",
      "type": [
        "null",
        "string"
      ],
      "doc": "Type of device. Messages sent by this device will be harmonised with this value as 'source_type'"
    },
    {
      "name": "model",
      "type": [
        "null",
        "string"
      ],
      "doc": "Device model"
    },
    {
      "name": "imei",
      "type": [
        "null",
        "string"
      ],
      "doc": "International mobile equipment identity. 15 digits. Must be a valid IMEI as per: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity#Check_digit_computation"
    },
    {
      "name": "iccid",
      "type": [
        "null",
        "string"
      ],
      "doc": "SIM identifier: Integrated Circuit Card IDentifier.https://en.wikipedia.org/wiki/SIM_card#ICCID"
    },
    {
      "name": "carrier",
      "type": [
        "null",
        "string"
      ],
      "doc": "Mobile Network Operator"
    },
    {
      "name": "allowed",
      "type": [
        "null",
        "boolean"
      ],
      "doc": "Is the platform allowing incoming messages from this device?"
    },
    {
      "name": "data_provider",
      "type": [
        "null",
        "string"
      ],
      "doc": "Name of the provider of the data, a third party such as TM8 or BMW."
    },
    {
      "name": "created",
      "type": [
        "null",
        "int"
      ],
      "doc": "Time of the creation of this entity / first activity recorded"
    },
    {
      "name": "time",
      "type": "int",
      "doc": "Time of the message"
    },
    {
      "name": "first_connected",
      "type": [
        "null",
        "int"
      ],
      "doc": "First time this device was connected on the platform"
    },
    {
      "name": "device_id",
      "type": "string",
      "doc": "Unique identifier of the Device"
    },
    {
      "name": "source_id",
      "type": "string",
      "doc": "The source unique identifier. Entity id in this case."
    },
    {
      "name": "tenant_id",
      "type": "string",
      "doc": "The tenant/club for this message"
    },
    {
      "name": "source_type",
      "type": "string",
      "doc": "The source type of the message received by the service"
    },
    {
      "name": "message_id",
      "type": "string",
      "doc": "The message unique identifier"
    },
    {
      "name": "message_type",
      "type": "string",
      "default": "ieu.device",
      "doc": "The message type"
    },
    {
      "name": "source_message_type",
      "type": [
        "null",
        "string"
      ],
      "doc": "The type of message sent by the source"
    }
  ]
}