File tree Expand file tree Collapse file tree
src/resources/generations
tests/api-resources/generations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- configured_endpoints : 9
2- openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-77915e19d91e49806410e1f72c98350af91b90cc9757cc502214e532d51016fe .yml
3- openapi_spec_hash : 5a8e2fe22b4400e78b88621090f145d8
1+ configured_endpoints : 10
2+ openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-ab7a0e79cde55b79693fcafeb72a5f691be8fe87b60909f8fabf4823107ec2b7 .yml
3+ openapi_spec_hash : 5e861f2431bafd7b34733b013e89a917
44config_hash : 340ab81846cdf3a6dd774f425fd612aa
Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ Methods:
1616
1717## Concepts
1818
19+ Types:
20+
21+ - <code ><a href =" ./src/resources/generations/concepts.ts " >ConceptListResponse</a ></code >
22+
23+ Methods:
24+
25+ - <code title =" get /generations/concepts/list " >client.generations.concepts.<a href =" ./src/resources/generations/concepts.ts " >list</a >() -> ConceptListResponse</code >
26+
1927## Image
2028
2129Methods:
Original file line number Diff line number Diff line change 11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import { APIResource } from '../../resource' ;
4+ import * as Core from '../../core' ;
45
5- export class Concepts extends APIResource { }
6+ export class Concepts extends APIResource {
7+ /**
8+ * Get all possible concepts
9+ */
10+ list ( options ?: Core . RequestOptions ) : Core . APIPromise < ConceptListResponse > {
11+ return this . _client . get ( '/generations/concepts/list' , options ) ;
12+ }
13+ }
14+
15+ export type ConceptListResponse = Array < string > ;
16+
17+ export declare namespace Concepts {
18+ export { type ConceptListResponse as ConceptListResponse } ;
19+ }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { APIResource } from '../../resource';
44import { isRequestOptions } from '../../core' ;
55import * as Core from '../../core' ;
66import * as ConceptsAPI from './concepts' ;
7- import { Concepts } from './concepts' ;
7+ import { ConceptListResponse , Concepts } from './concepts' ;
88import * as ImageAPI from './image' ;
99import { Image , ImageCreateParams } from './image' ;
1010import * as VideoAPI from './video' ;
@@ -639,7 +639,7 @@ export declare namespace Generations {
639639 type GenerationUpscaleParams as GenerationUpscaleParams ,
640640 } ;
641641
642- export { Concepts as Concepts } ;
642+ export { Concepts as Concepts , type ConceptListResponse as ConceptListResponse } ;
643643
644644 export { Image as Image , type ImageCreateParams as ImageCreateParams } ;
645645
Original file line number Diff line number Diff line change 11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
3- export { Concepts } from './concepts' ;
3+ export { Concepts , type ConceptListResponse } from './concepts' ;
44export {
55 Generations ,
66 type Generation ,
Original file line number Diff line number Diff line change 1+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+ import LumaAI from 'lumaai' ;
4+ import { Response } from 'node-fetch' ;
5+
6+ const client = new LumaAI ( {
7+ authToken : 'My Auth Token' ,
8+ baseURL : process . env [ 'TEST_API_BASE_URL' ] ?? 'http://127.0.0.1:4010' ,
9+ } ) ;
10+
11+ describe ( 'resource concepts' , ( ) => {
12+ test ( 'list' , async ( ) => {
13+ const responsePromise = client . generations . concepts . list ( ) ;
14+ const rawResponse = await responsePromise . asResponse ( ) ;
15+ expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
16+ const response = await responsePromise ;
17+ expect ( response ) . not . toBeInstanceOf ( Response ) ;
18+ const dataAndResponse = await responsePromise . withResponse ( ) ;
19+ expect ( dataAndResponse . data ) . toBe ( response ) ;
20+ expect ( dataAndResponse . response ) . toBe ( rawResponse ) ;
21+ } ) ;
22+
23+ test ( 'list: request options instead of params are passed correctly' , async ( ) => {
24+ // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25+ await expect ( client . generations . concepts . list ( { path : '/_stainless_unknown_path' } ) ) . rejects . toThrow (
26+ LumaAI . NotFoundError ,
27+ ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments