@cjavdev/believe-mcp 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +43 -2
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +10 -2
- package/code-tool-worker.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +10 -3
- package/http.js.map +1 -1
- package/http.mjs +10 -3
- package/http.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +613 -6
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +613 -6
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-worker.ts +10 -2
- package/src/http.ts +13 -4
- package/src/local-docs-search.ts +762 -6
- package/src/server.ts +1 -1
package/src/local-docs-search.ts
CHANGED
|
@@ -66,6 +66,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
66
66
|
method: '$client get_welcome',
|
|
67
67
|
example: "believe get-welcome \\\n --api-key 'My API Key'",
|
|
68
68
|
},
|
|
69
|
+
csharp: {
|
|
70
|
+
method: 'GetWelcome',
|
|
71
|
+
example:
|
|
72
|
+
'ClientGetWelcomeParams parameters = new();\n\nvar response = await client.GetWelcome(parameters);\n\nConsole.WriteLine(response);',
|
|
73
|
+
},
|
|
69
74
|
go: {
|
|
70
75
|
method: 'client.GetWelcome',
|
|
71
76
|
example:
|
|
@@ -84,6 +89,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
84
89
|
example:
|
|
85
90
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ClientGetWelcomeParams\nimport com.believe.api.models.ClientGetWelcomeResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: ClientGetWelcomeResponse = client.getWelcome()\n}',
|
|
86
91
|
},
|
|
92
|
+
php: {
|
|
93
|
+
method: 'getWelcome',
|
|
94
|
+
example:
|
|
95
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->getWelcome();\n\nvar_dump($response);",
|
|
96
|
+
},
|
|
87
97
|
python: {
|
|
88
98
|
method: 'get_welcome',
|
|
89
99
|
example:
|
|
@@ -125,6 +135,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
125
135
|
method: 'characters list',
|
|
126
136
|
example: "believe characters list \\\n --api-key 'My API Key'",
|
|
127
137
|
},
|
|
138
|
+
csharp: {
|
|
139
|
+
method: 'Characters.List',
|
|
140
|
+
example:
|
|
141
|
+
'CharacterListParams parameters = new();\n\nvar page = await client.Characters.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
142
|
+
},
|
|
128
143
|
go: {
|
|
129
144
|
method: 'client.Characters.List',
|
|
130
145
|
example:
|
|
@@ -144,6 +159,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
144
159
|
example:
|
|
145
160
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterListPage\nimport com.believe.api.models.characters.CharacterListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: CharacterListPage = client.characters().list()\n}',
|
|
146
161
|
},
|
|
162
|
+
php: {
|
|
163
|
+
method: 'characters->list',
|
|
164
|
+
example:
|
|
165
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->characters->list(\n limit: 10,\n minOptimism: 0,\n role: CharacterRole::COACH,\n skip: 0,\n teamID: 'team_id',\n);\n\nvar_dump($page);",
|
|
166
|
+
},
|
|
147
167
|
python: {
|
|
148
168
|
method: 'characters.list',
|
|
149
169
|
example:
|
|
@@ -194,6 +214,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
194
214
|
example:
|
|
195
215
|
"believe characters create \\\n --api-key 'My API Key' \\\n --background 'Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.' \\\n --emotional-stats '{curiosity: 40, empathy: 85, optimism: 45, resilience: 95, vulnerability: 60}' \\\n --name 'Roy Kent' \\\n --personality-trait intense \\\n --personality-trait loyal \\\n --personality-trait 'secretly caring' \\\n --personality-trait profane \\\n --role coach",
|
|
196
216
|
},
|
|
217
|
+
csharp: {
|
|
218
|
+
method: 'Characters.Create',
|
|
219
|
+
example:
|
|
220
|
+
'CharacterCreateParams parameters = new()\n{\n Background = "Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.",\n EmotionalStats = new()\n {\n Curiosity = 40,\n Empathy = 85,\n Optimism = 45,\n Resilience = 95,\n Vulnerability = 60,\n },\n Name = "Roy Kent",\n PersonalityTraits =\n [\n "intense", "loyal", "secretly caring", "profane"\n ],\n Role = CharacterRole.Coach,\n};\n\nvar character = await client.Characters.Create(parameters);\n\nConsole.WriteLine(character);',
|
|
221
|
+
},
|
|
197
222
|
go: {
|
|
198
223
|
method: 'client.Characters.New',
|
|
199
224
|
example:
|
|
@@ -213,6 +238,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
213
238
|
example:
|
|
214
239
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.Character\nimport com.believe.api.models.characters.CharacterCreateParams\nimport com.believe.api.models.characters.CharacterRole\nimport com.believe.api.models.characters.EmotionalStats\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: CharacterCreateParams = CharacterCreateParams.builder()\n .background("Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.")\n .emotionalStats(EmotionalStats.builder()\n .curiosity(40L)\n .empathy(85L)\n .optimism(45L)\n .resilience(95L)\n .vulnerability(60L)\n .build())\n .name("Roy Kent")\n .personalityTraits(listOf(\n "intense",\n "loyal",\n "secretly caring",\n "profane",\n ))\n .role(CharacterRole.COACH)\n .build()\n val character: Character = client.characters().create(params)\n}',
|
|
215
240
|
},
|
|
241
|
+
php: {
|
|
242
|
+
method: 'characters->create',
|
|
243
|
+
example:
|
|
244
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$character = $client->characters->create(\n background: 'Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.',\n emotionalStats: [\n 'curiosity' => 40,\n 'empathy' => 85,\n 'optimism' => 45,\n 'resilience' => 95,\n 'vulnerability' => 60,\n ],\n name: 'Roy Kent',\n personalityTraits: ['intense', 'loyal', 'secretly caring', 'profane'],\n role: CharacterRole::COACH,\n dateOfBirth: '1977-03-15',\n email: 'roy.kent@afcrichmond.com',\n growthArcs: [\n [\n 'breakthrough' => 'Finding purpose beyond playing',\n 'challenge' => 'Accepting his body\\'s limitations',\n 'endingPoint' => 'Retired but lost',\n 'season' => 1,\n 'startingPoint' => 'Aging footballer facing retirement',\n ],\n ],\n heightMeters: 1.78,\n profileImageURL: 'https://afcrichmond.com/images/roy-kent.jpg',\n salaryGbp: '175000.00',\n signatureQuotes: [\n 'He\\'s here, he\\'s there, he\\'s every-f***ing-where, Roy Kent!', 'Whistle!'\n ],\n teamID: 'afc-richmond',\n);\n\nvar_dump($character);",
|
|
245
|
+
},
|
|
216
246
|
python: {
|
|
217
247
|
method: 'characters.create',
|
|
218
248
|
example:
|
|
@@ -248,6 +278,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
248
278
|
method: 'characters retrieve',
|
|
249
279
|
example: "believe characters retrieve \\\n --api-key 'My API Key' \\\n --character-id character_id",
|
|
250
280
|
},
|
|
281
|
+
csharp: {
|
|
282
|
+
method: 'Characters.Retrieve',
|
|
283
|
+
example:
|
|
284
|
+
'CharacterRetrieveParams parameters = new() { CharacterID = "character_id" };\n\nvar character = await client.Characters.Retrieve(parameters);\n\nConsole.WriteLine(character);',
|
|
285
|
+
},
|
|
251
286
|
go: {
|
|
252
287
|
method: 'client.Characters.Get',
|
|
253
288
|
example:
|
|
@@ -267,6 +302,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
267
302
|
example:
|
|
268
303
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.Character\nimport com.believe.api.models.characters.CharacterRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val character: Character = client.characters().retrieve("character_id")\n}',
|
|
269
304
|
},
|
|
305
|
+
php: {
|
|
306
|
+
method: 'characters->retrieve',
|
|
307
|
+
example:
|
|
308
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$character = $client->characters->retrieve('character_id');\n\nvar_dump($character);",
|
|
309
|
+
},
|
|
270
310
|
python: {
|
|
271
311
|
method: 'characters.retrieve',
|
|
272
312
|
example:
|
|
@@ -317,6 +357,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
317
357
|
method: 'characters update',
|
|
318
358
|
example: "believe characters update \\\n --api-key 'My API Key' \\\n --character-id character_id",
|
|
319
359
|
},
|
|
360
|
+
csharp: {
|
|
361
|
+
method: 'Characters.Update',
|
|
362
|
+
example:
|
|
363
|
+
'CharacterUpdateParams parameters = new() { CharacterID = "character_id" };\n\nvar character = await client.Characters.Update(parameters);\n\nConsole.WriteLine(character);',
|
|
364
|
+
},
|
|
320
365
|
go: {
|
|
321
366
|
method: 'client.Characters.Update',
|
|
322
367
|
example:
|
|
@@ -336,6 +381,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
336
381
|
example:
|
|
337
382
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.Character\nimport com.believe.api.models.characters.CharacterUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val character: Character = client.characters().update("character_id")\n}',
|
|
338
383
|
},
|
|
384
|
+
php: {
|
|
385
|
+
method: 'characters->update',
|
|
386
|
+
example:
|
|
387
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$character = $client->characters->update(\n 'character_id',\n background: 'background',\n dateOfBirth: '2019-12-27',\n email: 'dev@stainless.com',\n emotionalStats: [\n 'curiosity' => 99,\n 'empathy' => 100,\n 'optimism' => 95,\n 'resilience' => 90,\n 'vulnerability' => 80,\n ],\n growthArcs: [\n [\n 'breakthrough' => 'breakthrough',\n 'challenge' => 'challenge',\n 'endingPoint' => 'ending_point',\n 'season' => 1,\n 'startingPoint' => 'starting_point',\n ],\n ],\n heightMeters: 1,\n name: 'x',\n personalityTraits: ['string'],\n profileImageURL: 'https://example.com',\n role: CharacterRole::COACH,\n salaryGbp: 0,\n signatureQuotes: ['string'],\n teamID: 'team_id',\n);\n\nvar_dump($character);",
|
|
388
|
+
},
|
|
339
389
|
python: {
|
|
340
390
|
method: 'characters.update',
|
|
341
391
|
example:
|
|
@@ -369,6 +419,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
369
419
|
method: 'characters delete',
|
|
370
420
|
example: "believe characters delete \\\n --api-key 'My API Key' \\\n --character-id character_id",
|
|
371
421
|
},
|
|
422
|
+
csharp: {
|
|
423
|
+
method: 'Characters.Delete',
|
|
424
|
+
example:
|
|
425
|
+
'CharacterDeleteParams parameters = new() { CharacterID = "character_id" };\n\nawait client.Characters.Delete(parameters);',
|
|
426
|
+
},
|
|
372
427
|
go: {
|
|
373
428
|
method: 'client.Characters.Delete',
|
|
374
429
|
example:
|
|
@@ -388,6 +443,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
388
443
|
example:
|
|
389
444
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.characters().delete("character_id")\n}',
|
|
390
445
|
},
|
|
446
|
+
php: {
|
|
447
|
+
method: 'characters->delete',
|
|
448
|
+
example:
|
|
449
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->characters->delete('character_id');\n\nvar_dump($result);",
|
|
450
|
+
},
|
|
391
451
|
python: {
|
|
392
452
|
method: 'characters.delete',
|
|
393
453
|
example:
|
|
@@ -423,6 +483,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
423
483
|
example:
|
|
424
484
|
"believe characters get-quotes \\\n --api-key 'My API Key' \\\n --character-id character_id",
|
|
425
485
|
},
|
|
486
|
+
csharp: {
|
|
487
|
+
method: 'Characters.GetQuotes',
|
|
488
|
+
example:
|
|
489
|
+
'CharacterGetQuotesParams parameters = new() { CharacterID = "character_id" };\n\nvar response = await client.Characters.GetQuotes(parameters);\n\nConsole.WriteLine(response);',
|
|
490
|
+
},
|
|
426
491
|
go: {
|
|
427
492
|
method: 'client.Characters.GetQuotes',
|
|
428
493
|
example:
|
|
@@ -442,6 +507,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
442
507
|
example:
|
|
443
508
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterGetQuotesParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: List<String> = client.characters().getQuotes("character_id")\n}',
|
|
444
509
|
},
|
|
510
|
+
php: {
|
|
511
|
+
method: 'characters->getQuotes',
|
|
512
|
+
example:
|
|
513
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->characters->getQuotes('character_id');\n\nvar_dump($response);",
|
|
514
|
+
},
|
|
445
515
|
python: {
|
|
446
516
|
method: 'characters.get_quotes',
|
|
447
517
|
example:
|
|
@@ -477,6 +547,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
477
547
|
method: 'teams list',
|
|
478
548
|
example: "believe teams list \\\n --api-key 'My API Key'",
|
|
479
549
|
},
|
|
550
|
+
csharp: {
|
|
551
|
+
method: 'Teams.List',
|
|
552
|
+
example:
|
|
553
|
+
'TeamListParams parameters = new();\n\nvar page = await client.Teams.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
554
|
+
},
|
|
480
555
|
go: {
|
|
481
556
|
method: 'client.Teams.List',
|
|
482
557
|
example:
|
|
@@ -495,6 +570,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
495
570
|
example:
|
|
496
571
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.TeamListPage\nimport com.believe.api.models.teams.TeamListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TeamListPage = client.teams().list()\n}',
|
|
497
572
|
},
|
|
573
|
+
php: {
|
|
574
|
+
method: 'teams->list',
|
|
575
|
+
example:
|
|
576
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->teams->list(\n league: League::PREMIER_LEAGUE, limit: 10, minCultureScore: 0, skip: 0\n);\n\nvar_dump($page);",
|
|
577
|
+
},
|
|
498
578
|
python: {
|
|
499
579
|
method: 'teams.list',
|
|
500
580
|
example:
|
|
@@ -549,6 +629,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
549
629
|
example:
|
|
550
630
|
"believe teams create \\\n --api-key 'My API Key' \\\n --culture-score 70 \\\n --founded-year 1895 \\\n --league 'Premier League' \\\n --name 'West Ham United' \\\n --stadium 'London Stadium' \\\n --values '{primary_value: Pride, secondary_values: [History, Community, Passion], team_motto: Forever Blowing Bubbles}'",
|
|
551
631
|
},
|
|
632
|
+
csharp: {
|
|
633
|
+
method: 'Teams.Create',
|
|
634
|
+
example:
|
|
635
|
+
'TeamCreateParams parameters = new()\n{\n CultureScore = 70,\n FoundedYear = 1895,\n League = League.PremierLeague,\n Name = "West Ham United",\n Stadium = "London Stadium",\n Values = new()\n {\n PrimaryValue = "Pride",\n SecondaryValues =\n [\n "History", "Community", "Passion"\n ],\n TeamMotto = "Forever Blowing Bubbles",\n },\n};\n\nvar team = await client.Teams.Create(parameters);\n\nConsole.WriteLine(team);',
|
|
636
|
+
},
|
|
552
637
|
go: {
|
|
553
638
|
method: 'client.Teams.New',
|
|
554
639
|
example:
|
|
@@ -568,6 +653,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
568
653
|
example:
|
|
569
654
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.League\nimport com.believe.api.models.teams.Team\nimport com.believe.api.models.teams.TeamCreateParams\nimport com.believe.api.models.teams.TeamValues\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: TeamCreateParams = TeamCreateParams.builder()\n .cultureScore(70L)\n .foundedYear(1895L)\n .league(League.PREMIER_LEAGUE)\n .name("West Ham United")\n .stadium("London Stadium")\n .values(TeamValues.builder()\n .primaryValue("Pride")\n .secondaryValues(listOf(\n "History",\n "Community",\n "Passion",\n ))\n .teamMotto("Forever Blowing Bubbles")\n .build())\n .build()\n val team: Team = client.teams().create(params)\n}',
|
|
570
655
|
},
|
|
656
|
+
php: {
|
|
657
|
+
method: 'teams->create',
|
|
658
|
+
example:
|
|
659
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$team = $client->teams->create(\n cultureScore: 70,\n foundedYear: 1895,\n league: League::PREMIER_LEAGUE,\n name: 'West Ham United',\n stadium: 'London Stadium',\n values: [\n 'primaryValue' => 'Pride',\n 'secondaryValues' => ['History', 'Community', 'Passion'],\n 'teamMotto' => 'Forever Blowing Bubbles',\n ],\n annualBudgetGbp: '150000000.00',\n averageAttendance: 59988,\n contactEmail: 'info@westhamunited.co.uk',\n isActive: true,\n nickname: 'The Hammers',\n primaryColor: '#7A263A',\n rivalTeams: ['afc-richmond', 'tottenham'],\n secondaryColor: '#1BB1E7',\n stadiumLocation: ['latitude' => 51.5387, 'longitude' => -0.0166],\n website: 'https://www.whufc.com',\n winPercentage: 52.3,\n);\n\nvar_dump($team);",
|
|
660
|
+
},
|
|
571
661
|
python: {
|
|
572
662
|
method: 'teams.create',
|
|
573
663
|
example:
|
|
@@ -603,6 +693,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
603
693
|
method: 'teams retrieve',
|
|
604
694
|
example: "believe teams retrieve \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
605
695
|
},
|
|
696
|
+
csharp: {
|
|
697
|
+
method: 'Teams.Retrieve',
|
|
698
|
+
example:
|
|
699
|
+
'TeamRetrieveParams parameters = new() { TeamID = "team_id" };\n\nvar team = await client.Teams.Retrieve(parameters);\n\nConsole.WriteLine(team);',
|
|
700
|
+
},
|
|
606
701
|
go: {
|
|
607
702
|
method: 'client.Teams.Get',
|
|
608
703
|
example:
|
|
@@ -622,6 +717,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
622
717
|
example:
|
|
623
718
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.Team\nimport com.believe.api.models.teams.TeamRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val team: Team = client.teams().retrieve("team_id")\n}',
|
|
624
719
|
},
|
|
720
|
+
php: {
|
|
721
|
+
method: 'teams->retrieve',
|
|
722
|
+
example:
|
|
723
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$team = $client->teams->retrieve('team_id');\n\nvar_dump($team);",
|
|
724
|
+
},
|
|
625
725
|
python: {
|
|
626
726
|
method: 'teams.retrieve',
|
|
627
727
|
example:
|
|
@@ -676,6 +776,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
676
776
|
method: 'teams update',
|
|
677
777
|
example: "believe teams update \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
678
778
|
},
|
|
779
|
+
csharp: {
|
|
780
|
+
method: 'Teams.Update',
|
|
781
|
+
example:
|
|
782
|
+
'TeamUpdateParams parameters = new() { TeamID = "team_id" };\n\nvar team = await client.Teams.Update(parameters);\n\nConsole.WriteLine(team);',
|
|
783
|
+
},
|
|
679
784
|
go: {
|
|
680
785
|
method: 'client.Teams.Update',
|
|
681
786
|
example:
|
|
@@ -695,6 +800,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
695
800
|
example:
|
|
696
801
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.Team\nimport com.believe.api.models.teams.TeamUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val team: Team = client.teams().update("team_id")\n}',
|
|
697
802
|
},
|
|
803
|
+
php: {
|
|
804
|
+
method: 'teams->update',
|
|
805
|
+
example:
|
|
806
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$team = $client->teams->update(\n 'team_id',\n annualBudgetGbp: 0,\n averageAttendance: 0,\n contactEmail: 'dev@stainless.com',\n cultureScore: 0,\n foundedYear: 1800,\n isActive: true,\n league: League::PREMIER_LEAGUE,\n name: 'x',\n nickname: 'nickname',\n primaryColor: 'primary_color',\n rivalTeams: ['string'],\n secondaryColor: 'secondary_color',\n stadium: 'stadium',\n stadiumLocation: ['latitude' => 51.4816, 'longitude' => -0.191],\n values: [\n 'primaryValue' => 'Believe',\n 'secondaryValues' => ['Family', 'Resilience', 'Joy'],\n 'teamMotto' => 'Football is life!',\n ],\n website: 'https://example.com',\n winPercentage: 0,\n);\n\nvar_dump($team);",
|
|
807
|
+
},
|
|
698
808
|
python: {
|
|
699
809
|
method: 'teams.update',
|
|
700
810
|
example:
|
|
@@ -728,6 +838,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
728
838
|
method: 'teams delete',
|
|
729
839
|
example: "believe teams delete \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
730
840
|
},
|
|
841
|
+
csharp: {
|
|
842
|
+
method: 'Teams.Delete',
|
|
843
|
+
example:
|
|
844
|
+
'TeamDeleteParams parameters = new() { TeamID = "team_id" };\n\nawait client.Teams.Delete(parameters);',
|
|
845
|
+
},
|
|
731
846
|
go: {
|
|
732
847
|
method: 'client.Teams.Delete',
|
|
733
848
|
example:
|
|
@@ -747,6 +862,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
747
862
|
example:
|
|
748
863
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.TeamDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.teams().delete("team_id")\n}',
|
|
749
864
|
},
|
|
865
|
+
php: {
|
|
866
|
+
method: 'teams->delete',
|
|
867
|
+
example:
|
|
868
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->teams->delete('team_id');\n\nvar_dump($result);",
|
|
869
|
+
},
|
|
750
870
|
python: {
|
|
751
871
|
method: 'teams.delete',
|
|
752
872
|
example:
|
|
@@ -782,6 +902,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
782
902
|
method: 'teams get_rivals',
|
|
783
903
|
example: "believe teams get-rivals \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
784
904
|
},
|
|
905
|
+
csharp: {
|
|
906
|
+
method: 'Teams.GetRivals',
|
|
907
|
+
example:
|
|
908
|
+
'TeamGetRivalsParams parameters = new() { TeamID = "team_id" };\n\nvar teams = await client.Teams.GetRivals(parameters);\n\nConsole.WriteLine(teams);',
|
|
909
|
+
},
|
|
785
910
|
go: {
|
|
786
911
|
method: 'client.Teams.GetRivals',
|
|
787
912
|
example:
|
|
@@ -801,6 +926,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
801
926
|
example:
|
|
802
927
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.Team\nimport com.believe.api.models.teams.TeamGetRivalsParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val teams: List<Team> = client.teams().getRivals("team_id")\n}',
|
|
803
928
|
},
|
|
929
|
+
php: {
|
|
930
|
+
method: 'teams->getRivals',
|
|
931
|
+
example:
|
|
932
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$teams = $client->teams->getRivals('team_id');\n\nvar_dump($teams);",
|
|
933
|
+
},
|
|
804
934
|
python: {
|
|
805
935
|
method: 'teams.get_rivals',
|
|
806
936
|
example:
|
|
@@ -835,6 +965,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
835
965
|
method: 'teams get_culture',
|
|
836
966
|
example: "believe teams get-culture \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
837
967
|
},
|
|
968
|
+
csharp: {
|
|
969
|
+
method: 'Teams.GetCulture',
|
|
970
|
+
example:
|
|
971
|
+
'TeamGetCultureParams parameters = new() { TeamID = "team_id" };\n\nvar response = await client.Teams.GetCulture(parameters);\n\nConsole.WriteLine(response);',
|
|
972
|
+
},
|
|
838
973
|
go: {
|
|
839
974
|
method: 'client.Teams.GetCulture',
|
|
840
975
|
example:
|
|
@@ -854,6 +989,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
854
989
|
example:
|
|
855
990
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.TeamGetCultureParams\nimport com.believe.api.models.teams.TeamGetCultureResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: TeamGetCultureResponse = client.teams().getCulture("team_id")\n}',
|
|
856
991
|
},
|
|
992
|
+
php: {
|
|
993
|
+
method: 'teams->getCulture',
|
|
994
|
+
example:
|
|
995
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->teams->getCulture('team_id');\n\nvar_dump($response);",
|
|
996
|
+
},
|
|
857
997
|
python: {
|
|
858
998
|
method: 'teams.get_culture',
|
|
859
999
|
example:
|
|
@@ -889,6 +1029,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
889
1029
|
method: 'teams list_logos',
|
|
890
1030
|
example: "believe teams list-logos \\\n --api-key 'My API Key' \\\n --team-id team_id",
|
|
891
1031
|
},
|
|
1032
|
+
csharp: {
|
|
1033
|
+
method: 'Teams.ListLogos',
|
|
1034
|
+
example:
|
|
1035
|
+
'TeamListLogosParams parameters = new() { TeamID = "team_id" };\n\nvar fileUploads = await client.Teams.ListLogos(parameters);\n\nConsole.WriteLine(fileUploads);',
|
|
1036
|
+
},
|
|
892
1037
|
go: {
|
|
893
1038
|
method: 'client.Teams.ListLogos',
|
|
894
1039
|
example:
|
|
@@ -908,6 +1053,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
908
1053
|
example:
|
|
909
1054
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.TeamListLogosParams\nimport com.believe.api.models.teams.logo.FileUpload\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val fileUploads: List<FileUpload> = client.teams().listLogos("team_id")\n}',
|
|
910
1055
|
},
|
|
1056
|
+
php: {
|
|
1057
|
+
method: 'teams->listLogos',
|
|
1058
|
+
example:
|
|
1059
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$fileUploads = $client->teams->listLogos('team_id');\n\nvar_dump($fileUploads);",
|
|
1060
|
+
},
|
|
911
1061
|
python: {
|
|
912
1062
|
method: 'teams.list_logos',
|
|
913
1063
|
example:
|
|
@@ -944,6 +1094,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
944
1094
|
example:
|
|
945
1095
|
"believe teams:logo upload \\\n --api-key 'My API Key' \\\n --team-id team_id \\\n --file 'Example data'",
|
|
946
1096
|
},
|
|
1097
|
+
csharp: {
|
|
1098
|
+
method: 'Teams.Logo.Upload',
|
|
1099
|
+
example:
|
|
1100
|
+
'LogoUploadParams parameters = new()\n{\n TeamID = "team_id",\n File = Encoding.UTF8.GetBytes("Example data"),\n};\n\nvar fileUpload = await client.Teams.Logo.Upload(parameters);\n\nConsole.WriteLine(fileUpload);',
|
|
1101
|
+
},
|
|
947
1102
|
go: {
|
|
948
1103
|
method: 'client.Teams.Logo.Upload',
|
|
949
1104
|
example:
|
|
@@ -963,6 +1118,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
963
1118
|
example:
|
|
964
1119
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file("Example data".byteInputStream())\n .build()\n val fileUpload: FileUpload = client.teams().logo().upload(params)\n}',
|
|
965
1120
|
},
|
|
1121
|
+
php: {
|
|
1122
|
+
method: 'teams->logo->upload',
|
|
1123
|
+
example:
|
|
1124
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$fileUpload = $client->teams->logo->upload('team_id', file: 'file');\n\nvar_dump($fileUpload);",
|
|
1125
|
+
},
|
|
966
1126
|
python: {
|
|
967
1127
|
method: 'teams.logo.upload',
|
|
968
1128
|
example:
|
|
@@ -998,6 +1158,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
998
1158
|
example:
|
|
999
1159
|
"believe teams:logo download \\\n --api-key 'My API Key' \\\n --team-id team_id \\\n --file-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
|
|
1000
1160
|
},
|
|
1161
|
+
csharp: {
|
|
1162
|
+
method: 'Teams.Logo.Download',
|
|
1163
|
+
example:
|
|
1164
|
+
'LogoDownloadParams parameters = new()\n{\n TeamID = "team_id",\n FileID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n};\n\nvar response = await client.Teams.Logo.Download(parameters);\n\nConsole.WriteLine(response);',
|
|
1165
|
+
},
|
|
1001
1166
|
go: {
|
|
1002
1167
|
method: 'client.Teams.Logo.Download',
|
|
1003
1168
|
example:
|
|
@@ -1017,6 +1182,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1017
1182
|
example:
|
|
1018
1183
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.logo.LogoDownloadParams\nimport com.believe.api.models.teams.logo.LogoDownloadResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: LogoDownloadParams = LogoDownloadParams.builder()\n .teamId("team_id")\n .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val response: LogoDownloadResponse = client.teams().logo().download(params)\n}',
|
|
1019
1184
|
},
|
|
1185
|
+
php: {
|
|
1186
|
+
method: 'teams->logo->download',
|
|
1187
|
+
example:
|
|
1188
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->teams->logo->download(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', teamID: 'team_id'\n);\n\nvar_dump($response);",
|
|
1189
|
+
},
|
|
1020
1190
|
python: {
|
|
1021
1191
|
method: 'teams.logo.download',
|
|
1022
1192
|
example:
|
|
@@ -1051,6 +1221,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1051
1221
|
example:
|
|
1052
1222
|
"believe teams:logo delete \\\n --api-key 'My API Key' \\\n --team-id team_id \\\n --file-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
|
|
1053
1223
|
},
|
|
1224
|
+
csharp: {
|
|
1225
|
+
method: 'Teams.Logo.Delete',
|
|
1226
|
+
example:
|
|
1227
|
+
'LogoDeleteParams parameters = new()\n{\n TeamID = "team_id",\n FileID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n};\n\nawait client.Teams.Logo.Delete(parameters);',
|
|
1228
|
+
},
|
|
1054
1229
|
go: {
|
|
1055
1230
|
method: 'client.Teams.Logo.Delete',
|
|
1056
1231
|
example:
|
|
@@ -1070,6 +1245,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1070
1245
|
example:
|
|
1071
1246
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teams.logo.LogoDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: LogoDeleteParams = LogoDeleteParams.builder()\n .teamId("team_id")\n .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n client.teams().logo().delete(params)\n}',
|
|
1072
1247
|
},
|
|
1248
|
+
php: {
|
|
1249
|
+
method: 'teams->logo->delete',
|
|
1250
|
+
example:
|
|
1251
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->teams->logo->delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', teamID: 'team_id'\n);\n\nvar_dump($result);",
|
|
1252
|
+
},
|
|
1073
1253
|
python: {
|
|
1074
1254
|
method: 'teams.logo.delete',
|
|
1075
1255
|
example:
|
|
@@ -1111,6 +1291,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1111
1291
|
method: 'matches list',
|
|
1112
1292
|
example: "believe matches list \\\n --api-key 'My API Key'",
|
|
1113
1293
|
},
|
|
1294
|
+
csharp: {
|
|
1295
|
+
method: 'Matches.List',
|
|
1296
|
+
example:
|
|
1297
|
+
'MatchListParams parameters = new();\n\nvar page = await client.Matches.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
1298
|
+
},
|
|
1114
1299
|
go: {
|
|
1115
1300
|
method: 'client.Matches.List',
|
|
1116
1301
|
example:
|
|
@@ -1129,6 +1314,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1129
1314
|
example:
|
|
1130
1315
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.MatchListPage\nimport com.believe.api.models.matches.MatchListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: MatchListPage = client.matches().list()\n}',
|
|
1131
1316
|
},
|
|
1317
|
+
php: {
|
|
1318
|
+
method: 'matches->list',
|
|
1319
|
+
example:
|
|
1320
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->matches->list(\n limit: 10,\n matchType: MatchType::LEAGUE,\n result: MatchResult::WIN,\n skip: 0,\n teamID: 'team_id',\n);\n\nvar_dump($page);",
|
|
1321
|
+
},
|
|
1132
1322
|
python: {
|
|
1133
1323
|
method: 'matches.list',
|
|
1134
1324
|
example:
|
|
@@ -1181,6 +1371,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1181
1371
|
example:
|
|
1182
1372
|
"believe matches create \\\n --api-key 'My API Key' \\\n --away-team-id tottenham \\\n --date \"'2024-02-20T19:45:00Z'\" \\\n --home-team-id afc-richmond \\\n --match-type cup",
|
|
1183
1373
|
},
|
|
1374
|
+
csharp: {
|
|
1375
|
+
method: 'Matches.Create',
|
|
1376
|
+
example:
|
|
1377
|
+
'MatchCreateParams parameters = new()\n{\n AwayTeamID = "tottenham",\n Date = DateTimeOffset.Parse("2024-02-20T19:45:00Z"),\n HomeTeamID = "afc-richmond",\n MatchType = MatchType.Cup,\n};\n\nvar match = await client.Matches.Create(parameters);\n\nConsole.WriteLine(match);',
|
|
1378
|
+
},
|
|
1184
1379
|
go: {
|
|
1185
1380
|
method: 'client.Matches.New',
|
|
1186
1381
|
example:
|
|
@@ -1200,6 +1395,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1200
1395
|
example:
|
|
1201
1396
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.Match\nimport com.believe.api.models.matches.MatchCreateParams\nimport com.believe.api.models.matches.MatchType\nimport java.time.OffsetDateTime\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: MatchCreateParams = MatchCreateParams.builder()\n .awayTeamId("tottenham")\n .date(OffsetDateTime.parse("2024-02-20T19:45:00Z"))\n .homeTeamId("afc-richmond")\n .matchType(MatchType.CUP)\n .build()\n val match: Match = client.matches().create(params)\n}',
|
|
1202
1397
|
},
|
|
1398
|
+
php: {
|
|
1399
|
+
method: 'matches->create',
|
|
1400
|
+
example:
|
|
1401
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$match = $client->matches->create(\n awayTeamID: 'tottenham',\n date: new \\DateTimeImmutable('2024-02-20T19:45:00Z'),\n homeTeamID: 'afc-richmond',\n matchType: MatchType::CUP,\n attendance: 24500,\n awayScore: 0,\n episodeID: 's02e05',\n homeScore: 0,\n lessonLearned: 'It\\'s not about the wins and losses, it\\'s about helping these young fellas be the best versions of themselves.',\n possessionPercentage: 50,\n result: MatchResult::PENDING,\n tedHalftimeSpeech: 'You know what the happiest animal on Earth is? It\\'s a goldfish. You know why? It\\'s got a 10-second memory.',\n ticketRevenueGbp: '735000.00',\n turningPoints: [\n [\n 'description' => 'description',\n 'emotionalImpact' => 'Galvanized the team\\'s fighting spirit',\n 'minute' => 0,\n 'characterInvolved' => 'jamie-tartt',\n ],\n ],\n weatherTempCelsius: 8.5,\n);\n\nvar_dump($match);",
|
|
1402
|
+
},
|
|
1203
1403
|
python: {
|
|
1204
1404
|
method: 'matches.create',
|
|
1205
1405
|
example:
|
|
@@ -1235,6 +1435,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1235
1435
|
method: 'matches retrieve',
|
|
1236
1436
|
example: "believe matches retrieve \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1237
1437
|
},
|
|
1438
|
+
csharp: {
|
|
1439
|
+
method: 'Matches.Retrieve',
|
|
1440
|
+
example:
|
|
1441
|
+
'MatchRetrieveParams parameters = new() { MatchID = "match_id" };\n\nvar match = await client.Matches.Retrieve(parameters);\n\nConsole.WriteLine(match);',
|
|
1442
|
+
},
|
|
1238
1443
|
go: {
|
|
1239
1444
|
method: 'client.Matches.Get',
|
|
1240
1445
|
example:
|
|
@@ -1254,6 +1459,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1254
1459
|
example:
|
|
1255
1460
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.Match\nimport com.believe.api.models.matches.MatchRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val match: Match = client.matches().retrieve("match_id")\n}',
|
|
1256
1461
|
},
|
|
1462
|
+
php: {
|
|
1463
|
+
method: 'matches->retrieve',
|
|
1464
|
+
example:
|
|
1465
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$match = $client->matches->retrieve('match_id');\n\nvar_dump($match);",
|
|
1466
|
+
},
|
|
1257
1467
|
python: {
|
|
1258
1468
|
method: 'matches.retrieve',
|
|
1259
1469
|
example:
|
|
@@ -1306,6 +1516,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1306
1516
|
method: 'matches update',
|
|
1307
1517
|
example: "believe matches update \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1308
1518
|
},
|
|
1519
|
+
csharp: {
|
|
1520
|
+
method: 'Matches.Update',
|
|
1521
|
+
example:
|
|
1522
|
+
'MatchUpdateParams parameters = new() { MatchID = "match_id" };\n\nvar match = await client.Matches.Update(parameters);\n\nConsole.WriteLine(match);',
|
|
1523
|
+
},
|
|
1309
1524
|
go: {
|
|
1310
1525
|
method: 'client.Matches.Update',
|
|
1311
1526
|
example:
|
|
@@ -1325,6 +1540,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1325
1540
|
example:
|
|
1326
1541
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.Match\nimport com.believe.api.models.matches.MatchUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val match: Match = client.matches().update("match_id")\n}',
|
|
1327
1542
|
},
|
|
1543
|
+
php: {
|
|
1544
|
+
method: 'matches->update',
|
|
1545
|
+
example:
|
|
1546
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$match = $client->matches->update(\n 'match_id',\n attendance: 0,\n awayScore: 0,\n awayTeamID: 'away_team_id',\n date: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n episodeID: 'episode_id',\n homeScore: 0,\n homeTeamID: 'home_team_id',\n lessonLearned: 'lesson_learned',\n matchType: MatchType::LEAGUE,\n possessionPercentage: 0,\n result: MatchResult::WIN,\n tedHalftimeSpeech: 'ted_halftime_speech',\n ticketRevenueGbp: 0,\n turningPoints: [\n [\n 'description' => 'description',\n 'emotionalImpact' => 'Galvanized the team\\'s fighting spirit',\n 'minute' => 0,\n 'characterInvolved' => 'jamie-tartt',\n ],\n ],\n weatherTempCelsius: -30,\n);\n\nvar_dump($match);",
|
|
1547
|
+
},
|
|
1328
1548
|
python: {
|
|
1329
1549
|
method: 'matches.update',
|
|
1330
1550
|
example:
|
|
@@ -1358,6 +1578,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1358
1578
|
method: 'matches delete',
|
|
1359
1579
|
example: "believe matches delete \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1360
1580
|
},
|
|
1581
|
+
csharp: {
|
|
1582
|
+
method: 'Matches.Delete',
|
|
1583
|
+
example:
|
|
1584
|
+
'MatchDeleteParams parameters = new() { MatchID = "match_id" };\n\nawait client.Matches.Delete(parameters);',
|
|
1585
|
+
},
|
|
1361
1586
|
go: {
|
|
1362
1587
|
method: 'client.Matches.Delete',
|
|
1363
1588
|
example:
|
|
@@ -1377,6 +1602,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1377
1602
|
example:
|
|
1378
1603
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.MatchDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.matches().delete("match_id")\n}',
|
|
1379
1604
|
},
|
|
1605
|
+
php: {
|
|
1606
|
+
method: 'matches->delete',
|
|
1607
|
+
example:
|
|
1608
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->matches->delete('match_id');\n\nvar_dump($result);",
|
|
1609
|
+
},
|
|
1380
1610
|
python: {
|
|
1381
1611
|
method: 'matches.delete',
|
|
1382
1612
|
example:
|
|
@@ -1411,6 +1641,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1411
1641
|
method: 'matches get_turning_points',
|
|
1412
1642
|
example: "believe matches get-turning-points \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1413
1643
|
},
|
|
1644
|
+
csharp: {
|
|
1645
|
+
method: 'Matches.GetTurningPoints',
|
|
1646
|
+
example:
|
|
1647
|
+
'MatchGetTurningPointsParams parameters = new() { MatchID = "match_id" };\n\nvar response = await client.Matches.GetTurningPoints(parameters);\n\nConsole.WriteLine(response);',
|
|
1648
|
+
},
|
|
1414
1649
|
go: {
|
|
1415
1650
|
method: 'client.Matches.GetTurningPoints',
|
|
1416
1651
|
example:
|
|
@@ -1430,6 +1665,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1430
1665
|
example:
|
|
1431
1666
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.MatchGetTurningPointsParams\nimport com.believe.api.models.matches.MatchGetTurningPointsResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: List<MatchGetTurningPointsResponse> = client.matches().getTurningPoints("match_id")\n}',
|
|
1432
1667
|
},
|
|
1668
|
+
php: {
|
|
1669
|
+
method: 'matches->getTurningPoints',
|
|
1670
|
+
example:
|
|
1671
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->matches->getTurningPoints('match_id');\n\nvar_dump($response);",
|
|
1672
|
+
},
|
|
1433
1673
|
python: {
|
|
1434
1674
|
method: 'matches.get_turning_points',
|
|
1435
1675
|
example:
|
|
@@ -1464,6 +1704,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1464
1704
|
method: 'matches get_lesson',
|
|
1465
1705
|
example: "believe matches get-lesson \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1466
1706
|
},
|
|
1707
|
+
csharp: {
|
|
1708
|
+
method: 'Matches.GetLesson',
|
|
1709
|
+
example:
|
|
1710
|
+
'MatchGetLessonParams parameters = new() { MatchID = "match_id" };\n\nvar response = await client.Matches.GetLesson(parameters);\n\nConsole.WriteLine(response);',
|
|
1711
|
+
},
|
|
1467
1712
|
go: {
|
|
1468
1713
|
method: 'client.Matches.GetLesson',
|
|
1469
1714
|
example:
|
|
@@ -1483,6 +1728,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1483
1728
|
example:
|
|
1484
1729
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.MatchGetLessonParams\nimport com.believe.api.models.matches.MatchGetLessonResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: MatchGetLessonResponse = client.matches().getLesson("match_id")\n}',
|
|
1485
1730
|
},
|
|
1731
|
+
php: {
|
|
1732
|
+
method: 'matches->getLesson',
|
|
1733
|
+
example:
|
|
1734
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->matches->getLesson('match_id');\n\nvar_dump($response);",
|
|
1735
|
+
},
|
|
1486
1736
|
python: {
|
|
1487
1737
|
method: 'matches.get_lesson',
|
|
1488
1738
|
example:
|
|
@@ -1517,6 +1767,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1517
1767
|
method: 'matches stream_live',
|
|
1518
1768
|
example: "believe matches stream-live \\\n --api-key 'My API Key'",
|
|
1519
1769
|
},
|
|
1770
|
+
csharp: {
|
|
1771
|
+
method: 'Matches.StreamLive',
|
|
1772
|
+
example: 'MatchStreamLiveParams parameters = new();\n\nawait client.Matches.StreamLive(parameters);',
|
|
1773
|
+
},
|
|
1520
1774
|
go: {
|
|
1521
1775
|
method: 'client.Matches.StreamLive',
|
|
1522
1776
|
example:
|
|
@@ -1536,6 +1790,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1536
1790
|
example:
|
|
1537
1791
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.MatchStreamLiveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.matches().streamLive()\n}',
|
|
1538
1792
|
},
|
|
1793
|
+
php: {
|
|
1794
|
+
method: 'matches->streamLive',
|
|
1795
|
+
example:
|
|
1796
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->matches->streamLive(\n awayTeam: 'away_team', excitementLevel: 1, homeTeam: 'home_team', speed: 0.1\n);\n\nvar_dump($result);",
|
|
1797
|
+
},
|
|
1539
1798
|
python: {
|
|
1540
1799
|
method: 'matches.stream_live',
|
|
1541
1800
|
example:
|
|
@@ -1571,6 +1830,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1571
1830
|
method: 'commentary stream',
|
|
1572
1831
|
example: "believe matches:commentary stream \\\n --api-key 'My API Key' \\\n --match-id match_id",
|
|
1573
1832
|
},
|
|
1833
|
+
csharp: {
|
|
1834
|
+
method: 'Matches.Commentary.Stream',
|
|
1835
|
+
example:
|
|
1836
|
+
'CommentaryStreamParams parameters = new() { MatchID = "match_id" };\n\nvar response = await client.Matches.Commentary.Stream(parameters);\n\nConsole.WriteLine(response);',
|
|
1837
|
+
},
|
|
1574
1838
|
go: {
|
|
1575
1839
|
method: 'client.Matches.Commentary.Stream',
|
|
1576
1840
|
example:
|
|
@@ -1590,6 +1854,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1590
1854
|
example:
|
|
1591
1855
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.matches.commentary.CommentaryStreamParams\nimport com.believe.api.models.matches.commentary.CommentaryStreamResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: CommentaryStreamResponse = client.matches().commentary().stream("match_id")\n}',
|
|
1592
1856
|
},
|
|
1857
|
+
php: {
|
|
1858
|
+
method: 'matches->commentary->stream',
|
|
1859
|
+
example:
|
|
1860
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->matches->commentary->stream('match_id');\n\nvar_dump($response);",
|
|
1861
|
+
},
|
|
1593
1862
|
python: {
|
|
1594
1863
|
method: 'matches.commentary.stream',
|
|
1595
1864
|
example:
|
|
@@ -1625,6 +1894,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1625
1894
|
method: 'episodes list',
|
|
1626
1895
|
example: "believe episodes list \\\n --api-key 'My API Key'",
|
|
1627
1896
|
},
|
|
1897
|
+
csharp: {
|
|
1898
|
+
method: 'Episodes.List',
|
|
1899
|
+
example:
|
|
1900
|
+
'EpisodeListParams parameters = new();\n\nvar page = await client.Episodes.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
1901
|
+
},
|
|
1628
1902
|
go: {
|
|
1629
1903
|
method: 'client.Episodes.List',
|
|
1630
1904
|
example:
|
|
@@ -1643,6 +1917,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1643
1917
|
example:
|
|
1644
1918
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.EpisodeListPage\nimport com.believe.api.models.episodes.EpisodeListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: EpisodeListPage = client.episodes().list()\n}',
|
|
1645
1919
|
},
|
|
1920
|
+
php: {
|
|
1921
|
+
method: 'episodes->list',
|
|
1922
|
+
example:
|
|
1923
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->episodes->list(\n characterFocus: 'character_focus', limit: 10, season: 1, skip: 0\n);\n\nvar_dump($page);",
|
|
1924
|
+
},
|
|
1646
1925
|
python: {
|
|
1647
1926
|
method: 'episodes.list',
|
|
1648
1927
|
example:
|
|
@@ -1695,6 +1974,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1695
1974
|
example:
|
|
1696
1975
|
"believe episodes create \\\n --api-key 'My API Key' \\\n --air-date \"'2020-10-02'\" \\\n --character-focus ted-lasso \\\n --character-focus coach-beard \\\n --character-focus higgins \\\n --character-focus nate \\\n --director 'MJ Delaney' \\\n --episode-number 8 \\\n --main-theme 'The power of vulnerability and male friendship' \\\n --runtime-minutes 29 \\\n --season 1 \\\n --synopsis 'Ted creates a support group for the coaching staff while Rebecca faces a difficult decision about her future.' \\\n --ted-wisdom \"There's two buttons I never like to hit: that's panic and snooze.\" \\\n --title 'The Diamond Dogs' \\\n --writer 'Jason Sudeikis, Brendan Hunt, Joe Kelly'",
|
|
1697
1976
|
},
|
|
1977
|
+
csharp: {
|
|
1978
|
+
method: 'Episodes.Create',
|
|
1979
|
+
example:
|
|
1980
|
+
'EpisodeCreateParams parameters = new()\n{\n AirDate = "2020-10-02",\n CharacterFocus =\n [\n "ted-lasso", "coach-beard", "higgins", "nate"\n ],\n Director = "MJ Delaney",\n EpisodeNumber = 8,\n MainTheme = "The power of vulnerability and male friendship",\n RuntimeMinutes = 29,\n Season = 1,\n Synopsis = "Ted creates a support group for the coaching staff while Rebecca faces a difficult decision about her future.",\n TedWisdom = "There\'s two buttons I never like to hit: that\'s panic and snooze.",\n Title = "The Diamond Dogs",\n Writer = "Jason Sudeikis, Brendan Hunt, Joe Kelly",\n};\n\nvar episode = await client.Episodes.Create(parameters);\n\nConsole.WriteLine(episode);',
|
|
1981
|
+
},
|
|
1698
1982
|
go: {
|
|
1699
1983
|
method: 'client.Episodes.New',
|
|
1700
1984
|
example:
|
|
@@ -1714,6 +1998,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1714
1998
|
example:
|
|
1715
1999
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.Episode\nimport com.believe.api.models.episodes.EpisodeCreateParams\nimport java.time.LocalDate\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: EpisodeCreateParams = EpisodeCreateParams.builder()\n .airDate(LocalDate.parse("2020-10-02"))\n .characterFocus(listOf(\n "ted-lasso",\n "coach-beard",\n "higgins",\n "nate",\n ))\n .director("MJ Delaney")\n .episodeNumber(8L)\n .mainTheme("The power of vulnerability and male friendship")\n .runtimeMinutes(29L)\n .season(1L)\n .synopsis("Ted creates a support group for the coaching staff while Rebecca faces a difficult decision about her future.")\n .tedWisdom("There\'s two buttons I never like to hit: that\'s panic and snooze.")\n .title("The Diamond Dogs")\n .writer("Jason Sudeikis, Brendan Hunt, Joe Kelly")\n .build()\n val episode: Episode = client.episodes().create(params)\n}',
|
|
1716
2000
|
},
|
|
2001
|
+
php: {
|
|
2002
|
+
method: 'episodes->create',
|
|
2003
|
+
example:
|
|
2004
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$episode = $client->episodes->create(\n airDate: '2020-10-02',\n characterFocus: ['ted-lasso', 'coach-beard', 'higgins', 'nate'],\n director: 'MJ Delaney',\n episodeNumber: 8,\n mainTheme: 'The power of vulnerability and male friendship',\n runtimeMinutes: 29,\n season: 1,\n synopsis: 'Ted creates a support group for the coaching staff while Rebecca faces a difficult decision about her future.',\n tedWisdom: 'There\\'s two buttons I never like to hit: that\\'s panic and snooze.',\n title: 'The Diamond Dogs',\n writer: 'Jason Sudeikis, Brendan Hunt, Joe Kelly',\n biscuitsWithBossMoment: 'Ted and Rebecca have an honest conversation about trust.',\n memorableMoments: [\n 'First Diamond Dogs meeting',\n 'The famous dart scene with Rupert',\n 'Be curious, not judgmental speech',\n ],\n usViewersMillions: 1.42,\n viewerRating: 9.1,\n);\n\nvar_dump($episode);",
|
|
2005
|
+
},
|
|
1717
2006
|
python: {
|
|
1718
2007
|
method: 'episodes.create',
|
|
1719
2008
|
example:
|
|
@@ -1749,6 +2038,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1749
2038
|
method: 'episodes retrieve',
|
|
1750
2039
|
example: "believe episodes retrieve \\\n --api-key 'My API Key' \\\n --episode-id episode_id",
|
|
1751
2040
|
},
|
|
2041
|
+
csharp: {
|
|
2042
|
+
method: 'Episodes.Retrieve',
|
|
2043
|
+
example:
|
|
2044
|
+
'EpisodeRetrieveParams parameters = new() { EpisodeID = "episode_id" };\n\nvar episode = await client.Episodes.Retrieve(parameters);\n\nConsole.WriteLine(episode);',
|
|
2045
|
+
},
|
|
1752
2046
|
go: {
|
|
1753
2047
|
method: 'client.Episodes.Get',
|
|
1754
2048
|
example:
|
|
@@ -1768,6 +2062,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1768
2062
|
example:
|
|
1769
2063
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.Episode\nimport com.believe.api.models.episodes.EpisodeRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val episode: Episode = client.episodes().retrieve("episode_id")\n}',
|
|
1770
2064
|
},
|
|
2065
|
+
php: {
|
|
2066
|
+
method: 'episodes->retrieve',
|
|
2067
|
+
example:
|
|
2068
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$episode = $client->episodes->retrieve('episode_id');\n\nvar_dump($episode);",
|
|
2069
|
+
},
|
|
1771
2070
|
python: {
|
|
1772
2071
|
method: 'episodes.retrieve',
|
|
1773
2072
|
example:
|
|
@@ -1820,6 +2119,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1820
2119
|
method: 'episodes update',
|
|
1821
2120
|
example: "believe episodes update \\\n --api-key 'My API Key' \\\n --episode-id episode_id",
|
|
1822
2121
|
},
|
|
2122
|
+
csharp: {
|
|
2123
|
+
method: 'Episodes.Update',
|
|
2124
|
+
example:
|
|
2125
|
+
'EpisodeUpdateParams parameters = new() { EpisodeID = "episode_id" };\n\nvar episode = await client.Episodes.Update(parameters);\n\nConsole.WriteLine(episode);',
|
|
2126
|
+
},
|
|
1823
2127
|
go: {
|
|
1824
2128
|
method: 'client.Episodes.Update',
|
|
1825
2129
|
example:
|
|
@@ -1839,6 +2143,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1839
2143
|
example:
|
|
1840
2144
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.Episode\nimport com.believe.api.models.episodes.EpisodeUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val episode: Episode = client.episodes().update("episode_id")\n}',
|
|
1841
2145
|
},
|
|
2146
|
+
php: {
|
|
2147
|
+
method: 'episodes->update',
|
|
2148
|
+
example:
|
|
2149
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$episode = $client->episodes->update(\n 'episode_id',\n airDate: '2019-12-27',\n biscuitsWithBossMoment: 'biscuits_with_boss_moment',\n characterFocus: ['string'],\n director: 'director',\n episodeNumber: 1,\n mainTheme: 'main_theme',\n memorableMoments: ['string'],\n runtimeMinutes: 20,\n season: 1,\n synopsis: 'synopsis',\n tedWisdom: 'ted_wisdom',\n title: 'x',\n usViewersMillions: 0,\n viewerRating: 0,\n writer: 'writer',\n);\n\nvar_dump($episode);",
|
|
2150
|
+
},
|
|
1842
2151
|
python: {
|
|
1843
2152
|
method: 'episodes.update',
|
|
1844
2153
|
example:
|
|
@@ -1872,6 +2181,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1872
2181
|
method: 'episodes delete',
|
|
1873
2182
|
example: "believe episodes delete \\\n --api-key 'My API Key' \\\n --episode-id episode_id",
|
|
1874
2183
|
},
|
|
2184
|
+
csharp: {
|
|
2185
|
+
method: 'Episodes.Delete',
|
|
2186
|
+
example:
|
|
2187
|
+
'EpisodeDeleteParams parameters = new() { EpisodeID = "episode_id" };\n\nawait client.Episodes.Delete(parameters);',
|
|
2188
|
+
},
|
|
1875
2189
|
go: {
|
|
1876
2190
|
method: 'client.Episodes.Delete',
|
|
1877
2191
|
example:
|
|
@@ -1891,6 +2205,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1891
2205
|
example:
|
|
1892
2206
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.EpisodeDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.episodes().delete("episode_id")\n}',
|
|
1893
2207
|
},
|
|
2208
|
+
php: {
|
|
2209
|
+
method: 'episodes->delete',
|
|
2210
|
+
example:
|
|
2211
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->episodes->delete('episode_id');\n\nvar_dump($result);",
|
|
2212
|
+
},
|
|
1894
2213
|
python: {
|
|
1895
2214
|
method: 'episodes.delete',
|
|
1896
2215
|
example:
|
|
@@ -1925,6 +2244,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1925
2244
|
method: 'episodes get_wisdom',
|
|
1926
2245
|
example: "believe episodes get-wisdom \\\n --api-key 'My API Key' \\\n --episode-id episode_id",
|
|
1927
2246
|
},
|
|
2247
|
+
csharp: {
|
|
2248
|
+
method: 'Episodes.GetWisdom',
|
|
2249
|
+
example:
|
|
2250
|
+
'EpisodeGetWisdomParams parameters = new() { EpisodeID = "episode_id" };\n\nvar response = await client.Episodes.GetWisdom(parameters);\n\nConsole.WriteLine(response);',
|
|
2251
|
+
},
|
|
1928
2252
|
go: {
|
|
1929
2253
|
method: 'client.Episodes.GetWisdom',
|
|
1930
2254
|
example:
|
|
@@ -1944,6 +2268,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1944
2268
|
example:
|
|
1945
2269
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.episodes.EpisodeGetWisdomParams\nimport com.believe.api.models.episodes.EpisodeGetWisdomResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: EpisodeGetWisdomResponse = client.episodes().getWisdom("episode_id")\n}',
|
|
1946
2270
|
},
|
|
2271
|
+
php: {
|
|
2272
|
+
method: 'episodes->getWisdom',
|
|
2273
|
+
example:
|
|
2274
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->episodes->getWisdom('episode_id');\n\nvar_dump($response);",
|
|
2275
|
+
},
|
|
1947
2276
|
python: {
|
|
1948
2277
|
method: 'episodes.get_wisdom',
|
|
1949
2278
|
example:
|
|
@@ -1987,6 +2316,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1987
2316
|
method: 'quotes list',
|
|
1988
2317
|
example: "believe quotes list \\\n --api-key 'My API Key'",
|
|
1989
2318
|
},
|
|
2319
|
+
csharp: {
|
|
2320
|
+
method: 'Quotes.List',
|
|
2321
|
+
example:
|
|
2322
|
+
'QuoteListParams parameters = new();\n\nvar page = await client.Quotes.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
2323
|
+
},
|
|
1990
2324
|
go: {
|
|
1991
2325
|
method: 'client.Quotes.List',
|
|
1992
2326
|
example:
|
|
@@ -2005,6 +2339,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2005
2339
|
example:
|
|
2006
2340
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.QuoteListPage\nimport com.believe.api.models.quotes.QuoteListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: QuoteListPage = client.quotes().list()\n}',
|
|
2007
2341
|
},
|
|
2342
|
+
php: {
|
|
2343
|
+
method: 'quotes->list',
|
|
2344
|
+
example:
|
|
2345
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->quotes->list(\n characterID: 'character_id',\n funny: true,\n inspirational: true,\n limit: 10,\n momentType: QuoteMoment::HALFTIME_SPEECH,\n skip: 0,\n theme: QuoteTheme::BELIEF,\n);\n\nvar_dump($page);",
|
|
2346
|
+
},
|
|
2008
2347
|
python: {
|
|
2009
2348
|
method: 'quotes.list',
|
|
2010
2349
|
example:
|
|
@@ -2053,6 +2392,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2053
2392
|
example:
|
|
2054
2393
|
"believe quotes create \\\n --api-key 'My API Key' \\\n --character-id ted-lasso \\\n --context \"Ted's first team meeting, revealing his coaching philosophy\" \\\n --moment-type locker_room \\\n --text 'I believe in believe.' \\\n --theme belief",
|
|
2055
2394
|
},
|
|
2395
|
+
csharp: {
|
|
2396
|
+
method: 'Quotes.Create',
|
|
2397
|
+
example:
|
|
2398
|
+
'QuoteCreateParams parameters = new()\n{\n CharacterID = "ted-lasso",\n Context = "Ted\'s first team meeting, revealing his coaching philosophy",\n MomentType = QuoteMoment.LockerRoom,\n Text = "I believe in believe.",\n Theme = QuoteTheme.Belief,\n};\n\nvar quote = await client.Quotes.Create(parameters);\n\nConsole.WriteLine(quote);',
|
|
2399
|
+
},
|
|
2056
2400
|
go: {
|
|
2057
2401
|
method: 'client.Quotes.New',
|
|
2058
2402
|
example:
|
|
@@ -2072,6 +2416,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2072
2416
|
example:
|
|
2073
2417
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.Quote\nimport com.believe.api.models.quotes.QuoteCreateParams\nimport com.believe.api.models.quotes.QuoteMoment\nimport com.believe.api.models.quotes.QuoteTheme\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: QuoteCreateParams = QuoteCreateParams.builder()\n .characterId("ted-lasso")\n .context("Ted\'s first team meeting, revealing his coaching philosophy")\n .momentType(QuoteMoment.LOCKER_ROOM)\n .text("I believe in believe.")\n .theme(QuoteTheme.BELIEF)\n .build()\n val quote: Quote = client.quotes().create(params)\n}',
|
|
2074
2418
|
},
|
|
2419
|
+
php: {
|
|
2420
|
+
method: 'quotes->create',
|
|
2421
|
+
example:
|
|
2422
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$quote = $client->quotes->create(\n characterID: 'ted-lasso',\n context: 'Ted\\'s first team meeting, revealing his coaching philosophy',\n momentType: QuoteMoment::LOCKER_ROOM,\n text: 'I believe in believe.',\n theme: QuoteTheme::BELIEF,\n episodeID: 's01e01',\n isFunny: false,\n isInspirational: true,\n popularityScore: 98.5,\n secondaryThemes: [QuoteTheme::LEADERSHIP, QuoteTheme::TEAMWORK],\n timesShared: 250000,\n);\n\nvar_dump($quote);",
|
|
2423
|
+
},
|
|
2075
2424
|
python: {
|
|
2076
2425
|
method: 'quotes.create',
|
|
2077
2426
|
example:
|
|
@@ -2107,6 +2456,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2107
2456
|
method: 'quotes get_random',
|
|
2108
2457
|
example: "believe quotes get-random \\\n --api-key 'My API Key'",
|
|
2109
2458
|
},
|
|
2459
|
+
csharp: {
|
|
2460
|
+
method: 'Quotes.GetRandom',
|
|
2461
|
+
example:
|
|
2462
|
+
'QuoteGetRandomParams parameters = new();\n\nvar quote = await client.Quotes.GetRandom(parameters);\n\nConsole.WriteLine(quote);',
|
|
2463
|
+
},
|
|
2110
2464
|
go: {
|
|
2111
2465
|
method: 'client.Quotes.GetRandom',
|
|
2112
2466
|
example:
|
|
@@ -2126,6 +2480,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2126
2480
|
example:
|
|
2127
2481
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.Quote\nimport com.believe.api.models.quotes.QuoteGetRandomParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val quote: Quote = client.quotes().getRandom()\n}',
|
|
2128
2482
|
},
|
|
2483
|
+
php: {
|
|
2484
|
+
method: 'quotes->getRandom',
|
|
2485
|
+
example:
|
|
2486
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$quote = $client->quotes->getRandom(\n characterID: 'character_id', inspirational: true, theme: QuoteTheme::BELIEF\n);\n\nvar_dump($quote);",
|
|
2487
|
+
},
|
|
2129
2488
|
python: {
|
|
2130
2489
|
method: 'quotes.get_random',
|
|
2131
2490
|
example:
|
|
@@ -2161,6 +2520,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2161
2520
|
method: 'quotes retrieve',
|
|
2162
2521
|
example: "believe quotes retrieve \\\n --api-key 'My API Key' \\\n --quote-id quote_id",
|
|
2163
2522
|
},
|
|
2523
|
+
csharp: {
|
|
2524
|
+
method: 'Quotes.Retrieve',
|
|
2525
|
+
example:
|
|
2526
|
+
'QuoteRetrieveParams parameters = new() { QuoteID = "quote_id" };\n\nvar quote = await client.Quotes.Retrieve(parameters);\n\nConsole.WriteLine(quote);',
|
|
2527
|
+
},
|
|
2164
2528
|
go: {
|
|
2165
2529
|
method: 'client.Quotes.Get',
|
|
2166
2530
|
example:
|
|
@@ -2180,6 +2544,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2180
2544
|
example:
|
|
2181
2545
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.Quote\nimport com.believe.api.models.quotes.QuoteRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val quote: Quote = client.quotes().retrieve("quote_id")\n}',
|
|
2182
2546
|
},
|
|
2547
|
+
php: {
|
|
2548
|
+
method: 'quotes->retrieve',
|
|
2549
|
+
example:
|
|
2550
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$quote = $client->quotes->retrieve('quote_id');\n\nvar_dump($quote);",
|
|
2551
|
+
},
|
|
2183
2552
|
python: {
|
|
2184
2553
|
method: 'quotes.retrieve',
|
|
2185
2554
|
example:
|
|
@@ -2228,6 +2597,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2228
2597
|
method: 'quotes update',
|
|
2229
2598
|
example: "believe quotes update \\\n --api-key 'My API Key' \\\n --quote-id quote_id",
|
|
2230
2599
|
},
|
|
2600
|
+
csharp: {
|
|
2601
|
+
method: 'Quotes.Update',
|
|
2602
|
+
example:
|
|
2603
|
+
'QuoteUpdateParams parameters = new() { QuoteID = "quote_id" };\n\nvar quote = await client.Quotes.Update(parameters);\n\nConsole.WriteLine(quote);',
|
|
2604
|
+
},
|
|
2231
2605
|
go: {
|
|
2232
2606
|
method: 'client.Quotes.Update',
|
|
2233
2607
|
example:
|
|
@@ -2247,6 +2621,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2247
2621
|
example:
|
|
2248
2622
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.Quote\nimport com.believe.api.models.quotes.QuoteUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val quote: Quote = client.quotes().update("quote_id")\n}',
|
|
2249
2623
|
},
|
|
2624
|
+
php: {
|
|
2625
|
+
method: 'quotes->update',
|
|
2626
|
+
example:
|
|
2627
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$quote = $client->quotes->update(\n 'quote_id',\n characterID: 'character_id',\n context: 'context',\n episodeID: 'episode_id',\n isFunny: true,\n isInspirational: true,\n momentType: QuoteMoment::HALFTIME_SPEECH,\n popularityScore: 0,\n secondaryThemes: [QuoteTheme::BELIEF],\n text: 'x',\n theme: QuoteTheme::BELIEF,\n timesShared: 0,\n);\n\nvar_dump($quote);",
|
|
2628
|
+
},
|
|
2250
2629
|
python: {
|
|
2251
2630
|
method: 'quotes.update',
|
|
2252
2631
|
example:
|
|
@@ -2280,6 +2659,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2280
2659
|
method: 'quotes delete',
|
|
2281
2660
|
example: "believe quotes delete \\\n --api-key 'My API Key' \\\n --quote-id quote_id",
|
|
2282
2661
|
},
|
|
2662
|
+
csharp: {
|
|
2663
|
+
method: 'Quotes.Delete',
|
|
2664
|
+
example:
|
|
2665
|
+
'QuoteDeleteParams parameters = new() { QuoteID = "quote_id" };\n\nawait client.Quotes.Delete(parameters);',
|
|
2666
|
+
},
|
|
2283
2667
|
go: {
|
|
2284
2668
|
method: 'client.Quotes.Delete',
|
|
2285
2669
|
example:
|
|
@@ -2299,6 +2683,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2299
2683
|
example:
|
|
2300
2684
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.QuoteDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.quotes().delete("quote_id")\n}',
|
|
2301
2685
|
},
|
|
2686
|
+
php: {
|
|
2687
|
+
method: 'quotes->delete',
|
|
2688
|
+
example:
|
|
2689
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->quotes->delete('quote_id');\n\nvar_dump($result);",
|
|
2690
|
+
},
|
|
2302
2691
|
python: {
|
|
2303
2692
|
method: 'quotes.delete',
|
|
2304
2693
|
example:
|
|
@@ -2334,6 +2723,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2334
2723
|
method: 'quotes list_by_theme',
|
|
2335
2724
|
example: "believe quotes list-by-theme \\\n --api-key 'My API Key' \\\n --theme belief",
|
|
2336
2725
|
},
|
|
2726
|
+
csharp: {
|
|
2727
|
+
method: 'Quotes.ListByTheme',
|
|
2728
|
+
example:
|
|
2729
|
+
'QuoteListByThemeParams parameters = new() { Theme = QuoteTheme.Belief };\n\nvar page = await client.Quotes.ListByTheme(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
2730
|
+
},
|
|
2337
2731
|
go: {
|
|
2338
2732
|
method: 'client.Quotes.ListByTheme',
|
|
2339
2733
|
example:
|
|
@@ -2353,6 +2747,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2353
2747
|
example:
|
|
2354
2748
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.QuoteListByThemePage\nimport com.believe.api.models.quotes.QuoteListByThemeParams\nimport com.believe.api.models.quotes.QuoteTheme\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: QuoteListByThemePage = client.quotes().listByTheme(QuoteTheme.BELIEF)\n}',
|
|
2355
2749
|
},
|
|
2750
|
+
php: {
|
|
2751
|
+
method: 'quotes->listByTheme',
|
|
2752
|
+
example:
|
|
2753
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->quotes->listByTheme(QuoteTheme::BELIEF, limit: 10, skip: 0);\n\nvar_dump($page);",
|
|
2754
|
+
},
|
|
2356
2755
|
python: {
|
|
2357
2756
|
method: 'quotes.list_by_theme',
|
|
2358
2757
|
example:
|
|
@@ -2389,6 +2788,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2389
2788
|
example:
|
|
2390
2789
|
"believe quotes list-by-character \\\n --api-key 'My API Key' \\\n --character-id character_id",
|
|
2391
2790
|
},
|
|
2791
|
+
csharp: {
|
|
2792
|
+
method: 'Quotes.ListByCharacter',
|
|
2793
|
+
example:
|
|
2794
|
+
'QuoteListByCharacterParams parameters = new() { CharacterID = "character_id" };\n\nvar page = await client.Quotes.ListByCharacter(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
2795
|
+
},
|
|
2392
2796
|
go: {
|
|
2393
2797
|
method: 'client.Quotes.ListByCharacter',
|
|
2394
2798
|
example:
|
|
@@ -2408,6 +2812,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2408
2812
|
example:
|
|
2409
2813
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.quotes.QuoteListByCharacterPage\nimport com.believe.api.models.quotes.QuoteListByCharacterParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: QuoteListByCharacterPage = client.quotes().listByCharacter("character_id")\n}',
|
|
2410
2814
|
},
|
|
2815
|
+
php: {
|
|
2816
|
+
method: 'quotes->listByCharacter',
|
|
2817
|
+
example:
|
|
2818
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->quotes->listByCharacter('character_id', limit: 10, skip: 0);\n\nvar_dump($page);",
|
|
2819
|
+
},
|
|
2411
2820
|
python: {
|
|
2412
2821
|
method: 'quotes.list_by_character',
|
|
2413
2822
|
example:
|
|
@@ -2444,6 +2853,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2444
2853
|
example:
|
|
2445
2854
|
"believe believe submit \\\n --api-key 'My API Key' \\\n --situation \"I just got passed over for a promotion I've been working toward for two years.\" \\\n --situation-type work_challenge",
|
|
2446
2855
|
},
|
|
2856
|
+
csharp: {
|
|
2857
|
+
method: 'Believe.Submit',
|
|
2858
|
+
example:
|
|
2859
|
+
'BelieveSubmitParams parameters = new()\n{\n Situation = "I just got passed over for a promotion I\'ve been working toward for two years.",\n SituationType = SituationType.WorkChallenge,\n};\n\nvar response = await client.Believe.Submit(parameters);\n\nConsole.WriteLine(response);',
|
|
2860
|
+
},
|
|
2447
2861
|
go: {
|
|
2448
2862
|
method: 'client.Believe.Submit',
|
|
2449
2863
|
example:
|
|
@@ -2463,6 +2877,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2463
2877
|
example:
|
|
2464
2878
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.believe.BelieveSubmitParams\nimport com.believe.api.models.believe.BelieveSubmitResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: BelieveSubmitParams = BelieveSubmitParams.builder()\n .situation("I just got passed over for a promotion I\'ve been working toward for two years.")\n .situationType(BelieveSubmitParams.SituationType.WORK_CHALLENGE)\n .build()\n val response: BelieveSubmitResponse = client.believe().submit(params)\n}',
|
|
2465
2879
|
},
|
|
2880
|
+
php: {
|
|
2881
|
+
method: 'believe->submit',
|
|
2882
|
+
example:
|
|
2883
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->believe->submit(\n situation: 'I just got passed over for a promotion I\\'ve been working toward for two years.',\n situationType: 'work_challenge',\n context: 'I\\'ve always tried to be a team player and support my colleagues.',\n intensity: 7,\n);\n\nvar_dump($response);",
|
|
2884
|
+
},
|
|
2466
2885
|
python: {
|
|
2467
2886
|
method: 'believe.submit',
|
|
2468
2887
|
example:
|
|
@@ -2504,6 +2923,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2504
2923
|
example:
|
|
2505
2924
|
"believe conflicts resolve \\\n --api-key 'My API Key' \\\n --conflict-type interpersonal \\\n --description \"Alex keeps taking credit for my ideas in meetings and I'm getting resentful.\" \\\n --parties-involved Me \\\n --parties-involved 'My teammate Alex'",
|
|
2506
2925
|
},
|
|
2926
|
+
csharp: {
|
|
2927
|
+
method: 'Conflicts.Resolve',
|
|
2928
|
+
example:
|
|
2929
|
+
'ConflictResolveParams parameters = new()\n{\n ConflictType = ConflictType.Interpersonal,\n Description = "Alex keeps taking credit for my ideas in meetings and I\'m getting resentful.",\n PartiesInvolved =\n [\n "Me", "My teammate Alex"\n ],\n};\n\nvar response = await client.Conflicts.Resolve(parameters);\n\nConsole.WriteLine(response);',
|
|
2930
|
+
},
|
|
2507
2931
|
go: {
|
|
2508
2932
|
method: 'client.Conflicts.Resolve',
|
|
2509
2933
|
example:
|
|
@@ -2523,6 +2947,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2523
2947
|
example:
|
|
2524
2948
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.conflicts.ConflictResolveParams\nimport com.believe.api.models.conflicts.ConflictResolveResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: ConflictResolveParams = ConflictResolveParams.builder()\n .conflictType(ConflictResolveParams.ConflictType.INTERPERSONAL)\n .description("Alex keeps taking credit for my ideas in meetings and I\'m getting resentful.")\n .addPartiesInvolved("Me")\n .addPartiesInvolved("My teammate Alex")\n .build()\n val response: ConflictResolveResponse = client.conflicts().resolve(params)\n}',
|
|
2525
2949
|
},
|
|
2950
|
+
php: {
|
|
2951
|
+
method: 'conflicts->resolve',
|
|
2952
|
+
example:
|
|
2953
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->conflicts->resolve(\n conflictType: 'interpersonal',\n description: 'Alex keeps taking credit for my ideas in meetings and I\\'m getting resentful.',\n partiesInvolved: ['Me', 'My teammate Alex'],\n attemptsMade: ['Mentioned it casually', 'Avoided them'],\n);\n\nvar_dump($response);",
|
|
2954
|
+
},
|
|
2526
2955
|
python: {
|
|
2527
2956
|
method: 'conflicts.resolve',
|
|
2528
2957
|
example:
|
|
@@ -2559,6 +2988,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2559
2988
|
example:
|
|
2560
2989
|
"believe reframe transform-negative-thoughts \\\n --api-key 'My API Key' \\\n --negative-thought \"I'm not good enough for this job.\"",
|
|
2561
2990
|
},
|
|
2991
|
+
csharp: {
|
|
2992
|
+
method: 'Reframe.TransformNegativeThoughts',
|
|
2993
|
+
example:
|
|
2994
|
+
'ReframeTransformNegativeThoughtsParams parameters = new()\n{\n NegativeThought = "I\'m not good enough for this job."\n};\n\nvar response = await client.Reframe.TransformNegativeThoughts(parameters);\n\nConsole.WriteLine(response);',
|
|
2995
|
+
},
|
|
2562
2996
|
go: {
|
|
2563
2997
|
method: 'client.Reframe.TransformNegativeThoughts',
|
|
2564
2998
|
example:
|
|
@@ -2578,6 +3012,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2578
3012
|
example:
|
|
2579
3013
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.reframe.ReframeTransformNegativeThoughtsParams\nimport com.believe.api.models.reframe.ReframeTransformNegativeThoughtsResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: ReframeTransformNegativeThoughtsParams = ReframeTransformNegativeThoughtsParams.builder()\n .negativeThought("I\'m not good enough for this job.")\n .build()\n val response: ReframeTransformNegativeThoughtsResponse = client.reframe().transformNegativeThoughts(params)\n}',
|
|
2580
3014
|
},
|
|
3015
|
+
php: {
|
|
3016
|
+
method: 'reframe->transformNegativeThoughts',
|
|
3017
|
+
example:
|
|
3018
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->reframe->transformNegativeThoughts(\n negativeThought: 'I\\'m not good enough for this job.', recurring: true\n);\n\nvar_dump($response);",
|
|
3019
|
+
},
|
|
2581
3020
|
python: {
|
|
2582
3021
|
method: 'reframe.transform_negative_thoughts',
|
|
2583
3022
|
example:
|
|
@@ -2614,6 +3053,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2614
3053
|
example:
|
|
2615
3054
|
"believe press simulate \\\n --api-key 'My API Key' \\\n --question 'Ted, your team just lost 5-0. How do you explain this embarrassing defeat?'",
|
|
2616
3055
|
},
|
|
3056
|
+
csharp: {
|
|
3057
|
+
method: 'Press.Simulate',
|
|
3058
|
+
example:
|
|
3059
|
+
'PressSimulateParams parameters = new()\n{\n Question = "Ted, your team just lost 5-0. How do you explain this embarrassing defeat?",\n};\n\nvar response = await client.Press.Simulate(parameters);\n\nConsole.WriteLine(response);',
|
|
3060
|
+
},
|
|
2617
3061
|
go: {
|
|
2618
3062
|
method: 'client.Press.Simulate',
|
|
2619
3063
|
example:
|
|
@@ -2633,6 +3077,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2633
3077
|
example:
|
|
2634
3078
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.press.PressSimulateParams\nimport com.believe.api.models.press.PressSimulateResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: PressSimulateParams = PressSimulateParams.builder()\n .question("Ted, your team just lost 5-0. How do you explain this embarrassing defeat?")\n .build()\n val response: PressSimulateResponse = client.press().simulate(params)\n}',
|
|
2635
3079
|
},
|
|
3080
|
+
php: {
|
|
3081
|
+
method: 'press->simulate',
|
|
3082
|
+
example:
|
|
3083
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->press->simulate(\n question: 'Ted, your team just lost 5-0. How do you explain this embarrassing defeat?',\n hostile: true,\n topic: 'match_result',\n);\n\nvar_dump($response);",
|
|
3084
|
+
},
|
|
2636
3085
|
python: {
|
|
2637
3086
|
method: 'press.simulate',
|
|
2638
3087
|
example:
|
|
@@ -2668,6 +3117,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2668
3117
|
method: 'principles list',
|
|
2669
3118
|
example: "believe coaching:principles list \\\n --api-key 'My API Key'",
|
|
2670
3119
|
},
|
|
3120
|
+
csharp: {
|
|
3121
|
+
method: 'Coaching.Principles.List',
|
|
3122
|
+
example:
|
|
3123
|
+
'PrincipleListParams parameters = new();\n\nvar page = await client.Coaching.Principles.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3124
|
+
},
|
|
2671
3125
|
go: {
|
|
2672
3126
|
method: 'client.Coaching.Principles.List',
|
|
2673
3127
|
example:
|
|
@@ -2687,6 +3141,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2687
3141
|
example:
|
|
2688
3142
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.coaching.principles.PrincipleListPage\nimport com.believe.api.models.coaching.principles.PrincipleListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: PrincipleListPage = client.coaching().principles().list()\n}',
|
|
2689
3143
|
},
|
|
3144
|
+
php: {
|
|
3145
|
+
method: 'coaching->principles->list',
|
|
3146
|
+
example:
|
|
3147
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->coaching->principles->list(limit: 10, skip: 0);\n\nvar_dump($page);",
|
|
3148
|
+
},
|
|
2690
3149
|
python: {
|
|
2691
3150
|
method: 'coaching.principles.list',
|
|
2692
3151
|
example:
|
|
@@ -2723,6 +3182,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2723
3182
|
example:
|
|
2724
3183
|
"believe coaching:principles retrieve \\\n --api-key 'My API Key' \\\n --principle-id principle_id",
|
|
2725
3184
|
},
|
|
3185
|
+
csharp: {
|
|
3186
|
+
method: 'Coaching.Principles.Retrieve',
|
|
3187
|
+
example:
|
|
3188
|
+
'PrincipleRetrieveParams parameters = new() { PrincipleID = "principle_id" };\n\nvar coachingPrinciple = await client.Coaching.Principles.Retrieve(parameters);\n\nConsole.WriteLine(coachingPrinciple);',
|
|
3189
|
+
},
|
|
2726
3190
|
go: {
|
|
2727
3191
|
method: 'client.Coaching.Principles.Get',
|
|
2728
3192
|
example:
|
|
@@ -2742,6 +3206,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2742
3206
|
example:
|
|
2743
3207
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.coaching.principles.CoachingPrinciple\nimport com.believe.api.models.coaching.principles.PrincipleRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val coachingPrinciple: CoachingPrinciple = client.coaching().principles().retrieve("principle_id")\n}',
|
|
2744
3208
|
},
|
|
3209
|
+
php: {
|
|
3210
|
+
method: 'coaching->principles->retrieve',
|
|
3211
|
+
example:
|
|
3212
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$coachingPrinciple = $client->coaching->principles->retrieve('principle_id');\n\nvar_dump($coachingPrinciple);",
|
|
3213
|
+
},
|
|
2745
3214
|
python: {
|
|
2746
3215
|
method: 'coaching.principles.retrieve',
|
|
2747
3216
|
example:
|
|
@@ -2776,6 +3245,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2776
3245
|
method: 'principles get_random',
|
|
2777
3246
|
example: "believe coaching:principles get-random \\\n --api-key 'My API Key'",
|
|
2778
3247
|
},
|
|
3248
|
+
csharp: {
|
|
3249
|
+
method: 'Coaching.Principles.GetRandom',
|
|
3250
|
+
example:
|
|
3251
|
+
'PrincipleGetRandomParams parameters = new();\n\nvar coachingPrinciple = await client.Coaching.Principles.GetRandom(parameters);\n\nConsole.WriteLine(coachingPrinciple);',
|
|
3252
|
+
},
|
|
2779
3253
|
go: {
|
|
2780
3254
|
method: 'client.Coaching.Principles.GetRandom',
|
|
2781
3255
|
example:
|
|
@@ -2795,6 +3269,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2795
3269
|
example:
|
|
2796
3270
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.coaching.principles.CoachingPrinciple\nimport com.believe.api.models.coaching.principles.PrincipleGetRandomParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val coachingPrinciple: CoachingPrinciple = client.coaching().principles().getRandom()\n}',
|
|
2797
3271
|
},
|
|
3272
|
+
php: {
|
|
3273
|
+
method: 'coaching->principles->getRandom',
|
|
3274
|
+
example:
|
|
3275
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$coachingPrinciple = $client->coaching->principles->getRandom();\n\nvar_dump($coachingPrinciple);",
|
|
3276
|
+
},
|
|
2798
3277
|
python: {
|
|
2799
3278
|
method: 'coaching.principles.get_random',
|
|
2800
3279
|
example:
|
|
@@ -2831,6 +3310,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2831
3310
|
method: 'biscuits list',
|
|
2832
3311
|
example: "believe biscuits list \\\n --api-key 'My API Key'",
|
|
2833
3312
|
},
|
|
3313
|
+
csharp: {
|
|
3314
|
+
method: 'Biscuits.List',
|
|
3315
|
+
example:
|
|
3316
|
+
'BiscuitListParams parameters = new();\n\nvar page = await client.Biscuits.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3317
|
+
},
|
|
2834
3318
|
go: {
|
|
2835
3319
|
method: 'client.Biscuits.List',
|
|
2836
3320
|
example:
|
|
@@ -2849,6 +3333,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2849
3333
|
example:
|
|
2850
3334
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.biscuits.BiscuitListPage\nimport com.believe.api.models.biscuits.BiscuitListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: BiscuitListPage = client.biscuits().list()\n}',
|
|
2851
3335
|
},
|
|
3336
|
+
php: {
|
|
3337
|
+
method: 'biscuits->list',
|
|
3338
|
+
example:
|
|
3339
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->biscuits->list(limit: 10, skip: 0);\n\nvar_dump($page);",
|
|
3340
|
+
},
|
|
2852
3341
|
python: {
|
|
2853
3342
|
method: 'biscuits.list',
|
|
2854
3343
|
example:
|
|
@@ -2883,6 +3372,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2883
3372
|
method: 'biscuits get_fresh',
|
|
2884
3373
|
example: "believe biscuits get-fresh \\\n --api-key 'My API Key'",
|
|
2885
3374
|
},
|
|
3375
|
+
csharp: {
|
|
3376
|
+
method: 'Biscuits.GetFresh',
|
|
3377
|
+
example:
|
|
3378
|
+
'BiscuitGetFreshParams parameters = new();\n\nvar biscuit = await client.Biscuits.GetFresh(parameters);\n\nConsole.WriteLine(biscuit);',
|
|
3379
|
+
},
|
|
2886
3380
|
go: {
|
|
2887
3381
|
method: 'client.Biscuits.GetFresh',
|
|
2888
3382
|
example:
|
|
@@ -2902,6 +3396,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2902
3396
|
example:
|
|
2903
3397
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.biscuits.Biscuit\nimport com.believe.api.models.biscuits.BiscuitGetFreshParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val biscuit: Biscuit = client.biscuits().getFresh()\n}',
|
|
2904
3398
|
},
|
|
3399
|
+
php: {
|
|
3400
|
+
method: 'biscuits->getFresh',
|
|
3401
|
+
example:
|
|
3402
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$biscuit = $client->biscuits->getFresh();\n\nvar_dump($biscuit);",
|
|
3403
|
+
},
|
|
2905
3404
|
python: {
|
|
2906
3405
|
method: 'biscuits.get_fresh',
|
|
2907
3406
|
example:
|
|
@@ -2937,6 +3436,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2937
3436
|
method: 'biscuits retrieve',
|
|
2938
3437
|
example: "believe biscuits retrieve \\\n --api-key 'My API Key' \\\n --biscuit-id biscuit_id",
|
|
2939
3438
|
},
|
|
3439
|
+
csharp: {
|
|
3440
|
+
method: 'Biscuits.Retrieve',
|
|
3441
|
+
example:
|
|
3442
|
+
'BiscuitRetrieveParams parameters = new() { BiscuitID = "biscuit_id" };\n\nvar biscuit = await client.Biscuits.Retrieve(parameters);\n\nConsole.WriteLine(biscuit);',
|
|
3443
|
+
},
|
|
2940
3444
|
go: {
|
|
2941
3445
|
method: 'client.Biscuits.Get',
|
|
2942
3446
|
example:
|
|
@@ -2956,6 +3460,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2956
3460
|
example:
|
|
2957
3461
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.biscuits.Biscuit\nimport com.believe.api.models.biscuits.BiscuitRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val biscuit: Biscuit = client.biscuits().retrieve("biscuit_id")\n}',
|
|
2958
3462
|
},
|
|
3463
|
+
php: {
|
|
3464
|
+
method: 'biscuits->retrieve',
|
|
3465
|
+
example:
|
|
3466
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$biscuit = $client->biscuits->retrieve('biscuit_id');\n\nvar_dump($biscuit);",
|
|
3467
|
+
},
|
|
2959
3468
|
python: {
|
|
2960
3469
|
method: 'biscuits.retrieve',
|
|
2961
3470
|
example:
|
|
@@ -2992,6 +3501,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2992
3501
|
method: 'pep_talk retrieve',
|
|
2993
3502
|
example: "believe pep-talk retrieve \\\n --api-key 'My API Key'",
|
|
2994
3503
|
},
|
|
3504
|
+
csharp: {
|
|
3505
|
+
method: 'PepTalk.Retrieve',
|
|
3506
|
+
example:
|
|
3507
|
+
'PepTalkRetrieveParams parameters = new();\n\nvar pepTalk = await client.PepTalk.Retrieve(parameters);\n\nConsole.WriteLine(pepTalk);',
|
|
3508
|
+
},
|
|
2995
3509
|
go: {
|
|
2996
3510
|
method: 'client.PepTalk.Get',
|
|
2997
3511
|
example:
|
|
@@ -3010,6 +3524,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3010
3524
|
example:
|
|
3011
3525
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.peptalk.PepTalkRetrieveParams\nimport com.believe.api.models.peptalk.PepTalkRetrieveResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val pepTalk: PepTalkRetrieveResponse = client.pepTalk().retrieve()\n}',
|
|
3012
3526
|
},
|
|
3527
|
+
php: {
|
|
3528
|
+
method: 'pepTalk->retrieve',
|
|
3529
|
+
example:
|
|
3530
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$pepTalk = $client->pepTalk->retrieve(stream: true);\n\nvar_dump($pepTalk);",
|
|
3531
|
+
},
|
|
3013
3532
|
python: {
|
|
3014
3533
|
method: 'pep_talk.retrieve',
|
|
3015
3534
|
example:
|
|
@@ -3043,6 +3562,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3043
3562
|
method: 'stream test_connection',
|
|
3044
3563
|
example: "believe stream test-connection \\\n --api-key 'My API Key'",
|
|
3045
3564
|
},
|
|
3565
|
+
csharp: {
|
|
3566
|
+
method: 'Stream.TestConnection',
|
|
3567
|
+
example:
|
|
3568
|
+
'StreamTestConnectionParams parameters = new();\n\nvar response = await client.Stream.TestConnection(parameters);\n\nConsole.WriteLine(response);',
|
|
3569
|
+
},
|
|
3046
3570
|
go: {
|
|
3047
3571
|
method: 'client.Stream.TestConnection',
|
|
3048
3572
|
example:
|
|
@@ -3062,6 +3586,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3062
3586
|
example:
|
|
3063
3587
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.stream.StreamTestConnectionParams\nimport com.believe.api.models.stream.StreamTestConnectionResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: StreamTestConnectionResponse = client.stream().testConnection()\n}',
|
|
3064
3588
|
},
|
|
3589
|
+
php: {
|
|
3590
|
+
method: 'stream->testConnection',
|
|
3591
|
+
example:
|
|
3592
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->stream->testConnection();\n\nvar_dump($response);",
|
|
3593
|
+
},
|
|
3065
3594
|
python: {
|
|
3066
3595
|
method: 'stream.test_connection',
|
|
3067
3596
|
example:
|
|
@@ -3103,6 +3632,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3103
3632
|
method: 'team_members list',
|
|
3104
3633
|
example: "believe team-members list \\\n --api-key 'My API Key'",
|
|
3105
3634
|
},
|
|
3635
|
+
csharp: {
|
|
3636
|
+
method: 'TeamMembers.List',
|
|
3637
|
+
example:
|
|
3638
|
+
'TeamMemberListParams parameters = new();\n\nvar page = await client.TeamMembers.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3639
|
+
},
|
|
3106
3640
|
go: {
|
|
3107
3641
|
method: 'client.TeamMembers.List',
|
|
3108
3642
|
example:
|
|
@@ -3122,6 +3656,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3122
3656
|
example:
|
|
3123
3657
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberListPage\nimport com.believe.api.models.teammembers.TeamMemberListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TeamMemberListPage = client.teamMembers().list()\n}',
|
|
3124
3658
|
},
|
|
3659
|
+
php: {
|
|
3660
|
+
method: 'teamMembers->list',
|
|
3661
|
+
example:
|
|
3662
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->teamMembers->list(\n limit: 10, memberType: 'player', skip: 0, teamID: 'team_id'\n);\n\nvar_dump($page);",
|
|
3663
|
+
},
|
|
3125
3664
|
python: {
|
|
3126
3665
|
method: 'team_members.list',
|
|
3127
3666
|
example:
|
|
@@ -3161,6 +3700,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3161
3700
|
example:
|
|
3162
3701
|
"believe team-members create \\\n --api-key 'My API Key' \\\n --member '{character_id: jamie-tartt, jersey_number: 9, position: forward, team_id: afc-richmond, years_with_team: 3, member_type: player}'",
|
|
3163
3702
|
},
|
|
3703
|
+
csharp: {
|
|
3704
|
+
method: 'TeamMembers.Create',
|
|
3705
|
+
example:
|
|
3706
|
+
'TeamMemberCreateParams parameters = new()\n{\n Member = new Player()\n {\n CharacterID = "jamie-tartt",\n JerseyNumber = 9,\n Position = Position.Forward,\n TeamID = "afc-richmond",\n YearsWithTeam = 3,\n Assists = 23,\n GoalsScored = 47,\n IsCaptain = false,\n MemberType = MemberType.Player,\n },\n};\n\nvar teamMember = await client.TeamMembers.Create(parameters);\n\nConsole.WriteLine(teamMember);',
|
|
3707
|
+
},
|
|
3164
3708
|
go: {
|
|
3165
3709
|
method: 'client.TeamMembers.New',
|
|
3166
3710
|
example:
|
|
@@ -3180,6 +3724,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3180
3724
|
example:
|
|
3181
3725
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.Position\nimport com.believe.api.models.teammembers.TeamMemberCreateParams\nimport com.believe.api.models.teammembers.TeamMemberCreateResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: TeamMemberCreateParams.Member.Player = TeamMemberCreateParams.Member.Player.builder()\n .characterId("jamie-tartt")\n .jerseyNumber(9L)\n .position(Position.FORWARD)\n .teamId("afc-richmond")\n .yearsWithTeam(3L)\n .memberType(TeamMemberCreateParams.Member.Player.MemberType.PLAYER)\n .build()\n val teamMember: TeamMemberCreateResponse = client.teamMembers().create(params)\n}',
|
|
3182
3726
|
},
|
|
3727
|
+
php: {
|
|
3728
|
+
method: 'teamMembers->create',
|
|
3729
|
+
example:
|
|
3730
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$teamMember = $client->teamMembers->create(\n member: [\n 'characterID' => 'jamie-tartt',\n 'jerseyNumber' => 9,\n 'position' => Position::FORWARD,\n 'teamID' => 'afc-richmond',\n 'yearsWithTeam' => 3,\n 'assists' => 23,\n 'goalsScored' => 47,\n 'isCaptain' => false,\n 'memberType' => 'player',\n ],\n);\n\nvar_dump($teamMember);",
|
|
3731
|
+
},
|
|
3183
3732
|
python: {
|
|
3184
3733
|
method: 'team_members.create',
|
|
3185
3734
|
example:
|
|
@@ -3216,6 +3765,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3216
3765
|
method: 'team_members retrieve',
|
|
3217
3766
|
example: "believe team-members retrieve \\\n --api-key 'My API Key' \\\n --member-id member_id",
|
|
3218
3767
|
},
|
|
3768
|
+
csharp: {
|
|
3769
|
+
method: 'TeamMembers.Retrieve',
|
|
3770
|
+
example:
|
|
3771
|
+
'TeamMemberRetrieveParams parameters = new() { MemberID = "member_id" };\n\nvar teamMember = await client.TeamMembers.Retrieve(parameters);\n\nConsole.WriteLine(teamMember);',
|
|
3772
|
+
},
|
|
3219
3773
|
go: {
|
|
3220
3774
|
method: 'client.TeamMembers.Get',
|
|
3221
3775
|
example:
|
|
@@ -3235,6 +3789,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3235
3789
|
example:
|
|
3236
3790
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberRetrieveParams\nimport com.believe.api.models.teammembers.TeamMemberRetrieveResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val teamMember: TeamMemberRetrieveResponse = client.teamMembers().retrieve("member_id")\n}',
|
|
3237
3791
|
},
|
|
3792
|
+
php: {
|
|
3793
|
+
method: 'teamMembers->retrieve',
|
|
3794
|
+
example:
|
|
3795
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$teamMember = $client->teamMembers->retrieve('member_id');\n\nvar_dump($teamMember);",
|
|
3796
|
+
},
|
|
3238
3797
|
python: {
|
|
3239
3798
|
method: 'team_members.retrieve',
|
|
3240
3799
|
example:
|
|
@@ -3274,6 +3833,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3274
3833
|
example:
|
|
3275
3834
|
"believe team-members update \\\n --api-key 'My API Key' \\\n --member-id member_id \\\n --updates '{}'",
|
|
3276
3835
|
},
|
|
3836
|
+
csharp: {
|
|
3837
|
+
method: 'TeamMembers.Update',
|
|
3838
|
+
example:
|
|
3839
|
+
'TeamMemberUpdateParams parameters = new()\n{\n MemberID = "member_id",\n Updates = new PlayerUpdate()\n {\n Assists = 0,\n GoalsScored = 0,\n IsCaptain = true,\n JerseyNumber = 1,\n Position = Position.Goalkeeper,\n TeamID = "team_id",\n YearsWithTeam = 0,\n },\n};\n\nvar teamMember = await client.TeamMembers.Update(parameters);\n\nConsole.WriteLine(teamMember);',
|
|
3840
|
+
},
|
|
3277
3841
|
go: {
|
|
3278
3842
|
method: 'client.TeamMembers.Update',
|
|
3279
3843
|
example:
|
|
@@ -3293,6 +3857,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3293
3857
|
example:
|
|
3294
3858
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberUpdateParams\nimport com.believe.api.models.teammembers.TeamMemberUpdateResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: TeamMemberUpdateParams = TeamMemberUpdateParams.builder()\n .memberId("member_id")\n .updates(TeamMemberUpdateParams.Updates.PlayerUpdate.builder().build())\n .build()\n val teamMember: TeamMemberUpdateResponse = client.teamMembers().update(params)\n}',
|
|
3295
3859
|
},
|
|
3860
|
+
php: {
|
|
3861
|
+
method: 'teamMembers->update',
|
|
3862
|
+
example:
|
|
3863
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$teamMember = $client->teamMembers->update(\n 'member_id',\n updates: [\n 'assists' => 0,\n 'goalsScored' => 0,\n 'isCaptain' => true,\n 'jerseyNumber' => 1,\n 'position' => Position::GOALKEEPER,\n 'teamID' => 'team_id',\n 'yearsWithTeam' => 0,\n ],\n);\n\nvar_dump($teamMember);",
|
|
3864
|
+
},
|
|
3296
3865
|
python: {
|
|
3297
3866
|
method: 'team_members.update',
|
|
3298
3867
|
example:
|
|
@@ -3326,6 +3895,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3326
3895
|
method: 'team_members delete',
|
|
3327
3896
|
example: "believe team-members delete \\\n --api-key 'My API Key' \\\n --member-id member_id",
|
|
3328
3897
|
},
|
|
3898
|
+
csharp: {
|
|
3899
|
+
method: 'TeamMembers.Delete',
|
|
3900
|
+
example:
|
|
3901
|
+
'TeamMemberDeleteParams parameters = new() { MemberID = "member_id" };\n\nawait client.TeamMembers.Delete(parameters);',
|
|
3902
|
+
},
|
|
3329
3903
|
go: {
|
|
3330
3904
|
method: 'client.TeamMembers.Delete',
|
|
3331
3905
|
example:
|
|
@@ -3345,6 +3919,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3345
3919
|
example:
|
|
3346
3920
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.teamMembers().delete("member_id")\n}',
|
|
3347
3921
|
},
|
|
3922
|
+
php: {
|
|
3923
|
+
method: 'teamMembers->delete',
|
|
3924
|
+
example:
|
|
3925
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->teamMembers->delete('member_id');\n\nvar_dump($result);",
|
|
3926
|
+
},
|
|
3348
3927
|
python: {
|
|
3349
3928
|
method: 'team_members.delete',
|
|
3350
3929
|
example:
|
|
@@ -3385,6 +3964,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3385
3964
|
method: 'team_members list_players',
|
|
3386
3965
|
example: "believe team-members list-players \\\n --api-key 'My API Key'",
|
|
3387
3966
|
},
|
|
3967
|
+
csharp: {
|
|
3968
|
+
method: 'TeamMembers.ListPlayers',
|
|
3969
|
+
example:
|
|
3970
|
+
'TeamMemberListPlayersParams parameters = new();\n\nvar page = await client.TeamMembers.ListPlayers(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3971
|
+
},
|
|
3388
3972
|
go: {
|
|
3389
3973
|
method: 'client.TeamMembers.ListPlayers',
|
|
3390
3974
|
example:
|
|
@@ -3404,6 +3988,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3404
3988
|
example:
|
|
3405
3989
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberListPlayersPage\nimport com.believe.api.models.teammembers.TeamMemberListPlayersParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TeamMemberListPlayersPage = client.teamMembers().listPlayers()\n}',
|
|
3406
3990
|
},
|
|
3991
|
+
php: {
|
|
3992
|
+
method: 'teamMembers->listPlayers',
|
|
3993
|
+
example:
|
|
3994
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->teamMembers->listPlayers(\n limit: 10, position: Position::GOALKEEPER, skip: 0, teamID: 'team_id'\n);\n\nvar_dump($page);",
|
|
3995
|
+
},
|
|
3407
3996
|
python: {
|
|
3408
3997
|
method: 'team_members.list_players',
|
|
3409
3998
|
example:
|
|
@@ -3444,6 +4033,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3444
4033
|
method: 'team_members list_coaches',
|
|
3445
4034
|
example: "believe team-members list-coaches \\\n --api-key 'My API Key'",
|
|
3446
4035
|
},
|
|
4036
|
+
csharp: {
|
|
4037
|
+
method: 'TeamMembers.ListCoaches',
|
|
4038
|
+
example:
|
|
4039
|
+
'TeamMemberListCoachesParams parameters = new();\n\nvar page = await client.TeamMembers.ListCoaches(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4040
|
+
},
|
|
3447
4041
|
go: {
|
|
3448
4042
|
method: 'client.TeamMembers.ListCoaches',
|
|
3449
4043
|
example:
|
|
@@ -3463,6 +4057,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3463
4057
|
example:
|
|
3464
4058
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberListCoachesPage\nimport com.believe.api.models.teammembers.TeamMemberListCoachesParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TeamMemberListCoachesPage = client.teamMembers().listCoaches()\n}',
|
|
3465
4059
|
},
|
|
4060
|
+
php: {
|
|
4061
|
+
method: 'teamMembers->listCoaches',
|
|
4062
|
+
example:
|
|
4063
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->teamMembers->listCoaches(\n limit: 10, skip: 0, specialty: CoachSpecialty::HEAD_COACH, teamID: 'team_id'\n);\n\nvar_dump($page);",
|
|
4064
|
+
},
|
|
3466
4065
|
python: {
|
|
3467
4066
|
method: 'team_members.list_coaches',
|
|
3468
4067
|
example:
|
|
@@ -3499,6 +4098,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3499
4098
|
method: 'team_members list_staff',
|
|
3500
4099
|
example: "believe team-members list-staff \\\n --api-key 'My API Key'",
|
|
3501
4100
|
},
|
|
4101
|
+
csharp: {
|
|
4102
|
+
method: 'TeamMembers.ListStaff',
|
|
4103
|
+
example:
|
|
4104
|
+
'TeamMemberListStaffParams parameters = new();\n\nvar page = await client.TeamMembers.ListStaff(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4105
|
+
},
|
|
3502
4106
|
go: {
|
|
3503
4107
|
method: 'client.TeamMembers.ListStaff',
|
|
3504
4108
|
example:
|
|
@@ -3518,6 +4122,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3518
4122
|
example:
|
|
3519
4123
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.teammembers.TeamMemberListStaffPage\nimport com.believe.api.models.teammembers.TeamMemberListStaffParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TeamMemberListStaffPage = client.teamMembers().listStaff()\n}',
|
|
3520
4124
|
},
|
|
4125
|
+
php: {
|
|
4126
|
+
method: 'teamMembers->listStaff',
|
|
4127
|
+
example:
|
|
4128
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->teamMembers->listStaff(limit: 10, skip: 0, teamID: 'team_id');\n\nvar_dump($page);",
|
|
4129
|
+
},
|
|
3521
4130
|
python: {
|
|
3522
4131
|
method: 'team_members.list_staff',
|
|
3523
4132
|
example:
|
|
@@ -3552,6 +4161,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3552
4161
|
method: 'webhooks list',
|
|
3553
4162
|
example: "believe webhooks list \\\n --api-key 'My API Key'",
|
|
3554
4163
|
},
|
|
4164
|
+
csharp: {
|
|
4165
|
+
method: 'Webhooks.List',
|
|
4166
|
+
example:
|
|
4167
|
+
'WebhookListParams parameters = new();\n\nvar registeredWebhooks = await client.Webhooks.List(parameters);\n\nConsole.WriteLine(registeredWebhooks);',
|
|
4168
|
+
},
|
|
3555
4169
|
go: {
|
|
3556
4170
|
method: 'client.Webhooks.List',
|
|
3557
4171
|
example:
|
|
@@ -3570,6 +4184,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3570
4184
|
example:
|
|
3571
4185
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.RegisteredWebhook\nimport com.believe.api.models.webhooks.WebhookListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val registeredWebhooks: List<RegisteredWebhook> = client.webhooks().list()\n}',
|
|
3572
4186
|
},
|
|
4187
|
+
php: {
|
|
4188
|
+
method: 'webhooks->list',
|
|
4189
|
+
example:
|
|
4190
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$registeredWebhooks = $client->webhooks->list();\n\nvar_dump($registeredWebhooks);",
|
|
4191
|
+
},
|
|
3573
4192
|
python: {
|
|
3574
4193
|
method: 'webhooks.list',
|
|
3575
4194
|
example:
|
|
@@ -3611,6 +4230,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3611
4230
|
example:
|
|
3612
4231
|
"believe webhooks create \\\n --api-key 'My API Key' \\\n --url https://example.com/webhooks",
|
|
3613
4232
|
},
|
|
4233
|
+
csharp: {
|
|
4234
|
+
method: 'Webhooks.Create',
|
|
4235
|
+
example:
|
|
4236
|
+
'WebhookCreateParams parameters = new() { Url = "https://example.com/webhooks" };\n\nvar webhook = await client.Webhooks.Create(parameters);\n\nConsole.WriteLine(webhook);',
|
|
4237
|
+
},
|
|
3614
4238
|
go: {
|
|
3615
4239
|
method: 'client.Webhooks.New',
|
|
3616
4240
|
example:
|
|
@@ -3630,6 +4254,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3630
4254
|
example:
|
|
3631
4255
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.WebhookCreateParams\nimport com.believe.api.models.webhooks.WebhookCreateResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: WebhookCreateParams = WebhookCreateParams.builder()\n .url("https://example.com/webhooks")\n .build()\n val webhook: WebhookCreateResponse = client.webhooks().create(params)\n}',
|
|
3632
4256
|
},
|
|
4257
|
+
php: {
|
|
4258
|
+
method: 'webhooks->create',
|
|
4259
|
+
example:
|
|
4260
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$webhook = $client->webhooks->create(\n url: 'https://example.com/webhooks',\n description: 'Production webhook for match notifications',\n eventTypes: ['match.completed', 'team_member.transferred'],\n);\n\nvar_dump($webhook);",
|
|
4261
|
+
},
|
|
3633
4262
|
python: {
|
|
3634
4263
|
method: 'webhooks.create',
|
|
3635
4264
|
example:
|
|
@@ -3665,6 +4294,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3665
4294
|
method: 'webhooks retrieve',
|
|
3666
4295
|
example: "believe webhooks retrieve \\\n --api-key 'My API Key' \\\n --webhook-id webhook_id",
|
|
3667
4296
|
},
|
|
4297
|
+
csharp: {
|
|
4298
|
+
method: 'Webhooks.Retrieve',
|
|
4299
|
+
example:
|
|
4300
|
+
'WebhookRetrieveParams parameters = new() { WebhookID = "webhook_id" };\n\nvar registeredWebhook = await client.Webhooks.Retrieve(parameters);\n\nConsole.WriteLine(registeredWebhook);',
|
|
4301
|
+
},
|
|
3668
4302
|
go: {
|
|
3669
4303
|
method: 'client.Webhooks.Get',
|
|
3670
4304
|
example:
|
|
@@ -3684,6 +4318,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3684
4318
|
example:
|
|
3685
4319
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.RegisteredWebhook\nimport com.believe.api.models.webhooks.WebhookRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val registeredWebhook: RegisteredWebhook = client.webhooks().retrieve("webhook_id")\n}',
|
|
3686
4320
|
},
|
|
4321
|
+
php: {
|
|
4322
|
+
method: 'webhooks->retrieve',
|
|
4323
|
+
example:
|
|
4324
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$registeredWebhook = $client->webhooks->retrieve('webhook_id');\n\nvar_dump($registeredWebhook);",
|
|
4325
|
+
},
|
|
3687
4326
|
python: {
|
|
3688
4327
|
method: 'webhooks.retrieve',
|
|
3689
4328
|
example:
|
|
@@ -3718,6 +4357,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3718
4357
|
method: 'webhooks delete',
|
|
3719
4358
|
example: "believe webhooks delete \\\n --api-key 'My API Key' \\\n --webhook-id webhook_id",
|
|
3720
4359
|
},
|
|
4360
|
+
csharp: {
|
|
4361
|
+
method: 'Webhooks.Delete',
|
|
4362
|
+
example:
|
|
4363
|
+
'WebhookDeleteParams parameters = new() { WebhookID = "webhook_id" };\n\nvar webhook = await client.Webhooks.Delete(parameters);\n\nConsole.WriteLine(webhook);',
|
|
4364
|
+
},
|
|
3721
4365
|
go: {
|
|
3722
4366
|
method: 'client.Webhooks.Delete',
|
|
3723
4367
|
example:
|
|
@@ -3737,6 +4381,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3737
4381
|
example:
|
|
3738
4382
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.WebhookDeleteParams\nimport com.believe.api.models.webhooks.WebhookDeleteResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val webhook: WebhookDeleteResponse = client.webhooks().delete("webhook_id")\n}',
|
|
3739
4383
|
},
|
|
4384
|
+
php: {
|
|
4385
|
+
method: 'webhooks->delete',
|
|
4386
|
+
example:
|
|
4387
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$webhook = $client->webhooks->delete('webhook_id');\n\nvar_dump($webhook);",
|
|
4388
|
+
},
|
|
3740
4389
|
python: {
|
|
3741
4390
|
method: 'webhooks.delete',
|
|
3742
4391
|
example:
|
|
@@ -3777,6 +4426,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3777
4426
|
example:
|
|
3778
4427
|
"believe webhooks trigger-event \\\n --api-key 'My API Key' \\\n --event-type match.completed",
|
|
3779
4428
|
},
|
|
4429
|
+
csharp: {
|
|
4430
|
+
method: 'Webhooks.TriggerEvent',
|
|
4431
|
+
example:
|
|
4432
|
+
'WebhookTriggerEventParams parameters = new()\n{\n EventType = EventType.MatchCompleted\n};\n\nvar response = await client.Webhooks.TriggerEvent(parameters);\n\nConsole.WriteLine(response);',
|
|
4433
|
+
},
|
|
3780
4434
|
go: {
|
|
3781
4435
|
method: 'client.Webhooks.TriggerEvent',
|
|
3782
4436
|
example:
|
|
@@ -3796,6 +4450,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3796
4450
|
example:
|
|
3797
4451
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.WebhookTriggerEventParams\nimport com.believe.api.models.webhooks.WebhookTriggerEventResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: WebhookTriggerEventParams = WebhookTriggerEventParams.builder()\n .eventType(WebhookTriggerEventParams.EventType.MATCH_COMPLETED)\n .build()\n val response: WebhookTriggerEventResponse = client.webhooks().triggerEvent(params)\n}',
|
|
3798
4452
|
},
|
|
4453
|
+
php: {
|
|
4454
|
+
method: 'webhooks->triggerEvent',
|
|
4455
|
+
example:
|
|
4456
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->webhooks->triggerEvent(\n eventType: 'match.completed',\n payload: [\n 'data' => [\n 'awayScore' => 0,\n 'awayTeamID' => 'away_team_id',\n 'completedAt' => new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n 'homeScore' => 0,\n 'homeTeamID' => 'home_team_id',\n 'matchID' => 'match_id',\n 'matchType' => 'league',\n 'result' => 'home_win',\n 'tedPostMatchQuote' => 'ted_post_match_quote',\n 'lessonLearned' => 'lesson_learned',\n 'manOfTheMatch' => 'man_of_the_match',\n ],\n 'eventType' => 'match.completed',\n ],\n);\n\nvar_dump($response);",
|
|
4457
|
+
},
|
|
3799
4458
|
python: {
|
|
3800
4459
|
method: 'webhooks.trigger_event',
|
|
3801
4460
|
example:
|
|
@@ -3825,6 +4484,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3825
4484
|
cli: {
|
|
3826
4485
|
example: "believe webhooks unwrap \\\n --api-key 'My API Key'",
|
|
3827
4486
|
},
|
|
4487
|
+
csharp: {
|
|
4488
|
+
example: 'WebhookUnwrapParams parameters = new();\n\nawait client.Webhooks.Unwrap(parameters);',
|
|
4489
|
+
},
|
|
3828
4490
|
go: {
|
|
3829
4491
|
method: 'client.Webhooks.Unwrap',
|
|
3830
4492
|
example:
|
|
@@ -3838,6 +4500,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3838
4500
|
example:
|
|
3839
4501
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.webhooks.WebhookUnwrapParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.webhooks().unwrap()\n}',
|
|
3840
4502
|
},
|
|
4503
|
+
php: {
|
|
4504
|
+
method: 'webhooks->unwrap',
|
|
4505
|
+
example:
|
|
4506
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->webhooks->unwrap();\n\nvar_dump($result);",
|
|
4507
|
+
},
|
|
3841
4508
|
python: {
|
|
3842
4509
|
method: 'webhooks.unwrap',
|
|
3843
4510
|
example:
|
|
@@ -3881,6 +4548,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3881
4548
|
method: 'ticket_sales list',
|
|
3882
4549
|
example: "believe ticket-sales list \\\n --api-key 'My API Key'",
|
|
3883
4550
|
},
|
|
4551
|
+
csharp: {
|
|
4552
|
+
method: 'TicketSales.List',
|
|
4553
|
+
example:
|
|
4554
|
+
'TicketSaleListParams parameters = new();\n\nvar page = await client.TicketSales.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4555
|
+
},
|
|
3884
4556
|
go: {
|
|
3885
4557
|
method: 'client.TicketSales.List',
|
|
3886
4558
|
example:
|
|
@@ -3900,6 +4572,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3900
4572
|
example:
|
|
3901
4573
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ticketsales.TicketSaleListPage\nimport com.believe.api.models.ticketsales.TicketSaleListParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val page: TicketSaleListPage = client.ticketSales().list()\n}',
|
|
3902
4574
|
},
|
|
4575
|
+
php: {
|
|
4576
|
+
method: 'ticketSales->list',
|
|
4577
|
+
example:
|
|
4578
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$page = $client->ticketSales->list(\n couponCode: 'coupon_code',\n currency: 'currency',\n limit: 10,\n matchID: 'match_id',\n purchaseMethod: PurchaseMethod::ONLINE,\n skip: 0,\n);\n\nvar_dump($page);",
|
|
4579
|
+
},
|
|
3903
4580
|
python: {
|
|
3904
4581
|
method: 'ticket_sales.list',
|
|
3905
4582
|
example:
|
|
@@ -3949,6 +4626,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3949
4626
|
example:
|
|
3950
4627
|
"believe ticket-sales create \\\n --api-key 'My API Key' \\\n --buyer-name 'Mae Green' \\\n --currency GBP \\\n --discount 9.00 \\\n --match-id match-001 \\\n --purchase-method online \\\n --quantity 2 \\\n --subtotal 90.00 \\\n --tax 16.20 \\\n --total 97.20 \\\n --unit-price 45.00",
|
|
3951
4628
|
},
|
|
4629
|
+
csharp: {
|
|
4630
|
+
method: 'TicketSales.Create',
|
|
4631
|
+
example:
|
|
4632
|
+
'TicketSaleCreateParams parameters = new()\n{\n BuyerName = "Mae Green",\n Currency = "GBP",\n Discount = "9.00",\n MatchID = "match-001",\n PurchaseMethod = PurchaseMethod.Online,\n Quantity = 2,\n Subtotal = "90.00",\n Tax = "16.20",\n Total = "97.20",\n UnitPrice = "45.00",\n};\n\nvar ticketSale = await client.TicketSales.Create(parameters);\n\nConsole.WriteLine(ticketSale);',
|
|
4633
|
+
},
|
|
3952
4634
|
go: {
|
|
3953
4635
|
method: 'client.TicketSales.New',
|
|
3954
4636
|
example:
|
|
@@ -3968,6 +4650,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3968
4650
|
example:
|
|
3969
4651
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ticketsales.PurchaseMethod\nimport com.believe.api.models.ticketsales.TicketSale\nimport com.believe.api.models.ticketsales.TicketSaleCreateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val params: TicketSaleCreateParams = TicketSaleCreateParams.builder()\n .buyerName("Mae Green")\n .currency("GBP")\n .discount("9.00")\n .matchId("match-001")\n .purchaseMethod(PurchaseMethod.ONLINE)\n .quantity(2L)\n .subtotal("90.00")\n .tax("16.20")\n .total("97.20")\n .unitPrice("45.00")\n .build()\n val ticketSale: TicketSale = client.ticketSales().create(params)\n}',
|
|
3970
4652
|
},
|
|
4653
|
+
php: {
|
|
4654
|
+
method: 'ticketSales->create',
|
|
4655
|
+
example:
|
|
4656
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$ticketSale = $client->ticketSales->create(\n buyerName: 'Mae Green',\n currency: 'GBP',\n discount: '9.00',\n matchID: 'match-001',\n purchaseMethod: PurchaseMethod::ONLINE,\n quantity: 2,\n subtotal: '90.00',\n tax: '16.20',\n total: '97.20',\n unitPrice: '45.00',\n buyerEmail: 'mae.green@example.com',\n couponCode: 'BELIEVE10',\n);\n\nvar_dump($ticketSale);",
|
|
4657
|
+
},
|
|
3971
4658
|
python: {
|
|
3972
4659
|
method: 'ticket_sales.create',
|
|
3973
4660
|
example:
|
|
@@ -4002,6 +4689,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4002
4689
|
example:
|
|
4003
4690
|
"believe ticket-sales delete \\\n --api-key 'My API Key' \\\n --ticket-sale-id ticket_sale_id",
|
|
4004
4691
|
},
|
|
4692
|
+
csharp: {
|
|
4693
|
+
method: 'TicketSales.Delete',
|
|
4694
|
+
example:
|
|
4695
|
+
'TicketSaleDeleteParams parameters = new() { TicketSaleID = "ticket_sale_id" };\n\nawait client.TicketSales.Delete(parameters);',
|
|
4696
|
+
},
|
|
4005
4697
|
go: {
|
|
4006
4698
|
method: 'client.TicketSales.Delete',
|
|
4007
4699
|
example:
|
|
@@ -4021,6 +4713,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4021
4713
|
example:
|
|
4022
4714
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ticketsales.TicketSaleDeleteParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.ticketSales().delete("ticket_sale_id")\n}',
|
|
4023
4715
|
},
|
|
4716
|
+
php: {
|
|
4717
|
+
method: 'ticketSales->delete',
|
|
4718
|
+
example:
|
|
4719
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->ticketSales->delete('ticket_sale_id');\n\nvar_dump($result);",
|
|
4720
|
+
},
|
|
4024
4721
|
python: {
|
|
4025
4722
|
method: 'ticket_sales.delete',
|
|
4026
4723
|
example:
|
|
@@ -4057,6 +4754,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4057
4754
|
example:
|
|
4058
4755
|
"believe ticket-sales retrieve \\\n --api-key 'My API Key' \\\n --ticket-sale-id ticket_sale_id",
|
|
4059
4756
|
},
|
|
4757
|
+
csharp: {
|
|
4758
|
+
method: 'TicketSales.Retrieve',
|
|
4759
|
+
example:
|
|
4760
|
+
'TicketSaleRetrieveParams parameters = new() { TicketSaleID = "ticket_sale_id" };\n\nvar ticketSale = await client.TicketSales.Retrieve(parameters);\n\nConsole.WriteLine(ticketSale);',
|
|
4761
|
+
},
|
|
4060
4762
|
go: {
|
|
4061
4763
|
method: 'client.TicketSales.Get',
|
|
4062
4764
|
example:
|
|
@@ -4076,6 +4778,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4076
4778
|
example:
|
|
4077
4779
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ticketsales.TicketSale\nimport com.believe.api.models.ticketsales.TicketSaleRetrieveParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val ticketSale: TicketSale = client.ticketSales().retrieve("ticket_sale_id")\n}',
|
|
4078
4780
|
},
|
|
4781
|
+
php: {
|
|
4782
|
+
method: 'ticketSales->retrieve',
|
|
4783
|
+
example:
|
|
4784
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$ticketSale = $client->ticketSales->retrieve('ticket_sale_id');\n\nvar_dump($ticketSale);",
|
|
4785
|
+
},
|
|
4079
4786
|
python: {
|
|
4080
4787
|
method: 'ticket_sales.retrieve',
|
|
4081
4788
|
example:
|
|
@@ -4126,6 +4833,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4126
4833
|
example:
|
|
4127
4834
|
"believe ticket-sales update \\\n --api-key 'My API Key' \\\n --ticket-sale-id ticket_sale_id",
|
|
4128
4835
|
},
|
|
4836
|
+
csharp: {
|
|
4837
|
+
method: 'TicketSales.Update',
|
|
4838
|
+
example:
|
|
4839
|
+
'TicketSaleUpdateParams parameters = new() { TicketSaleID = "ticket_sale_id" };\n\nvar ticketSale = await client.TicketSales.Update(parameters);\n\nConsole.WriteLine(ticketSale);',
|
|
4840
|
+
},
|
|
4129
4841
|
go: {
|
|
4130
4842
|
method: 'client.TicketSales.Update',
|
|
4131
4843
|
example:
|
|
@@ -4145,6 +4857,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4145
4857
|
example:
|
|
4146
4858
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.ticketsales.TicketSale\nimport com.believe.api.models.ticketsales.TicketSaleUpdateParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val ticketSale: TicketSale = client.ticketSales().update("ticket_sale_id")\n}',
|
|
4147
4859
|
},
|
|
4860
|
+
php: {
|
|
4861
|
+
method: 'ticketSales->update',
|
|
4862
|
+
example:
|
|
4863
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$ticketSale = $client->ticketSales->update(\n 'ticket_sale_id',\n buyerEmail: 'dev@stainless.com',\n buyerName: 'buyer_name',\n couponCode: 'coupon_code',\n currency: 'currency',\n discount: 'discount',\n matchID: 'match_id',\n purchaseMethod: PurchaseMethod::ONLINE,\n quantity: 1,\n subtotal: 'subtotal',\n tax: 'tax',\n total: 'total',\n unitPrice: 'unit_price',\n);\n\nvar_dump($ticketSale);",
|
|
4864
|
+
},
|
|
4148
4865
|
python: {
|
|
4149
4866
|
method: 'ticket_sales.update',
|
|
4150
4867
|
example:
|
|
@@ -4178,6 +4895,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4178
4895
|
method: 'health check',
|
|
4179
4896
|
example: "believe health check \\\n --api-key 'My API Key'",
|
|
4180
4897
|
},
|
|
4898
|
+
csharp: {
|
|
4899
|
+
method: 'Health.Check',
|
|
4900
|
+
example:
|
|
4901
|
+
'HealthCheckParams parameters = new();\n\nvar response = await client.Health.Check(parameters);\n\nConsole.WriteLine(response);',
|
|
4902
|
+
},
|
|
4181
4903
|
go: {
|
|
4182
4904
|
method: 'client.Health.Check',
|
|
4183
4905
|
example:
|
|
@@ -4196,6 +4918,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4196
4918
|
example:
|
|
4197
4919
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.health.HealthCheckParams\nimport com.believe.api.models.health.HealthCheckResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val response: HealthCheckResponse = client.health().check()\n}',
|
|
4198
4920
|
},
|
|
4921
|
+
php: {
|
|
4922
|
+
method: 'health->check',
|
|
4923
|
+
example:
|
|
4924
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->health->check();\n\nvar_dump($response);",
|
|
4925
|
+
},
|
|
4199
4926
|
python: {
|
|
4200
4927
|
method: 'health.check',
|
|
4201
4928
|
example:
|
|
@@ -4229,6 +4956,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4229
4956
|
method: 'version retrieve',
|
|
4230
4957
|
example: "believe version retrieve \\\n --api-key 'My API Key'",
|
|
4231
4958
|
},
|
|
4959
|
+
csharp: {
|
|
4960
|
+
method: 'Version.Retrieve',
|
|
4961
|
+
example:
|
|
4962
|
+
'VersionRetrieveParams parameters = new();\n\nvar version = await client.Version.Retrieve(parameters);\n\nConsole.WriteLine(version);',
|
|
4963
|
+
},
|
|
4232
4964
|
go: {
|
|
4233
4965
|
method: 'client.Version.Get',
|
|
4234
4966
|
example:
|
|
@@ -4247,6 +4979,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4247
4979
|
example:
|
|
4248
4980
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.version.VersionRetrieveParams\nimport com.believe.api.models.version.VersionRetrieveResponse\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n val version: VersionRetrieveResponse = client.version().retrieve()\n}',
|
|
4249
4981
|
},
|
|
4982
|
+
php: {
|
|
4983
|
+
method: 'version->retrieve',
|
|
4984
|
+
example:
|
|
4985
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$version = $client->version->retrieve();\n\nvar_dump($version);",
|
|
4986
|
+
},
|
|
4250
4987
|
python: {
|
|
4251
4988
|
method: 'version.retrieve',
|
|
4252
4989
|
example:
|
|
@@ -4280,6 +5017,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4280
5017
|
method: 'ws test',
|
|
4281
5018
|
example: "believe client:ws test \\\n --api-key 'My API Key'",
|
|
4282
5019
|
},
|
|
5020
|
+
csharp: {
|
|
5021
|
+
method: 'Client.Ws.Test',
|
|
5022
|
+
example: 'WTestParams parameters = new();\n\nawait client.Client.Ws.Test(parameters);',
|
|
5023
|
+
},
|
|
4283
5024
|
go: {
|
|
4284
5025
|
method: 'client.Client.Ws.Test',
|
|
4285
5026
|
example:
|
|
@@ -4298,6 +5039,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4298
5039
|
example:
|
|
4299
5040
|
'package com.believe.api.example\n\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.client.ws.WTestParams\n\nfun main() {\n val client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\n client.client().ws().test()\n}',
|
|
4300
5041
|
},
|
|
5042
|
+
php: {
|
|
5043
|
+
method: 'client->ws->test',
|
|
5044
|
+
example:
|
|
5045
|
+
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$result = $client->client->ws->test();\n\nvar_dump($result);",
|
|
5046
|
+
},
|
|
4301
5047
|
python: {
|
|
4302
5048
|
method: 'client.ws.test',
|
|
4303
5049
|
example:
|
|
@@ -4321,12 +5067,12 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
|
|
|
4321
5067
|
{
|
|
4322
5068
|
language: 'python',
|
|
4323
5069
|
content:
|
|
4324
|
-
'# Believe Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/believe/)\n\nThe Believe Python library provides convenient access to the Believe REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\n The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from the production repo\npip install git+ssh://git@github.com/cjavdev/believe-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install believe`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom believe import Believe\n\nclient = Believe(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n)\n\npage = client.characters.list()\nprint(page.data)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `BELIEVE_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncBelieve` instead of `Believe` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom believe import AsyncBelieve\n\nclient = AsyncBelieve(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n page = await client.characters.list()\n print(page.data)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from the production repo\npip install \'believe[aiohttp] @ git+ssh://git@github.com/cjavdev/believe-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom believe import DefaultAioHttpClient\nfrom believe import AsyncBelieve\n\nasync def main() -> None:\n async with AsyncBelieve(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n page = await client.characters.list()\n print(page.data)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Believe API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom believe import Believe\n\nclient = Believe()\n\nall_characters = []\n# Automatically fetches more pages as needed.\nfor character in client.characters.list():\n # Do something with character here\n all_characters.append(character)\nprint(all_characters)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom believe import AsyncBelieve\n\nclient = AsyncBelieve()\n\nasync def main() -> None:\n all_characters = []\n # Iterate through items across all pages, issuing requests as needed.\n async for character in client.characters.list():\n all_characters.append(character)\n print(all_characters)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.characters.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.data)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.characters.list()\n\nprint(f"the current start offset for this page: {first_page.skip}") # => "the current start offset for this page: 1"\nfor character in first_page.data:\n print(character.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom believe import Believe\n\nclient = Believe()\n\ncharacter = client.characters.create(\n background="Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.",\n emotional_stats={\n "curiosity": 40,\n "empathy": 85,\n "optimism": 45,\n "resilience": 95,\n "vulnerability": 60,\n },\n name="Roy Kent",\n personality_traits=["intense", "loyal", "secretly caring", "profane"],\n role="coach",\n)\nprint(character.emotional_stats)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom believe import Believe\n\nclient = Believe()\n\nclient.teams.logo.upload(\n team_id="team_id",\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `believe.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `believe.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `believe.APIError`.\n\n```python\nimport believe\nfrom believe import Believe\n\nclient = Believe()\n\ntry:\n client.characters.list()\nexcept believe.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept believe.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept believe.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom believe import Believe\n\n# Configure the default for all requests:\nclient = Believe(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).characters.list()\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom believe import Believe\n\n# Configure the default for all requests:\nclient = Believe(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Believe(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).characters.list()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `BELIEVE_LOG` to `info`.\n\n```shell\n$ export BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom believe import Believe\n\nclient = Believe()\nresponse = client.characters.with_raw_response.list()\nprint(response.headers.get(\'X-My-Header\'))\n\ncharacter = response.parse() # get the object that `characters.list()` would have returned\nprint(character.id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/cjavdev/believe-python/tree/main/src/believe/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/cjavdev/believe-python/tree/main/src/believe/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.characters.with_streaming_response.list() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom believe import Believe, DefaultHttpxClient\n\nclient = Believe(\n # Or use the `BELIEVE_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom believe import Believe\n\nwith Believe() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport believe\nprint(believe.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
5070
|
+
'# Believe Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/believe/)\n\nThe Believe Python library provides convenient access to the Believe REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\n The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from the production repo\npip install git+ssh://git@github.com/cjavdev/believe-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install believe`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom believe import Believe\n\nclient = Believe(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n)\n\npage = client.characters.list()\nprint(page.data)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `BELIEVE_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncBelieve` instead of `Believe` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom believe import AsyncBelieve\n\nclient = AsyncBelieve(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n page = await client.characters.list()\n print(page.data)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from the production repo\npip install \'believe[aiohttp] @ git+ssh://git@github.com/cjavdev/believe-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom believe import DefaultAioHttpClient\nfrom believe import AsyncBelieve\n\nasync def main() -> None:\n async with AsyncBelieve(\n api_key=os.environ.get("BELIEVE_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n page = await client.characters.list()\n print(page.data)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Believe API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom believe import Believe\n\nclient = Believe()\n\nall_characters = []\n# Automatically fetches more pages as needed.\nfor character in client.characters.list():\n # Do something with character here\n all_characters.append(character)\nprint(all_characters)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom believe import AsyncBelieve\n\nclient = AsyncBelieve()\n\nasync def main() -> None:\n all_characters = []\n # Iterate through items across all pages, issuing requests as needed.\n async for character in client.characters.list():\n all_characters.append(character)\n print(all_characters)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.characters.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.data)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.characters.list()\n\nprint(f"the current start offset for this page: {first_page.skip}") # => "the current start offset for this page: 1"\nfor character in first_page.data:\n print(character.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom believe import Believe\n\nclient = Believe()\n\ncharacter = client.characters.create(\n background="Legendary midfielder for Chelsea and AFC Richmond, now assistant coach. Known for his gruff exterior hiding a heart of gold.",\n emotional_stats={\n "curiosity": 40,\n "empathy": 85,\n "optimism": 45,\n "resilience": 95,\n "vulnerability": 60,\n },\n name="Roy Kent",\n personality_traits=["intense", "loyal", "secretly caring", "profane"],\n role="coach",\n)\nprint(character.emotional_stats)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom believe import Believe\n\nclient = Believe()\n\nclient.teams.logo.upload(\n team_id="team_id",\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `believe.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `believe.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `believe.APIError`.\n\n```python\nimport believe\nfrom believe import Believe\n\nclient = Believe()\n\ntry:\n client.characters.list()\nexcept believe.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept believe.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept believe.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom believe import Believe\n\n# Configure the default for all requests:\nclient = Believe(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).characters.list()\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom believe import Believe\n\n# Configure the default for all requests:\nclient = Believe(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Believe(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).characters.list()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `BELIEVE_LOG` to `info`.\n\n```shell\n$ export BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom believe import Believe\n\nclient = Believe()\nresponse = client.characters.with_raw_response.list()\nprint(response.headers.get(\'X-My-Header\'))\n\ncharacter = response.parse() # get the object that `characters.list()` would have returned\nprint(character.id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/cjavdev/believe-python/tree/main/src/believe/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/cjavdev/believe-python/tree/main/src/believe/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.characters.with_streaming_response.list() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom believe import Believe, DefaultHttpxClient\n\nclient = Believe(\n # Or use the `BELIEVE_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom believe import Believe\n\nwith Believe() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport believe\nprint(believe.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
4325
5071
|
},
|
|
4326
5072
|
{
|
|
4327
5073
|
language: 'go',
|
|
4328
5074
|
content:
|
|
4329
|
-
'# Believe Go API Library\n\n<a href="https://pkg.go.dev/github.com/cjavdev/believe-go"><img src="https://pkg.go.dev/badge/github.com/cjavdev/believe-go.svg" alt="Go Reference"></a>\n\nThe Believe Go library provides convenient access to the Believe REST API\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/cjavdev/believe-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/cjavdev/believe-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/cjavdev/believe-go"\n\t"github.com/cjavdev/believe-go/option"\n)\n\nfunc main() {\n\tclient := believe.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("BELIEVE_API_KEY")\n\t)\n\tpage, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Characters.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/cjavdev/believe-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Characters.ListAutoPaging(context.TODO(), believe.CharacterListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tcharacter := iter.Current()\n\tfmt.Printf("%+v\\n", character)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\nfor page != nil {\n\tfor _, character := range page.Data {\n\t\tfmt.Printf("%+v\\n", character)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\nif err != nil {\n\tvar apierr *believe.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/characters": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Characters.List(\n\tctx,\n\tbelieve.CharacterListParams{},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nbelieve.TeamLogoUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nbelieve.TeamLogoUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nbelieve.TeamLogoUploadParams{\n\tFile: believe.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := believe.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Characters.List(\n\tcontext.TODO(),\n\tbelieve.CharacterListParams{},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\npage, err := client.Characters.List(\n\tcontext.TODO(),\n\tbelieve.CharacterListParams{},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", page)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
5075
|
+
'# Believe Go API Library\n\n<a href="https://pkg.go.dev/github.com/cjavdev/believe-go"><img src="https://pkg.go.dev/badge/github.com/cjavdev/believe-go.svg" alt="Go Reference"></a>\n\nThe Believe Go library provides convenient access to the Believe REST API\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/cjavdev/believe-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/cjavdev/believe-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/cjavdev/believe-go"\n\t"github.com/cjavdev/believe-go/option"\n)\n\nfunc main() {\n\tclient := believe.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("BELIEVE_API_KEY")\n\t)\n\tpage, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Characters.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/cjavdev/believe-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Characters.ListAutoPaging(context.TODO(), believe.CharacterListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tcharacter := iter.Current()\n\tfmt.Printf("%+v\\n", character)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\nfor page != nil {\n\tfor _, character := range page.Data {\n\t\tfmt.Printf("%+v\\n", character)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Characters.List(context.TODO(), believe.CharacterListParams{})\nif err != nil {\n\tvar apierr *believe.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/characters": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Characters.List(\n\tctx,\n\tbelieve.CharacterListParams{},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nbelieve.TeamLogoUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nbelieve.TeamLogoUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nbelieve.TeamLogoUploadParams{\n\tFile: believe.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := believe.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Characters.List(\n\tcontext.TODO(),\n\tbelieve.CharacterListParams{},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\npage, err := client.Characters.List(\n\tcontext.TODO(),\n\tbelieve.CharacterListParams{},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", page)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
4330
5076
|
},
|
|
4331
5077
|
{
|
|
4332
5078
|
language: 'terraform',
|
|
@@ -4336,28 +5082,38 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
|
|
|
4336
5082
|
{
|
|
4337
5083
|
language: 'typescript',
|
|
4338
5084
|
content:
|
|
4339
|
-
"# Believe TypeScript API Library\n\n[)](https://npmjs.org/package/@cjavdev/believe) \n\nThis library provides convenient access to the Believe REST API from server-side TypeScript or JavaScript.\n\n\n\nThe full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @cjavdev/believe\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n apiKey: process.env['BELIEVE_API_KEY'], // This is the default and can be omitted\n});\n\nconst page = await client.characters.list();\nconst character = page.data[0];\n\nconsole.log(character.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n apiKey: process.env['BELIEVE_API_KEY'], // This is the default and can be omitted\n});\n\nconst [character]: [Believe.Character] = await client.characters.list();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport Believe, { toFile } from '@cjavdev/believe';\n\nconst client = new Believe();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.teams.logo.upload('team_id', { file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.teams.logo.upload('team_id', { file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.teams.logo.upload('team_id', { file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.teams.logo.upload('team_id', { file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.teams.logo.upload('team_id', {\n file: await toFile(new Uint8Array([0, 1, 2]), 'file'),\n});\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst page = await client.characters.list().catch(async (err) => {\n if (err instanceof Believe.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new Believe({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.characters.list({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new Believe({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.characters.list({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the Believe API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllCharacters(params) {\n const allCharacters = [];\n // Automatically fetches more pages as needed.\n for await (const character of client.characters.list()) {\n allCharacters.push(character);\n }\n return allCharacters;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.characters.list();\nfor (const character of page.data) {\n console.log(character);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Tree shaking\n\nThis library supports tree shaking to reduce bundle size. Instead of importing the full client, you can create a client only including the API resources you need:\n\n~~~ts\nimport { createClient } from '@cjavdev/believe/tree-shakable';\nimport { Characters } from '@cjavdev/believe/resources/characters';\nimport { BaseLogo } from '@cjavdev/believe/resources/teams/logo';\n\nconst client = createClient({\n // Specify the resources you'd like to use ...\n resources: [Characters, BaseLogo],\n});\n\n// ... then make API calls as usual.\nconst page = await client.characters.list();\nconst character = page.data[0]\nconst fileUpload = await client.teams.logo.upload('team_id', { file: fs.createReadStream('path/to/file') });\n~~~\n\nEach API resource has two versions, the full resource (e.g., `Characters`) which includes all subresources, and the base resource (e.g., `BaseCharacters`) which does not.\n\nThe tree-shaken client is fully typed, so TypeScript will provide accurate autocomplete and prevent access to resources not included in your configuration.\nThe `createClient` function automatically infers the correct type, but you can also use the `PartialBelieve` type explicitly:\n\n~~~ts\nimport Believe from '@cjavdev/believe';\nimport { createClient, type PartialBelieve } from '@cjavdev/believe/tree-shakable';\nimport { BaseCharacters } from '@cjavdev/believe/resources/characters';\n\n// Explicit variable type\nconst client: PartialBelieve<{ characters: BaseCharacters }> = createClient({\n resources: [BaseCharacters],\n /* ... */\n});\n\n// Function parameter type\nasync function main(client: PartialBelieve<{ characters: BaseCharacters }>) {\n const page = await client.characters.list();\n const character = page.data[0]\n}\n\n// Works with any client that has the characters resource\nconst treeShakableClient = createClient({\n resources: [BaseCharacters],\n /* ... */\n});\nconst fullClient = new Believe(/* ... */);\n\nmain(treeShakableClient); // Works\nmain(fullClient); // Also works\n~~~\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new Believe();\n\nconst response = await client.characters.list().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: page, response: raw } = await client.characters.list().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nfor await (const character of page) {\n console.log(character.id);\n}\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `BELIEVE_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Believe({\n logger: logger.child({ name: 'Believe' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.characters.list({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport fetch from 'my-fetch';\n\nconst client = new Believe({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Believe({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport Believe from 'npm:@cjavdev/believe';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Believe({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n- Web browsers: disabled by default to avoid exposing your secret API credentials. Enable browser support by explicitly setting `dangerouslyAllowBrowser` to true'.\n<details>\n <summary>More explanation</summary>\n\n ### Why is this dangerous?\n Enabling the `dangerouslyAllowBrowser` option can be dangerous because it exposes your secret API credentials in the client-side code. Web browsers are inherently less secure than server environments,\n any user with access to the browser can potentially inspect, extract, and misuse these credentials. This could lead to unauthorized access using your credentials and potentially compromise sensitive data or functionality.\n ### When might this not be dangerous?\n In certain scenarios where enabling browser support might not pose significant risks:\n - Internal Tools: If the application is used solely within a controlled internal environment where the users are trusted, the risk of credential exposure can be mitigated.\n - Public APIs with Limited Scope: If your API has very limited scope and the exposed credentials do not grant access to sensitive data or critical operations, the potential impact of exposure is reduced.\n - Development or debugging purpose: Enabling this feature temporarily might be acceptable, provided the credentials are short-lived, aren't also used in production environments, or are frequently rotated.\n\n</details>\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
5085
|
+
"# Believe TypeScript API Library\n\n[)](https://npmjs.org/package/@cjavdev/believe) \n\nThis library provides convenient access to the Believe REST API from server-side TypeScript or JavaScript.\n\n\n\nThe full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @cjavdev/believe\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n apiKey: process.env['BELIEVE_API_KEY'], // This is the default and can be omitted\n});\n\nconst page = await client.characters.list();\nconst character = page.data[0];\n\nconsole.log(character.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n apiKey: process.env['BELIEVE_API_KEY'], // This is the default and can be omitted\n});\n\nconst [character]: [Believe.Character] = await client.characters.list();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport Believe, { toFile } from '@cjavdev/believe';\n\nconst client = new Believe();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.teams.logo.upload('team_id', { file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.teams.logo.upload('team_id', { file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.teams.logo.upload('team_id', { file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.teams.logo.upload('team_id', { file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.teams.logo.upload('team_id', {\n file: await toFile(new Uint8Array([0, 1, 2]), 'file'),\n});\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst page = await client.characters.list().catch(async (err) => {\n if (err instanceof Believe.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new Believe({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.characters.list({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new Believe({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.characters.list({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the Believe API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllCharacters(params) {\n const allCharacters = [];\n // Automatically fetches more pages as needed.\n for await (const character of client.characters.list()) {\n allCharacters.push(character);\n }\n return allCharacters;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.characters.list();\nfor (const character of page.data) {\n console.log(character);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Tree shaking\n\nThis library supports tree shaking to reduce bundle size. Instead of importing the full client, you can create a client only including the API resources you need:\n\n~~~ts\nimport { createClient } from '@cjavdev/believe/tree-shakable';\nimport { Characters } from '@cjavdev/believe/resources/characters';\nimport { BaseLogo } from '@cjavdev/believe/resources/teams/logo';\n\nconst client = createClient({\n // Specify the resources you'd like to use ...\n resources: [Characters, BaseLogo],\n});\n\n// ... then make API calls as usual.\nconst page = await client.characters.list();\nconst character = page.data[0]\nconst fileUpload = await client.teams.logo.upload('team_id', { file: fs.createReadStream('path/to/file') });\n~~~\n\nEach API resource has two versions, the full resource (e.g., `Characters`) which includes all subresources, and the base resource (e.g., `BaseCharacters`) which does not.\n\nThe tree-shaken client is fully typed, so TypeScript will provide accurate autocomplete and prevent access to resources not included in your configuration.\nThe `createClient` function automatically infers the correct type, but you can also use the `PartialBelieve` type explicitly:\n\n~~~ts\nimport Believe from '@cjavdev/believe';\nimport { createClient, type PartialBelieve } from '@cjavdev/believe/tree-shakable';\nimport { BaseCharacters } from '@cjavdev/believe/resources/characters';\n\n// Explicit variable type\nconst client: PartialBelieve<{ characters: BaseCharacters }> = createClient({\n resources: [BaseCharacters],\n /* ... */\n});\n\n// Function parameter type\nasync function main(client: PartialBelieve<{ characters: BaseCharacters }>) {\n const page = await client.characters.list();\n const character = page.data[0]\n}\n\n// Works with any client that has the characters resource\nconst treeShakableClient = createClient({\n resources: [BaseCharacters],\n /* ... */\n});\nconst fullClient = new Believe(/* ... */);\n\nmain(treeShakableClient); // Works\nmain(fullClient); // Also works\n~~~\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new Believe();\n\nconst response = await client.characters.list().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: page, response: raw } = await client.characters.list().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nfor await (const character of page) {\n console.log(character.id);\n}\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `BELIEVE_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Believe({\n logger: logger.child({ name: 'Believe' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.characters.list({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport fetch from 'my-fetch';\n\nconst client = new Believe({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport Believe from '@cjavdev/believe';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Believe({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport Believe from '@cjavdev/believe';\n\nconst client = new Believe({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport Believe from 'npm:@cjavdev/believe';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Believe({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n- Web browsers: disabled by default to avoid exposing your secret API credentials. Enable browser support by explicitly setting `dangerouslyAllowBrowser` to true'.\n<details>\n <summary>More explanation</summary>\n\n ### Why is this dangerous?\n Enabling the `dangerouslyAllowBrowser` option can be dangerous because it exposes your secret API credentials in the client-side code. Web browsers are inherently less secure than server environments,\n any user with access to the browser can potentially inspect, extract, and misuse these credentials. This could lead to unauthorized access using your credentials and potentially compromise sensitive data or functionality.\n ### When might this not be dangerous?\n In certain scenarios where enabling browser support might not pose significant risks:\n - Internal Tools: If the application is used solely within a controlled internal environment where the users are trusted, the risk of credential exposure can be mitigated.\n - Public APIs with Limited Scope: If your API has very limited scope and the exposed credentials do not grant access to sensitive data or critical operations, the potential impact of exposure is reduced.\n - Development or debugging purpose: Enabling this feature temporarily might be acceptable, provided the credentials are short-lived, aren't also used in production environments, or are frequently rotated.\n\n</details>\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
4340
5086
|
},
|
|
4341
5087
|
{
|
|
4342
5088
|
language: 'ruby',
|
|
4343
5089
|
content:
|
|
4344
|
-
'# Believe Ruby API library\n\nThe Believe Ruby library provides convenient access to the Believe REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/cjavdev/believe-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/believe).\n\n\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n<!-- x-release-please-start-version -->\n\n```ruby\ngem "believe", "~> 0.0.1"\n```\n\n<!-- x-release-please-end -->\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "believe"\n\nbelieve = ::Believe::Client.new(\n api_key: ENV["BELIEVE_API_KEY"] # This is the default and can be omitted\n)\n\npage = believe.characters.list\n\nputs(page.id)\n```\n\n\n\n### Pagination\n\nList methods in the Believe API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = believe.characters.list\n\n# Fetch single item from page.\ncharacter = page.data[0]\nputs(character.id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |character|\n puts(character.id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.data[0].id)\nend\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.\n\n```ruby\nrequire "pathname"\n\n# Use `Pathname` to send the filename and/or avoid paging a large file into memory:\nfile_upload = believe.teams.logo.upload(file: Pathname("/path/to/file"))\n\n# Alternatively, pass file contents or a `StringIO` directly:\nfile_upload = believe.teams.logo.upload(file: File.read("/path/to/file"))\n\n# Or, to control the filename and/or content type:\nfile = ::Believe::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")\nfile_upload = believe.teams.logo.upload(file: file)\n\nputs(file_upload.file_id)\n```\n\nNote that you can also pass a raw `IO` descriptor, but this disables retries, as the library can\'t be sure if the descriptor is a file or pipe (which cannot be rewound).\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `::Believe::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n character = believe.characters.list\nrescue ::Believe::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue ::Believe::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue ::Believe::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nbelieve = ::Believe::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nbelieve.characters.list(request_options: {max_retries: 5})\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nbelieve = ::Believe::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nbelieve.characters.list(request_options: {timeout: 5})\n```\n\nOn timeout, `::Believe::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `::Believe::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\npage =\n believe.characters.list(\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(page[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `::Believe::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `::Believe::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nbelieve.characters.list \n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nbelieve.characters.list\n\n# You can also splat a full Params class:\nparams = ::Believe::CharacterListParams.new\nbelieve.characters.list(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :coach\nputs(::Believe::CharacterRole::COACH)\n\n# Revealed type: `T.all(::Believe::CharacterRole, Symbol)`\nT.reveal_type(::Believe::CharacterRole::COACH)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nbelieve.characters.create(\n role: ::Believe::CharacterRole::COACH,\n # …\n)\n\n# Literal values are also permissible:\nbelieve.characters.create(\n role: :coach,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/cjavdev/believe-ruby/tree/main/CONTRIBUTING.md).\n',
|
|
5090
|
+
'# Believe Ruby API library\n\nThe Believe Ruby library provides convenient access to the Believe REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/cjavdev/believe-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/believe).\n\n\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n<!-- x-release-please-start-version -->\n\n```ruby\ngem "believe", "~> 0.0.1"\n```\n\n<!-- x-release-please-end -->\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "believe"\n\nbelieve = ::Believe::Client.new(\n api_key: ENV["BELIEVE_API_KEY"] # This is the default and can be omitted\n)\n\npage = believe.characters.list\n\nputs(page.id)\n```\n\n\n\n### Pagination\n\nList methods in the Believe API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = believe.characters.list\n\n# Fetch single item from page.\ncharacter = page.data[0]\nputs(character.id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |character|\n puts(character.id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.data[0].id)\nend\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.\n\n```ruby\nrequire "pathname"\n\n# Use `Pathname` to send the filename and/or avoid paging a large file into memory:\nfile_upload = believe.teams.logo.upload(file: Pathname("/path/to/file"))\n\n# Alternatively, pass file contents or a `StringIO` directly:\nfile_upload = believe.teams.logo.upload(file: File.read("/path/to/file"))\n\n# Or, to control the filename and/or content type:\nfile = ::Believe::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")\nfile_upload = believe.teams.logo.upload(file: file)\n\nputs(file_upload.file_id)\n```\n\nNote that you can also pass a raw `IO` descriptor, but this disables retries, as the library can\'t be sure if the descriptor is a file or pipe (which cannot be rewound).\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `::Believe::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n character = believe.characters.list\nrescue ::Believe::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue ::Believe::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue ::Believe::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nbelieve = ::Believe::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nbelieve.characters.list(request_options: {max_retries: 5})\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nbelieve = ::Believe::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nbelieve.characters.list(request_options: {timeout: 5})\n```\n\nOn timeout, `::Believe::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `::Believe::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\npage =\n believe.characters.list(\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(page[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `::Believe::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `::Believe::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nbelieve.characters.list \n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nbelieve.characters.list\n\n# You can also splat a full Params class:\nparams = ::Believe::CharacterListParams.new\nbelieve.characters.list(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :coach\nputs(::Believe::CharacterRole::COACH)\n\n# Revealed type: `T.all(::Believe::CharacterRole, Symbol)`\nT.reveal_type(::Believe::CharacterRole::COACH)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nbelieve.characters.create(\n role: ::Believe::CharacterRole::COACH,\n # …\n)\n\n# Literal values are also permissible:\nbelieve.characters.create(\n role: :coach,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/cjavdev/believe-ruby/tree/main/CONTRIBUTING.md).\n',
|
|
4345
5091
|
},
|
|
4346
5092
|
{
|
|
4347
5093
|
language: 'java',
|
|
4348
5094
|
content:
|
|
4349
|
-
'# Believe Java API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/com.believe.api/believe-java/0.0.1)\n[](https://javadoc.io/doc/com.believe.api/believe-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Believe Java SDK provides convenient access to the Believe REST API from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nJavadocs are available on [javadoc.io](https://javadoc.io/doc/com.believe.api/believe-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.believe.api:believe-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.believe.api</groupId>\n <artifactId>believe-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport com.believe.api.models.characters.CharacterListPage;\nimport com.believe.api.models.characters.CharacterListParams;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n\nCharacterListPage page = client.characters().list();\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n // Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n // Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | ----------------- | -------------------- | -------- | ---------------------------- |\n| `apiKey` | `believe.apiKey` | `BELIEVE_API_KEY` | true | - |\n| `baseUrl` | `believe.baseUrl` | `BELIEVE_BASE_URL` | true | `"https://believe.cjav.dev"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.believe.api.client.BelieveClient;\n\nBelieveClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Believe API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.characters().list(...)` should be called with an instance of `CharacterListParams`, and it will return an instance of `CharacterListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport com.believe.api.models.characters.CharacterListParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n\nCompletableFuture<CharacterListPageAsync> page = client.async().characters().list();\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.believe.api.client.BelieveClientAsync;\nimport com.believe.api.client.okhttp.BelieveOkHttpClientAsync;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport com.believe.api.models.characters.CharacterListParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClientAsync client = BelieveOkHttpClientAsync.fromEnv();\n\nCompletableFuture<CharacterListPageAsync> page = client.characters().list();\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.nio.file.Paths;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(Paths.get("/path/to/file"))\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.net.URL;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(new URL("https://example.com//path/to/file").openStream())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nOr a `byte[]` array:\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file("content".getBytes())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```java\nimport com.believe.api.core.MultipartField;\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.io.InputStream;\nimport java.net.URL;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(MultipartField.<InputStream>builder()\n .value(new URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.believe.api.core.http.Headers;\nimport com.believe.api.core.http.HttpResponseFor;\nimport com.believe.api.models.characters.CharacterListPage;\nimport com.believe.api.models.characters.CharacterListParams;\n\nHttpResponseFor<CharacterListPage> page = client.characters().withRawResponse().list();\n\nint statusCode = page.statusCode();\nHeaders headers = page.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage parsedPage = page.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`BelieveServiceException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](believe-java-core/src/main/kotlin/com/believe/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](believe-java-core/src/main/kotlin/com/believe/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](believe-java-core/src/main/kotlin/com/believe/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](believe-java-core/src/main/kotlin/com/believe/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`BelieveIoException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveIoException.kt): I/O networking errors.\n\n- [`BelieveRetryableException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`BelieveInvalidDataException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`BelieveException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list();\n\n// Process as an Iterable\nfor (Character character : page.autoPager()) {\n System.out.println(character);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(character -> System.out.println(character));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](believe-java-core/src/main/kotlin/com/believe/api/core/http/AsyncStreamResponse.kt):\n\n```java\nimport com.believe.api.core.http.AsyncStreamResponse;\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture<CharacterListPageAsync> pageFuture = client.async().characters().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(character -> {\n System.out.println(character);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(Character character) {\n System.out.println(character);\n }\n\n @Override\n public void onComplete(Optional<Throwable> error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(character -> {\n System.out.println(character);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list();\nwhile (true) {\n for (Character character : page.items()) {\n System.out.println(character);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nThe SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).\n\nEnable logging by setting the `BELIEVE_LOG` environment variable to `info`:\n\n```sh\nexport BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport BELIEVE_LOG=debug\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `believe-java-core` is published with a [configuration file](believe-java-core/src/main/resources/META-INF/proguard/believe-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.time.Duration;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.time.Duration;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `believe-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveClient`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClient.kt), [`BelieveClientAsync`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsync.kt), [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt), and [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), all of which can work with any HTTP client\n- `believe-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) and [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), which provide a way to construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) and [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), respectively, using OkHttp\n- `believe-java`\n - Depends on and exposes the APIs of both `believe-java-core` and `believe-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`believe-java` dependency](#installation) with `believe-java-core`\n2. Copy `believe-java-client-okhttp`\'s [`OkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`believe-java` dependency](#installation) with `believe-java-core`\n2. Write a class that implements the [`HttpClient`](believe-java-core/src/main/kotlin/com/believe/api/core/http/HttpClient.kt) interface\n3. Construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport com.believe.api.models.characters.CharacterListParams;\n\nCharacterListParams params = CharacterListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport com.believe.api.models.characters.CharacterCreateParams;\nimport com.believe.api.models.characters.EmotionalStats;\n\nCharacterCreateParams params = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt) object to its setter:\n\n```java\nimport com.believe.api.models.characters.CharacterListParams;\n\nCharacterListParams params = CharacterListParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```java\nimport com.believe.api.core.JsonMissing;\nimport com.believe.api.models.characters.CharacterCreateParams;\nimport com.believe.api.models.characters.CharacterListParams;\nimport com.believe.api.models.characters.CharacterRole;\nimport com.believe.api.models.characters.EmotionalStats;\nimport java.util.List;\n\nCharacterListParams params = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .curiosity(40L)\n .empathy(85L)\n .optimism(45L)\n .resilience(95L)\n .vulnerability(60L)\n .build())\n .name("Roy Kent")\n .personalityTraits(List.of(\n "intense",\n "loyal",\n "secretly caring",\n "profane"\n ))\n .role(CharacterRole.COACH)\n .background(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.characters().create(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.believe.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField<String> background = client.characters().create(params)._background();\n\nif (background.isMissing()) {\n // The property is absent from the JSON response\n} else if (background.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = background.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = background.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`BelieveInvalidDataException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt) only if you directly access the property.\n\nIf you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.believe.api.models.characters.Character;\n\nCharacter character = client.characters().create(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-java/issues) with questions, bugs, or suggestions.\n',
|
|
5095
|
+
'# Believe Java API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/com.believe.api/believe-java/0.0.1)\n[](https://javadoc.io/doc/com.believe.api/believe-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Believe Java SDK provides convenient access to the Believe REST API from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nJavadocs are available on [javadoc.io](https://javadoc.io/doc/com.believe.api/believe-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.believe.api:believe-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.believe.api</groupId>\n <artifactId>believe-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport com.believe.api.models.characters.CharacterListPage;\nimport com.believe.api.models.characters.CharacterListParams;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n\nCharacterListPage page = client.characters().list();\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n // Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n // Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | ----------------- | -------------------- | -------- | ---------------------------- |\n| `apiKey` | `believe.apiKey` | `BELIEVE_API_KEY` | true | - |\n| `baseUrl` | `believe.baseUrl` | `BELIEVE_BASE_URL` | true | `"https://believe.cjav.dev"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.believe.api.client.BelieveClient;\n\nBelieveClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Believe API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.characters().list(...)` should be called with an instance of `CharacterListParams`, and it will return an instance of `CharacterListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport com.believe.api.models.characters.CharacterListParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClient client = BelieveOkHttpClient.fromEnv();\n\nCompletableFuture<CharacterListPageAsync> page = client.async().characters().list();\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.believe.api.client.BelieveClientAsync;\nimport com.believe.api.client.okhttp.BelieveOkHttpClientAsync;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport com.believe.api.models.characters.CharacterListParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nBelieveClientAsync client = BelieveOkHttpClientAsync.fromEnv();\n\nCompletableFuture<CharacterListPageAsync> page = client.characters().list();\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.nio.file.Paths;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(Paths.get("/path/to/file"))\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.net.URL;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(new URL("https://example.com//path/to/file").openStream())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nOr a `byte[]` array:\n\n```java\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file("content".getBytes())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```java\nimport com.believe.api.core.MultipartField;\nimport com.believe.api.models.teams.logo.FileUpload;\nimport com.believe.api.models.teams.logo.LogoUploadParams;\nimport java.io.InputStream;\nimport java.net.URL;\n\nLogoUploadParams params = LogoUploadParams.builder()\n .teamId("team_id")\n .file(MultipartField.<InputStream>builder()\n .value(new URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build();\nFileUpload fileUpload = client.teams().logo().upload(params);\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.believe.api.core.http.Headers;\nimport com.believe.api.core.http.HttpResponseFor;\nimport com.believe.api.models.characters.CharacterListPage;\nimport com.believe.api.models.characters.CharacterListParams;\n\nHttpResponseFor<CharacterListPage> page = client.characters().withRawResponse().list();\n\nint statusCode = page.statusCode();\nHeaders headers = page.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage parsedPage = page.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`BelieveServiceException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](believe-java-core/src/main/kotlin/com/believe/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](believe-java-core/src/main/kotlin/com/believe/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](believe-java-core/src/main/kotlin/com/believe/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](believe-java-core/src/main/kotlin/com/believe/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](believe-java-core/src/main/kotlin/com/believe/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`BelieveIoException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveIoException.kt): I/O networking errors.\n\n- [`BelieveRetryableException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`BelieveInvalidDataException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`BelieveException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list();\n\n// Process as an Iterable\nfor (Character character : page.autoPager()) {\n System.out.println(character);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(character -> System.out.println(character));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](believe-java-core/src/main/kotlin/com/believe/api/core/http/AsyncStreamResponse.kt):\n\n```java\nimport com.believe.api.core.http.AsyncStreamResponse;\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPageAsync;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture<CharacterListPageAsync> pageFuture = client.async().characters().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(character -> {\n System.out.println(character);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(Character character) {\n System.out.println(character);\n }\n\n @Override\n public void onComplete(Optional<Throwable> error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(character -> {\n System.out.println(character);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport com.believe.api.models.characters.Character;\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list();\nwhile (true) {\n for (Character character : page.items()) {\n System.out.println(character);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nThe SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).\n\nEnable logging by setting the `BELIEVE_LOG` environment variable to `info`:\n\n```sh\nexport BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport BELIEVE_LOG=debug\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `believe-java-core` is published with a [configuration file](believe-java-core/src/main/resources/META-INF/proguard/believe-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.time.Duration;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\nimport java.time.Duration;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `believe-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveClient`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClient.kt), [`BelieveClientAsync`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsync.kt), [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt), and [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), all of which can work with any HTTP client\n- `believe-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) and [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), which provide a way to construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) and [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), respectively, using OkHttp\n- `believe-java`\n - Depends on and exposes the APIs of both `believe-java-core` and `believe-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`believe-java` dependency](#installation) with `believe-java-core`\n2. Copy `believe-java-client-okhttp`\'s [`OkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`believe-java` dependency](#installation) with `believe-java-core`\n2. Write a class that implements the [`HttpClient`](believe-java-core/src/main/kotlin/com/believe/api/core/http/HttpClient.kt) interface\n3. Construct [`BelieveClientImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-java-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-java-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport com.believe.api.models.characters.CharacterListParams;\n\nCharacterListParams params = CharacterListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport com.believe.api.models.characters.CharacterCreateParams;\nimport com.believe.api.models.characters.EmotionalStats;\n\nCharacterCreateParams params = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt) object to its setter:\n\n```java\nimport com.believe.api.models.characters.CharacterListParams;\n\nCharacterListParams params = CharacterListParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](believe-java-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```java\nimport com.believe.api.core.JsonMissing;\nimport com.believe.api.models.characters.CharacterCreateParams;\nimport com.believe.api.models.characters.CharacterListParams;\nimport com.believe.api.models.characters.CharacterRole;\nimport com.believe.api.models.characters.EmotionalStats;\nimport java.util.List;\n\nCharacterListParams params = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .curiosity(40L)\n .empathy(85L)\n .optimism(45L)\n .resilience(95L)\n .vulnerability(60L)\n .build())\n .name("Roy Kent")\n .personalityTraits(List.of(\n "intense",\n "loyal",\n "secretly caring",\n "profane"\n ))\n .role(CharacterRole.COACH)\n .background(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.believe.api.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.characters().create(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.believe.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField<String> background = client.characters().create(params)._background();\n\nif (background.isMissing()) {\n // The property is absent from the JSON response\n} else if (background.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = background.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = background.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`BelieveInvalidDataException`](believe-java-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt) only if you directly access the property.\n\nIf you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.believe.api.models.characters.Character;\n\nCharacter character = client.characters().create(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.believe.api.models.characters.CharacterListPage;\n\nCharacterListPage page = client.characters().list(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.believe.api.client.BelieveClient;\nimport com.believe.api.client.okhttp.BelieveOkHttpClient;\n\nBelieveClient client = BelieveOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-java/issues) with questions, bugs, or suggestions.\n',
|
|
4350
5096
|
},
|
|
4351
5097
|
{
|
|
4352
5098
|
language: 'kotlin',
|
|
4353
5099
|
content:
|
|
4354
|
-
'# Believe Kotlin API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/com.believe.api/believe-kotlin/0.0.1)\n[](https://javadoc.io/doc/com.believe.api/believe-kotlin/0.0.1)\n<!-- x-release-please-end -->\n\nThe Believe Kotlin SDK provides convenient access to the Believe REST API from applications written in Kotlin.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJuYW1lIjoiQGNqYXZkZXYvYmVsaWV2ZS1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9iZWxpZXZlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYmVsaWV2ZS1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fbelieve.stlmcp.com%22%2C%22headers%22%3A%7B%22x-believe-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nKDocs are available on [javadoc.io](https://javadoc.io/doc/com.believe.api/believe-kotlin/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.believe.api:believe-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.believe.api</groupId>\n <artifactId>believe-kotlin</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterListPage\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\nval page: CharacterListPage = client.characters().list()\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .apiKey("My API Key")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n // Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n // Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | ----------------- | -------------------- | -------- | ---------------------------- |\n| `apiKey` | `believe.apiKey` | `BELIEVE_API_KEY` | true | - |\n| `baseUrl` | `believe.baseUrl` | `BELIEVE_BASE_URL` | true | `"https://believe.cjav.dev"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\n\nval clientWithOptions: BelieveClient = client.withOptions {\n it.baseUrl("https://example.com")\n it.maxRetries(42)\n}\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Believe API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Kotlin class.\n\nFor example, `client.characters().list(...)` should be called with an instance of `CharacterListParams`, and it will return an instance of `CharacterListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterListPageAsync\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\nval page: CharacterListPageAsync = client.async().characters().list()\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.believe.api.client.BelieveClientAsync\nimport com.believe.api.client.okhttp.BelieveOkHttpClientAsync\nimport com.believe.api.models.characters.CharacterListPageAsync\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClientAsync = BelieveOkHttpClientAsync.fromEnv()\n\nval page: CharacterListPageAsync = client.characters().list()\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods are [suspending](https://kotlinlang.org/docs/coroutines-guide.html).\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.nio.file.Paths\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(Paths.get("/path/to/file"))\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.net.URL\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(URL("https://example.com//path/to/file").openStream())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nOr a `ByteArray`:\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file("content".toByteArray())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```kotlin\nimport com.believe.api.core.MultipartField\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.io.InputStream\nimport java.net.URL\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(MultipartField.builder<InputStream>()\n .value(URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Kotlin classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```kotlin\nimport com.believe.api.core.http.Headers\nimport com.believe.api.core.http.HttpResponseFor\nimport com.believe.api.models.characters.CharacterListPage\nimport com.believe.api.models.characters.CharacterListParams\n\nval page: HttpResponseFor<CharacterListPage> = client.characters().withRawResponse().list()\n\nval statusCode: Int = page.statusCode()\nval headers: Headers = page.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval parsedPage: CharacterListPage = page.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`BelieveServiceException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`BelieveIoException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveIoException.kt): I/O networking errors.\n\n- [`BelieveRetryableException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`BelieveInvalidDataException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`BelieveException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns a [`Sequence`](https://kotlinlang.org/docs/sequences.html)\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list()\npage.autoPager()\n .take(50)\n .forEach { character -> println(character) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPageAsync\n\nval page: CharacterListPageAsync = client.async().characters().list()\npage.autoPager()\n .take(50)\n .forEach { character -> println(character) }\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```kotlin\nimport com.believe.api.models.characters.Character\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list()\nwhile (true) {\n for (character in page.items()) {\n println(character)\n }\n\n if (!page.hasNextPage()) {\n break\n }\n\n page = page.nextPage()\n}\n```\n\n## Logging\n\nThe SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).\n\nEnable logging by setting the `BELIEVE_LOG` environment variable to `info`:\n\n```sh\nexport BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport BELIEVE_LOG=debug\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `believe-kotlin-core` is published with a [configuration file](believe-kotlin-core/src/main/resources/META-INF/proguard/believe-kotlin-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build()\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build())\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.time.Duration\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build()\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .proxy(Proxy(\n Proxy.Type.HTTP, InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build()\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.time.Duration\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build()\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build()\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `believe-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveClient`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClient.kt), [`BelieveClientAsync`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsync.kt), [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt), and [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), all of which can work with any HTTP client\n- `believe-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) and [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), which provide a way to construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) and [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), respectively, using OkHttp\n- `believe-kotlin`\n - Depends on and exposes the APIs of both `believe-kotlin-core` and `believe-kotlin-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`believe-kotlin` dependency](#installation) with `believe-kotlin-core`\n2. Copy `believe-kotlin-client-okhttp`\'s [`OkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`believe-kotlin` dependency](#installation) with `believe-kotlin-core`\n2. Write a class that implements the [`HttpClient`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/http/HttpClient.kt) interface\n3. Construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```kotlin\nimport com.believe.api.core.JsonValue\nimport com.believe.api.models.characters.CharacterListParams\n\nval params: CharacterListParams = CharacterListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build()\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```kotlin\nimport com.believe.api.core.JsonValue\nimport com.believe.api.models.characters.CharacterCreateParams\nimport com.believe.api.models.characters.EmotionalStats\n\nval params: CharacterCreateParams = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build()\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListParams\n\nval params: CharacterListParams = CharacterListParams.builder().build()\n```\n\nThe most straightforward way to create a [`JsonValue`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.believe.api.core.JsonValue\n\n// Create primitive JSON values\nval nullValue: JsonValue = JsonValue.from(null)\nval booleanValue: JsonValue = JsonValue.from(true)\nval numberValue: JsonValue = JsonValue.from(42)\nval stringValue: JsonValue = JsonValue.from("Hello World!")\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nval arrayValue: JsonValue = JsonValue.from(listOf(\n "Hello", "World"\n))\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nval objectValue: JsonValue = JsonValue.from(mapOf(\n "a" to 1, "b" to 2\n))\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nval complexValue: JsonValue = JsonValue.from(mapOf(\n "a" to listOf(\n 1, 2\n ), "b" to listOf(\n 3, 4\n )\n))\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```kotlin\nimport com.believe.api.core.JsonMissing\nimport com.believe.api.models.characters.CharacterCreateParams\nimport com.believe.api.models.characters.CharacterListParams\nimport com.believe.api.models.characters.CharacterRole\nimport com.believe.api.models.characters.EmotionalStats\n\nval params: CharacterListParams = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .curiosity(40L)\n .empathy(85L)\n .optimism(45L)\n .resilience(95L)\n .vulnerability(60L)\n .build())\n .name("Roy Kent")\n .personalityTraits(listOf(\n "intense",\n "loyal",\n "secretly caring",\n "profane",\n ))\n .role(CharacterRole.COACH)\n .background(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.believe.api.core.JsonBoolean\nimport com.believe.api.core.JsonNull\nimport com.believe.api.core.JsonNumber\nimport com.believe.api.core.JsonValue\n\nval additionalProperties: Map<String, JsonValue> = client.characters().create(params)._additionalProperties()\nval secretPropertyValue: JsonValue = additionalProperties.get("secretProperty")\n\nval result = when (secretPropertyValue) {\n is JsonNull -> "It\'s null!"\n is JsonBoolean -> "It\'s a boolean!"\n is JsonNumber -> "It\'s a number!"\n // Other types include `JsonMissing`, `JsonString`, `JsonArray`, and `JsonObject`\n else -> "It\'s something else!"\n}\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```kotlin\nimport com.believe.api.core.JsonField\n\nval background: JsonField<String> = client.characters().create(params)._background()\n\nif (background.isMissing()) {\n // The property is absent from the JSON response\n} else if (background.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n val jsonString: String? = background.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = background.asUnknown()!!.convert(MyClass::class.java)\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`BelieveInvalidDataException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt) only if you directly access the property.\n\nIf you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```kotlin\nimport com.believe.api.models.characters.Character\n\nval character: Character = client.characters().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list(RequestOptions.builder().responseValidation(true).build())\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build()\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nKotlin `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-kotlin/issues) with questions, bugs, or suggestions.\n',
|
|
5100
|
+
'# Believe Kotlin API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/com.believe.api/believe-kotlin/0.0.1)\n[](https://javadoc.io/doc/com.believe.api/believe-kotlin/0.0.1)\n<!-- x-release-please-end -->\n\nThe Believe Kotlin SDK provides convenient access to the Believe REST API from applications written in Kotlin.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Believe MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40cjavdev%2Fbelieve-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjamF2ZGV2L2JlbGlldmUtbWNwIl0sImVudiI6eyJCRUxJRVZFX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40cjavdev%2Fbelieve-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cjavdev%2Fbelieve-mcp%22%5D%2C%22env%22%3A%7B%22BELIEVE_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nKDocs are available on [javadoc.io](https://javadoc.io/doc/com.believe.api/believe-kotlin/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.believe.api:believe-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.believe.api</groupId>\n <artifactId>believe-kotlin</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterListPage\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\nval page: CharacterListPage = client.characters().list()\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .apiKey("My API Key")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n // Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n // Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | ----------------- | -------------------- | -------- | ---------------------------- |\n| `apiKey` | `believe.apiKey` | `BELIEVE_API_KEY` | true | - |\n| `baseUrl` | `believe.baseUrl` | `BELIEVE_BASE_URL` | true | `"https://believe.cjav.dev"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\n\nval clientWithOptions: BelieveClient = client.withOptions {\n it.baseUrl("https://example.com")\n it.maxRetries(42)\n}\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Believe API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Kotlin class.\n\nFor example, `client.characters().list(...)` should be called with an instance of `CharacterListParams`, and it will return an instance of `CharacterListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport com.believe.api.models.characters.CharacterListPageAsync\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClient = BelieveOkHttpClient.fromEnv()\n\nval page: CharacterListPageAsync = client.async().characters().list()\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.believe.api.client.BelieveClientAsync\nimport com.believe.api.client.okhttp.BelieveOkHttpClientAsync\nimport com.believe.api.models.characters.CharacterListPageAsync\nimport com.believe.api.models.characters.CharacterListParams\n\n// Configures using the `believe.apiKey` and `believe.baseUrl` system properties\n// Or configures using the `BELIEVE_API_KEY` and `BELIEVE_BASE_URL` environment variables\nval client: BelieveClientAsync = BelieveOkHttpClientAsync.fromEnv()\n\nval page: CharacterListPageAsync = client.characters().list()\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods are [suspending](https://kotlinlang.org/docs/coroutines-guide.html).\n\n\n\n## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.nio.file.Paths\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(Paths.get("/path/to/file"))\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.net.URL\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(URL("https://example.com//path/to/file").openStream())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nOr a `ByteArray`:\n\n```kotlin\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file("content".toByteArray())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```kotlin\nimport com.believe.api.core.MultipartField\nimport com.believe.api.models.teams.logo.FileUpload\nimport com.believe.api.models.teams.logo.LogoUploadParams\nimport java.io.InputStream\nimport java.net.URL\n\nval params: LogoUploadParams = LogoUploadParams.builder()\n .teamId("team_id")\n .file(MultipartField.builder<InputStream>()\n .value(URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build()\nval fileUpload: FileUpload = client.teams().logo().upload(params)\n```\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Kotlin classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```kotlin\nimport com.believe.api.core.http.Headers\nimport com.believe.api.core.http.HttpResponseFor\nimport com.believe.api.models.characters.CharacterListPage\nimport com.believe.api.models.characters.CharacterListParams\n\nval page: HttpResponseFor<CharacterListPage> = client.characters().withRawResponse().list()\n\nval statusCode: Int = page.statusCode()\nval headers: Headers = page.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval parsedPage: CharacterListPage = page.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`BelieveServiceException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`BelieveIoException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveIoException.kt): I/O networking errors.\n\n- [`BelieveRetryableException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`BelieveInvalidDataException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`BelieveException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns a [`Sequence`](https://kotlinlang.org/docs/sequences.html)\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list()\npage.autoPager()\n .take(50)\n .forEach { character -> println(character) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPageAsync\n\nval page: CharacterListPageAsync = client.async().characters().list()\npage.autoPager()\n .take(50)\n .forEach { character -> println(character) }\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```kotlin\nimport com.believe.api.models.characters.Character\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list()\nwhile (true) {\n for (character in page.items()) {\n println(character)\n }\n\n if (!page.hasNextPage()) {\n break\n }\n\n page = page.nextPage()\n}\n```\n\n## Logging\n\nThe SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).\n\nEnable logging by setting the `BELIEVE_LOG` environment variable to `info`:\n\n```sh\nexport BELIEVE_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport BELIEVE_LOG=debug\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `believe-kotlin-core` is published with a [configuration file](believe-kotlin-core/src/main/resources/META-INF/proguard/believe-kotlin-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build()\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build())\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.time.Duration\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build()\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .proxy(Proxy(\n Proxy.Type.HTTP, InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build()\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\nimport java.time.Duration\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build()\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build()\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `believe-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveClient`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClient.kt), [`BelieveClientAsync`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsync.kt), [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt), and [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), all of which can work with any HTTP client\n- `believe-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) and [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), which provide a way to construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) and [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), respectively, using OkHttp\n- `believe-kotlin`\n - Depends on and exposes the APIs of both `believe-kotlin-core` and `believe-kotlin-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`believe-kotlin` dependency](#installation) with `believe-kotlin-core`\n2. Copy `believe-kotlin-client-okhttp`\'s [`OkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`believe-kotlin` dependency](#installation) with `believe-kotlin-core`\n2. Write a class that implements the [`HttpClient`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/http/HttpClient.kt) interface\n3. Construct [`BelieveClientImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientImpl.kt) or [`BelieveClientAsyncImpl`](believe-kotlin-core/src/main/kotlin/com/believe/api/client/BelieveClientAsyncImpl.kt), similarly to [`BelieveOkHttpClient`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClient.kt) or [`BelieveOkHttpClientAsync`](believe-kotlin-client-okhttp/src/main/kotlin/com/believe/api/client/okhttp/BelieveOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```kotlin\nimport com.believe.api.core.JsonValue\nimport com.believe.api.models.characters.CharacterListParams\n\nval params: CharacterListParams = CharacterListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build()\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```kotlin\nimport com.believe.api.core.JsonValue\nimport com.believe.api.models.characters.CharacterCreateParams\nimport com.believe.api.models.characters.EmotionalStats\n\nval params: CharacterCreateParams = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build()\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListParams\n\nval params: CharacterListParams = CharacterListParams.builder().build()\n```\n\nThe most straightforward way to create a [`JsonValue`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.believe.api.core.JsonValue\n\n// Create primitive JSON values\nval nullValue: JsonValue = JsonValue.from(null)\nval booleanValue: JsonValue = JsonValue.from(true)\nval numberValue: JsonValue = JsonValue.from(42)\nval stringValue: JsonValue = JsonValue.from("Hello World!")\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nval arrayValue: JsonValue = JsonValue.from(listOf(\n "Hello", "World"\n))\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nval objectValue: JsonValue = JsonValue.from(mapOf(\n "a" to 1, "b" to 2\n))\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nval complexValue: JsonValue = JsonValue.from(mapOf(\n "a" to listOf(\n 1, 2\n ), "b" to listOf(\n 3, 4\n )\n))\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](believe-kotlin-core/src/main/kotlin/com/believe/api/core/Values.kt):\n\n```kotlin\nimport com.believe.api.core.JsonMissing\nimport com.believe.api.models.characters.CharacterCreateParams\nimport com.believe.api.models.characters.CharacterListParams\nimport com.believe.api.models.characters.CharacterRole\nimport com.believe.api.models.characters.EmotionalStats\n\nval params: CharacterListParams = CharacterCreateParams.builder()\n .emotionalStats(EmotionalStats.builder()\n .curiosity(40L)\n .empathy(85L)\n .optimism(45L)\n .resilience(95L)\n .vulnerability(60L)\n .build())\n .name("Roy Kent")\n .personalityTraits(listOf(\n "intense",\n "loyal",\n "secretly caring",\n "profane",\n ))\n .role(CharacterRole.COACH)\n .background(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.believe.api.core.JsonBoolean\nimport com.believe.api.core.JsonNull\nimport com.believe.api.core.JsonNumber\nimport com.believe.api.core.JsonValue\n\nval additionalProperties: Map<String, JsonValue> = client.characters().create(params)._additionalProperties()\nval secretPropertyValue: JsonValue = additionalProperties.get("secretProperty")\n\nval result = when (secretPropertyValue) {\n is JsonNull -> "It\'s null!"\n is JsonBoolean -> "It\'s a boolean!"\n is JsonNumber -> "It\'s a number!"\n // Other types include `JsonMissing`, `JsonString`, `JsonArray`, and `JsonObject`\n else -> "It\'s something else!"\n}\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```kotlin\nimport com.believe.api.core.JsonField\n\nval background: JsonField<String> = client.characters().create(params)._background()\n\nif (background.isMissing()) {\n // The property is absent from the JSON response\n} else if (background.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n val jsonString: String? = background.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = background.asUnknown()!!.convert(MyClass::class.java)\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`BelieveInvalidDataException`](believe-kotlin-core/src/main/kotlin/com/believe/api/errors/BelieveInvalidDataException.kt) only if you directly access the property.\n\nIf you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```kotlin\nimport com.believe.api.models.characters.Character\n\nval character: Character = client.characters().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.believe.api.models.characters.CharacterListPage\n\nval page: CharacterListPage = client.characters().list(RequestOptions.builder().responseValidation(true).build())\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.believe.api.client.BelieveClient\nimport com.believe.api.client.okhttp.BelieveOkHttpClient\n\nval client: BelieveClient = BelieveOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build()\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nKotlin `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/cjavdev/believe-kotlin/issues) with questions, bugs, or suggestions.\n',
|
|
5101
|
+
},
|
|
5102
|
+
{
|
|
5103
|
+
language: 'csharp',
|
|
5104
|
+
content:
|
|
5105
|
+
'# Believe C# API Library\n\nThe Believe C# SDK provides convenient access to the Believe REST API from applications written in C#.\n\n## Installation\n\n```bash\ngit clone git@github.com:cjavdev/believe-csharp.git\ndotnet add reference believe-csharp/src/Believe\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nBelieveClient client = new();\n\nCharacterListParams parameters = new();\n\nvar page = await client.Characters.List(parameters);\n\nConsole.WriteLine(page);\n```',
|
|
4355
5106
|
},
|
|
4356
5107
|
{
|
|
4357
5108
|
language: 'cli',
|
|
4358
5109
|
content:
|
|
4359
5110
|
"# Believe CLI\n\nThe official CLI for the Believe REST API.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n<!-- x-release-please-start-version -->\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/cjavdev/believe-cli/cmd/believe@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n<!-- x-release-please-end -->\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nbelieve [resource] <command> [flags...]\n~~~\n\n~~~sh\nbelieve characters list \\\n --api-key 'My API Key'\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| -------------------- | -------- |\n| `BELIEVE_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `BELIEVE_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nbelieve <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nbelieve <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nbelieve <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\nbelieve <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nbelieve <command> --arg @data://file.txt\n~~~\n",
|
|
4360
5111
|
},
|
|
5112
|
+
{
|
|
5113
|
+
language: 'php',
|
|
5114
|
+
content:
|
|
5115
|
+
'# Believe PHP API Library\n\nThe Believe PHP library provides convenient access to the Believe REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n<!-- x-release-please-start-version -->\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:cjavdev/believe-php.git"\n }\n ],\n "require": {\n "org-placeholder/believe": "dev-main"\n }\n}\n```\n<!-- x-release-please-end -->\n\n## Usage\n\n```php\n<?php\n\n$client = new Client(apiKey: getenv(\'BELIEVE_API_KEY\') ?: \'My API Key\');\n\n$page = $client->characters->list();\n\nvar_dump($page->id);\n```',
|
|
5116
|
+
},
|
|
4361
5117
|
];
|
|
4362
5118
|
|
|
4363
5119
|
const INDEX_OPTIONS = {
|