Subtype.fromResourceName constructor

Subtype.fromResourceName(
  1. ResourceName name
)

Create a new Subtype from a ResourceName

// Example, creating a Sensor from a resource named "mySensor":
var mySensor = Sensor.fromResourceName('mySensor');

Implementation

Subtype.fromResourceName(ResourceName name)
    : namespace = name.namespace,
      resourceType = name.type,
      resourceSubtype = name.subtype;