{ "protocol" : "AdviceSession", "namespace" : "Switchboard", "types" : [ { "type" : "record", "name" : "AdviceSession", "doc" : "The main class for this protocol", "fields" : [ { "name" : "id", "type" : "int", "doc" : "The primary key" }, { "name" : "specialty_id", "type" : "int" }, { "name" : "advisor_id", "type" : "int" }, { "name" : "review_id", "type" : "int" }, { "name" : "chose_advisor", "type" : "boolean" }, { "name" : "state", "type" : "string" }, { "name" : "called", "type" : "boolean" }, { "name" : "advice_session_image_token", "type" : [ "null", "string" ], "default" : null }, { "name" : "advice_session_image_tokens", "type" : { "type" : "array", "items" : "string" } }, { "name" : "name", "type" : "string" }, { "name" : "email_address", "type" : "string" }, { "name" : "phone_number", "type" : "string" }, { "name" : "payment_amount", "type" : "int" }, { "name" : "promo_code", "type" : "string" }, { "name" : "offer_id", "type" : "int" }, { "name" : "location_id", "type" : "int" }, { "name" : "lawyer_id", "type" : "int" }, { "name" : "package_id", "type" : "int" }, { "name" : "package_name", "type" : "string" } ] }, { "type" : "record", "name" : "AdviceSessionFetchOption", "doc" : "Options you can send for limiting AdviceSession results", "fields" : [ { "name" : "page", "type" : "int", "doc" : "Which page of records to fetch", "default" : 1 }, { "name" : "per_page", "type" : "int", "doc" : "How many records per page", "default" : 30 } ] }, { "type" : "record", "name" : "AdviceSessionCreateParams", "doc" : "Params to create a new AdviceSession", "fields" : [ { "name" : "specialty_id", "type" : "int" }, { "name" : "advisor_id", "type" : "int" }, { "name" : "state", "type" : "string" }, { "name" : "client_name", "type" : "string" }, { "name" : "client_email_address", "type" : "string" }, { "name" : "client_phone_number", "type" : "string" }, { "name" : "payment_gateway", "type" : [ "null", "string" ], "default" : null }, { "name" : "card_href", "type" : "string" }, { "name" : "name_on_card", "type" : "string" }, { "name" : "advice_session_image_token", "type" : [ "null", "string" ], "default" : null }, { "name" : "advice_session_image_tokens", "type" : { "type" : "array", "items" : "string" } }, { "name" : "promo_code", "type" : [ "null", "string" ], "default" : null } ] }, { "type" : "record", "name" : "AdviceSessionPromoCode", "fields" : [ { "name" : "promo_discount_amount_in_cents", "type" : "int" }, { "name" : "promo_advice_session_price_in_cents", "type" : "int" } ] } ], "messages" : { "index" : { "doc" : "Returns a list of AdviceSession", "request" : [ { "name" : "options", "type" : "AdviceSessionFetchOption" } ], "response" : { "type" : "array", "items" : "AdviceSession" } }, "show" : { "doc" : "Return a single AdviceSession", "request" : [ { "name" : "id", "type" : "int" } ], "response" : { "type" : "array", "items" : "AdviceSession" } }, "create" : { "doc" : "Create a new AdviceSession", "request" : [ { "name" : "advice_session", "type" : "AdviceSessionCreateParams" } ], "response" : { "type" : "array", "items" : "AdviceSession" } }, "find_promo_code" : { "doc" : "Apply an Advice Session Promo Code", "request" : [ { "name" : "promo_code", "type" : "string" } ], "response" : { "type" : "array", "items" : "AdviceSessionPromoCode" } } } }