@@ -17,7 +17,8 @@ Developer-friendly & type-safe Typescript SDK specifically catered to leverage _
1717<!-- Start Summary [summary] -->
1818## Summary
1919
20- Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events
20+ Speakeasy Code Samples API: REST APIs for retrieving SDK usage snippets from the Speakeasy Code Samples API.
21+
2122
2223For more information about the API: [ The Speakeasy Platform Documentation] ( /docs )
2324<!-- End Summary [summary] -->
@@ -111,7 +112,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
111112
112113async function run() {
113114 const result = await speakeasyCodeSamples .codeSamples .get ({
114- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
115+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
116+ operationIds: [
117+ " getPetById" ,
118+ ],
119+ languages: [
120+ " python" ,
121+ ],
115122 });
116123
117124 // Handle the result
@@ -188,7 +195,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
188195
189196async function run() {
190197 const result = await speakeasyCodeSamples .codeSamples .get ({
191- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
198+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
199+ operationIds: [
200+ " getPetById" ,
201+ ],
202+ languages: [
203+ " python" ,
204+ ],
192205 });
193206
194207 // Handle the result
@@ -208,7 +221,7 @@ run();
208221
209222### [ codeSamples] ( docs/sdks/codesamples/README.md )
210223
211- * [ get] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets from document stored in the registry
224+ * [ get] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets
212225
213226
214227</details >
@@ -229,7 +242,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
229242
230243<summary >Available standalone functions</summary >
231244
232- - [ ` codeSamplesGet ` ] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets from document stored in the registry
245+ - [ ` codeSamplesGet ` ] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets
233246
234247</details >
235248<!-- End Standalone functions [standalone-funcs] -->
@@ -256,7 +269,7 @@ To learn about this feature and how to get started, check
256269
257270<summary >Available React hooks</summary >
258271
259- - [ ` useCodeSamplesGet ` ] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets from document stored in the registry
272+ - [ ` useCodeSamplesGet ` ] ( docs/sdks/codesamples/README.md#get ) - Retrieve usage snippets
260273
261274</details >
262275<!-- End React hooks with TanStack Query [react-query] -->
@@ -289,7 +302,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
289302
290303async function run() {
291304 const result = await speakeasyCodeSamples .codeSamples .get ({
292- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
305+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
306+ operationIds: [
307+ " getPetById" ,
308+ ],
309+ languages: [
310+ " python" ,
311+ ],
293312 });
294313
295314 // Handle the result
@@ -317,7 +336,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
317336
318337async function run() {
319338 const result = await speakeasyCodeSamples .codeSamples .get ({
320- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
339+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
340+ operationIds: [
341+ " getPetById" ,
342+ ],
343+ languages: [
344+ " python" ,
345+ ],
321346 }, {
322347 retries: {
323348 strategy: " backoff" ,
@@ -360,7 +385,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
360385
361386async function run() {
362387 const result = await speakeasyCodeSamples .codeSamples .get ({
363- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
388+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
389+ operationIds: [
390+ " getPetById" ,
391+ ],
392+ languages: [
393+ " python" ,
394+ ],
364395 });
365396
366397 // Handle the result
@@ -400,7 +431,13 @@ async function run() {
400431 let result;
401432 try {
402433 result = await speakeasyCodeSamples .codeSamples .get ({
403- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
434+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
435+ operationIds: [
436+ " getPetById" ,
437+ ],
438+ languages: [
439+ " python" ,
440+ ],
404441 });
405442
406443 // Handle the result
@@ -469,7 +506,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
469506
470507async function run() {
471508 const result = await speakeasyCodeSamples .codeSamples .get ({
472- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
509+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
510+ operationIds: [
511+ " getPetById" ,
512+ ],
513+ languages: [
514+ " python" ,
515+ ],
473516 });
474517
475518 // Handle the result
@@ -494,7 +537,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({
494537
495538async function run() {
496539 const result = await speakeasyCodeSamples .codeSamples .get ({
497- registryUrl: " https://spec.speakeasy.com/org/ws/my-source" ,
540+ registryUrl: " https://spec.speakeasy.com/my-org/my-workspace/my-source" ,
541+ operationIds: [
542+ " getPetById" ,
543+ ],
544+ languages: [
545+ " python" ,
546+ ],
498547 });
499548
500549 // Handle the result
0 commit comments