1: <?php
2:
3: namespace ShippoClient;
4:
5: use ShippoClient\Entity\Rate;
6: use ShippoClient\Http\Request;
7: use ShippoClient\Http\Response\RateList;
8:
9: class Rates
10: {
11: private $request;
12:
13: public function __construct(Request $request)
14: {
15: $this->request = $request;
16: }
17:
18: public function retrieve($objectId)
19: {
20: $responseArray = $this->request->get("rates/$objectId");
21:
22: return new Rate($responseArray);
23: }
24:
25: 26: 27: 28:
29: public function getList($results = null)
30: {
31: $responseArray = $this->request->get("rates", ['results' => $results]);
32:
33: return new RateList($responseArray);
34: }
35: }
36: