{ "protocol" : "Offer", "namespace" : "Switchboard", "types" : [ { "type" : "record", "name" : "Package", "fields" : [ { "name" : "id", "type" : "int", "doc" : "The primary key" }, { "name" : "name", "type" : "string" }, { "name" : "short_description", "type" : "string" }, { "name" : "call", "type" : "boolean" }, { "name" : "call_duration_in_minutes", "type" : "int" }, { "name" : "document", "type" : "boolean" }, { "name" : "max_document_length_in_pages", "type" : "int" }, { "name" : "claim_game", "type" : "boolean" }, { "name" : "offline", "type" : "boolean" }, { "name" : "specialty_id", "type" : "int" }, { "name" : "micro_description", "type" : "string" } ] }, { "type" : "record", "name" : "Offer", "doc" : "The main class for this protocol", "fields" : [ { "name" : "id", "type" : "int", "doc" : "The primary key" }, { "name" : "state_id", "type" : "int" }, { "name" : "consumer_fee_in_cents", "type" : "int" }, { "name" : "package", "type" : "Package" } ] }, { "type" : "record", "name" : "OfferFetchOption", "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" : 10 }, { "name" : "package_id", "type" : "int", "doc" : "The ID of the package this offer is associated with." }, { "name" : "enabled", "type" : "boolean", "doc" : "Enabled meaning it is available for the public to purchase." }, { "name" : "name", "type" : "string", "doc" : "The name of the package this offer is associated with." } ] } ], "messages" : { "index" : { "doc" : "Returns a list of Offers", "request" : [ { "name" : "options", "type" : "OfferFetchOption" } ], "response" : { "type" : "array", "items" : "Offer" } }, "show" : { "doc" : "Return a single Offer", "request" : [ { "name" : "id", "type" : "int" } ], "response" : { "type" : "array", "items" : "Offer" } } } }