{
  "name": "Cloud Configuration",
  "status": "rc",
  "shortId": "cloudconfiguration",
  "camelName": "cloudConfiguration",
  "shortName": "cloudConfiguration",
  "extends": [
    "_base"
  ],
  "notes": {
    "short": "Connection and diagnostics information about the cloud connection."
  },
  "classIdentifier": 342028028,
  "enums": {
    "ConnectionStatus": {
      "name": "ConnectionStatus",
      "storage": 2,
      "members": {
        "Connected": 1,
        "Disconnected": 2,
        "Connecting": 3,
        "Disconnecting": 4
      }
    }
  },
  "constants": {},
  "packets": [
    {
      "kind": "report",
      "name": "command_not_implemented",
      "identifier": 3,
      "description": "This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.",
      "fields": [
        {
          "name": "service_command",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "packet_crc",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "identifierName": "command_not_implemented",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "const",
      "name": "instance_name",
      "identifier": 265,
      "description": "A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "identifierName": "instance_name",
      "packFormat": "s",
      "derived": "_base"
    },
    {
      "kind": "ro",
      "name": "status_code",
      "identifier": 259,
      "description": "Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.",
      "fields": [
        {
          "name": "code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "vendor_code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "optional": true,
      "identifierName": "status_code",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "rw",
      "name": "client_variant",
      "identifier": 9,
      "description": "An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "identifierName": "client_variant",
      "packFormat": "s",
      "derived": "_base"
    },
    {
      "kind": "event",
      "name": "status_code_changed",
      "identifier": 4,
      "description": "Notifies that the status code of the service changed.",
      "fields": [
        {
          "name": "code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "vendor_code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "optional": true,
      "identifierName": "status_code_changed",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "ro",
      "name": "server_name",
      "identifier": 384,
      "description": "Something like `my-iot-hub.azure-devices.net` if available.",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "packFormat": "s"
    },
    {
      "kind": "ro",
      "name": "cloud_device_id",
      "identifier": 385,
      "description": "Device identifier for the device in the cloud if available.",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "packFormat": "s"
    },
    {
      "kind": "const",
      "name": "cloud_type",
      "identifier": 387,
      "description": "Cloud provider identifier.",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "packFormat": "s"
    },
    {
      "kind": "ro",
      "name": "connection_status",
      "identifier": 386,
      "description": "Indicates the status of connection. A message beyond the [0..3] range represents an HTTP error code.",
      "fields": [
        {
          "name": "_",
          "type": "ConnectionStatus",
          "storage": 2
        }
      ],
      "packFormat": "u16"
    },
    {
      "kind": "rw",
      "name": "push_period",
      "identifier": 128,
      "description": "How often to push data to the cloud.",
      "fields": [
        {
          "name": "_",
          "unit": "ms",
          "type": "u32",
          "storage": 4,
          "isSimpleType": true,
          "defaultValue": 5000
        }
      ],
      "packFormat": "u32"
    },
    {
      "kind": "rw",
      "name": "push_watchdog_period",
      "identifier": 129,
      "description": "If no message is published within given period, the device resets.\nThis can be due to connectivity problems or due to the device having nothing to publish.\nForced to be at least `2 * flush_period`.\nSet to `0` to disable (default).",
      "fields": [
        {
          "name": "_",
          "unit": "ms",
          "type": "u32",
          "storage": 4,
          "isSimpleType": true
        }
      ],
      "packFormat": "u32"
    },
    {
      "kind": "command",
      "name": "connect",
      "identifier": 129,
      "description": "Starts a connection to the cloud service",
      "fields": [],
      "restricted": true
    },
    {
      "kind": "command",
      "name": "disconnect",
      "identifier": 130,
      "description": "Starts disconnecting from the cloud service",
      "fields": [],
      "restricted": true
    },
    {
      "kind": "command",
      "name": "set_connection_string",
      "identifier": 134,
      "description": "Restricted command to override the existing connection string to cloud.",
      "fields": [
        {
          "name": "connection_string",
          "type": "string",
          "storage": 0
        }
      ],
      "restricted": true,
      "packFormat": "s"
    },
    {
      "kind": "event",
      "name": "connection_status_change",
      "identifier": 3,
      "description": "Raised when the connection status changes",
      "fields": [
        {
          "name": "connection_status",
          "type": "ConnectionStatus",
          "storage": 2
        }
      ],
      "identifierName": "change",
      "packFormat": "u16"
    },
    {
      "kind": "event",
      "name": "message_sent",
      "identifier": 128,
      "description": "Raised when a message has been sent to the hub.",
      "fields": []
    }
  ],
  "tags": [
    "management"
  ],
  "group": "Iot"
}