def get_artifact_types_by_id( self, type_ids: Sequence[int]) -> List[metadata_store_pb2.ArtifactType]: """Gets types by ID. TODO(b/122657258): implement in gRPC Args: type_ids: a sequence of artifact type IDs. Returns: A list of artifact types. Raises: InternalError: if query execution fails. """ request = metadata_store_service_pb2.GetArtifactTypesByIDRequest() response = metadata_store_service_pb2.GetArtifactTypesByIDResponse() for x in type_ids: request.type_ids.append(x) self._swig_call(metadata_store_serialized.GetArtifactTypesByID, request, response) result = [] for x in response.artifact_types: result.append(x) return result
def get_artifact_types_by_id( self, type_ids: Iterable[int]) -> List[metadata_store_pb2.ArtifactType]: """Gets artifact types by ID. Args: type_ids: a sequence of artifact type IDs. Returns: A list of artifact types. Raises: InternalError: if query execution fails. """ request = metadata_store_service_pb2.GetArtifactTypesByIDRequest() response = metadata_store_service_pb2.GetArtifactTypesByIDResponse() for x in type_ids: request.type_ids.append(x) self._call('GetArtifactTypesByID', request, response) result = [] for x in response.artifact_types: result.append(x) return result