request('get', '/api_keys'); return Util::convertToEasyPostObject($response, $apiKey); } /** * api keys * * @param string $apiKey * @return array|null */ public function api_keys($apiKey = null) { $api_keys = self::all_api_keys(); $my_api_keys = null; if ($api_keys->id == $this->id) { $my_api_keys = $api_keys->keys; } if (is_null($my_api_keys)) { foreach($api_keys->children as $children_keys) { if ($children_keys->id == $this->id) { $my_api_keys = $children_keys->keys; } } } if (is_null($my_api_keys)) { return null; } else { $response = array(); foreach($my_api_keys as $key) { $response[$key->mode] = $key->key; } return $response; } } }