@@ -80,6 +80,12 @@ import {
8080 transformJSONToScreenUpdateBody
8181} from '../models' ;
8282// @ts -ignore
83+ import {
84+ ScreenVariant ,
85+ transformScreenVariantToJSON ,
86+ transformJSONToScreenVariant
87+ } from '../models' ;
88+ // @ts -ignore
8389import {
8490 ScreenVersion ,
8591 transformScreenVersionToJSON ,
@@ -554,6 +560,104 @@ export const ScreensApiAxiosParamCreator = function (configuration?: Configurati
554560
555561
556562
563+ setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ;
564+ let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
565+ localVarRequestOptions . headers = { ...localVarHeaderParameter , ...headersFromBaseOptions , ...options . headers } ;
566+
567+ return {
568+ url : toPathString ( localVarUrlObj ) ,
569+ options : localVarRequestOptions ,
570+ } ;
571+ } ,
572+ /**
573+ * Get a screen variant by id
574+ * @summary Get a single screen variant
575+ * @param {string } projectId Project id
576+ * @param {string } variantId Screen variant id
577+ * @param {* } [options] Override http request option.
578+ * @throws {RequiredError }
579+ */
580+ getScreenVariant : async ( projectId : string , variantId : string , options : any = { } ) : Promise < RequestArgs > => {
581+ // verify required parameter 'projectId' is not null or undefined
582+ assertParamExists ( 'getScreenVariant' , 'projectId' , projectId )
583+ // verify required parameter 'variantId' is not null or undefined
584+ assertParamExists ( 'getScreenVariant' , 'variantId' , variantId )
585+ const localVarPath = `/v1/projects/{project_id}/screen_variants/{variant_id}`
586+ . replace ( `{${ "project_id" } }` , encodeURIComponent ( String ( projectId ) ) )
587+ . replace ( `{${ "variant_id" } }` , encodeURIComponent ( String ( variantId ) ) ) ;
588+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
589+ const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
590+ let baseOptions ;
591+ if ( configuration ) {
592+ baseOptions = configuration . baseOptions ;
593+ }
594+
595+ const localVarRequestOptions = { method : 'GET' , ...baseOptions , ...options } ;
596+ const localVarHeaderParameter = { } as any ;
597+ const localVarQueryParameter = { } as any ;
598+
599+ // authentication OAuth2 required
600+ // oauth required
601+ await setOAuthToObject ( localVarHeaderParameter , "OAuth2" , [ ] , configuration )
602+
603+ // authentication PersonalAccessToken required
604+ // http bearer authentication required
605+ await setBearerAuthToObject ( localVarHeaderParameter , configuration )
606+
607+
608+
609+ setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ;
610+ let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
611+ localVarRequestOptions . headers = { ...localVarHeaderParameter , ...headersFromBaseOptions , ...options . headers } ;
612+
613+ return {
614+ url : toPathString ( localVarUrlObj ) ,
615+ options : localVarRequestOptions ,
616+ } ;
617+ } ,
618+ /**
619+ * List all screen variants of the project
620+ * @summary Get screen variants
621+ * @param {string } projectId Project id
622+ * @param {number } [limit] Pagination limit
623+ * @param {number } [offset] Pagination offset
624+ * @param {* } [options] Override http request option.
625+ * @throws {RequiredError }
626+ */
627+ getScreenVariants : async ( projectId : string , limit ?: number , offset ?: number , options : any = { } ) : Promise < RequestArgs > => {
628+ // verify required parameter 'projectId' is not null or undefined
629+ assertParamExists ( 'getScreenVariants' , 'projectId' , projectId )
630+ const localVarPath = `/v1/projects/{project_id}/screen_variants`
631+ . replace ( `{${ "project_id" } }` , encodeURIComponent ( String ( projectId ) ) ) ;
632+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
633+ const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
634+ let baseOptions ;
635+ if ( configuration ) {
636+ baseOptions = configuration . baseOptions ;
637+ }
638+
639+ const localVarRequestOptions = { method : 'GET' , ...baseOptions , ...options } ;
640+ const localVarHeaderParameter = { } as any ;
641+ const localVarQueryParameter = { } as any ;
642+
643+ // authentication OAuth2 required
644+ // oauth required
645+ await setOAuthToObject ( localVarHeaderParameter , "OAuth2" , [ ] , configuration )
646+
647+ // authentication PersonalAccessToken required
648+ // http bearer authentication required
649+ await setBearerAuthToObject ( localVarHeaderParameter , configuration )
650+
651+ if ( limit !== undefined ) {
652+ localVarQueryParameter [ 'limit' ] = limit ;
653+ }
654+
655+ if ( offset !== undefined ) {
656+ localVarQueryParameter [ 'offset' ] = offset ;
657+ }
658+
659+
660+
557661 setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ;
558662 let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
559663 localVarRequestOptions . headers = { ...localVarHeaderParameter , ...headersFromBaseOptions , ...options . headers } ;
@@ -965,6 +1069,31 @@ export const ScreensApiFp = function(configuration?: Configuration) {
9651069 const localVarAxiosArgs = await localVarAxiosParamCreator . getScreenSections ( projectId , limit , offset , options ) ;
9661070 return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ;
9671071 } ,
1072+ /**
1073+ * Get a screen variant by id
1074+ * @summary Get a single screen variant
1075+ * @param {string } projectId Project id
1076+ * @param {string } variantId Screen variant id
1077+ * @param {* } [options] Override http request option.
1078+ * @throws {RequiredError }
1079+ */
1080+ async getScreenVariant ( projectId : string , variantId : string , options ?: any ) : Promise < ( axios ?: AxiosInstance , basePath ?: string ) => AxiosPromise < any > > {
1081+ const localVarAxiosArgs = await localVarAxiosParamCreator . getScreenVariant ( projectId , variantId , options ) ;
1082+ return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ;
1083+ } ,
1084+ /**
1085+ * List all screen variants of the project
1086+ * @summary Get screen variants
1087+ * @param {string } projectId Project id
1088+ * @param {number } [limit] Pagination limit
1089+ * @param {number } [offset] Pagination offset
1090+ * @param {* } [options] Override http request option.
1091+ * @throws {RequiredError }
1092+ */
1093+ async getScreenVariants ( projectId : string , limit ?: number , offset ?: number , options ?: any ) : Promise < ( axios ?: AxiosInstance , basePath ?: string ) => AxiosPromise < any > > {
1094+ const localVarAxiosArgs = await localVarAxiosParamCreator . getScreenVariants ( projectId , limit , offset , options ) ;
1095+ return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ;
1096+ } ,
9681097 /**
9691098 * Get details of the screen version
9701099 * @summary Get a single screen version
@@ -1122,6 +1251,28 @@ export interface ScreensApiGetScreenSectionsSearchParams {
11221251}
11231252
11241253
1254+ /**
1255+ * Search parameters for getScreenVariants operation in ScreensApi.
1256+ * @export
1257+ * @interface ScreensApiGetScreenVariantsSearchParams
1258+ */
1259+ export interface ScreensApiGetScreenVariantsSearchParams {
1260+ /**
1261+ * Pagination limit
1262+ * @type {number }
1263+ * @memberof ScreensApiGetScreenVariantsSearchParams
1264+ */
1265+ readonly limit ?: number ;
1266+
1267+ /**
1268+ * Pagination offset
1269+ * @type {number }
1270+ * @memberof ScreensApiGetScreenVariantsSearchParams
1271+ */
1272+ readonly offset ?: number ;
1273+ }
1274+
1275+
11251276/**
11261277 * Search parameters for getScreenVersions operation in ScreensApi.
11271278 * @export
@@ -1330,6 +1481,44 @@ export class ScreensApi extends BaseAPI {
13301481 } ;
13311482 }
13321483
1484+ /**
1485+ * Get a screen variant by id
1486+ * @summary Get a single screen variant
1487+ * @param {string } projectId Project id
1488+ * @param {string } variantId Screen variant id
1489+ * @param {* } [options] Override http request option.
1490+ * @throws {RequiredError }
1491+ * @memberof ScreensApi
1492+ */
1493+ public async getScreenVariant ( projectId : string , variantId : string , options ?: any ) : Promise < AxiosResponse < ScreenVariant > > {
1494+ const screensApiFp = ScreensApiFp ( this . configuration ) ;
1495+ const request = await screensApiFp . getScreenVariant ( projectId , variantId , options ) ;
1496+ const response = await request ( this . axios , this . basePath ) ;
1497+ return {
1498+ ...response ,
1499+ data : transformJSONToScreenVariant ( response . data )
1500+ } ;
1501+ }
1502+
1503+ /**
1504+ * List all screen variants of the project
1505+ * @summary Get screen variants
1506+ * @param {string } projectId Project id
1507+ * @param {ScreensApiGetScreenVariantsSearchParams } [searchParams] Search parameters.
1508+ * @param {* } [options] Override http request option.
1509+ * @throws {RequiredError }
1510+ * @memberof ScreensApi
1511+ */
1512+ public async getScreenVariants ( projectId : string , searchParams : ScreensApiGetScreenVariantsSearchParams = { } , options ?: any ) : Promise < AxiosResponse < Array < ScreenVariant > > > {
1513+ const screensApiFp = ScreensApiFp ( this . configuration ) ;
1514+ const request = await screensApiFp . getScreenVariants ( projectId , searchParams . limit , searchParams . offset , options ) ;
1515+ const response = await request ( this . axios , this . basePath ) ;
1516+ return {
1517+ ...response ,
1518+ data : response . data . map ( transformJSONToScreenVariant )
1519+ } ;
1520+ }
1521+
13331522 /**
13341523 * Get details of the screen version
13351524 * @summary Get a single screen version
0 commit comments