/**
  * Update single accommodation unit type matching the $code filter and array of key => value params
  *
  * @param  string $code
  * @param  array $params
  * @param  array $data
  * @param  Credentials $credentials API credentials
  *
  * @return self  the updated accommodation unit type
  */
 public static function updateSingle($code, array $params = [], array $data = [], Credentials $credentials = null)
 {
     if (!empty($credentials)) {
         self::setCredentials($credentials);
     }
     $allowedParams = array('expand' => 1);
     $wrongParams = array_diff_key($params, $allowedParams);
     if (!empty($wrongParams)) {
         throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams)));
     }
     $call = new JsonCall($credentials);
     $sxe = $call->execute('accommodation-unit-types/' . $code, 'PUT', array_intersect_key($params, $allowedParams), $data);
     return $sxe;
 }
 /**
  * Retrieve all cities
  *
  * @param  Credentials $credentials API credentials
  *
  * @return self  the retrieved cities
  */
 public static function cities(Credentials $credentials = null)
 {
     if (!empty($credentials)) {
         self::setCredentials($credentials);
     }
     $call = new JsonCall($credentials);
     $sxe = $call->execute('locations/cities', 'GET', []);
     self::setTotalPageCount($call->getTotalPageCount());
     return $sxe;
 }
 /**
  * Retrieve all cooperation modes
  *
  * @param  Credentials $credentials API credentials
  *
  * @return self  the retrieved cooperation modes
  */
 public static function cooperationTypes(Credentials $credentials = null)
 {
     if (!empty($credentials)) {
         self::setCredentials($credentials);
     }
     $call = new JsonCall($credentials);
     $sxe = $call->execute('accommodation-units/cooperation-modes', 'GET', []);
     self::setTotalPageCount($call->getTotalPageCount());
     return $sxe;
 }