Skip to content

Commit 3e0abf1

Browse files
committed
final touches
1 parent 1804b5c commit 3e0abf1

File tree

3 files changed

+6
-81
lines changed

3 files changed

+6
-81
lines changed

clients/algoliasearch-client-php/lib/Configuration/Configuration.php

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -200,87 +200,14 @@ public function setClientApiKey($apiKey)
200200
return $this;
201201
}
202202

203-
public function getHosts()
204-
{
205-
return $this->config['hosts'];
206-
}
207-
208-
public function setHosts($hosts)
209-
{
210-
$this->config['hosts'] = $hosts;
211-
212-
return $this;
213-
}
214-
215-
public function setFullHosts($hosts)
216-
{
217-
$this->config['hasFullHosts'] = true;
218-
219-
return $this->setHosts($hosts);
220-
}
221-
222-
public function getHasFullHosts()
223-
{
224-
return $this->config['hasFullHosts'];
225-
}
226-
227-
public function getReadTimeout()
228-
{
229-
return $this->config['readTimeout'];
230-
}
231-
232-
public function setReadTimeout($readTimeout)
233-
{
234-
$this->config['readTimeout'] = $readTimeout;
235-
236-
return $this;
237-
}
238-
239-
public function getWriteTimeout()
240-
{
241-
return $this->config['writeTimeout'];
242-
}
243-
244-
public function setWriteTimeout($writeTimeout)
245-
{
246-
$this->config['writeTimeout'] = $writeTimeout;
247-
248-
return $this;
249-
}
250-
251-
public function getConnectTimeout()
252-
{
253-
return $this->config['connectTimeout'];
254-
}
255-
256-
public function setConnectTimeout($connectTimeout)
257-
{
258-
$this->config['connectTimeout'] = $connectTimeout;
259-
260-
return $this;
261-
}
262-
263-
public function getDefaultHeaders()
264-
{
265-
return $this->config['defaultHeaders'];
266-
}
267-
268-
public function setDefaultHeaders(array $defaultHeaders)
203+
/**
204+
* @deprecated This method is deprecated. Use setClientApiKey() instead.
205+
*/
206+
public function setAlgoliaApiKey($apiKey)
269207
{
270-
$this->config['defaultHeaders'] = $defaultHeaders;
271-
272-
return $this;
208+
return $this->setClientApiKey($apiKey);
273209
}
274210

275-
/**
276-
* Sets the user agent of the api client.
277-
*
278-
* @param string $algoliaAgent the user agent of the api client
279-
*
280-
* @return $this
281-
*
282-
* @throws \InvalidArgumentException
283-
*/
284211
public function setAlgoliaAgent($algoliaAgent)
285212
{
286213
if (!is_string($algoliaAgent)) {

specs/common/helpers/setClientApiKey.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ method:
1818
responses:
1919
'204':
2020
description: No content.
21-
'400':
22-
$ref: '../../common/responses/IndexNotFound.yml'

templates/go/client.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (c *APIClient) GetConfiguration() *{{#lambda.titlecase}}{{#lambda.camelcase
143143
// Allow update of stored API key used to authenticate requests.
144144
func (c *APIClient) SetClientApiKey(apiKey string) error {
145145
if c.cfg == nil {
146-
return fmt.Errorf("client config is not set")
146+
return errors.New("client config is not set")
147147
}
148148

149149
c.cfg.ApiKey = apiKey

0 commit comments

Comments
 (0)