BehaviorInstance class

API to manage instances of script.

Inheritance

Constructors

BehaviorInstance({required ResourceType type, required String id, String idV1 = "", required String scriptId, required bool isEnabled, required Map<String, dynamic> state, required Map<String, dynamic> configuration, required List<BehaviorInstanceDependee> dependees, required String status, required String lastError, required String name, required String migratedFrom, Map<String, dynamic>? trigger})
Creates a BehaviorInstance object.
BehaviorInstance.empty()
Creates an empty BehaviorInstance object.
BehaviorInstance.fromJson(Map<String, dynamic> dataMap)
Creates a BehaviorInstance object from the JSON response to a GET request.
factory

Properties

bridge Bridge?
The bridge that this resource is associated with.
getter/setter pairinherited
configuration Map<String, dynamic>
Script configuration.
getter/setter pair
dependees List<BehaviorInstanceDependee>
Represents all resources which this instance depends on.
final
hashCode int
The hash code for this object.
no setteroverride
hueNetwork HueNetwork?
The HueNetwork that this resource is associated with.
getter/setter pairinherited
id String
Unique identifier representing a specific resource instance.
finalinherited
idV1 String
Clip v1 resource identifier.
final
isEnabled bool
Whether or not this script is enabled.
getter/setter pair
lastError String
The last error that happened while executing this script.
final
migratedFrom String
Clip v1 resource identifier.
getter/setter pair
name String
Human readable name of a resource.
getter/setter pair
originalType ResourceType
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scriptId String
Identifier to ScriptDefinition.
getter/setter pair
state Map<String, dynamic>
Script instance state.
final
status String
Script status.
final
targetsAsResources List<Resource>
Returns a list of the targets as Resource objects.
no setter
trigger Map<String, dynamic>?
Action that needs to be taken by this script instance.
getter/setter pair
type ResourceType
Type of the supported resource.
getter/setter pairinherited

Methods

copyWith({ResourceType? type, String? id, String? idV1, String? scriptId, bool? isEnabled, Map<String, dynamic>? state, Map<String, dynamic>? configuration, List<BehaviorInstanceDependee>? dependees, String? status, String? lastError, String? name, String? migratedFrom, Map<String, dynamic>? trigger = const {}, bool copyOriginalValues = true}) BehaviorInstance
Returns a copy of this object with its field values replaced by the ones provided to this method.
getRelativeAsResource(Relative relative) Resource
Returns a Resource object that represents the relative of this Resource.
inherited
getRelativesAsResources(List<Relative> relatives) List<Resource>
Returns a list of Resource objects that represent the relatives of this Resource.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshOriginals() → void
Called after a successful PUT request, this method refreshed the "original" data in this object.
override
toJson({OptimizeFor optimizeFor = OptimizeFor.put}) Map<String, dynamic>
Converts this object into JSON format.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override