|
54 | 54 | GetFragmentResponse,
|
55 | 55 | GetLocationRequest,
|
56 | 56 | GetLocationResponse,
|
| 57 | + GetLocationMetadataRequest, |
| 58 | + GetLocationMetadataResponse, |
57 | 59 | GetModuleRequest,
|
58 | 60 | GetModuleResponse,
|
59 | 61 | GetOrganizationNamespaceAvailabilityRequest,
|
60 | 62 | GetOrganizationNamespaceAvailabilityResponse,
|
61 | 63 | GetOrganizationRequest,
|
62 | 64 | GetOrganizationResponse,
|
| 65 | + GetOrganizationMetadataRequest, |
| 66 | + GetOrganizationMetadataResponse, |
63 | 67 | GetOrganizationsWithAccessToLocationRequest,
|
64 | 68 | GetOrganizationsWithAccessToLocationResponse,
|
65 | 69 | GetRegistryItemRequest,
|
@@ -2523,3 +2527,39 @@ async def rotate_key(self, id: str) -> Tuple[str, str]:
|
2523 | 2527 | request = RotateKeyRequest(id=id)
|
2524 | 2528 | response: RotateKeyResponse = await self._app_client.RotateKey(request, metadata=self._metadata)
|
2525 | 2529 | return response.key, response.id
|
| 2530 | + |
| 2531 | + async def get_organization_metadata(self, org_id: str) -> Mapping[str, Any]: |
| 2532 | + """Get an organization's user-defined metadata. |
| 2533 | +
|
| 2534 | + :: |
| 2535 | +
|
| 2536 | + metadata = await cloud.get_organization_metadata(org_id="<YOUR-ORG-ID>") |
| 2537 | +
|
| 2538 | + Args: |
| 2539 | + org_id (str): The ID of the organization with which the user-defined metadata is associated. |
| 2540 | + You can obtain your organization ID from the Viam app's organization settings page. |
| 2541 | +
|
| 2542 | + Returns: |
| 2543 | + Mapping[str, Any]: The user-defined metadata converted from JSON to a Python dictionary |
| 2544 | + """ |
| 2545 | + request = GetOrganizationMetadataRequest(organization_id=org_id) |
| 2546 | + response: GetOrganizationMetadataResponse = await self._app_client.GetOrganizationMetadata(request) |
| 2547 | + return struct_to_dict(response.data) |
| 2548 | + |
| 2549 | + async def get_location_metadata(self, location_id: str) -> Mapping[str, Any]: |
| 2550 | + """Get a location's user-defined metadata. |
| 2551 | +
|
| 2552 | + :: |
| 2553 | +
|
| 2554 | + metadata = await cloud.get_location_metadata(location_id="<YOUR-LOCATION-ID>") |
| 2555 | +
|
| 2556 | + Args: |
| 2557 | + org_id (str): The ID of the location with which the user-defined metadata is associated. |
| 2558 | + You can obtain your location ID from the Viam app's locations page. |
| 2559 | +
|
| 2560 | + Returns: |
| 2561 | + Mapping[str, Any]: The user-defined metadata converted from JSON to a Python dictionary |
| 2562 | + """ |
| 2563 | + request = GetLocationMetadataRequest(location_id=location_id) |
| 2564 | + response: GetLocationMetadataResponse = await self._app_client.GetLocationMetadata(request) |
| 2565 | + return struct_to_dict(response.data) |
0 commit comments