forked from viamrobotics/viam-flutter-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneric.dart
25 lines (22 loc) · 1019 Bytes
/
generic.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
/// {@category Viam SDK}
/// Generic represents a generic component that executes doCommand.
///
/// For more information, see [Generic component](https://docs.viam.com/components/generic/).
abstract class Generic extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'generic');
/// Get the [ResourceName] for this [Generic] with the given [name]
///
/// For more information, see [Generic component](https://docs.viam.com/components/generic/).
static ResourceName getResourceName(String name) {
return Generic.subtype.getResourceName(name);
}
/// Get the [Generic] named [name] from the provided robot.
///
/// For more information, see [Generic component](https://docs.viam.com/components/generic/).
static Generic fromRobot(RobotClient robot, String name) {
return robot.getResource(Generic.getResourceName(name));
}
}