Skip to content

Commit 33c37e5

Browse files
feat(api): manual updates
1 parent d3c55dc commit 33c37e5

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2e40370ce4d7d019b30d43020674bb02aaaf2a67a8916772084815c874f99950.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-9de98d1d4d2c9a431961599cb54716212c06200a919e09adedd42244038ec07b.yml
33
openapi_spec_hash: a44b7d4172c8c7cd395237738867d5cb
4-
config_hash: 472cc1adb51663e5b3d8dce16f6d29d9
4+
config_hash: ff35e224e809656528c44163aa41bebd

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use ContextDev\Client;
3030

3131
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
3232

33-
$response = $client->web->extract();
33+
$brand = $client->brand->retrieve(domain: 'REPLACE_ME');
3434

35-
var_dump($response->data);
35+
var_dump($brand->brand);
3636
```
3737

3838
### Value Objects
@@ -54,7 +54,7 @@ use ContextDev\Core\Exceptions\RateLimitException;
5454
use ContextDev\Core\Exceptions\APIStatusException;
5555

5656
try {
57-
$response = $client->web->extract();
57+
$brand = $client->brand->retrieve(domain: 'REPLACE_ME');
5858
} catch (APIConnectionException $e) {
5959
echo "The server could not be reached", PHP_EOL;
6060
var_dump($e->getPrevious());
@@ -99,7 +99,9 @@ use ContextDev\Client;
9999
$client = new Client(requestOptions: ['maxRetries' => 0]);
100100

101101
// Or, configure per-request:
102-
$result = $client->web->extract(requestOptions: ['maxRetries' => 5]);
102+
$result = $client->brand->retrieve(
103+
domain: 'REPLACE_ME', requestOptions: ['maxRetries' => 5]
104+
);
103105
```
104106

105107
## Advanced concepts
@@ -115,7 +117,8 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
115117
```php
116118
<?php
117119

118-
$response = $client->web->extract(
120+
$brand = $client->brand->retrieve(
121+
domain: 'REPLACE_ME',
119122
requestOptions: [
120123
'extraQueryParams' => ['my_query_parameter' => 'value'],
121124
'extraBodyParams' => ['my_body_parameter' => 'value'],

tests/ClientTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ public function testDefaultHeaders(): void
3232
requestOptions: ['transporter' => $transporter],
3333
);
3434

35-
$client->web->extract(
36-
schema: [
37-
'type' => 'bar',
38-
'properties' => 'bar',
39-
'required' => 'bar',
40-
'additionalProperties' => 'bar',
41-
],
42-
url: 'https://example.com',
35+
$client->brand->retrieve(
36+
domain: 'domain',
37+
name: 'xxx',
38+
email: 'dev@stainless.com',
39+
ticker: 'ticker',
40+
transactionInfo: 'xxx',
4341
);
4442

4543
$this->assertNotFalse($requested = $transporter->getRequests()[0] ?? false);

0 commit comments

Comments
 (0)