22
33namespace Dadata ;
44
5+ use GuzzleHttp \Exception \GuzzleException ;
6+
57class DadataClient
68{
79 private $ cleaner ;
@@ -15,51 +17,81 @@ public function __construct($token, $secret)
1517 $ this ->suggestions = new SuggestClient ($ token , $ secret );
1618 }
1719
20+ /**
21+ * @throws GuzzleException
22+ */
1823 public function clean ($ name , $ value )
1924 {
2025 return $ this ->cleaner ->clean ($ name , $ value );
2126 }
2227
28+ /**
29+ * @throws GuzzleException
30+ */
2331 public function cleanRecord ($ structure , $ record )
2432 {
2533 return $ this ->cleaner ->cleanRecord ($ structure , $ record );
2634 }
2735
36+ /**
37+ * @throws GuzzleException
38+ */
2839 public function findAffiliated ($ query , $ count = Settings::SUGGESTION_COUNT , $ kwargs = [])
2940 {
3041 return $ this ->suggestions ->findAffiliated ($ query , $ count , $ kwargs );
3142 }
3243
44+ /**
45+ * @throws GuzzleException
46+ */
3347 public function findById ($ name , $ query , $ count = Settings::SUGGESTION_COUNT , $ kwargs = [])
3448 {
3549 return $ this ->suggestions ->findById ($ name , $ query , $ count , $ kwargs );
3650 }
3751
52+ /**
53+ * @throws GuzzleException
54+ */
3855 public function geolocate ($ name , $ lat , $ lon , $ radiusMeters = 100 , $ count = Settings::SUGGESTION_COUNT , $ kwargs = [])
3956 {
4057 return $ this ->suggestions ->geolocate ($ name , $ lat , $ lon , $ radiusMeters , $ count , $ kwargs );
4158 }
4259
60+ /**
61+ * @throws GuzzleException
62+ */
4363 public function getBalance ()
4464 {
4565 return $ this ->profile ->getBalance ();
4666 }
4767
68+ /**
69+ * @throws GuzzleException
70+ */
4871 public function getDailyStats ($ date = null )
4972 {
5073 return $ this ->profile ->getDailyStats ($ date );
5174 }
5275
76+ /**
77+ * @throws GuzzleException
78+ */
5379 public function getVersions ()
5480 {
5581 return $ this ->profile ->getVersions ();
5682 }
5783
84+ /**
85+ * @throws GuzzleException
86+ */
5887 public function iplocate ($ ip , $ kwargs = [])
5988 {
6089 return $ this ->suggestions ->iplocate ($ ip , $ kwargs );
6190 }
6291
92+ /**
93+ * @throws GuzzleException
94+ */
6395 public function suggest ($ name , $ query , $ count = Settings::SUGGESTION_COUNT , $ kwargs = [])
6496 {
6597 return $ this ->suggestions ->suggest ($ name , $ query , $ count , $ kwargs );
0 commit comments