stringToPropertyType function

PropertiesTypes stringToPropertyType(
  1. String type
)

Returns the property type of the given property type string.

Implementation

PropertiesTypes stringToPropertyType(String type) {
  switch (type) {
    case 'rich_text':
      return PropertiesTypes.RichText;
    case 'number':
      return PropertiesTypes.Number;
    case 'select':
      return PropertiesTypes.Select;
    case 'multi_select':
      return PropertiesTypes.MultiSelect;
    case 'date':
      return PropertiesTypes.Date;
    case 'people':
      return PropertiesTypes.People;
    case 'file':
      return PropertiesTypes.File;
    case 'checkbox':
      return PropertiesTypes.Checkbox;
    case 'url':
      return PropertiesTypes.URL;
    case 'email':
      return PropertiesTypes.Email;
    case 'phone_number':
      return PropertiesTypes.PhoneNumber;
    case 'formula':
      return PropertiesTypes.Formula;
    case 'relation':
      return PropertiesTypes.Relation;
    case 'rollup':
      return PropertiesTypes.Rollup;
    case 'created_time':
      return PropertiesTypes.CreatedTime;
    case 'created_by':
      return PropertiesTypes.CreatedBy;
    case 'last_edited_time':
      return PropertiesTypes.LastEditedTime;
    case 'last_edited_by':
      return PropertiesTypes.LastEditedBy;
    case 'title':
      return PropertiesTypes.Title;
    case '':
    default:
      return PropertiesTypes.None;
  }
}