pub struct CreateEntityRequest {
pub channel_index: Option<i32>,
pub device_id: String,
pub entity_type: String,
pub external_id: Option<String>,
pub metadata: Option<Map<String, Value>>,
pub name: Option<String>,
pub zone_id: Option<String>,
}Expand description
CreateEntityRequest
JSON schema
{
"type": "object",
"required": [
"device_id",
"entity_type"
],
"properties": {
"channel_index": {
"type": [
"integer",
"null"
],
"format": "int32"
},
"device_id": {
"type": "string"
},
"entity_type": {
"type": "string"
},
"external_id": {
"type": [
"string",
"null"
]
},
"metadata": {
"description": "Arbitrary, persisted entity metadata (integration-specific).\n\nFor example, MQTT entities can store:\n- `command_topic`\n- `toggle_payload`\n\nValues are converted to strings (non-strings are JSON-stringified) to match `domain::Metadata`.",
"type": [
"object",
"null"
],
"additionalProperties": {}
},
"name": {
"description": "Optional friendly name for the entity.",
"type": [
"string",
"null"
]
},
"zone_id": {
"type": [
"string",
"null"
]
}
}
}Fields§
§channel_index: Option<i32>§device_id: String§entity_type: String§external_id: Option<String>§metadata: Option<Map<String, Value>>Arbitrary, persisted entity metadata (integration-specific).
For example, MQTT entities can store:
- `command_topic`
- `toggle_payload`
Values are converted to strings (non-strings are JSON-stringified) to match `domain::Metadata`.name: Option<String>Optional friendly name for the entity.
zone_id: Option<String>Trait Implementations§
Source§impl Clone for CreateEntityRequest
impl Clone for CreateEntityRequest
Source§fn clone(&self) -> CreateEntityRequest
fn clone(&self) -> CreateEntityRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateEntityRequest
impl Debug for CreateEntityRequest
Source§impl<'de> Deserialize<'de> for CreateEntityRequest
impl<'de> Deserialize<'de> for CreateEntityRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CreateEntityRequest
impl RefUnwindSafe for CreateEntityRequest
impl Send for CreateEntityRequest
impl Sync for CreateEntityRequest
impl Unpin for CreateEntityRequest
impl UnsafeUnpin for CreateEntityRequest
impl UnwindSafe for CreateEntityRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more