Resource constructor

Resource(
  1. List<Attribute> attributeList
)

Implementation

factory Resource(List<api.Attribute> attributeList) {
  for (final attribute in attributeList) {
    if (attribute.value is! String) {
      throw ArgumentError('Attributes value must be String.');
    }
  }
  final attributes = Attributes.empty()..addAll(attributeList);
  return Resource.fromAttributes(attributes);
}