Device.fromJson constructor

Device.fromJson(
  1. Map json_
)

Implementation

Device.fromJson(core.Map json_)
    : this(
        attributes: json_.containsKey('attributes')
            ? json_['attributes'] as core.Map<core.String, core.dynamic>
            : null,
        customData: json_.containsKey('customData')
            ? json_['customData'] as core.Map<core.String, core.dynamic>
            : null,
        deviceInfo: json_.containsKey('deviceInfo')
            ? DeviceInfo.fromJson(
                json_['deviceInfo'] as core.Map<core.String, core.dynamic>)
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        name: json_.containsKey('name')
            ? DeviceNames.fromJson(
                json_['name'] as core.Map<core.String, core.dynamic>)
            : null,
        notificationSupportedByAgent:
            json_.containsKey('notificationSupportedByAgent')
                ? json_['notificationSupportedByAgent'] as core.bool
                : null,
        otherDeviceIds: json_.containsKey('otherDeviceIds')
            ? (json_['otherDeviceIds'] as core.List)
                .map((value) => AgentOtherDeviceId.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        roomHint: json_.containsKey('roomHint')
            ? json_['roomHint'] as core.String
            : null,
        structureHint: json_.containsKey('structureHint')
            ? json_['structureHint'] as core.String
            : null,
        traits: json_.containsKey('traits')
            ? (json_['traits'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        type: json_.containsKey('type') ? json_['type'] as core.String : null,
        willReportState: json_.containsKey('willReportState')
            ? json_['willReportState'] as core.bool
            : null,
      );