From 43465c6ae990629d61bf1cd291f02b941cf807fa Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Fri, 6 Mar 2020 01:27:46 -0600 Subject: [PATCH] extended response struct --- client.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 8fe615b..dea9c31 100644 --- a/client.go +++ b/client.go @@ -18,15 +18,27 @@ type ( Client *http.Client } - Results struct { - Results []Result `json:results` - } - Result struct { ID string `json:"id"` Label string `json:"label"` Status Status `json:"status"` } + + Error struct { + Field string `json:"field"` + Message []string `json:"message"` + } + + Warning struct { + Warning string `json:"warning"` + } + + Response struct { + Error string `json:"error"` + Errors []Error `json:"errors"` + Warnings []Warning `json:"warnings"` + Results []Result `json:"results"` + } ) var errorMap = map[int]error{