Skip to content

Commit 35f2632

Browse files
committed
vnull
1 parent 1b3f24c commit 35f2632

File tree

7 files changed

+368
-2
lines changed

7 files changed

+368
-2
lines changed

src/apis/screens-api.ts

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
8389
import {
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

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ export {
160160
ScreenNoteUpdateBody,
161161
ScreenSection,
162162
ScreenUpdateBody,
163+
ScreenVariant,
164+
ScreenVariantGroup,
165+
ScreenVariantVariants,
163166
ScreenVersion,
164167
ScreenVersionSummary,
165168
SnapshotImage,

src/models/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ export * from './screen-note-status-enum';
146146
export * from './screen-note-update-body';
147147
export * from './screen-section';
148148
export * from './screen-update-body';
149+
export * from './screen-variant';
150+
export * from './screen-variant-group';
151+
export * from './screen-variant-variants';
149152
export * from './screen-version';
150153
export * from './screen-version-summary';
151154
export * from './snapshot-image';

src/models/screen-variant-group.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Zeplin API
5+
* Access your resources in Zeplin
6+
*
7+
* Contact: [email protected]
8+
*
9+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10+
* https://openapi-generator.tech
11+
* Do not edit the class manually.
12+
*/
13+
14+
15+
16+
17+
export const transformScreenVariantGroupToJSON = function (value: ScreenVariantGroup): any {
18+
return {
19+
id: value.id,
20+
name: value.name
21+
}
22+
}
23+
24+
export const transformJSONToScreenVariantGroup = function (value: any): ScreenVariantGroup {
25+
return {
26+
id: value.id,
27+
name: value.name
28+
}
29+
}
30+
31+
/**
32+
* Variant group that contains the screen
33+
* @export
34+
* @interface ScreenVariantGroup
35+
*/
36+
export interface ScreenVariantGroup {
37+
/**
38+
* Unique id of the screen variant
39+
* @type {string}
40+
* @memberof ScreenVariantGroup
41+
*/
42+
id: string;
43+
/**
44+
* Name of the screen variant
45+
* @type {string}
46+
* @memberof ScreenVariantGroup
47+
*/
48+
name: string;
49+
}
50+
51+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Zeplin API
5+
* Access your resources in Zeplin
6+
*
7+
* Contact: [email protected]
8+
*
9+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10+
* https://openapi-generator.tech
11+
* Do not edit the class manually.
12+
*/
13+
14+
15+
16+
17+
export const transformScreenVariantVariantsToJSON = function (value: ScreenVariantVariants): any {
18+
return {
19+
screen_id: value.screenId,
20+
value: value.value
21+
}
22+
}
23+
24+
export const transformJSONToScreenVariantVariants = function (value: any): ScreenVariantVariants {
25+
return {
26+
screenId: value.screen_id,
27+
value: value.value
28+
}
29+
}
30+
31+
/**
32+
*
33+
* @export
34+
* @interface ScreenVariantVariants
35+
*/
36+
export interface ScreenVariantVariants {
37+
/**
38+
* Unique id of the variant screen
39+
* @type {string}
40+
* @memberof ScreenVariantVariants
41+
*/
42+
screenId: string;
43+
/**
44+
* Value for the variant
45+
* @type {string}
46+
* @memberof ScreenVariantVariants
47+
*/
48+
value: string;
49+
}
50+
51+

0 commit comments

Comments
 (0)