{
  "properties": {
    "apiVersion": {
      "description": "apiVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "blocked": {
          "description": "If a device is blocked, connections or requests from this device will fail.",
          "type": "boolean"
        },
        "credentials": {
          "description": "The credentials used to authenticate this device.",
          "items": {
            "properties": {
              "expirationTime": {
                "description": "The time at which this credential becomes invalid.",
                "type": "string"
              },
              "publicKey": {
                "description": "A public key used to verify the signature of JSON Web Tokens (JWTs).",
                "properties": {
                  "format": {
                    "description": "The format of the key. Possible values: [\"RSA_PEM\", \"RSA_X509_PEM\", \"ES256_PEM\", \"ES256_X509_PEM\"].",
                    "type": "string"
                  },
                  "key": {
                    "description": "The key data.",
                    "type": "string"
                  }
                },
                "required": [
                  "format",
                  "key"
                ],
                "type": "object",
                "additionalProperties": false
              }
            },
            "required": [
              "publicKey"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "gatewayConfig": {
          "description": "Gateway-related configuration and state.",
          "properties": {
            "gatewayAuthMethod": {
              "description": "Indicates whether the device is a gateway. Possible values: [\"ASSOCIATION_ONLY\", \"DEVICE_AUTH_TOKEN_ONLY\", \"ASSOCIATION_AND_DEVICE_AUTH_TOKEN\"].",
              "type": "string"
            },
            "gatewayType": {
              "description": "Immutable. Indicates whether the device is a gateway. Default value: \"NON_GATEWAY\" Possible values: [\"GATEWAY\", \"NON_GATEWAY\"].",
              "type": "string"
            },
            "lastAccessedGatewayId": {
              "description": "The ID of the gateway the device accessed most recently.",
              "type": "string"
            },
            "lastAccessedGatewayTime": {
              "description": "The most recent time at which the device accessed the gateway specified in last_accessed_gateway.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "logLevel": {
          "description": "The logging verbosity for device activity. Possible values: [\"NONE\", \"ERROR\", \"INFO\", \"DEBUG\"].",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The metadata key-value pairs assigned to the device.",
          "type": "object"
        },
        "registry": {
          "description": "Immutable. The name of the device registry where this device should be created.",
          "type": "string"
        },
        "resourceID": {
          "description": "Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.",
          "type": "string"
        }
      },
      "required": [
        "registry"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observation of the resource's current state.",
          "items": {
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "type": "string"
              },
              "message": {
                "description": "Human-readable message indicating details about last transition.",
                "type": "string"
              },
              "reason": {
                "description": "Unique, one-word, CamelCase reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status is the status of the condition. Can be True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the condition.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "config": {
          "description": "The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.",
          "items": {
            "properties": {
              "binaryData": {
                "description": "The device configuration data.",
                "type": "string"
              },
              "cloudUpdateTime": {
                "description": "The time at which this configuration version was updated in Cloud IoT Core.",
                "type": "string"
              },
              "deviceAckTime": {
                "description": "The time at which Cloud IoT Core received the acknowledgment from the device,\nindicating that the device has received this configuration version.",
                "type": "string"
              },
              "version": {
                "description": "The version of this update.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "lastConfigAckTime": {
          "description": "The last time a cloud-to-device config version acknowledgment was received from the device.",
          "type": "string"
        },
        "lastConfigSendTime": {
          "description": "The last time a cloud-to-device config version was sent to the device.",
          "type": "string"
        },
        "lastErrorStatus": {
          "description": "The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.",
          "items": {
            "properties": {
              "details": {
                "description": "A list of messages that carry the error details.",
                "items": {
                  "type": "object",
                  "x-kubernetes-preserve-unknown-fields": true
                },
                "type": "array"
              },
              "message": {
                "description": "A developer-facing error message, which should be in English.",
                "type": "string"
              },
              "number": {
                "description": "The status code, which should be an enum value of google.rpc.Code.",
                "type": "integer"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "lastErrorTime": {
          "description": "The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.",
          "type": "string"
        },
        "lastEventTime": {
          "description": "The last time a telemetry event was received.",
          "type": "string"
        },
        "lastHeartbeatTime": {
          "description": "The last time an MQTT PINGREQ was received.",
          "type": "string"
        },
        "lastStateTime": {
          "description": "The last time a state event was received.",
          "type": "string"
        },
        "numId": {
          "description": "A server-defined unique numeric ID for the device.\nThis is a more compact way to identify devices, and it is globally unique.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.",
          "type": "integer"
        },
        "state": {
          "description": "The state most recently received from the device.",
          "items": {
            "properties": {
              "binaryData": {
                "description": "The device state data.",
                "type": "string"
              },
              "updateTime": {
                "description": "The time at which this state version was updated in Cloud IoT Core.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
