diff --git a/lib/src/app/app.dart b/lib/src/app/app.dart index 2b5de1d51f5..dc48ac78470 100644 --- a/lib/src/app/app.dart +++ b/lib/src/app/app.dart @@ -12,12 +12,16 @@ typedef RobotPartLogPage = GetRobotPartLogsResponse; /// gRPC client for connecting to Viam's App Service /// /// All calls must be authenticated. +/// +/// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). class AppClient { final AppServiceClient _client; AppClient(this._client); /// Get the id of the user with the email provided + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getUserIdByEmail(String email) async { final request = GetUserIDByEmailRequest()..email = email; final GetUserIDByEmailResponse response = await _client.getUserIDByEmail(request); @@ -25,6 +29,8 @@ class AppClient { } /// Create a new [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createOrganization(String name) async { Future createOrganization(String name) async { final request = CreateOrganizationRequest()..name = name; final CreateOrganizationResponse response = await _client.createOrganization(request); @@ -32,6 +38,8 @@ class AppClient { } /// List all the [Organization] the currently authenticated user has access to + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listOrganizations() async { final listOrganizationsRequest = ListOrganizationsRequest(); final ListOrganizationsResponse response = await _client.listOrganizations(listOrganizationsRequest); @@ -39,6 +47,8 @@ class AppClient { } /// Get all [OrganizationIdentity]s that have access to a [Location]. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> getOrganizationsWithAccessToLocation(String locationId) async { final request = GetOrganizationsWithAccessToLocationRequest()..locationId = locationId; final GetOrganizationsWithAccessToLocationResponse response = await _client.getOrganizationsWithAccessToLocation(request); @@ -46,6 +56,8 @@ class AppClient { } /// List the [Organization]s a user belongs to + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listOrganizationsByUser(String userId) async { final request = ListOrganizationsByUserRequest()..userId = userId; final ListOrganizationsByUserResponse response = await _client.listOrganizationsByUser(request); @@ -53,6 +65,8 @@ class AppClient { } /// Get a specific [Organization] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getOrganization(String organizationId) async { final getOrganizationRequest = GetOrganizationRequest()..organizationId = organizationId; final GetOrganizationResponse response = await _client.getOrganization(getOrganizationRequest); @@ -60,6 +74,8 @@ class AppClient { } /// Checks for namespace availablity throughout all [Organization]s. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getOrganizationNamespaceAvailability(String publicNamespace) async { final request = GetOrganizationNamespaceAvailabilityRequest()..publicNamespace = publicNamespace; final GetOrganizationNamespaceAvailabilityResponse response = await _client.getOrganizationNamespaceAvailability(request); @@ -67,6 +83,8 @@ class AppClient { } /// Update an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateOrganization(String organizationId, {String? name, String? publicNamespace, String? region, String? cid}) async { final request = UpdateOrganizationRequest()..organizationId = organizationId; @@ -79,12 +97,16 @@ class AppClient { } /// Delete an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteOrganization(String organizationId) async { final request = DeleteOrganizationRequest()..organizationId = organizationId; await _client.deleteOrganization(request); } /// List the members and pending invites for an [Organization]. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future listOrganizationMembers(String organizationId) async { final request = ListOrganizationMembersRequest()..organizationId = organizationId; final ListOrganizationMembersResponse response = await _client.listOrganizationMembers(request); @@ -92,6 +114,8 @@ class AppClient { } /// Send an invitation to to join an [Organization] to the specified email. Grant the level of permission defined in the [ViamAuthorization] object attached. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createOrganizationInvite(String organizationId, String email, List authorizations, {bool sendEmailInvite = true}) async { final List protoAuthorizations = []; @@ -108,6 +132,8 @@ class AppClient { } /// Update the [ViamAuthorization]s attached to an [Organization] invite + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateOrganizationInviteAuthorizations( String organizationId, String email, List addAuthorizations, List removeAuthorizations) async { final List protoAddAuthorizations = []; @@ -129,6 +155,8 @@ class AppClient { } /// Delete a member from an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteOrganizationMember(String organizationId, String userId) async { final request = DeleteOrganizationMemberRequest() ..organizationId = organizationId @@ -137,6 +165,8 @@ class AppClient { } /// Delete an invite to an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteOrganizationInvite(String organizationId, String email) async { final request = DeleteOrganizationInviteRequest() ..organizationId = organizationId @@ -145,6 +175,8 @@ class AppClient { } /// Resend an invite to an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future resendOrganizationInvite(String organizationId, String email) async { final request = ResendOrganizationInviteRequest() ..organizationId = organizationId @@ -154,6 +186,8 @@ class AppClient { } /// Create a [Location] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createLocation(String organizationId, String name, {String? parentLocationId}) async { final request = CreateLocationRequest() ..organizationId = organizationId @@ -164,6 +198,8 @@ class AppClient { } /// Get a specific [Location] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getLocation(String locationId) async { final getLocationRequest = GetLocationRequest()..locationId = locationId; final GetLocationResponse response = await _client.getLocation(getLocationRequest); @@ -171,6 +207,8 @@ class AppClient { } /// Update a [Location] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateLocation(String locationId, {String? name, String? parentLocationId, String? region}) async { final request = UpdateLocationRequest()..locationId = locationId; if (name != null) request.name = name; @@ -181,12 +219,16 @@ class AppClient { } /// Delete a [Location] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteLocation(String locationId) async { final request = DeleteLocationRequest()..locationId = locationId; await _client.deleteLocation(request); } /// List the [Location]s of a specific [Organization] that the currently authenticated user has access to + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listLocations(String organizationId) async { final listLocationsRequest = ListLocationsRequest()..organizationId = organizationId; final ListLocationsResponse response = await _client.listLocations(listLocationsRequest); @@ -194,6 +236,8 @@ class AppClient { } /// Share a [Location] with an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future shareLocation(String locationId, String organizationId) async { final request = ShareLocationRequest() ..locationId = locationId @@ -202,6 +246,8 @@ class AppClient { } /// Stop sharing a [Location] with an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future unshareLocation(String locationId, String organizationId) async { final request = UnshareLocationRequest() ..locationId = locationId @@ -210,6 +256,8 @@ class AppClient { } /// Get a [LocationAuth] with a [Location]'s authorization secrets + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future locationAuth(String locationId) async { final request = LocationAuthRequest()..locationId = locationId; final LocationAuthResponse response = await _client.locationAuth(request); @@ -217,6 +265,8 @@ class AppClient { } /// Create a new generated [LocationAuth] in the [Location]. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createLocationSecret(String locationId) async { final request = CreateLocationSecretRequest()..locationId = locationId; final CreateLocationSecretResponse response = await _client.createLocationSecret(request); @@ -224,6 +274,8 @@ class AppClient { } /// Delete a Secret from the [Location]. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteLocationSecret(String locationId, String secretId) async { final request = DeleteLocationSecretRequest() ..locationId = locationId @@ -232,6 +284,8 @@ class AppClient { } /// Get a specific [Robot] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getRobot(String robotId) async { final getRobotRequest = GetRobotRequest()..id = robotId; final GetRobotResponse response = await _client.getRobot(getRobotRequest); @@ -239,6 +293,8 @@ class AppClient { } /// Get [RoverRentalRobot]s in an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> getRoverRentalRobots(String orgId) async { final request = GetRoverRentalRobotsRequest()..orgId = orgId; final GetRoverRentalRobotsResponse response = await _client.getRoverRentalRobots(request); @@ -246,6 +302,8 @@ class AppClient { } /// List the [RobotPart] of a specific [Robot] that the currently authenticated user has access to + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listRobotParts(String robotId) async { final getRobotPartsRequest = GetRobotPartsRequest()..robotId = robotId; final response = await _client.getRobotParts(getRobotPartsRequest); @@ -253,6 +311,8 @@ class AppClient { } /// Get a specific [RobotPart] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getRobotPart(String partId) async { final getRobotPartRequest = GetRobotPartRequest()..id = partId; final response = await _client.getRobotPart(getRobotPartRequest); @@ -260,6 +320,8 @@ class AppClient { } /// Get a page of [LogEntry] for a specific [RobotPart]. Logs are sorted by descending time (newest first) + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getLogs(String partId, {String? filter, String? pageToken}) async { final request = GetRobotPartLogsRequest() ..id = partId @@ -269,6 +331,8 @@ class AppClient { } /// Get a stream of [LogEntry] for a specific [RobotPart]. Logs are sorted by descending time (newest first) + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Stream> tailLogs(String partId, {bool errorsOnly = false, String? filter}) { final request = TailRobotPartLogsRequest() ..id = partId @@ -280,6 +344,8 @@ class AppClient { } /// Get a specific [RobotPart] history by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> getRobotPartHistory(String id) async { final request = GetRobotPartHistoryRequest()..id = id; final GetRobotPartHistoryResponse response = await _client.getRobotPartHistory(request); @@ -287,6 +353,8 @@ class AppClient { } /// Update a specific [RobotPart] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateRobotPart(String partId, String name, Map robotConfig) async { final updateRobotPartRequest = UpdateRobotPartRequest() ..id = partId @@ -297,6 +365,8 @@ class AppClient { } /// Create a new [RobotPart] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future newRobotPart(String robotId, String partName) async { final request = NewRobotPartRequest() ..robotId = robotId @@ -306,12 +376,16 @@ class AppClient { } /// Delete a [RobotPart] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteRobotPart(String partId) async { final request = DeleteRobotPartRequest()..partId = partId; await _client.deleteRobotPart(request); } /// Gets the [APIKey]'s for a [Robot] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> getRobotApiKeys(String robotId) async { final request = GetRobotAPIKeysRequest()..robotId = robotId; final GetRobotAPIKeysResponse response = await _client.getRobotAPIKeys(request); @@ -319,6 +393,8 @@ class AppClient { } /// Marks the given [RobotPart] as the main part, and all the others as not + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future markPartAsMain(String partId) async { final request = MarkPartAsMainRequest()..partId = partId; await _client.markPartAsMain(request); @@ -326,12 +402,16 @@ class AppClient { /// Marks [RobotPart] for restart. Once the [RobotPart] checks-in with the app the flag is reset on the [RobotPart]. Calling this multiple times before a [RobotPart] checks-in has no affect. /// Note: This API may be removed in the near future. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future markPartForRestart(String partId) async { final request = MarkPartForRestartRequest()..partId = partId; await _client.markPartForRestart(request); } /// Create a new generated Secret in the [RobotPart]. Succeeds if there are no more than 2 active secrets after creation. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createRobotPartSecret(String partId) async { final request = CreateRobotPartSecretRequest()..partId = partId; final CreateRobotPartSecretResponse response = await _client.createRobotPartSecret(request); @@ -339,6 +419,8 @@ class AppClient { } /// Delete a Secret from the [RobotPart]. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteRobotPartSecret(String partId, String secretId) async { final request = DeleteRobotPartSecretRequest() ..partId = partId @@ -347,6 +429,8 @@ class AppClient { } /// List the [Robot] of a specific [Location] that the currently authenticated user has access to + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listRobots(String locationId) async { final listRobotsRequest = ListRobotsRequest()..locationId = locationId; final ListRobotsResponse response = await _client.listRobots(listRobotsRequest); @@ -354,6 +438,8 @@ class AppClient { } /// Create a new smart machine with the included [name] in the passed in [locationId] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future newMachine(String name, String locationId) async { final request = NewRobotRequest() ..name = name @@ -363,6 +449,8 @@ class AppClient { } /// Update a [Robot] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateRobot(String id, String name, String location) async { final request = UpdateRobotRequest() ..id = id @@ -373,12 +461,16 @@ class AppClient { } /// Delete a [Robot] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteRobot(String id) async { final request = DeleteRobotRequest()..id = id; await _client.deleteRobot(request); } /// Get a list of [Fragment]s in an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listFragments(String organizationId, bool showPublic) async { final request = ListFragmentsRequest() ..organizationId = organizationId @@ -388,6 +480,8 @@ class AppClient { } /// Get a specific [Fragment] by ID. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getFragment(String id) async { final request = GetFragmentRequest()..id = id; final response = await _client.getFragment(request); @@ -395,6 +489,8 @@ class AppClient { } /// Create a [Fragment] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createFragment(String name, Map config, String organizationId) async { final request = CreateFragmentRequest() ..name = name @@ -405,6 +501,8 @@ class AppClient { } /// Update a [Fragment] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateFragment(String id, String name, Map config, {bool? public}) async { final request = UpdateFragmentRequest() ..id = id @@ -416,24 +514,32 @@ class AppClient { } /// Delete a [Fragment] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteFragment(String id) async { final request = DeleteFragmentRequest()..id = id; await _client.deleteFragment(request); } /// Creates an [Authorization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future addRole(ViamAuthorization authorization) async { final request = AddRoleRequest()..authorization = authorization.toProto; await _client.addRole(request); } /// Deletes an [Authorization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future removeRole(ViamAuthorization authorization) async { final request = RemoveRoleRequest()..authorization = authorization.toProto; await _client.removeRole(request); } /// Changes an [Authorization] to a new [Authorization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future changeRole(ViamAuthorization oldAuthorization, ViamAuthorization newAuthorization) async { final request = ChangeRoleRequest() ..oldAuthorization = oldAuthorization.toProto @@ -442,6 +548,8 @@ class AppClient { } /// List the [Authorization]s available for the currently authenticated user + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listAuthorizations(String organizationId, {List resourceIds = const []}) async { final request = ListAuthorizationsRequest() ..organizationId = organizationId @@ -451,6 +559,8 @@ class AppClient { } /// Validates a [Permission] for the current user + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> checkPermissions(ResourceType resourceType, String resourceId, List permissions) async { final request = CheckPermissionsRequest() ..permissions.add((AuthorizedPermissions() @@ -465,6 +575,8 @@ class AppClient { } /// Get a [RegistryItem] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getRegistryItem(String itemId) async { final request = GetRegistryItemRequest()..itemId = itemId; final GetRegistryItemResponse response = await _client.getRegistryItem(request); @@ -472,6 +584,8 @@ class AppClient { } /// Create a [RegistryItem] in an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createRegistryItem(String organizationId, String name, PackageType type) async { final request = CreateRegistryItemRequest() ..organizationId = organizationId @@ -481,6 +595,8 @@ class AppClient { } /// Update a [Registry Item] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateRegistryItem(String itemId, PackageType type, String description, Visibility visibility) async { final request = UpdateRegistryItemRequest() ..itemId = itemId @@ -491,6 +607,8 @@ class AppClient { } /// List [RegistryItem]s in an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listRegistryItems( List types, List visibilities, List platforms, List statuses, {String? organizationId, String? searchTerm, String? pageToken}) async { @@ -503,12 +621,16 @@ class AppClient { } /// Delete a [RegistryItem] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteRegistryItem(String itemId) async { final request = DeleteRegistryItemRequest()..itemId = itemId; await _client.deleteRegistryItem(request); } /// Create a [Module] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createModule(String organizationId, String name) async { final request = CreateModuleRequest() ..organizationId = organizationId @@ -517,6 +639,8 @@ class AppClient { } /// Update a [Module] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future updateModule( String moduleId, Visibility visibility, String url, String description, List models, String entrypoint) async { final request = UpdateModuleRequest(models: models) @@ -530,6 +654,8 @@ class AppClient { } /// Upload a [Module] file + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future uploadModuleFile(ModuleFileInfo moduleFileInfo, List file) async { final request = UploadModuleFileRequest() ..moduleFileInfo = moduleFileInfo @@ -539,6 +665,8 @@ class AppClient { } /// Get a [Module] by ID + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getModule(String moduleId) async { final request = GetModuleRequest()..moduleId = moduleId; final GetModuleResponse response = await _client.getModule(request); @@ -546,6 +674,8 @@ class AppClient { } /// List all the [Module]s. Return private modules for an [Organization] if its ID is provided. + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listModules(String? organizationId) async { final request = ListModulesRequest()..organizationId = organizationId ?? ''; final ListModulesResponse response = await _client.listModules(request); @@ -553,6 +683,8 @@ class AppClient { } /// Create an [APIKey] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createKey(List authorizations, String name) async { final List protoAuthorizations = []; for (final authorization in authorizations) { @@ -564,12 +696,16 @@ class AppClient { } /// Delete an [APIKey] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future deleteKey(String id) async { final request = DeleteKeyRequest()..id = id; await _client.deleteKey(request); } /// List the [APIKeyWithAuthorizations]s in an [Organization] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future> listKeys(String orgId) async { final request = ListKeysRequest()..orgId = orgId; final ListKeysResponse response = await _client.listKeys(request); @@ -577,12 +713,16 @@ class AppClient { } /// Rotate an [APIKey] + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future rotateKey(String id) async { final request = RotateKeyRequest()..id = id; return await _client.rotateKey(request); } /// Create an [APIKey] with existing authorizations + /// + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createKeyFromExistingKeyAuthorizations(String id) async { final request = CreateKeyFromExistingKeyAuthorizationsRequest()..id = id; return await _client.createKeyFromExistingKeyAuthorizations(request); diff --git a/lib/src/app/billing.dart b/lib/src/app/billing.dart index 74ca147330a..c722dd3ded3 100644 --- a/lib/src/app/billing.dart +++ b/lib/src/app/billing.dart @@ -5,30 +5,40 @@ import 'package:viam_sdk/protos/app/billing.dart'; /// gRPC client for connecting to Viam's Billing Service /// /// All calls must be authenticated. +/// +/// For more information, see [Billing Client API](https://docs.viam.com/appendix/apis/billing-client/). class BillingClient { final BillingServiceClient _client; BillingClient(this._client); /// Get a detailed breakdown of current month's costs + /// + /// For more information, see [Billing Client API](https://docs.viam.com/appendix/apis/billing-client/). Future getCurrentMonthUsage(String orgId) async { final request = GetCurrentMonthUsageRequest()..orgId = orgId; return await _client.getCurrentMonthUsage(request); } /// Org-level information (like billing email and payment details) + /// + /// For more information, see [Billing Client API](https://docs.viam.com/appendix/apis/billing-client/). Future getOrgBillingInformation(String orgId) async { final request = GetOrgBillingInformationRequest()..orgId = orgId; return await _client.getOrgBillingInformation(request); } /// Total outstanding balance and previous invoices + /// + /// For more information, see [Billing Client API](https://docs.viam.com/appendix/apis/billing-client/). Future getInvoicesSummary(String orgId) async { final request = GetInvoicesSummaryRequest()..orgId = orgId; return await _client.getInvoicesSummary(request); } /// Download a PDF invoice + /// + /// For more information, see [Billing Client API](https://docs.viam.com/appendix/apis/billing-client/). Stream> getInvoicePdf(String orgId, String id) { final request = GetInvoicePdfRequest() ..id = id diff --git a/lib/src/app/data.dart b/lib/src/app/data.dart index b858392c750..b9952c86da3 100644 --- a/lib/src/app/data.dart +++ b/lib/src/app/data.dart @@ -19,6 +19,8 @@ typedef DatabaseConnection = GetDatabaseConnectionResponse; /// gRPC client used for retrieving, uploading, and modifying stored data from app.viam.com. /// /// All calls must be authenticated. +/// +/// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). class DataClient { final DataServiceClient _dataClient; final DataSyncServiceClient _dataSyncClient; @@ -43,6 +45,8 @@ class DataClient { /// Filter and download tabular data. The data will be paginated into pages of `limit` items, and the last ID will be included in /// the returned response. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future tabularDataByFilter( {Filter? filter, int? limit, Order? sortOrder, String? last, countOnly = false}) async { final dataRequest = _makeDataRequest(filter, limit, last, sortOrder); @@ -54,6 +58,8 @@ class DataClient { /// Filter and download binary data. The data will be paginated into pages of `limit` items, and the last ID will be included in the /// returned response. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future binaryDataByFilter( {Filter? filter, int? limit, Order? sortOrder, String? last, countOnly = false}) async { final dataRequest = _makeDataRequest(filter, limit, last, sortOrder); @@ -64,6 +70,8 @@ class DataClient { } /// Retrieve binary data by IDs + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future> binaryDataByIds(List binaryIds) async { final request = BinaryDataByIDsRequest()..binaryIds.addAll(binaryIds); final response = await _dataClient.binaryDataByIDs(request); @@ -71,6 +79,8 @@ class DataClient { } /// Obtain unified tabular data and metadata, queried with SQL. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future>> tabularDataBySql(String organizationId, String query) async { final request = TabularDataBySQLRequest() ..organizationId = organizationId @@ -80,6 +90,8 @@ class DataClient { } /// Obtain unified tabular data and metadata, queried with MQL. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future>> tabularDataByMql(String organizationId, List query) async { final request = TabularDataByMQLRequest() ..organizationId = organizationId @@ -91,6 +103,8 @@ class DataClient { /// Delete tabular data older than a provided number of days from an organization. /// /// Returns the number of pieces of data that were deleted. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future deleteTabularData(String organizationId, int olderThanDays) async { final request = DeleteTabularDataRequest() ..organizationId = organizationId @@ -103,6 +117,8 @@ class DataClient { /// If a [filter] is not provided, all data will be deleted. /// /// Returns the number of pieces of data that were deleted. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future deleteBinaryDataByFilter(Filter? filter, {bool includeInternalData = false}) async { final request = DeleteBinaryDataByFilterRequest() ..includeInternalData = includeInternalData @@ -114,6 +130,8 @@ class DataClient { /// Delete binary data based on data ID. /// /// Returns the number of pieces of data that were deleted. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future deleteBinaryDataByIds(List binaryIds) async { final request = DeleteBinaryDataByIDsRequest()..binaryIds.addAll(binaryIds); final response = await _dataClient.deleteBinaryDataByIDs(request); @@ -121,6 +139,8 @@ class DataClient { } /// Adds tags to binary data based on IDs. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future addTagsToBinaryDataByIds(List tags, List binaryIds) async { final request = AddTagsToBinaryDataByIDsRequest() ..tags.addAll(tags) @@ -130,6 +150,8 @@ class DataClient { /// Adds tags to binary data based on a filter. /// If no [filter] is provided, all binary data will be tagged. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future addTagsToBinaryDataByFilter(List tags, Filter? filter) async { final request = AddTagsToBinaryDataByFilterRequest() ..tags.addAll(tags) @@ -141,6 +163,8 @@ class DataClient { /// If a [filter] is not provided, the tags will be removed from all data. /// /// Returns the number of tags deleted. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future removeTagsFromBinaryDataByFilter(List tags, Filter? filter) async { final request = RemoveTagsFromBinaryDataByFilterRequest() ..tags.addAll(tags) @@ -152,6 +176,8 @@ class DataClient { /// Remove tags from binary data based on IDs. /// /// Returns the number of tags deleted. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future removeTagsFromBinaryDataByIds(List tags, List binaryIds) async { final request = RemoveTagsFromBinaryDataByIDsRequest() ..tags.addAll(tags) @@ -163,6 +189,8 @@ class DataClient { /// Add a bounding box to an image by ID, with x and y coordinates normalized from 0 to 1. /// /// Returns the bounding box ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future addBoundingBoxToImageById( String label, BinaryID binaryId, double xMinNormalized, double yMinNormalized, double xMaxNormalized, double yMaxNormalized) async { final request = AddBoundingBoxToImageByIDRequest() @@ -177,6 +205,8 @@ class DataClient { } /// Removes a bounding box from an image based on bbox ID and image ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future removeBoundingBoxFromImageById(String bboxId, BinaryID binaryId) async { final request = RemoveBoundingBoxFromImageByIDRequest() ..bboxId = bboxId @@ -186,6 +216,8 @@ class DataClient { /// Returns a list of tags based on a filter. /// If no [filter] is provided, all tags will be returned. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future> tagsByFilter(Filter? filter) async { final request = TagsByFilterRequest()..filter = filter ?? Filter(); final response = await _dataClient.tagsByFilter(request); @@ -194,6 +226,8 @@ class DataClient { /// Returns a list of bounding box labels based on a filter. /// If no [filter] is provided, all labels will be returned. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future> boundingBoxLabelsByFilter(Filter? filter) async { final request = BoundingBoxLabelsByFilterRequest()..filter = filter ?? Filter(); final response = await _dataClient.boundingBoxLabelsByFilter(request); @@ -201,12 +235,16 @@ class DataClient { } /// Returns a database connection to access a MongoDB Atlas Data Federation instance. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future getDatabaseConnection(String organizationId) async { final request = GetDatabaseConnectionRequest()..organizationId = organizationId; return await _dataClient.getDatabaseConnection(request); } /// Configures a database user for Viam's MongoDB Atlas Data Federation instance. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future configureDatabaseUser(String organizationId, String password) async { final request = ConfigureDatabaseUserRequest() ..password = password @@ -215,6 +253,8 @@ class DataClient { } /// Adds binary data to a dataset based on IDs. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future addBinaryDataToDatasetByIds(List binaryIds, String datasetId) async { final request = AddBinaryDataToDatasetByIDsRequest() ..binaryIds.addAll(binaryIds) @@ -223,6 +263,8 @@ class DataClient { } /// Removes binary data from a dataset based on IDs. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future removeBinaryDataFromDatasetByIds(List binaryIds, String datasetId) async { final request = RemoveBinaryDataFromDatasetByIDsRequest() ..binaryIds.addAll(binaryIds) @@ -233,6 +275,8 @@ class DataClient { /// Upload an image to Viam's Data Manager /// /// If no name is provided, the current timestamp will be used as the filename. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future uploadImage(ViamImage image, String partId, {String? fileName, String? componentType, @@ -263,6 +307,8 @@ class DataClient { /// Upload a file from its path to Viam's Data Manager /// /// The file name can be overridden by providing the [fileName] parameter. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future uploadFile(String path, String partId, {String? fileName, String? componentType, @@ -307,6 +353,8 @@ class DataClient { /// Upload binary sensor data to Viam's Data Manager /// /// Returns the data's file ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future binaryDataCaptureUpload(List binaryData, String partId, String fileExtension, {String? componentType, String? componentName, @@ -349,6 +397,8 @@ class DataClient { /// Upload tabular sensor data to Viam's Data Manager /// /// Returns the data's file ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future tabularDataCaptureUpload(List> tabularData, String partId, {String? componentType, String? componentName, @@ -392,6 +442,8 @@ class DataClient { /// Uploads the metadata and contents of streaming binary data /// /// Returns the data's file ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future streamingDataCaptureUpload(List bytes, String partId, String fileExtension, {String? componentType, String? componentName, @@ -433,6 +485,8 @@ class DataClient { } /// Creates a new dataset, returning the new dataset's ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future createDataset(String orgId, String name) async { final request = CreateDatasetRequest() ..organizationId = orgId @@ -442,12 +496,16 @@ class DataClient { } /// Deletes a dataset. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future deleteDataset(String id) async { final request = DeleteDatasetRequest()..id = id; await _datasetClient.deleteDataset(request); } /// Renames a dataset by ID. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future renameDataset(String id, String name) async { final request = RenameDatasetRequest() ..id = id @@ -456,6 +514,8 @@ class DataClient { } /// Returns a list of datasets within a given organization. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future> listDatasetsByOrganizationID(String orgId) async { final request = ListDatasetsByOrganizationIDRequest()..organizationId = orgId; final response = await _datasetClient.listDatasetsByOrganizationID(request); @@ -463,6 +523,8 @@ class DataClient { } /// Looks up and returns a list of datasets by their IDs. + /// + /// For more information, see [Data Client API](https://docs.viam.com/appendix/apis/data-client/). Future> listDatasetsByIDs(List ids) async { final request = ListDatasetsByIDsRequest()..ids.addAll(ids); final response = await _datasetClient.listDatasetsByIDs(request); diff --git a/lib/src/app/ml_training.dart b/lib/src/app/ml_training.dart index d8ff25422fb..5cfff8e4153 100644 --- a/lib/src/app/ml_training.dart +++ b/lib/src/app/ml_training.dart @@ -3,6 +3,8 @@ import 'package:viam_sdk/protos/app/ml_training.dart'; /// gRPC client used for working with ML training jobs. /// /// All calls must be authenticated. +/// +/// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). class MLTrainingClient { final MLTrainingServiceClient _mlTrainingClient; @@ -11,6 +13,8 @@ class MLTrainingClient { /// Submits a training job request. /// /// Returns the new job's ID. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future submitTrainingJob( String orgId, String datasetId, String modelName, String modelVersion, ModelType modelType, List tags) async { final request = SubmitTrainingJobRequest() @@ -27,6 +31,8 @@ class MLTrainingClient { /// Submits a custom training job request. /// /// Returns the new job's ID. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future submitCustomTrainingJob( String orgId, String datasetId, String modelName, String modelVersion, String registryItemId) async { final request = SubmitCustomTrainingJobRequest() @@ -40,6 +46,8 @@ class MLTrainingClient { } /// Retrieves a training job by its ID. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future getTrainingJob(String id) async { final request = GetTrainingJobRequest()..id = id; final response = await _mlTrainingClient.getTrainingJob(request); @@ -48,6 +56,8 @@ class MLTrainingClient { /// Lists training jobs for a given orgarnization ID and training status. /// if [status] is not provided, all training jobs will be returned. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future> listTrainingJobs(String orgId, {TrainingStatus status = TrainingStatus.TRAINING_STATUS_UNSPECIFIED}) async { final request = ListTrainingJobsRequest() @@ -58,12 +68,16 @@ class MLTrainingClient { } /// Cancels a training job that has not yet completed. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future cancelTrainingJob(String id) async { final request = CancelTrainingJobRequest()..id = id; await _mlTrainingClient.cancelTrainingJob(request); } /// Removes a completed training job from the database, whether it has succeeded or failed. + /// + /// For more information, see [ML Training Client API](https://docs.viam.com/appendix/apis/ml-training-client/). Future deleteCompletedTrainingJob(String id) async { final request = DeleteCompletedTrainingJobRequest()..id = id; await _mlTrainingClient.deleteCompletedTrainingJob(request); diff --git a/lib/src/components/arm/arm.dart b/lib/src/components/arm/arm.dart index 6baf0adf7b0..7141e147a0d 100644 --- a/lib/src/components/arm/arm.dart +++ b/lib/src/components/arm/arm.dart @@ -3,15 +3,18 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// Arm represents a physical robot arm that exists in three-dimensional space. +/// +/// For more information, see [Arm component](https://docs.viam.com/components/arm/). abstract class Arm extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'arm'); /// Get the current [Pose] of the end of the arm. /// /// ``` - /// // Get the pose of an arm named "myArm" /// final currentPose = await myArm.endPosition(); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future endPosition({Map? extra}); /// Move the end of the arm to the [Pose] specified. @@ -23,6 +26,8 @@ abstract class Arm extends Resource { /// // Move the arm to the pose /// await myArm.moveToPosition(targetPose); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future moveToPosition(Pose pose, {Map? extra}); /// Move each joint on the arm to the corresponding position specified in [positions]. @@ -34,6 +39,8 @@ abstract class Arm extends Resource { /// // Move the arm joints to those angles /// await myArm.moveToJointPositions(targetPositions); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future moveToJointPositions(List positions, {Map? extra}); /// Get the [List] of current joint angles of each arm joint @@ -41,6 +48,8 @@ abstract class Arm extends Resource { /// ``` /// List currentJointPositions = await myArm.moveToJointPosition(); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future> jointPositions({Map? extra}); /// Stop all motion of the arm. It is assumed that the arm stops immediately. @@ -48,6 +57,8 @@ abstract class Arm extends Resource { /// ``` /// await myArm.stop(); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future stop({Map? extra}); /// Whether the arm is currently moving @@ -55,14 +66,20 @@ abstract class Arm extends Resource { /// ``` /// bool isArmMoving = await myArm.isMoving(); /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). Future isMoving(); /// Get the [ResourceName] for this [Arm] with the given [name]. + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). static ResourceName getResourceName(String name) { return Arm.subtype.getResourceName(name); } /// Get the [Arm] named [name] from the provided robot. + /// + /// For more information, see [Arm component](https://docs.viam.com/components/arm/). static Arm fromRobot(RobotClient robot, String name) { return robot.getResource(Arm.getResourceName(name)); } diff --git a/lib/src/components/base/base.dart b/lib/src/components/base/base.dart index 740aa638dbc..56442e8152b 100644 --- a/lib/src/components/base/base.dart +++ b/lib/src/components/base/base.dart @@ -6,6 +6,8 @@ import '../../robot/client.dart'; typedef BaseProperties = GetPropertiesResponse; /// Base represents a physical base of a robot. +/// +/// For more information, see [Base component](https://docs.viam.com/components/base/). abstract class Base extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'base'); @@ -19,6 +21,8 @@ abstract class Base extends Resource { /// // Move the base 40mm forward at 90 mm/s /// await myBase.moveStraight(40, 90); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future moveStraight(int distance, double velocity, {Map? extra}); /// Spin the [Base] in place [angle] degrees, at the given angular [velocity], expressed in degrees per second. @@ -30,6 +34,8 @@ abstract class Base extends Resource { /// // Spin the base 10 degrees at 15 deg/s /// await myBase.spin(10, 15); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future spin(double angle, double velocity, {Map? extra}); /// Set the linear and angular velocity of the [Base]. @@ -54,6 +60,8 @@ abstract class Base extends Resource { /// // Turn the base to the right at 60% power: /// await myBase.setPower(Vector3(), Vector3(0, 0, -0.6)); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future setPower(Vector3 linear, Vector3 angular, {Map? extra}); /// Set the linear and angular velocities of the base, expressed as @@ -65,6 +73,8 @@ abstract class Base extends Resource { /// // /// await myBase.setVelocity(Vector3(0, 50, 0), Vector3(0, 0, 15)); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future setVelocity(Vector3 linear, Vector3 angular, {Map? extra}); /// Stop the base. @@ -72,6 +82,8 @@ abstract class Base extends Resource { /// ``` /// await myBase.stop(); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future stop({Map? extra}); /// Whether the base is currently moving @@ -79,18 +91,26 @@ abstract class Base extends Resource { /// ``` /// bool baseIsMoving = await myBase.isMoving(); /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future isMoving(); /// Get the [ResourceName] for this [Base] with the given [name] + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). static ResourceName getResourceName(String name) { return Base.subtype.getResourceName(name); } /// Report a dictionary mapping optional properties to /// whether it is supported by this base. + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). Future properties({Map? extra}); /// Get the [Base] named [name] from the provided robot. + /// + /// For more information, see [Base component](https://docs.viam.com/components/base/). static Base fromRobot(RobotClient robot, String name) { return robot.getResource(Base.getResourceName(name)); } diff --git a/lib/src/components/board/board.dart b/lib/src/components/board/board.dart index a356c231d8c..680c7b04a6b 100644 --- a/lib/src/components/board/board.dart +++ b/lib/src/components/board/board.dart @@ -11,6 +11,8 @@ typedef AnalogValue = ReadAnalogReaderResponse; /// Board represents a physical general purpose compute board that contains various /// components such as analog readers, and digital interrupts. +/// +/// For more information, see [Board component](https://docs.viam.com/components/board/). abstract class Board extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'board'); @@ -20,6 +22,8 @@ abstract class Board extends Resource { /// // Set pin 15 to high /// await myBoard.setGpioState('15', true); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future setGpioState(String pin, bool high, {Map? extra}); /// Get the high/low state of the given pin of a board. @@ -28,6 +32,8 @@ abstract class Board extends Resource { /// // Whether the state of pin 15 is currently high /// bool pinStateIsHigh = await myBoard.gpio('15'); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future gpio(String pin, {Map? extra}); /// Get the duty cycle of the given pin of a board. @@ -36,6 +42,8 @@ abstract class Board extends Resource { /// // Get the PWM duty cycle of pin 15 /// var dutyCycle = await myBoard.pwm('15'); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future pwm(String pin, {Map? extra}); /// Set the duty cycle of the given pin of a board. @@ -44,6 +52,8 @@ abstract class Board extends Resource { /// // Set the PWM duty cycle of pin 13 /// await myBoard.setPwm('13', 0.6); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future setPwm(String pin, double dutyCyclePct, {Map? extra}); /// Get the PWM frequency of the given pin of a board. @@ -52,6 +62,8 @@ abstract class Board extends Resource { /// // Get the PWM frequency of pin 11 /// var frequency = await myBoard.pwmFrequency('11'); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future pwmFrequency(String pin, {Map? extra}); /// Set the PWM frequency in hertz of the given pin of a board. @@ -60,6 +72,8 @@ abstract class Board extends Resource { /// // Set the PWM frequency of pin 15 to 1600 Hz /// await myBoard.setPwmFrequency('15', 1600); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future setPwmFrequency(String pin, int frequencyHz, {Map? extra}); /// Read the current value of an analog reader of a board. @@ -68,6 +82,8 @@ abstract class Board extends Resource { /// // Get the current value of an analog reader named "my_example_analog" /// var analogVal = await myBoard.analogReaderValue('my_example_analog'); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future analogReaderValue(String analogReaderName, {Map? extra}); /// Return the current value of the interrupt which is based on the type of Interrupt. @@ -76,6 +92,8 @@ abstract class Board extends Resource { /// // Get the current value of a digital interrupt named "my_example_digital_interrupt" /// var interruptVal = await myBoard.digitalInterruptValue('my_example_digital_interrupt'); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future digitalInterruptValue(String digitalInterruptName, {Map? extra}); /// Stream digital interrupts ticks. @@ -85,6 +103,8 @@ abstract class Board extends Resource { /// var interrupts = ['8', '11']; /// Stream tickStream = await myBoard.streamTicks(interrupts); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Stream streamTicks(List interrupts, {Map? extra}); /// Add a listener for the digital interrupts. @@ -95,6 +115,8 @@ abstract class Board extends Resource { /// final tickQueue = Queue(); /// await myBoard.addCallbacks(interrupts, tickQueue); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future addCallbacks(List interrupts, Queue tickQueue, {Map? extra}); /// Set the board to the indicated power mode. @@ -105,6 +127,8 @@ abstract class Board extends Resource { /// const powerMode = PowerMode.POWER_MODE_OFFLINE_DEEP; /// await myBoard.setPowerMode(powerMode, 60, 0); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future setPowerMode(PowerMode powerMode, int seconds, int nanos, {Map? extra}); /// Write analog value to pin. @@ -113,14 +137,20 @@ abstract class Board extends Resource { /// // Set pin 11 to value 48 /// await myBoard.writeAnalog('11', 48); /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). Future writeAnalog(String pin, int value, {Map? extra}); /// Get the [ResourceName] for this [Board] with the given [name] + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). static common.ResourceName getResourceName(String name) { return Board.subtype.getResourceName(name); } /// Get the [Board] named [name] from the provided robot. + /// + /// For more information, see [Board component](https://docs.viam.com/components/board/). static Board fromRobot(RobotClient robot, String name) { return robot.getResource(Board.getResourceName(name)); } diff --git a/lib/src/components/camera/camera.dart b/lib/src/components/camera/camera.dart index 32c72e63fae..195520c1b22 100644 --- a/lib/src/components/camera/camera.dart +++ b/lib/src/components/camera/camera.dart @@ -8,6 +8,8 @@ import '../../robot/client.dart'; typedef CameraProperties = GetPropertiesResponse; /// Camera represents any physical hardware that can capture frames. +/// +/// For more information, see [Camera component](https://docs.viam.com/components/camera/). abstract class Camera extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'camera'); @@ -16,6 +18,8 @@ abstract class Camera extends Resource { /// ``` /// var nextImage = await myCamera.image(); /// ``` + /// + /// For more information, see [Camera component](https://docs.viam.com/components/camera/). Future image({MimeType? mimeType, Map? extra}); /// Get the next point cloud from the camera. @@ -23,6 +27,8 @@ abstract class Camera extends Resource { /// ``` /// var nextPointCloud = await myCamera.pointCloud(); /// ``` + /// + /// For more information, see [Camera component](https://docs.viam.com/components/camera/). Future pointCloud({Map? extra}); /// Get the camera's intrinsic parameters and the camera's distortion parameters. @@ -30,14 +36,20 @@ abstract class Camera extends Resource { /// ``` /// var cameraProperties = await myCamera.properties(); /// ``` + /// + /// For more information, see [Camera component](https://docs.viam.com/components/camera/). Future properties(); /// Get the [ResourceName] for this [Camera] with the given [name] + /// + /// For more information, see [Camera component](https://docs.viam.com/components/camera/). static ResourceName getResourceName(String name) { return Camera.subtype.getResourceName(name); } /// Get the [Camera] named [name] from the provided robot. + /// + /// For more information, see [Camera component](https://docs.viam.com/components/camera/). static Camera fromRobot(RobotClient robot, String name) { return robot.getResource(Camera.getResourceName(name)); } diff --git a/lib/src/components/gantry/gantry.dart b/lib/src/components/gantry/gantry.dart index b37c0c43aeb..05e1d87b16a 100644 --- a/lib/src/components/gantry/gantry.dart +++ b/lib/src/components/gantry/gantry.dart @@ -3,6 +3,8 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// Gantry represents a physical Gantry and can be used for controlling gantries of N axes. +/// +/// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). abstract class Gantry extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gantry'); @@ -11,6 +13,8 @@ abstract class Gantry extends Resource { /// ``` /// var position = await myGantry.position(); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future> position({Map? extra}); /// Move the gantry to a new position in millimeters at the requested speeds in millimeters/second. @@ -18,6 +22,8 @@ abstract class Gantry extends Resource { /// ``` /// await myGantry.moveToPosition([0.0, 20.5], [15, 15]); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future moveToPosition(List positions, List speeds, {Map? extra}); /// Run the homing sequence and return true if completed successfully. @@ -25,6 +31,8 @@ abstract class Gantry extends Resource { /// ``` /// var homed = await myGantry.home(); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future home({Map? extra}); /// Get the lengths of the axes of the gantry in millimeters. @@ -32,6 +40,8 @@ abstract class Gantry extends Resource { /// ``` /// var lengths = await myGantry.lengths(); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future> lengths({Map? extra}); /// Stop all motion of the [Gantry]. It is assumed the [Gantry] stops immediately. @@ -39,6 +49,8 @@ abstract class Gantry extends Resource { /// ``` /// await myGantry.stop(); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future stop({Map? extra}); /// Whether the [Gantry] is currently moving. @@ -46,14 +58,20 @@ abstract class Gantry extends Resource { /// ``` /// var moving = await myGantry.isMoving(); /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). Future isMoving(); /// Get the [ResourceName] for this [Gantry] with the given [name] + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). static ResourceName getResourceName(String name) { return Gantry.subtype.getResourceName(name); } /// Get the [Gantry] named [name] from the provided robot. + /// + /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). static Gantry fromRobot(RobotClient robot, String name) { return robot.getResource(Gantry.getResourceName(name)); } diff --git a/lib/src/components/generic/generic.dart b/lib/src/components/generic/generic.dart index 56d30e4a252..759ed4f169a 100644 --- a/lib/src/components/generic/generic.dart +++ b/lib/src/components/generic/generic.dart @@ -3,15 +3,21 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// 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)); } diff --git a/lib/src/components/gripper/gripper.dart b/lib/src/components/gripper/gripper.dart index 96b42de5c3e..d723d9eded1 100644 --- a/lib/src/components/gripper/gripper.dart +++ b/lib/src/components/gripper/gripper.dart @@ -3,6 +3,8 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// Gripper represents a physical Gripper which can open and close. +/// +/// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). abstract class Gripper extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gripper'); @@ -11,6 +13,8 @@ abstract class Gripper extends Resource { /// ``` /// await myGripper.open(); /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). Future open({Map? extra}); /// Close the [Gripper] @@ -18,6 +22,8 @@ abstract class Gripper extends Resource { /// ``` /// await myGripper.grab(); /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). Future grab({Map? extra}); /// Stop all motion of the [Gripper]. It is assumed the [Gripper] stops immediately. @@ -25,6 +31,8 @@ abstract class Gripper extends Resource { /// ``` /// await myGripper.stop(); /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). Future stop({Map? extra}); /// Whether the [Gripper] is currently moving. @@ -32,14 +40,20 @@ abstract class Gripper extends Resource { /// ``` /// var isItMoving = await myGripper.isMoving(); /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). Future isMoving(); /// Get the [ResourceName] for the [Gripper] with the given [name] + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). static ResourceName getResourceName(String name) { return Gripper.subtype.getResourceName(name); } /// Get the [Gripper] named [name] from the provided robot. + /// + /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). static Gripper fromRobot(RobotClient robot, String name) { return robot.getResource(Gripper.getResourceName(name)); } diff --git a/lib/src/components/motor/motor.dart b/lib/src/components/motor/motor.dart index c19338b6311..fb12edc32c8 100644 --- a/lib/src/components/motor/motor.dart +++ b/lib/src/components/motor/motor.dart @@ -17,6 +17,8 @@ class PowerState { } /// Motor represents a physical motor. +/// +/// For more information, see [Motor component](https://docs.viam.com/components/motor/). abstract class Motor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'motor'); @@ -27,6 +29,8 @@ abstract class Motor extends Resource { /// // Set the power to 40% forwards. /// await myMotor.setPower(0.4); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future setPower(double powerPct, {Map? extra}); /// Spin the [Motor] the specified number of [revolutions] at specified [rpm]. @@ -37,6 +41,8 @@ abstract class Motor extends Resource { /// // Turn the motor 7.2 revolutions forward at 60 RPM. /// await myMotor.goFor(60, 7.2); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future goFor(double rpm, double revolutions, {Map? extra}); /// Spin the [Motor] to the specified position (provided in revolutions from home/zero), @@ -48,6 +54,8 @@ abstract class Motor extends Resource { /// // Turn the motor to 8.3 revolutions from home at 75 RPM. /// await myMotor.goTo(75, 8.3); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future goTo(double rpm, double positionRevolutions, {Map? extra}); /// Spin the [Motor] indefinitely at the specified speed, in revolutions per minute. @@ -57,6 +65,8 @@ abstract class Motor extends Resource { /// // Set the motor to turn backwards at 120.5 RPM. /// await myMotor.setRPM(-120.5); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future setRPM(double rpm, {Map? extra}); /// Set the current position (modified by [offset]) to be the new zero (home) position. @@ -65,6 +75,8 @@ abstract class Motor extends Resource { /// // Set the current position as the new home position with no offset. /// await myMotor.resetZeroPosition(0.0); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future resetZeroPosition(double offset, {Map? extra}); /// Report the position of the motor based on its encoder. @@ -75,6 +87,8 @@ abstract class Motor extends Resource { /// // Get the current position of an encoded motor. /// var position = await myMotor.position(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future position({Map? extra}); /// Report a dictionary mapping each optional property to @@ -84,6 +98,8 @@ abstract class Motor extends Resource { /// // Return whether the motor supports certain optional features /// var properties = await myMotor.properties(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future properties({Map? extra}); /// Stop the motor immediately, without any gradual step down. @@ -92,6 +108,8 @@ abstract class Motor extends Resource { /// // Stop the motor. /// await myMotor.stop(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future stop({Map? extra}); /// Returns whether or not the motor is currently powered, and the portion @@ -106,6 +124,8 @@ abstract class Motor extends Resource { /// var powered = powerState.isOn; /// var pct = powerState.powerPct; /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future powerState({Map? extra}); /// Get if the [Motor] is currently moving. @@ -114,6 +134,8 @@ abstract class Motor extends Resource { /// // Check whether the motor is moving. /// var moving = await myMotor.isMoving(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future isMoving({Map? extra}); /// Get the [ResourceName] for this [Motor] with the given [name]. @@ -121,11 +143,15 @@ abstract class Motor extends Resource { /// ``` /// var name = Motor.getResourceName('myMotor'); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). static ResourceName getResourceName(String name) { return Motor.subtype.getResourceName(name); } /// Get the [Motor] named [name] from the provided robot. + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). static Motor fromRobot(RobotClient robot, String name) { return robot.getResource(Motor.getResourceName(name)); } diff --git a/lib/src/components/movement_sensor/movement_sensor.dart b/lib/src/components/movement_sensor/movement_sensor.dart index 2662fb9a042..767a97009e4 100644 --- a/lib/src/components/movement_sensor/movement_sensor.dart +++ b/lib/src/components/movement_sensor/movement_sensor.dart @@ -14,6 +14,8 @@ typedef Properties = GetPropertiesResponse; typedef Accuracy = GetAccuracyResponse; /// MovementSensor reports information about the robot's direction, position and speed. +/// +/// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). abstract class MovementSensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'movement_sensor'); @@ -24,6 +26,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var readings = await myMovementSensor.readings(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future> readings({Map? extra}); /// Get the current [GeoPoint] (latitude, longitude) and altitude (mm). @@ -31,6 +35,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var position = await myMovementSensor.position(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future position({Map? extra}); /// Get the current linear velocity as a [Vector3] with x, y, and z axes represented in mm/sec. @@ -38,6 +44,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var linVel = await myMovementSensor.linearVelocity(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future linearVelocity({Map? extra}); /// Get the current angular velocity as a [Vector3] with @@ -46,6 +54,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var angVel = await myMovementSensor.angularVelocity(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future angularVelocity({Map? extra}); /// Get the current linear acceleration as a [Vector3] with @@ -54,6 +64,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var linAccel = await myMovementSensor.linearAcceleration(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future linearAcceleration({Map? extra}); /// Get the current compass heading in degrees. @@ -61,6 +73,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var compassHeading = await myMovementSensor.compassHeading(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future compassHeading({Map? extra}); /// Get the current orientation as an [Orientation]. @@ -68,6 +82,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var orientation = await myMovementSensor.orientation(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future orientation({Map? extra}); /// Get the supported properties of this sensor. @@ -75,6 +91,8 @@ abstract class MovementSensor extends Resource { /// ``` /// var props = await myMovementSensor.properties(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future properties({Map? extra}); /// Get the reliability metrics of the movement sensor, @@ -84,14 +102,20 @@ abstract class MovementSensor extends Resource { /// ``` /// var accuracy = await myMovementSensor.accuracy(); /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). Future accuracy({Map? extra}); /// Get the [ResourceName] for this [MovementSensor] with the given [name] + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). static ResourceName getResourceName(String name) { return MovementSensor.subtype.getResourceName(name); } /// Get the [MovementSensor] named [name] from the provided robot. + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). static MovementSensor fromRobot(RobotClient robot, String name) { return robot.getResource(MovementSensor.getResourceName(name)); } diff --git a/lib/src/components/power_sensor/power_sensor.dart b/lib/src/components/power_sensor/power_sensor.dart index ec106bab882..d8edafa9691 100644 --- a/lib/src/components/power_sensor/power_sensor.dart +++ b/lib/src/components/power_sensor/power_sensor.dart @@ -7,6 +7,8 @@ typedef Voltage = GetVoltageResponse; typedef Current = GetCurrentResponse; /// PowerSensor reports information about voltage, current, and power. +/// +/// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). abstract class PowerSensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'power_sensor'); @@ -17,6 +19,8 @@ abstract class PowerSensor extends Resource { /// ``` /// var readings = await myPowerSensor.readings(); /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). Future> readings({Map? extra}); /// Get the voltage in volts, and whether the power is @@ -27,6 +31,8 @@ abstract class PowerSensor extends Resource { /// double voltageInVolts = voltageObject.volts; /// bool isItAC = voltageObject.isAc; /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). Future voltage({Map? extra}); /// Get the current in amperes, and whether the current @@ -37,6 +43,8 @@ abstract class PowerSensor extends Resource { /// double amps = currentObject.amperes; /// bool isItAC = currentObject.isAc; /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). Future current({Map? extra}); /// Get the power (watts) @@ -44,14 +52,20 @@ abstract class PowerSensor extends Resource { /// ``` /// var power = await myPowerSensor.power(); /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). Future power({Map? extra}); /// Get the [ResourceName] for this [PowerSensor] with the given [name]. + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). static ResourceName getResourceName(String name) { return PowerSensor.subtype.getResourceName(name); } /// Get the [PowerSensor] named [name] from the provided robot. + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). static PowerSensor fromRobot(RobotClient robot, String name) { return robot.getResource(PowerSensor.getResourceName(name)); } diff --git a/lib/src/components/sensor/sensor.dart b/lib/src/components/sensor/sensor.dart index 4cbcf531252..fd725616544 100644 --- a/lib/src/components/sensor/sensor.dart +++ b/lib/src/components/sensor/sensor.dart @@ -3,6 +3,8 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// Sensor represents a physical sensing device that can provide measurement readings. +/// +/// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). abstract class Sensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'sensor'); @@ -11,14 +13,20 @@ abstract class Sensor extends Resource { /// ``` /// var readings = await mySensor.readings(); /// ``` + /// + /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). Future> readings({Map? extra}); /// Get the [ResourceName] for this [Sensor] with the given [name]. + /// + /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). static ResourceName getResourceName(String name) { return Sensor.subtype.getResourceName(name); } /// Get the [Sensor] named [name] from the provided robot. + /// + /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). static Sensor fromRobot(RobotClient robot, String name) { return robot.getResource(Sensor.getResourceName(name)); } diff --git a/lib/src/components/servo/servo.dart b/lib/src/components/servo/servo.dart index 84e116bc1e0..8b05214ebf4 100644 --- a/lib/src/components/servo/servo.dart +++ b/lib/src/components/servo/servo.dart @@ -3,10 +3,14 @@ import '../../resource/base.dart'; import '../../robot/client.dart'; /// Servo represents a physical servo. +/// +/// For more information, see [Servo component](https://docs.viam.com/components/servo/). abstract class Servo extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'servo'); /// Move the [Servo] to the provided angle. + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). Future move(int angle, {Map? extra}); /// Get the current angle (degrees) of the [Servo]. @@ -14,6 +18,8 @@ abstract class Servo extends Resource { /// ``` /// var angle = await myServo.position(); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). Future position({Map? extra}); /// Stop the [Servo]. It is assumed that the servo stops immediately. @@ -21,12 +27,17 @@ abstract class Servo extends Resource { /// ``` /// await myServo.stop(); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). Future stop({Map? extra}); - /// Whether the [Servo] is currently moving. + /// Get if the [Servo] is currently moving. + /// /// ``` /// var isItMoving = await myServo.isMoving(); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). Future isMoving(); /// Get the [ResourceName] for this [Servo] with the given [name]. @@ -35,11 +46,16 @@ abstract class Servo extends Resource { /// // Example: /// var name = Servo.getResourceName('myServo'); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). static ResourceName getResourceName(String name) { return Servo.subtype.getResourceName(name); } /// Get the [Servo] named [name] from the provided robot. + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// static Servo fromRobot(RobotClient robot, String name) { return robot.getResource(Servo.getResourceName(name)); }