Skip to content

Commit

Permalink
Revert "Release v1.0.33"
Browse files Browse the repository at this point in the history
This reverts commit 99f4710.
  • Loading branch information
moniar committed Nov 22, 2023
1 parent d8910a7 commit 90af03b
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 582 deletions.
61 changes: 9 additions & 52 deletions lib/Api/APINotificationCallbacksApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function pullMultipleNotificationRequest($limit = null)

// query params
if ($limit !== null) {
$queryParams['limit'] = ObjectSerializer::toQueryValue($limit);
$queryParams['limit'] = ObjectSerializer::toQueryValue($limit, null);
}


Expand Down Expand Up @@ -317,7 +317,7 @@ protected function pullMultipleNotificationRequest($limit = null)

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -337,7 +337,7 @@ protected function pullMultipleNotificationRequest($limit = null)
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand Down Expand Up @@ -568,7 +568,7 @@ protected function pullNotificationRequest()

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -588,7 +588,7 @@ protected function pullNotificationRequest()
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand Down Expand Up @@ -774,7 +774,7 @@ protected function pushNotificationsRequest()

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -790,7 +790,7 @@ protected function pushNotificationsRequest()
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand Down Expand Up @@ -984,7 +984,7 @@ protected function releaseNotificationsRequest()

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -1004,7 +1004,7 @@ protected function releaseNotificationsRequest()
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand All @@ -1031,47 +1031,4 @@ protected function createHttpClientOption()

return $options;
}

protected function buildQuery($params, $encoding = PHP_QUERY_RFC3986)
{
if (!$params) {
return '';
}

if ($encoding === false) {
$encoder = function ($str) {
return $str;
};
} elseif ($encoding === PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode';
} elseif ($encoding === PHP_QUERY_RFC1738) {
$encoder = 'urlencode';
} else {
throw new \InvalidArgumentException('Invalid type');
}

$qs = '';
foreach ($params as $k => $v) {
$k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
$v = is_bool($v) ? (int) $v : $v;
if ($v !== null) {
$qs .= '='.$encoder((string) $v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
$vv = is_bool($vv) ? (int) $vv : $vv;
if ($vv !== null) {
$qs .= '='.$encoder((string) $vv);
}
$qs .= '&';
}
}
}

return $qs ? (string) substr($qs, 0, -1) : '';
}
}
59 changes: 8 additions & 51 deletions lib/Api/AddressesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ protected function getAddressRequest($facility_id, $doctor_id, $address_id, $wit

// query params
if ($with !== null) {
$queryParams['with'] = ObjectSerializer::toQueryValue($with);
$queryParams['with'] = ObjectSerializer::toQueryValue($with, null);
}

// path params
Expand Down Expand Up @@ -382,7 +382,7 @@ protected function getAddressRequest($facility_id, $doctor_id, $address_id, $wit

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -402,7 +402,7 @@ protected function getAddressRequest($facility_id, $doctor_id, $address_id, $wit
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand Down Expand Up @@ -629,7 +629,7 @@ protected function getAddressesRequest($facility_id, $doctor_id, $with = null)

// query params
if ($with !== null) {
$queryParams['with'] = ObjectSerializer::toQueryValue($with);
$queryParams['with'] = ObjectSerializer::toQueryValue($with, null);
}

// path params
Expand Down Expand Up @@ -688,7 +688,7 @@ protected function getAddressesRequest($facility_id, $doctor_id, $with = null)

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -708,7 +708,7 @@ protected function getAddressesRequest($facility_id, $doctor_id, $with = null)
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand Down Expand Up @@ -1026,7 +1026,7 @@ protected function updateAddressRequest($body, $facility_id, $doctor_id, $addres

} else {
// for HTTP post (form)
$httpBody = $this->buildQuery($formParams);
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}

Expand All @@ -1046,7 +1046,7 @@ protected function updateAddressRequest($body, $facility_id, $doctor_id, $addres
$headers
);

$query = $this->buildQuery($queryParams);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PATCH',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
Expand All @@ -1073,47 +1073,4 @@ protected function createHttpClientOption()

return $options;
}

protected function buildQuery($params, $encoding = PHP_QUERY_RFC3986)
{
if (!$params) {
return '';
}

if ($encoding === false) {
$encoder = function ($str) {
return $str;
};
} elseif ($encoding === PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode';
} elseif ($encoding === PHP_QUERY_RFC1738) {
$encoder = 'urlencode';
} else {
throw new \InvalidArgumentException('Invalid type');
}

$qs = '';
foreach ($params as $k => $v) {
$k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
$v = is_bool($v) ? (int) $v : $v;
if ($v !== null) {
$qs .= '='.$encoder((string) $v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
$vv = is_bool($vv) ? (int) $vv : $vv;
if ($vv !== null) {
$qs .= '='.$encoder((string) $vv);
}
$qs .= '&';
}
}
}

return $qs ? (string) substr($qs, 0, -1) : '';
}
}
Loading

0 comments on commit 90af03b

Please sign in to comment.