PayloadDevice

Struct PayloadDevice 

Source
pub struct PayloadDevice {
    pub id: String,
    pub device_type: Type,
    pub traits: Vec<Trait>,
    pub name: PayloadDeviceName,
    pub will_report_state: bool,
    pub notification_supported_by_agent: bool,
    pub room_hint: Option<String>,
    pub device_info: Option<PayloadDeviceInfo>,
    pub attributes: Attributes,
    pub custom_data: Option<Map<String, Value>>,
    pub other_device_ids: Option<Vec<PayloadOtherDeviceID>>,
}
Expand description

Device execution result.

Fields§

§id: String

The ID of the device in the developer’s cloud. This must be unique for the user and for the developer, as in cases of sharing we may use this to dedupe multiple views of the same device. It should be immutable for the device; if it changes, the Assistant will treat it as a new device.

§device_type: Type

The hardware type of device.

§traits: Vec<Trait>

List of traits this device has. This defines the commands, attributes, and states that the device supports.

§name: PayloadDeviceName

Names of this device.

§will_report_state: bool

Indicates whether this device will have its states updated by the Real Time Feed. true to use the Real Time Feed for reporting state, and false to use the polling model.

§notification_supported_by_agent: bool

Indicates whether notifications are enabled for the device.

§room_hint: Option<String>

Provides the current room of the device in the user’s home to simplify setup.

§device_info: Option<PayloadDeviceInfo>

Contains fields describing the device for use in one-off logic if needed (e.g. ‘broken firmware version X of light Y requires adjusting color’, or ‘security flaw requires notifying all users of firmware Z’).

§attributes: Attributes

Aligned with per-trait attributes described in each trait schema reference.

§custom_data: Option<Map<String, Value>>

Object defined by the developer which will be attached to future QUERY and EXECUTE requests, maximum of 512 bytes per device. Use this object to store additional information about the device your cloud service may need, such as the global region of the device. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.

§other_device_ids: Option<Vec<PayloadOtherDeviceID>>

List of alternate IDs used to identify a cloud synced device for local execution.

Trait Implementations§

Source§

impl Clone for PayloadDevice

Source§

fn clone(&self) -> PayloadDevice

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PayloadDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PayloadDevice

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PayloadDevice

Source§

fn eq(&self, other: &PayloadDevice) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PayloadDevice

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PayloadDevice

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,