Exemplo n.º 1
0
 /**
  * Find an event by its ID.
  * @param string $eventId
  * @param array $options
  * @return $this
  */
 public function find($eventId, $options = array())
 {
     $request = new Request($this->client);
     $path = "/events/" . urlencode($eventId) . "";
     $data = array();
     $response = $request->get($path, $data, $options);
     $returnValues = array();
     // Handling for field event
     $body = $response->getBody();
     $body = $body['event'];
     $returnValues['find'] = $this->fillWithData($body);
     return array_values($returnValues)[0];
 }
Exemplo n.º 2
0
 /**
  * Get all the gateway configurations of the project
  * @param array $options
  * @return array
  */
 public function fetchGatewayConfigurations($options = array())
 {
     $request = new Request($this->client);
     $path = "/projects/" . urlencode($this->getId()) . "/gateway-configurations";
     $data = array();
     $response = $request->get($path, $data, $options);
     $returnValues = array();
     // Handling for field gateway_configurations
     $a = array();
     $body = $response->getBody();
     foreach ($body['gateway_configurations'] as $v) {
         $tmp = new GatewayConfiguration($this->client);
         $tmp->fillWithData($v);
         $a[] = $tmp;
     }
     $returnValues['GatewayConfigurations'] = $a;
     return array_values($returnValues)[0];
 }