switchboard-contract 1.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +31 -0
  4. data/Rakefile +3 -0
  5. data/contracts/3/compiled/advice_session.avpr +190 -0
  6. data/contracts/3/compiled/advice_session_image.avpr +36 -0
  7. data/contracts/3/compiled/advice_session_review.avpr +90 -0
  8. data/contracts/3/compiled/advisor.avpr +77 -0
  9. data/contracts/3/compiled/advisor_config.avpr +38 -0
  10. data/contracts/3/compiled/lawyer.avpr +83 -0
  11. data/contracts/3/compiled/location.avpr +128 -0
  12. data/contracts/3/compiled/offer.avpr +111 -0
  13. data/contracts/3/compiled/package.avpr +85 -0
  14. data/contracts/3/compiled/package_detail.avpr +100 -0
  15. data/contracts/3/compiled/provider_offer.avpr +144 -0
  16. data/contracts/3/compiled/specialty.avpr +61 -0
  17. data/contracts/3/compiled/user.avpr +50 -0
  18. data/contracts/3/compiled/user_authentication.avpr +111 -0
  19. data/contracts/3/source/advice_session.avdl +72 -0
  20. data/contracts/3/source/advice_session_image.avdl +16 -0
  21. data/contracts/3/source/advice_session_review.avdl +40 -0
  22. data/contracts/3/source/advisor.avdl +30 -0
  23. data/contracts/3/source/advisor_config.avdl +17 -0
  24. data/contracts/3/source/common.inc +20 -0
  25. data/contracts/3/source/lawyer.avdl +45 -0
  26. data/contracts/3/source/location.avdl +76 -0
  27. data/contracts/3/source/offer.avdl +51 -0
  28. data/contracts/3/source/package.avdl +36 -0
  29. data/contracts/3/source/package_detail.avdl +41 -0
  30. data/contracts/3/source/provider_offer.avdl +38 -0
  31. data/contracts/3/source/specialty.avdl +33 -0
  32. data/contracts/3/source/user.avdl +12 -0
  33. data/contracts/3/source/user_authentication.avdl +57 -0
  34. data/contracts/4/compiled/lawyer.avpr +127 -0
  35. data/contracts/4/compiled/lawyer_address.avpr +54 -0
  36. data/contracts/4/compiled/review.avpr +44 -0
  37. data/contracts/4/compiled/specialty.avpr +43 -0
  38. data/contracts/4/source/lawyer.avdl +69 -0
  39. data/contracts/4/source/lawyer_address.avdl +31 -0
  40. data/contracts/4/source/review.avdl +28 -0
  41. data/contracts/4/source/specialty.avdl +23 -0
  42. data/contracts/messaging/compiled/access_token.avpr +41 -0
  43. data/contracts/messaging/compiled/channel.avpr +111 -0
  44. data/contracts/messaging/source/access_token.avdl +21 -0
  45. data/contracts/messaging/source/channel.avdl +59 -0
  46. data/contracts/mobile/compiled/advice_session.avpr +160 -0
  47. data/contracts/mobile/compiled/checkout.avpr +115 -0
  48. data/contracts/mobile/compiled/lawyer.avpr +787 -0
  49. data/contracts/mobile/compiled/offer.avpr +111 -0
  50. data/contracts/mobile/compiled/package.avpr +85 -0
  51. data/contracts/mobile/compiled/package_detail.avpr +100 -0
  52. data/contracts/mobile/compiled/package_slug.avpr +67 -0
  53. data/contracts/mobile/compiled/promotion.avpr +45 -0
  54. data/contracts/mobile/compiled/provider_offer.avpr +144 -0
  55. data/contracts/mobile/compiled/review.avpr +83 -0
  56. data/contracts/mobile/compiled/specialty.avpr +55 -0
  57. data/contracts/mobile/source/advice_session.avdl +61 -0
  58. data/contracts/mobile/source/checkout.avdl +90 -0
  59. data/contracts/mobile/source/lawyer.avdl +321 -0
  60. data/contracts/mobile/source/offer.avdl +51 -0
  61. data/contracts/mobile/source/package.avdl +36 -0
  62. data/contracts/mobile/source/package_detail.avdl +41 -0
  63. data/contracts/mobile/source/package_slug.avdl +30 -0
  64. data/contracts/mobile/source/promotion.avdl +18 -0
  65. data/contracts/mobile/source/provider_offer.avdl +38 -0
  66. data/contracts/mobile/source/review.avdl +43 -0
  67. data/contracts/mobile/source/specialty.avdl +32 -0
  68. data/contracts/sales_force/compiled/account.avpr +94 -0
  69. data/contracts/sales_force/compiled/account_professional.avpr +39 -0
  70. data/contracts/sales_force/source/account.avdl +50 -0
  71. data/contracts/sales_force/source/account_professional.avdl +14 -0
  72. data/contracts/verify/compiled/lawyer.avpr +79 -0
  73. data/contracts/verify/compiled/license.avpr +64 -0
  74. data/contracts/verify/source/lawyer.avdl +41 -0
  75. data/contracts/verify/source/license.avdl +36 -0
  76. data/lib/switchboard/contract.rb +8 -0
  77. data/lib/switchboard/contract/documentation.rb +7 -0
  78. data/lib/switchboard/contract/service.rb +15 -0
  79. data/lib/switchboard/contract/version.rb +5 -0
  80. metadata +164 -0
@@ -0,0 +1,31 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol LawyerAddress {
4
+
5
+ /** The main class for this protocol */
6
+ record LawyerAddress {
7
+ /** The LawyerAddress's id */
8
+ int id;
9
+
10
+ /** The lawyer's id */
11
+ int lawyer_id;
12
+
13
+ /** The first line of the address */
14
+ string line1;
15
+
16
+ /** The second line of the address */
17
+ string line2;
18
+
19
+ /** The city of the address */
20
+ string city;
21
+
22
+ /** The state abbreviation of the address */
23
+ string state_code;
24
+
25
+ /** The postal code of the address */
26
+ string postal_code;
27
+ }
28
+
29
+ /** Look up many adddresses in bulk */
30
+ array<LawyerAddress> index(int lawyer_id, string lawyer_ids);
31
+ }
@@ -0,0 +1,28 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Review {
4
+
5
+ /** The main class for this protocol */
6
+ record Review {
7
+ /** The reviews's id */
8
+ int id;
9
+
10
+ /** The lawyer's id */
11
+ int lawyer_id;
12
+
13
+ /** Overall rating **/
14
+ int rating;
15
+
16
+ /** Title of the Review */
17
+ string title;
18
+
19
+ /** The body text of the review */
20
+ string body;
21
+
22
+ /** The integer timestamp of when the review was created */
23
+ int created_at;
24
+ }
25
+
26
+ /** Look up many reviews in bulk */
27
+ array<Review> index();
28
+ }
@@ -0,0 +1,23 @@
1
+ @namespace("Switchboard")
2
+
3
+ protocol Specialty {
4
+
5
+ /** The main class for this protocol */
6
+ record Specialty {
7
+ /** The primary key */
8
+ int id;
9
+
10
+ /** Name of the specialty */
11
+ string name;
12
+
13
+ /** Url to the icon representing this specialty */
14
+ string description;
15
+ }
16
+
17
+ /** Look up many specialties in bulk */
18
+ array<Specialty> index();
19
+
20
+ /** Look up a specialty by id */
21
+ array<Specialty> show(int id);
22
+
23
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "protocol" : "AccessToken",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "AccessToken",
7
+ "doc" : "A Twilio Access token that the client can use to authenticate with Avvo's Twilio IP Messaging Channels",
8
+ "fields" : [ {
9
+ "name" : "identity",
10
+ "type" : "string"
11
+ }, {
12
+ "name" : "token",
13
+ "type" : "string"
14
+ } ]
15
+ }, {
16
+ "type" : "record",
17
+ "name" : "AccessTokenRequestParams",
18
+ "doc" : "The accepted attributes that we'd like to fetch by in the index endpoint",
19
+ "fields" : [ {
20
+ "name" : "push_notifications_sid",
21
+ "type" : [ "null", "int" ],
22
+ "doc" : "The Twilio Push Notifications SID for the client, used primarily by the iOS SDK"
23
+ }, {
24
+ "name" : "endpoint_id",
25
+ "type" : [ "null", "int" ],
26
+ "doc" : "The unique endpoint ID for the IP Messaging Client"
27
+ } ]
28
+ } ],
29
+ "messages" : {
30
+ "index" : {
31
+ "request" : [ {
32
+ "name" : "params",
33
+ "type" : "AccessTokenRequestParams"
34
+ } ],
35
+ "response" : {
36
+ "type" : "array",
37
+ "items" : "AccessToken"
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "protocol" : "Channel",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "Channel",
7
+ "doc" : "A Chat Channel, includes basic information allowing client to setup",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The Avvo ID for the partner user of the channel"
12
+ }, {
13
+ "name" : "channel_sid",
14
+ "type" : "string",
15
+ "doc" : "The Twilio Service ID for the Channel"
16
+ }, {
17
+ "name" : "operating_user_id",
18
+ "type" : "int",
19
+ "doc" : "The Avvo ID for the operating user"
20
+ }, {
21
+ "name" : "operating_user_sid",
22
+ "type" : "string",
23
+ "doc" : "The Twilio Service ID for the operating user"
24
+ }, {
25
+ "name" : "operating_user_identity",
26
+ "type" : "string",
27
+ "doc" : "The Twilio Unique Identifier for the operating user"
28
+ }, {
29
+ "name" : "partner_sid",
30
+ "type" : "string",
31
+ "doc" : "The Twilio Service ID for the partner user"
32
+ }, {
33
+ "name" : "partner_identity",
34
+ "type" : "string",
35
+ "doc" : "The Twilio Unique Identifier for the partner user"
36
+ }, {
37
+ "name" : "archived",
38
+ "type" : "boolean",
39
+ "doc" : "Is the channel archived by the operating user"
40
+ }, {
41
+ "name" : "spam",
42
+ "type" : "boolean",
43
+ "doc" : "Is the channel marked as spam by the operating user"
44
+ } ]
45
+ }, {
46
+ "type" : "record",
47
+ "name" : "ChannelSearchParams",
48
+ "doc" : "Accepted parameters for filtering channels",
49
+ "fields" : [ {
50
+ "name" : "spam",
51
+ "type" : [ "boolean", "null" ],
52
+ "doc" : "Show only records marked as spam?"
53
+ }, {
54
+ "name" : "archived",
55
+ "type" : [ "boolean", "null" ],
56
+ "doc" : "Show only records marked as archived"
57
+ }, {
58
+ "name" : "partner_user_id",
59
+ "type" : [ "int", "null" ],
60
+ "doc" : "Filter the given user's channels by the user id of the partner user"
61
+ } ]
62
+ }, {
63
+ "type" : "record",
64
+ "name" : "UpdateChannelParams",
65
+ "doc" : "Accepted inbound attributes for updating a channel",
66
+ "fields" : [ {
67
+ "name" : "spam",
68
+ "type" : [ "boolean", "null" ],
69
+ "doc" : "Should the new record be marked as spam?"
70
+ }, {
71
+ "name" : "archived",
72
+ "type" : [ "boolean", "null" ],
73
+ "doc" : "Should the new record be archived?"
74
+ } ]
75
+ } ],
76
+ "messages" : {
77
+ "index" : {
78
+ "request" : [ {
79
+ "name" : "params",
80
+ "type" : "ChannelSearchParams"
81
+ } ],
82
+ "response" : {
83
+ "type" : "array",
84
+ "items" : "Channel"
85
+ }
86
+ },
87
+ "show" : {
88
+ "request" : [ {
89
+ "name" : "id",
90
+ "type" : "int"
91
+ } ],
92
+ "response" : {
93
+ "type" : "array",
94
+ "items" : "Channel"
95
+ }
96
+ },
97
+ "update" : {
98
+ "request" : [ {
99
+ "name" : "id",
100
+ "type" : "int"
101
+ }, {
102
+ "name" : "channel",
103
+ "type" : "UpdateChannelParams"
104
+ } ],
105
+ "response" : {
106
+ "type" : "array",
107
+ "items" : "Channel"
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,21 @@
1
+ @namespace("Switchboard")
2
+ protocol AccessToken {
3
+ /** A Twilio Access token that the client can use to authenticate with Avvo's Twilio IP Messaging Channels */
4
+
5
+ record AccessToken {
6
+ string identity;
7
+ string token;
8
+ }
9
+
10
+ /** The accepted attributes that we'd like to fetch by in the index endpoint */
11
+ record AccessTokenRequestParams {
12
+ /** The Twilio Push Notifications SID for the client, used primarily by the iOS SDK */
13
+ union { null, int } push_notifications_sid;
14
+
15
+ /** The unique endpoint ID for the IP Messaging Client */
16
+ union { null, int } endpoint_id;
17
+ }
18
+
19
+ array<AccessToken> index(AccessTokenRequestParams params);
20
+ }
21
+
@@ -0,0 +1,59 @@
1
+ @namespace("Switchboard")
2
+ protocol Channel {
3
+ /** A Chat Channel, includes basic information allowing client to setup */
4
+
5
+ record Channel {
6
+ /** The Avvo ID for the partner user of the channel */
7
+ int id;
8
+
9
+ /** The Twilio Service ID for the Channel */
10
+ string channel_sid;
11
+
12
+ /** The Avvo ID for the operating user */
13
+ int operating_user_id;
14
+
15
+ /** The Twilio Service ID for the operating user */
16
+ string operating_user_sid;
17
+
18
+ /** The Twilio Unique Identifier for the operating user */
19
+ string operating_user_identity;
20
+
21
+ /** The Twilio Service ID for the partner user */
22
+ string partner_sid;
23
+
24
+ /** The Twilio Unique Identifier for the partner user */
25
+ string partner_identity;
26
+
27
+ /** Is the channel archived by the operating user */
28
+ boolean archived;
29
+
30
+ /** Is the channel marked as spam by the operating user */
31
+ boolean spam;
32
+ }
33
+
34
+ /** Accepted parameters for filtering channels */
35
+ record ChannelSearchParams {
36
+ /** Show only records marked as spam? */
37
+ union { boolean, null } spam;
38
+
39
+ /** Show only records marked as archived */
40
+ union { boolean, null } archived;
41
+
42
+ /** Filter the given user's channels by the user id of the partner user */
43
+ union { int, null } partner_user_id;
44
+ }
45
+
46
+ /** Accepted inbound attributes for updating a channel */
47
+ record UpdateChannelParams {
48
+ /** Should the new record be marked as spam? */
49
+ union { boolean, null } spam;
50
+
51
+ /** Should the new record be archived? */
52
+ union { boolean, null } archived;
53
+ }
54
+
55
+ array<Channel> index(ChannelSearchParams params);
56
+ array<Channel> show(int id);
57
+ array<Channel> update(int id, UpdateChannelParams `channel`);
58
+ }
59
+
@@ -0,0 +1,160 @@
1
+ {
2
+ "protocol" : "AdviceSession",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "AdviceSession",
7
+ "doc" : "The main class for this protocol",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The primary key"
12
+ }, {
13
+ "name" : "specialty_id",
14
+ "type" : "int"
15
+ }, {
16
+ "name" : "advisor_id",
17
+ "type" : "int"
18
+ }, {
19
+ "name" : "review_id",
20
+ "type" : "int"
21
+ }, {
22
+ "name" : "chose_advisor",
23
+ "type" : "boolean"
24
+ }, {
25
+ "name" : "state",
26
+ "type" : "string"
27
+ }, {
28
+ "name" : "called",
29
+ "type" : "boolean"
30
+ }, {
31
+ "name" : "advice_session_image_token",
32
+ "type" : [ "null", "string" ],
33
+ "default" : null
34
+ }, {
35
+ "name" : "advice_session_image_tokens",
36
+ "type" : {
37
+ "type" : "array",
38
+ "items" : "string"
39
+ }
40
+ } ]
41
+ }, {
42
+ "type" : "record",
43
+ "name" : "AdviceSessionFetchOption",
44
+ "doc" : "Options you can send for limiting AdviceSession results",
45
+ "fields" : [ {
46
+ "name" : "page",
47
+ "type" : "int",
48
+ "doc" : "Which page of records to fetch",
49
+ "default" : 1
50
+ }, {
51
+ "name" : "per_page",
52
+ "type" : "int",
53
+ "doc" : "How many records per page",
54
+ "default" : 30
55
+ } ]
56
+ }, {
57
+ "type" : "record",
58
+ "name" : "AdviceSessionCreateParams",
59
+ "doc" : "Params to create a new AdviceSession",
60
+ "fields" : [ {
61
+ "name" : "specialty_id",
62
+ "type" : "int"
63
+ }, {
64
+ "name" : "advisor_id",
65
+ "type" : "int"
66
+ }, {
67
+ "name" : "state",
68
+ "type" : "string"
69
+ }, {
70
+ "name" : "client_name",
71
+ "type" : "string"
72
+ }, {
73
+ "name" : "client_email_address",
74
+ "type" : "string"
75
+ }, {
76
+ "name" : "client_phone_number",
77
+ "type" : "string"
78
+ }, {
79
+ "name" : "payment_gateway",
80
+ "type" : [ "null", "string" ],
81
+ "default" : null
82
+ }, {
83
+ "name" : "card_href",
84
+ "type" : "string"
85
+ }, {
86
+ "name" : "name_on_card",
87
+ "type" : "string"
88
+ }, {
89
+ "name" : "advice_session_image_token",
90
+ "type" : [ "null", "string" ],
91
+ "default" : null
92
+ }, {
93
+ "name" : "advice_session_image_tokens",
94
+ "type" : {
95
+ "type" : "array",
96
+ "items" : "string"
97
+ }
98
+ }, {
99
+ "name" : "promo_code",
100
+ "type" : [ "null", "string" ],
101
+ "default" : null
102
+ } ]
103
+ }, {
104
+ "type" : "record",
105
+ "name" : "AdviceSessionPromoCode",
106
+ "fields" : [ {
107
+ "name" : "promo_discount_amount_in_cents",
108
+ "type" : "int"
109
+ }, {
110
+ "name" : "promo_advice_session_price_in_cents",
111
+ "type" : "int"
112
+ } ]
113
+ } ],
114
+ "messages" : {
115
+ "index" : {
116
+ "doc" : "Returns a list of AdviceSession",
117
+ "request" : [ {
118
+ "name" : "options",
119
+ "type" : "AdviceSessionFetchOption"
120
+ } ],
121
+ "response" : {
122
+ "type" : "array",
123
+ "items" : "AdviceSession"
124
+ }
125
+ },
126
+ "show" : {
127
+ "doc" : "Return a single AdviceSession",
128
+ "request" : [ {
129
+ "name" : "id",
130
+ "type" : "int"
131
+ } ],
132
+ "response" : {
133
+ "type" : "array",
134
+ "items" : "AdviceSession"
135
+ }
136
+ },
137
+ "create" : {
138
+ "doc" : "Create a new AdviceSession",
139
+ "request" : [ {
140
+ "name" : "advice_session",
141
+ "type" : "AdviceSessionCreateParams"
142
+ } ],
143
+ "response" : {
144
+ "type" : "array",
145
+ "items" : "AdviceSession"
146
+ }
147
+ },
148
+ "find_promo_code" : {
149
+ "doc" : "Apply an Advice Session Promo Code",
150
+ "request" : [ {
151
+ "name" : "promo_code",
152
+ "type" : "string"
153
+ } ],
154
+ "response" : {
155
+ "type" : "array",
156
+ "items" : "AdviceSessionPromoCode"
157
+ }
158
+ }
159
+ }
160
+ }