@namespace("Switchboard") protocol Lawyer { record Phone { string area_code; string local_number; string type; } record Address { int id; int lawyer_id; string address_line1; string address_line2; string city; string state; string postal_code; string standardized_address; int location_id; float latitude; float longitude; array phones; string firm_name; } record License { int id; string state; string status; string status_type; int license_date; int licensing_authority_id; int last_updated; } record Sanction { int id; int lawyer_id; int license_id; string state; string name; string type; int sanction_date; int updated_at; string description; string interpretation; string comment; } record Fee { string name; string symbolic_name; int min_rate; int max_rate; } record AdditionalProfileLink { int id; string url; string title; string social_network; string rss; boolean rssable; int updated_at; } record Media { int id; string path; int mime_type_id; string external_url; string caption; string copyright; boolean is_video; } record Personal { array aliases; string bio; array languages; array payment_types; string fixed_acceptance_type; string retainer_acceptance_type; int probono_contribution; int free_consultation; string cache_key; array fees; array media_thumbnails; array social_networks; } record Status { boolean deceased; boolean judge; boolean retired; boolean official; boolean unverified; boolean displayable; boolean sanctioned; boolean rateable; } record Rating { int overall; int trustworthy; int responsive; int knowledgeable; int communication; } record Review { int id; int lawyer_id; string title; string body; boolean recommended; int specialty_id; boolean anonymous; int approval_status; string display_name; int created_at; int updated_at; string cache_key; Rating ratings; } record LawyerSpecialty { int id; string name; int specialty_id; int percent; int start_date; string description; int cases; } /** The main class for this protocol */ record Lawyer { /** The primary key */ int id; /** Their name */ string firstname; string middlename; string lastname; string suffix; string email_address; int licensed_since; string website; int advisor_id; boolean advisor_available; array sanction_ids; array licenses; Status status; array
addresses; array reviews; array lawyer_specialties; Personal personal; array sanctions; /** id of claiming user **/ int claimed_by; /** Url to their full-size headshot photo */ string headshot_url; /** Avvo Rating (Scale of 1-10) */ float avvo_rating; boolean avvo_pro; /** Average client review score (Scale of 1-5) */ float aggregate_client_review_score; /** Number of reviews the average is based upon */ int client_review_count; /** List of specialties this lawyer practices */ array specialty_ids; } /** The lawyer result when performing a search */ record SearchLawyer { /** The primary key */ int id; /** Their name */ string firstname; string middlename; string lastname; string suffix; string email_address; int licensed_since; int advisor_id; boolean advisor_available; array
addresses; /** id of claiming user **/ int claimed_by; /** Url to their full-size headshot photo */ string headshot_url; /** Avvo Rating (Scale of 1-10) */ float avvo_rating; boolean avvo_pro; /** Average client review score (Scale of 1-5) */ float aggregate_client_review_score; /** Number of reviews the average is based upon */ int client_review_count; /** List of specialties this lawyer practices */ array specialty_ids; } record SearchParams{ /** location **/ /** takes a string that will be then processed through Gnomon **/ string loc; /** latitude **/ float lat; /** longitude **/ float Long; /** radius **/ float radius; /** this is the query interface. "divorce" or "Mark Britton" go here **/ string q; /** this is to force what kind of search you want. The options are "specialty"(this is what we default to), "location", and "name" **/ string type; /** filters **/ /** takes a language string, such as "English". With the new UI, the requirement is to only filter by one language at a time **/ string language; boolean has_reviews; boolean has_endorsements; boolean free_consultation; /** takes an expertise name string **/ string expertise; /** can take a single value, or an array of `[min, max]` where max & min are 0-5 in 0.5 increments. (Test note, the format in the URL for this is client_ratings[] =min&client_ratings[]=max) **/ array client_ratings; /** single year value or an array of `[start, end]`. has to be a year. **/ array licensed_since; /** ordering **/ /** order by avvo rating. takes "asc" or "desc" **/ string avvo_rating; /** order by client review rating. takes "asc" or "desc" **/ string client_rating; /** order by number of client reviews. takes "asc" or "desc" **/ string number_of_reviews; /** pagination **/ /** page of results **/ int page; /** results per page **/ int per_page; } record SearchFilters { array language; array has_reviews; array has_endorsements; array free_consultation; array expertise; array client_reviews; } record SearchLocation { int location_id; float lat; float Long; string type; array surrounding_location_ids; } record SearchStats { int review_count; float average_review_rating; } record SearchContext { string search; int specialty; boolean name_suggestion; SearchFilters filters; SearchLocation location; SearchStats stats; array pls_lawyer_ids; } record SearchMetadata { SearchContext context; int status; int current_page; int per_page; int total_pages; int total_entries; } record SearchResult { array lawyers; SearchMetadata meta; } /** Look up many lawyers in bulk */ array index(); /** Look up a single lawyer by id */ array show(int id); /** Look up a single lawyer by id */ SearchResult search(SearchParams params); }