Skip to content

Commit 4912cce

Browse files
committed
Bumped v0.18.1
Signed-off-by: Vishal Rana <[email protected]>
1 parent 792ed8a commit 4912cce

File tree

7 files changed

+27
-1
lines changed

7 files changed

+27
-1
lines changed

barcode.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type (
1717
}
1818

1919
BarcodeScanResponse struct {
20+
*Response
2021
Format string `json:"format"`
2122
Content string `json:"content"`
2223
ContentType string `json:"content_type"`
@@ -36,3 +37,17 @@ func (c *Client) BarcodeGenerate(req *BarcodeGenerateRequest) (res *BarcodeGener
3637
}
3738
return
3839
}
40+
41+
func (c *Client) BarcodeScan(req *BarcodeScanRequest) (res *BarcodeScanResponse, err *APIError) {
42+
res = new(BarcodeScanResponse)
43+
_, e := c.resty.R().
44+
SetFile("file", req.File).
45+
SetResult(res).
46+
SetError(err).
47+
Post("/barcode/scan")
48+
if e != nil {
49+
err = new(APIError)
50+
err.Message = e.Error()
51+
}
52+
return
53+
}

client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ type (
1414
logger *log.Logger
1515
}
1616

17+
Response struct {
18+
ID string `json:"id"`
19+
}
20+
1721
Download struct {
18-
ID string `json:"id"`
22+
*Response
1923
Name string `json:"name"`
2024
URL string `json:"url"`
2125
}

currency.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type (
88
}
99

1010
CurrencyExchangeResponse struct {
11+
*Response
1112
Rates map[string]float64 `json:"rates"`
1213
UpdatedAt time.Time `json:"updated_at"`
1314
}

dns.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type (
77
}
88

99
DNSLookupResponse struct {
10+
*Response
1011
Records []DNSRecord `json:"records"`
1112
}
1213

email.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type (
66
}
77

88
EmailVerifyResponse struct {
9+
*Response
910
Syntax bool `json:"syntax"`
1011
Disposable bool `json:"disposable"`
1112
Domain bool `json:"domain"`

text.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type (
99
}
1010

1111
TextSummaryResponse struct {
12+
*Response
1213
Summary string `json:"summary"`
1314
}
1415

@@ -17,6 +18,7 @@ type (
1718
}
1819

1920
TextSentimentResponse struct {
21+
*Response
2022
Subjectivity float32 `json:"subjectivity"`
2123
Polarity float32 `json:"polarity"`
2224
}
@@ -26,6 +28,7 @@ type (
2628
}
2729

2830
TextSpellcheckResponse struct {
31+
*Response
2932
Misspelled []*TextSpellcheckMisspelled `json:"misspelled"`
3033
}
3134

word.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type (
66
}
77

88
WordLookupResponse struct {
9+
*Response
910
Pronunciation []string `json:"pronunciation"`
1011
Rhymes []string `json:"rhymes"`
1112
Nouns []*WordLookupResult `json:"nouns"`

0 commit comments

Comments
 (0)