switchboard-contract 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +3 -0
- data/contracts/3/compiled/advice_session.avpr +190 -0
- data/contracts/3/compiled/advice_session_image.avpr +36 -0
- data/contracts/3/compiled/advice_session_review.avpr +90 -0
- data/contracts/3/compiled/advisor.avpr +77 -0
- data/contracts/3/compiled/advisor_config.avpr +38 -0
- data/contracts/3/compiled/lawyer.avpr +83 -0
- data/contracts/3/compiled/location.avpr +128 -0
- data/contracts/3/compiled/offer.avpr +111 -0
- data/contracts/3/compiled/package.avpr +85 -0
- data/contracts/3/compiled/package_detail.avpr +100 -0
- data/contracts/3/compiled/provider_offer.avpr +144 -0
- data/contracts/3/compiled/specialty.avpr +61 -0
- data/contracts/3/compiled/user.avpr +50 -0
- data/contracts/3/compiled/user_authentication.avpr +111 -0
- data/contracts/3/source/advice_session.avdl +72 -0
- data/contracts/3/source/advice_session_image.avdl +16 -0
- data/contracts/3/source/advice_session_review.avdl +40 -0
- data/contracts/3/source/advisor.avdl +30 -0
- data/contracts/3/source/advisor_config.avdl +17 -0
- data/contracts/3/source/common.inc +20 -0
- data/contracts/3/source/lawyer.avdl +45 -0
- data/contracts/3/source/location.avdl +76 -0
- data/contracts/3/source/offer.avdl +51 -0
- data/contracts/3/source/package.avdl +36 -0
- data/contracts/3/source/package_detail.avdl +41 -0
- data/contracts/3/source/provider_offer.avdl +38 -0
- data/contracts/3/source/specialty.avdl +33 -0
- data/contracts/3/source/user.avdl +12 -0
- data/contracts/3/source/user_authentication.avdl +57 -0
- data/contracts/4/compiled/lawyer.avpr +127 -0
- data/contracts/4/compiled/lawyer_address.avpr +54 -0
- data/contracts/4/compiled/review.avpr +44 -0
- data/contracts/4/compiled/specialty.avpr +43 -0
- data/contracts/4/source/lawyer.avdl +69 -0
- data/contracts/4/source/lawyer_address.avdl +31 -0
- data/contracts/4/source/review.avdl +28 -0
- data/contracts/4/source/specialty.avdl +23 -0
- data/contracts/messaging/compiled/access_token.avpr +41 -0
- data/contracts/messaging/compiled/channel.avpr +111 -0
- data/contracts/messaging/source/access_token.avdl +21 -0
- data/contracts/messaging/source/channel.avdl +59 -0
- data/contracts/mobile/compiled/advice_session.avpr +160 -0
- data/contracts/mobile/compiled/checkout.avpr +115 -0
- data/contracts/mobile/compiled/lawyer.avpr +787 -0
- data/contracts/mobile/compiled/offer.avpr +111 -0
- data/contracts/mobile/compiled/package.avpr +85 -0
- data/contracts/mobile/compiled/package_detail.avpr +100 -0
- data/contracts/mobile/compiled/package_slug.avpr +67 -0
- data/contracts/mobile/compiled/promotion.avpr +45 -0
- data/contracts/mobile/compiled/provider_offer.avpr +144 -0
- data/contracts/mobile/compiled/review.avpr +83 -0
- data/contracts/mobile/compiled/specialty.avpr +55 -0
- data/contracts/mobile/source/advice_session.avdl +61 -0
- data/contracts/mobile/source/checkout.avdl +90 -0
- data/contracts/mobile/source/lawyer.avdl +321 -0
- data/contracts/mobile/source/offer.avdl +51 -0
- data/contracts/mobile/source/package.avdl +36 -0
- data/contracts/mobile/source/package_detail.avdl +41 -0
- data/contracts/mobile/source/package_slug.avdl +30 -0
- data/contracts/mobile/source/promotion.avdl +18 -0
- data/contracts/mobile/source/provider_offer.avdl +38 -0
- data/contracts/mobile/source/review.avdl +43 -0
- data/contracts/mobile/source/specialty.avdl +32 -0
- data/contracts/sales_force/compiled/account.avpr +94 -0
- data/contracts/sales_force/compiled/account_professional.avpr +39 -0
- data/contracts/sales_force/source/account.avdl +50 -0
- data/contracts/sales_force/source/account_professional.avdl +14 -0
- data/contracts/verify/compiled/lawyer.avpr +79 -0
- data/contracts/verify/compiled/license.avpr +64 -0
- data/contracts/verify/source/lawyer.avdl +41 -0
- data/contracts/verify/source/license.avdl +36 -0
- data/lib/switchboard/contract.rb +8 -0
- data/lib/switchboard/contract/documentation.rb +7 -0
- data/lib/switchboard/contract/service.rb +15 -0
- data/lib/switchboard/contract/version.rb +5 -0
- metadata +164 -0
@@ -0,0 +1,72 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol AdviceSession {
|
4
|
+
/** The main class for this protocol */
|
5
|
+
record AdviceSession {
|
6
|
+
/** The primary key */
|
7
|
+
int id;
|
8
|
+
int specialty_id;
|
9
|
+
int advisor_id;
|
10
|
+
int review_id;
|
11
|
+
boolean chose_advisor;
|
12
|
+
|
13
|
+
string state;
|
14
|
+
boolean called;
|
15
|
+
union {null, string} advice_session_image_token = null;
|
16
|
+
array<string> advice_session_image_tokens;
|
17
|
+
|
18
|
+
string name;
|
19
|
+
string email_address;
|
20
|
+
string phone_number;
|
21
|
+
int payment_amount;
|
22
|
+
string promo_code;
|
23
|
+
int offer_id;
|
24
|
+
int location_id;
|
25
|
+
int lawyer_id;
|
26
|
+
int package_id;
|
27
|
+
string package_name;
|
28
|
+
}
|
29
|
+
|
30
|
+
/** Options you can send for limiting AdviceSession results */
|
31
|
+
record AdviceSessionFetchOption {
|
32
|
+
/** Which page of records to fetch */
|
33
|
+
int page = 1;
|
34
|
+
|
35
|
+
/** How many records per page */
|
36
|
+
int per_page = 30;
|
37
|
+
}
|
38
|
+
|
39
|
+
/** Params to create a new AdviceSession */
|
40
|
+
record AdviceSessionCreateParams {
|
41
|
+
int specialty_id;
|
42
|
+
int advisor_id;
|
43
|
+
|
44
|
+
string state;
|
45
|
+
string client_name;
|
46
|
+
string client_email_address;
|
47
|
+
string client_phone_number;
|
48
|
+
union {null, string} payment_gateway = null;
|
49
|
+
string card_href;
|
50
|
+
string name_on_card;
|
51
|
+
union {null, string} advice_session_image_token = null;
|
52
|
+
array<string> advice_session_image_tokens;
|
53
|
+
union {null, string} promo_code = null;
|
54
|
+
}
|
55
|
+
|
56
|
+
record AdviceSessionPromoCode {
|
57
|
+
int promo_discount_amount_in_cents;
|
58
|
+
int promo_advice_session_price_in_cents;
|
59
|
+
}
|
60
|
+
|
61
|
+
/** Returns a list of AdviceSession */
|
62
|
+
array<AdviceSession> index(AdviceSessionFetchOption options);
|
63
|
+
|
64
|
+
/** Return a single AdviceSession */
|
65
|
+
array<AdviceSession> show(int id);
|
66
|
+
|
67
|
+
/** Create a new AdviceSession */
|
68
|
+
array<AdviceSession> create(AdviceSessionCreateParams advice_session);
|
69
|
+
|
70
|
+
/** Apply an Advice Session Promo Code */
|
71
|
+
array<AdviceSessionPromoCode> find_promo_code(string promo_code);
|
72
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol AdviceSessionImage {
|
4
|
+
/** The main class for this protocol */
|
5
|
+
record AdviceSessionImage {
|
6
|
+
string token;
|
7
|
+
}
|
8
|
+
|
9
|
+
record AdviceSessionImageCreateParams {
|
10
|
+
string data;
|
11
|
+
string content_type;
|
12
|
+
}
|
13
|
+
|
14
|
+
/** Create a new AdviceSessionImage */
|
15
|
+
array<AdviceSessionImage> create(AdviceSessionImageCreateParams advice_session_image);
|
16
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol AdviceSessionReview {
|
4
|
+
/** The main class for this protocol */
|
5
|
+
record AdviceSessionReview {
|
6
|
+
/** The primary key */
|
7
|
+
int id;
|
8
|
+
int advice_session_id;
|
9
|
+
|
10
|
+
int rating;
|
11
|
+
string body;
|
12
|
+
int approval_status_id;
|
13
|
+
}
|
14
|
+
|
15
|
+
/** Params to create a new Review */
|
16
|
+
record AdviceSessionReviewCreateParams {
|
17
|
+
int advice_session_id;
|
18
|
+
|
19
|
+
int rating;
|
20
|
+
string body;
|
21
|
+
}
|
22
|
+
|
23
|
+
/** Return a single Review */
|
24
|
+
array<AdviceSessionReview> show(int id);
|
25
|
+
|
26
|
+
/** Create a new Review */
|
27
|
+
array<AdviceSessionReview> create(AdviceSessionReviewCreateParams advice_session_review);
|
28
|
+
|
29
|
+
/** Options you can send for limiting Review results */
|
30
|
+
record AdviceSessionReviewFetchOption {
|
31
|
+
/** Which page of records to fetch */
|
32
|
+
int page = 1;
|
33
|
+
|
34
|
+
/** How many records per page */
|
35
|
+
int per_page = 20;
|
36
|
+
}
|
37
|
+
|
38
|
+
/** Returns a list of Review */
|
39
|
+
array<AdviceSessionReview> index(AdviceSessionReviewFetchOption options);
|
40
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Advisor {
|
4
|
+
/** The main class for this protocol */
|
5
|
+
record Advisor {
|
6
|
+
/** The primary key */
|
7
|
+
int id;
|
8
|
+
int lawyer_id;
|
9
|
+
|
10
|
+
array<int> specialty_ids;
|
11
|
+
array<string> states;
|
12
|
+
boolean available;
|
13
|
+
array<int> offer_ids;
|
14
|
+
}
|
15
|
+
|
16
|
+
/** Options you can send for limiting Advisor results */
|
17
|
+
record AdvisorFetchOption {
|
18
|
+
/** Which page of records to fetch */
|
19
|
+
int page = 1;
|
20
|
+
|
21
|
+
/** How many records per page */
|
22
|
+
int per_page = 30;
|
23
|
+
}
|
24
|
+
|
25
|
+
/** Returns a list of Advisor */
|
26
|
+
array<Advisor> index(AdvisorFetchOption options);
|
27
|
+
|
28
|
+
/** Return a single Advisor */
|
29
|
+
array<Advisor> show(int id);
|
30
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol AdvisorConfig {
|
4
|
+
/** The main class for this protocol */
|
5
|
+
record AdvisorConfig {
|
6
|
+
array<string> enabled_states;
|
7
|
+
|
8
|
+
array<int> enabled_specialty_ids;
|
9
|
+
|
10
|
+
int default_advice_session_price_in_cents;
|
11
|
+
|
12
|
+
union {null, string} payment_gateway;
|
13
|
+
}
|
14
|
+
|
15
|
+
/** Return the Config */
|
16
|
+
array<AdvisorConfig> index();
|
17
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Common {
|
4
|
+
|
5
|
+
/** The main User class */
|
6
|
+
record User {
|
7
|
+
/** The primary key */
|
8
|
+
int id;
|
9
|
+
|
10
|
+
/** Their name */
|
11
|
+
string name;
|
12
|
+
|
13
|
+
/** The email address of the user */
|
14
|
+
string email_address;
|
15
|
+
|
16
|
+
/** An array of the names of all permissions the user has */
|
17
|
+
array<string> permissions;
|
18
|
+
}
|
19
|
+
|
20
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Lawyer {
|
4
|
+
|
5
|
+
/** The main class for this protocol */
|
6
|
+
record Lawyer {
|
7
|
+
/** The primary key */
|
8
|
+
int id;
|
9
|
+
|
10
|
+
/** Their name */
|
11
|
+
string firstname;
|
12
|
+
string middlename;
|
13
|
+
string lastname;
|
14
|
+
|
15
|
+
/** Is the lawyer claimed? */
|
16
|
+
boolean claimed;
|
17
|
+
|
18
|
+
/** id of claiming user **/
|
19
|
+
int claimed_by;
|
20
|
+
|
21
|
+
/** Url to their full-size headshot photo */
|
22
|
+
string headshot_url;
|
23
|
+
|
24
|
+
/** Avvo Rating (Scale of 1-10) */
|
25
|
+
float avvo_rating;
|
26
|
+
|
27
|
+
/** Average client review score (Scale of 1-5) */
|
28
|
+
float aggregate_client_review_score;
|
29
|
+
|
30
|
+
/** Number of reviews the average is based upon */
|
31
|
+
int client_review_count;
|
32
|
+
|
33
|
+
/** List of specialties this lawyer practices */
|
34
|
+
array<int> specialty_ids;
|
35
|
+
|
36
|
+
/** List of states this lawyer is licensed in */
|
37
|
+
array<string> licensed_states;
|
38
|
+
}
|
39
|
+
|
40
|
+
/** Look up many lawyers in bulk */
|
41
|
+
array<Lawyer> index();
|
42
|
+
|
43
|
+
/** Look up a single lawyer by id */
|
44
|
+
array<Lawyer> show(int id);
|
45
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Location {
|
4
|
+
|
5
|
+
/** The main class for this protocol */
|
6
|
+
record Location {
|
7
|
+
/** The primary key */
|
8
|
+
int id;
|
9
|
+
|
10
|
+
/** What type of record this is. (Gnomon::Country, Gnomon::State, Gnomon::County, Gnomon::City, Gnomon::PostalCode, Gnomon::Neighborhood) */
|
11
|
+
string type;
|
12
|
+
|
13
|
+
/** Name of the county this location is in (or nil) */
|
14
|
+
string county_name;
|
15
|
+
|
16
|
+
/** Name of the state this location is in (or nil) */
|
17
|
+
string state_name;
|
18
|
+
|
19
|
+
/** Short name of state **/
|
20
|
+
string state_code;
|
21
|
+
|
22
|
+
/** Name of the country this location is in (or nil) */
|
23
|
+
string country_name;
|
24
|
+
|
25
|
+
/** Name of the city this location is in (or nil) */
|
26
|
+
string city_name;
|
27
|
+
|
28
|
+
/** Name of the neighborhood this location is in (or nil) */
|
29
|
+
string neighborhood_name;
|
30
|
+
|
31
|
+
/** Zip code of this location (or nil) */
|
32
|
+
string postal_code_name;
|
33
|
+
|
34
|
+
/** Most common description of this location */
|
35
|
+
string to_location;
|
36
|
+
|
37
|
+
/** Shorter description of this location */
|
38
|
+
string to_short_location;
|
39
|
+
|
40
|
+
/** More verbose description of this location */
|
41
|
+
string to_long_location;
|
42
|
+
|
43
|
+
/** More verbose description of this location, usually with 3 levels of detail */
|
44
|
+
string to_location_with_region;
|
45
|
+
|
46
|
+
/** Latitude of the center of this location */
|
47
|
+
float latitude;
|
48
|
+
|
49
|
+
/** Longitude of the center of this location */
|
50
|
+
float longitude;
|
51
|
+
|
52
|
+
/** Approximate population of this location */
|
53
|
+
int population;
|
54
|
+
|
55
|
+
/** Datetime string of when this location was last updated */
|
56
|
+
string updated_at;
|
57
|
+
}
|
58
|
+
|
59
|
+
/** Options you can send for limiting Location results */
|
60
|
+
record LocationFetchOption {
|
61
|
+
/** Which page of records to fetch */
|
62
|
+
int page = 1;
|
63
|
+
|
64
|
+
/** How many records per page */
|
65
|
+
int per_page = 30;
|
66
|
+
}
|
67
|
+
|
68
|
+
/** Returns a list of Locations */
|
69
|
+
array<Location> index(LocationFetchOption options);
|
70
|
+
|
71
|
+
/** Return a single Location */
|
72
|
+
array<Location> show(int id);
|
73
|
+
|
74
|
+
/** Try to guess a location from a given string */
|
75
|
+
array<Location> resolve(string q);
|
76
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Offer {
|
4
|
+
|
5
|
+
record Package {
|
6
|
+
/** The primary key */
|
7
|
+
int id;
|
8
|
+
string name;
|
9
|
+
string short_description;
|
10
|
+
boolean call;
|
11
|
+
int call_duration_in_minutes;
|
12
|
+
boolean document;
|
13
|
+
int max_document_length_in_pages;
|
14
|
+
boolean claim_game;
|
15
|
+
boolean offline;
|
16
|
+
int specialty_id;
|
17
|
+
string micro_description;
|
18
|
+
}
|
19
|
+
|
20
|
+
/** The main class for this protocol */
|
21
|
+
record Offer {
|
22
|
+
/** The primary key */
|
23
|
+
int id;
|
24
|
+
int state_id;
|
25
|
+
int consumer_fee_in_cents;
|
26
|
+
Package package;
|
27
|
+
}
|
28
|
+
|
29
|
+
record OfferFetchOption {
|
30
|
+
/** Which page of records to fetch */
|
31
|
+
int page = 1;
|
32
|
+
|
33
|
+
/** How many records per page */
|
34
|
+
int per_page = 10;
|
35
|
+
|
36
|
+
/** The ID of the package this offer is associated with. */
|
37
|
+
int package_id;
|
38
|
+
|
39
|
+
/** Enabled meaning it is available for the public to purchase. */
|
40
|
+
boolean enabled;
|
41
|
+
|
42
|
+
/** The name of the package this offer is associated with. */
|
43
|
+
string name;
|
44
|
+
}
|
45
|
+
|
46
|
+
/** Returns a list of Offers */
|
47
|
+
array<Offer> index(OfferFetchOption options);
|
48
|
+
|
49
|
+
/** Return a single Offer */
|
50
|
+
array<Offer> show(int id);
|
51
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol Package {
|
4
|
+
|
5
|
+
/** The main class for this protocol */
|
6
|
+
record Package {
|
7
|
+
/** The primary key */
|
8
|
+
int id;
|
9
|
+
string name;
|
10
|
+
string short_description;
|
11
|
+
boolean call;
|
12
|
+
int call_duration_in_minutes;
|
13
|
+
boolean document;
|
14
|
+
int max_document_length_in_pages;
|
15
|
+
boolean claim_game;
|
16
|
+
boolean offline;
|
17
|
+
int specialty_id;
|
18
|
+
string micro_description;
|
19
|
+
}
|
20
|
+
|
21
|
+
record PackageFetchOption {
|
22
|
+
/** Which page of records to fetch */
|
23
|
+
int page = 1;
|
24
|
+
|
25
|
+
/** How many records per page */
|
26
|
+
int per_page = 10;
|
27
|
+
|
28
|
+
int specialty_id;
|
29
|
+
}
|
30
|
+
|
31
|
+
/** Returns a list of Packages */
|
32
|
+
array<Package> index(PackageFetchOption options);
|
33
|
+
|
34
|
+
/** Return a single Package */
|
35
|
+
array<Package> show(int id);
|
36
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
@namespace("Switchboard")
|
2
|
+
|
3
|
+
protocol PackageDetail {
|
4
|
+
|
5
|
+
/** The main class for this protocol */
|
6
|
+
record Package {
|
7
|
+
/** The primary key */
|
8
|
+
int id;
|
9
|
+
string name;
|
10
|
+
string short_description;
|
11
|
+
boolean call;
|
12
|
+
int call_duration_in_minutes;
|
13
|
+
boolean document;
|
14
|
+
int max_document_length_in_pages;
|
15
|
+
boolean claim_game;
|
16
|
+
boolean offline;
|
17
|
+
int specialty_id;
|
18
|
+
string how_it_works;
|
19
|
+
string whats_included;
|
20
|
+
string whats_not_included;
|
21
|
+
string micro_description;
|
22
|
+
string right_for_you_if;
|
23
|
+
string hero_image_url;
|
24
|
+
}
|
25
|
+
|
26
|
+
record PackageFetchOption {
|
27
|
+
/** Which page of records to fetch */
|
28
|
+
int page = 1;
|
29
|
+
|
30
|
+
/** How many records per page */
|
31
|
+
int per_page = 10;
|
32
|
+
|
33
|
+
int specialty_id;
|
34
|
+
}
|
35
|
+
|
36
|
+
/** Returns a list of Packages */
|
37
|
+
array<Package> index(PackageFetchOption options);
|
38
|
+
|
39
|
+
/** Return a single Package */
|
40
|
+
array<Package> show(int id);
|
41
|
+
}
|