Skip to content

Commit

Permalink
RSDK-9636: Add deprecation warning with date the Discover Components …
Browse files Browse the repository at this point in the history
…will be deprecated to the flutter SDK (#331)

* add deprecation warnings to flutter sdk

* also deprecate DiscoveryQuery

* fix warning log
  • Loading branch information
martha-johnston authored Jan 27, 2025
1 parent 010db72 commit b41d9ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/robot/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class RobotClientOptions {

/// {@category Viam SDK}
/// Represents a discovery query in the SDK to query for discoverable components.
///
/// deprecated, remove on march 10th
class DiscoveryQuery {
final String subtype;
final String model;
Expand Down Expand Up @@ -334,6 +336,8 @@ class RobotClient {
return await _client.getCloudMetadata(rpb.GetCloudMetadataRequest());
}

/// Deprecated: use the Discovery Service APIs instead.
///
/// Discover components that the robot can connect to, given specific query metadata.
///
/// ```
Expand All @@ -347,6 +351,7 @@ class RobotClient {
..model = sdkQuery.model
..extra = sdkQuery.extraStruct));

_logger.w("RobotClient.discoverComponents is deprecated. It will be removed on March 10 2025. Use the DiscoveryService APIs instead.");
final response = await _client.discoverComponents(request);
return response.discovery.map((d) => Discovery.fromProto(d)).toList();
}
Expand Down

0 comments on commit b41d9ce

Please sign in to comment.