switchboard-contract 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,100 @@
1
+ {
2
+ "protocol" : "PackageDetail",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "Package",
7
+ "doc" : "The main class for this protocol",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The primary key"
12
+ }, {
13
+ "name" : "name",
14
+ "type" : "string"
15
+ }, {
16
+ "name" : "short_description",
17
+ "type" : "string"
18
+ }, {
19
+ "name" : "call",
20
+ "type" : "boolean"
21
+ }, {
22
+ "name" : "call_duration_in_minutes",
23
+ "type" : "int"
24
+ }, {
25
+ "name" : "document",
26
+ "type" : "boolean"
27
+ }, {
28
+ "name" : "max_document_length_in_pages",
29
+ "type" : "int"
30
+ }, {
31
+ "name" : "claim_game",
32
+ "type" : "boolean"
33
+ }, {
34
+ "name" : "offline",
35
+ "type" : "boolean"
36
+ }, {
37
+ "name" : "specialty_id",
38
+ "type" : "int"
39
+ }, {
40
+ "name" : "how_it_works",
41
+ "type" : "string"
42
+ }, {
43
+ "name" : "whats_included",
44
+ "type" : "string"
45
+ }, {
46
+ "name" : "whats_not_included",
47
+ "type" : "string"
48
+ }, {
49
+ "name" : "micro_description",
50
+ "type" : "string"
51
+ }, {
52
+ "name" : "right_for_you_if",
53
+ "type" : "string"
54
+ }, {
55
+ "name" : "hero_image_url",
56
+ "type" : "string"
57
+ } ]
58
+ }, {
59
+ "type" : "record",
60
+ "name" : "PackageFetchOption",
61
+ "fields" : [ {
62
+ "name" : "page",
63
+ "type" : "int",
64
+ "doc" : "Which page of records to fetch",
65
+ "default" : 1
66
+ }, {
67
+ "name" : "per_page",
68
+ "type" : "int",
69
+ "doc" : "How many records per page",
70
+ "default" : 10
71
+ }, {
72
+ "name" : "specialty_id",
73
+ "type" : "int"
74
+ } ]
75
+ } ],
76
+ "messages" : {
77
+ "index" : {
78
+ "doc" : "Returns a list of Packages",
79
+ "request" : [ {
80
+ "name" : "options",
81
+ "type" : "PackageFetchOption"
82
+ } ],
83
+ "response" : {
84
+ "type" : "array",
85
+ "items" : "Package"
86
+ }
87
+ },
88
+ "show" : {
89
+ "doc" : "Return a single Package",
90
+ "request" : [ {
91
+ "name" : "id",
92
+ "type" : "int"
93
+ } ],
94
+ "response" : {
95
+ "type" : "array",
96
+ "items" : "Package"
97
+ }
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "protocol" : "ProviderOffer",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "Package",
7
+ "doc" : "The main class for this protocol",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The primary key"
12
+ }, {
13
+ "name" : "name",
14
+ "type" : "string"
15
+ }, {
16
+ "name" : "short_description",
17
+ "type" : "string"
18
+ }, {
19
+ "name" : "call",
20
+ "type" : "boolean"
21
+ }, {
22
+ "name" : "call_duration_in_minutes",
23
+ "type" : "int"
24
+ }, {
25
+ "name" : "document",
26
+ "type" : "boolean"
27
+ }, {
28
+ "name" : "max_document_length_in_pages",
29
+ "type" : "int"
30
+ }, {
31
+ "name" : "claim_game",
32
+ "type" : "boolean"
33
+ }, {
34
+ "name" : "offline",
35
+ "type" : "boolean"
36
+ }, {
37
+ "name" : "specialty_id",
38
+ "type" : "int"
39
+ }, {
40
+ "name" : "micro_description",
41
+ "type" : "string"
42
+ } ]
43
+ }, {
44
+ "type" : "record",
45
+ "name" : "PackageFetchOption",
46
+ "fields" : [ {
47
+ "name" : "page",
48
+ "type" : "int",
49
+ "doc" : "Which page of records to fetch",
50
+ "default" : 1
51
+ }, {
52
+ "name" : "per_page",
53
+ "type" : "int",
54
+ "doc" : "How many records per page",
55
+ "default" : 10
56
+ }, {
57
+ "name" : "specialty_id",
58
+ "type" : "int"
59
+ } ]
60
+ }, {
61
+ "type" : "record",
62
+ "name" : "ProviderOffer",
63
+ "doc" : "The main class for this protocol",
64
+ "fields" : [ {
65
+ "name" : "id",
66
+ "type" : "int",
67
+ "doc" : "The primary key"
68
+ }, {
69
+ "name" : "state_id",
70
+ "type" : "int"
71
+ }, {
72
+ "name" : "lawyer_id",
73
+ "type" : "int"
74
+ }, {
75
+ "name" : "provider_id",
76
+ "type" : "int"
77
+ }, {
78
+ "name" : "offer_id",
79
+ "type" : "int"
80
+ }, {
81
+ "name" : "consumer_fee_in_cents",
82
+ "type" : "int"
83
+ }, {
84
+ "name" : "available",
85
+ "type" : "boolean"
86
+ }, {
87
+ "name" : "package",
88
+ "type" : "Package"
89
+ } ]
90
+ }, {
91
+ "type" : "record",
92
+ "name" : "ProviderOfferFetchOption",
93
+ "fields" : [ {
94
+ "name" : "page",
95
+ "type" : "int",
96
+ "doc" : "Which page of records to fetch",
97
+ "default" : 1
98
+ }, {
99
+ "name" : "per_page",
100
+ "type" : "int",
101
+ "doc" : "How many records per page",
102
+ "default" : 10
103
+ }, {
104
+ "name" : "provider_id",
105
+ "type" : "int"
106
+ }, {
107
+ "name" : "offer_id",
108
+ "type" : "int"
109
+ }, {
110
+ "name" : "state_id",
111
+ "type" : "int"
112
+ }, {
113
+ "name" : "specialty_id",
114
+ "type" : "int"
115
+ }, {
116
+ "name" : "available",
117
+ "type" : "boolean"
118
+ } ]
119
+ } ],
120
+ "messages" : {
121
+ "index" : {
122
+ "doc" : "Returns a list of ProviderOffers",
123
+ "request" : [ {
124
+ "name" : "options",
125
+ "type" : "ProviderOfferFetchOption"
126
+ } ],
127
+ "response" : {
128
+ "type" : "array",
129
+ "items" : "ProviderOffer"
130
+ }
131
+ },
132
+ "show" : {
133
+ "doc" : "Return a single ProviderOffer",
134
+ "request" : [ {
135
+ "name" : "id",
136
+ "type" : "int"
137
+ } ],
138
+ "response" : {
139
+ "type" : "array",
140
+ "items" : "ProviderOffer"
141
+ }
142
+ }
143
+ }
144
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "protocol" : "Specialty",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "SpecialtyCompact",
7
+ "fields" : [ {
8
+ "name" : "id",
9
+ "type" : "int",
10
+ "doc" : "The primary key"
11
+ }, {
12
+ "name" : "name",
13
+ "type" : "string",
14
+ "doc" : "Name of the specialty"
15
+ } ]
16
+ }, {
17
+ "type" : "record",
18
+ "name" : "Specialty",
19
+ "doc" : "The main class for this protocol",
20
+ "fields" : [ {
21
+ "name" : "id",
22
+ "type" : "int",
23
+ "doc" : "The primary key"
24
+ }, {
25
+ "name" : "name",
26
+ "type" : "string",
27
+ "doc" : "Name of the specialty"
28
+ }, {
29
+ "name" : "image_url",
30
+ "type" : "string",
31
+ "doc" : "Url to the icon representing this specialty"
32
+ }, {
33
+ "name" : "ancestors",
34
+ "type" : {
35
+ "type" : "array",
36
+ "items" : "SpecialtyCompact"
37
+ }
38
+ } ]
39
+ } ],
40
+ "messages" : {
41
+ "index" : {
42
+ "doc" : "Look up many specialties in bulk",
43
+ "request" : [ ],
44
+ "response" : {
45
+ "type" : "array",
46
+ "items" : "Specialty"
47
+ }
48
+ },
49
+ "show" : {
50
+ "doc" : "Look up a specialty by id",
51
+ "request" : [ {
52
+ "name" : "id",
53
+ "type" : "int"
54
+ } ],
55
+ "response" : {
56
+ "type" : "array",
57
+ "items" : "Specialty"
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "protocol" : "User",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "User",
7
+ "doc" : "The main User class",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The primary key"
12
+ }, {
13
+ "name" : "name",
14
+ "type" : "string",
15
+ "doc" : "Their name"
16
+ }, {
17
+ "name" : "email_address",
18
+ "type" : "string",
19
+ "doc" : "The email address of the user"
20
+ }, {
21
+ "name" : "permissions",
22
+ "type" : {
23
+ "type" : "array",
24
+ "items" : "string"
25
+ },
26
+ "doc" : "An array of the names of all permissions the user has"
27
+ } ]
28
+ } ],
29
+ "messages" : {
30
+ "index" : {
31
+ "doc" : "Look up many Users in bulk",
32
+ "request" : [ ],
33
+ "response" : {
34
+ "type" : "array",
35
+ "items" : "User"
36
+ }
37
+ },
38
+ "show" : {
39
+ "doc" : "Look up a single User by id",
40
+ "request" : [ {
41
+ "name" : "id",
42
+ "type" : "int"
43
+ } ],
44
+ "response" : {
45
+ "type" : "array",
46
+ "items" : "User"
47
+ }
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "protocol" : "UserAuthentication",
3
+ "namespace" : "Switchboard",
4
+ "types" : [ {
5
+ "type" : "record",
6
+ "name" : "UserAuthenticationUser",
7
+ "doc" : "The main User class",
8
+ "fields" : [ {
9
+ "name" : "id",
10
+ "type" : "int",
11
+ "doc" : "The primary key"
12
+ }, {
13
+ "name" : "name",
14
+ "type" : "string",
15
+ "doc" : "Their name"
16
+ }, {
17
+ "name" : "email_address",
18
+ "type" : "string",
19
+ "doc" : "The email address of the user"
20
+ }, {
21
+ "name" : "permissions",
22
+ "type" : {
23
+ "type" : "array",
24
+ "items" : "string"
25
+ },
26
+ "doc" : "An array of the names of all permissions the user has"
27
+ }, {
28
+ "name" : "lawyer_id",
29
+ "type" : [ "null", "int" ],
30
+ "doc" : "The id of the lawyer this user has claimed, if any"
31
+ } ]
32
+ }, {
33
+ "type" : "record",
34
+ "name" : "UserAuthentication",
35
+ "fields" : [ {
36
+ "name" : "user",
37
+ "type" : "UserAuthenticationUser",
38
+ "doc" : "The authorized user"
39
+ }, {
40
+ "name" : "access_token",
41
+ "type" : "string",
42
+ "doc" : "An OAuth2 access token the client can use on this user's behalf"
43
+ } ]
44
+ }, {
45
+ "type" : "record",
46
+ "name" : "UserRegistrationParams",
47
+ "doc" : "When registering a user, provide these options",
48
+ "fields" : [ {
49
+ "name" : "email_address",
50
+ "type" : "string",
51
+ "doc" : "User's email address"
52
+ }, {
53
+ "name" : "password",
54
+ "type" : "string",
55
+ "doc" : "User's new password"
56
+ }, {
57
+ "name" : "name",
58
+ "type" : [ "string", "null" ],
59
+ "doc" : "User's display name name"
60
+ } ]
61
+ }, {
62
+ "type" : "enum",
63
+ "name" : "SocialNetwork",
64
+ "doc" : "All the allowed different social networks that we can auth via",
65
+ "symbols" : [ "FACEBOOK", "GOOGLE", "TWITTER", "LINKEDIN" ]
66
+ } ],
67
+ "messages" : {
68
+ "register" : {
69
+ "doc" : "POST: Register a user by email_address and password",
70
+ "request" : [ {
71
+ "name" : "user",
72
+ "type" : "UserRegistrationParams"
73
+ } ],
74
+ "response" : {
75
+ "type" : "array",
76
+ "items" : "UserAuthentication"
77
+ }
78
+ },
79
+ "authenticate" : {
80
+ "doc" : "POST: Authenticate a user via email_address and password",
81
+ "request" : [ {
82
+ "name" : "email_address",
83
+ "type" : "string"
84
+ }, {
85
+ "name" : "password",
86
+ "type" : "string"
87
+ } ],
88
+ "response" : {
89
+ "type" : "array",
90
+ "items" : "UserAuthentication"
91
+ }
92
+ },
93
+ "find_or_create_via_social" : {
94
+ "doc" : "POST: Login or register via a social network",
95
+ "request" : [ {
96
+ "name" : "social_network",
97
+ "type" : "SocialNetwork"
98
+ }, {
99
+ "name" : "access_token",
100
+ "type" : "string"
101
+ }, {
102
+ "name" : "secret",
103
+ "type" : [ "null", "string" ]
104
+ } ],
105
+ "response" : {
106
+ "type" : "array",
107
+ "items" : "UserAuthentication"
108
+ }
109
+ }
110
+ }
111
+ }