|
| 1 | +/** |
| 2 | + * This file was auto-generated by Fern from our API Definition. |
| 3 | + */ |
| 4 | +import * as environments from "../../../../../../environments"; |
| 5 | +import * as core from "../../../../../../core"; |
| 6 | +import * as TrophyApi from "../../../../.."; |
| 7 | +export declare namespace Attributes { |
| 8 | + interface Options { |
| 9 | + environment?: core.Supplier<environments.TrophyApiEnvironment | environments.TrophyApiEnvironmentUrls>; |
| 10 | + apiKey: core.Supplier<string>; |
| 11 | + } |
| 12 | + interface RequestOptions { |
| 13 | + timeoutInSeconds?: number; |
| 14 | + maxRetries?: number; |
| 15 | + } |
| 16 | +} |
| 17 | +export declare class Attributes { |
| 18 | + protected readonly _options: Attributes.Options; |
| 19 | + constructor(_options: Attributes.Options); |
| 20 | + /** |
| 21 | + * List attributes. |
| 22 | + * @throws {@link TrophyApi.UnauthorizedError} |
| 23 | + * @throws {@link TrophyApi.UnprocessableEntityError} |
| 24 | + * |
| 25 | + * @example |
| 26 | + * await trophyApi.admin.attributes.list({ |
| 27 | + * limit: 1, |
| 28 | + * skip: 1 |
| 29 | + * }) |
| 30 | + */ |
| 31 | + list(request?: TrophyApi.admin.AttributesListRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.ListAttributesResponse>; |
| 32 | + /** |
| 33 | + * Create attributes in bulk. |
| 34 | + * @throws {@link TrophyApi.UnauthorizedError} |
| 35 | + * @throws {@link TrophyApi.UnprocessableEntityError} |
| 36 | + * |
| 37 | + * @example |
| 38 | + * await trophyApi.admin.attributes.create([{ |
| 39 | + * name: "Plan", |
| 40 | + * key: "plan", |
| 41 | + * type: TrophyApi.CreateAttributeRequestItemType.User |
| 42 | + * }, { |
| 43 | + * name: "Device", |
| 44 | + * key: "device", |
| 45 | + * type: TrophyApi.CreateAttributeRequestItemType.Event |
| 46 | + * }]) |
| 47 | + */ |
| 48 | + create(request: TrophyApi.CreateAttributesRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.CreateAttributesResponse>; |
| 49 | + /** |
| 50 | + * Delete attributes in bulk by ID. |
| 51 | + * @throws {@link TrophyApi.UnauthorizedError} |
| 52 | + * @throws {@link TrophyApi.UnprocessableEntityError} |
| 53 | + * |
| 54 | + * @example |
| 55 | + * await trophyApi.admin.attributes.delete({}) |
| 56 | + */ |
| 57 | + delete(request?: TrophyApi.admin.AttributesDeleteRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.DeleteAttributesResponse>; |
| 58 | + /** |
| 59 | + * Update attributes in bulk by ID. |
| 60 | + * @throws {@link TrophyApi.UnauthorizedError} |
| 61 | + * @throws {@link TrophyApi.UnprocessableEntityError} |
| 62 | + * |
| 63 | + * @example |
| 64 | + * await trophyApi.admin.attributes.update([{ |
| 65 | + * id: "550e8400-e29b-41d4-a716-446655440000", |
| 66 | + * name: "Subscription Plan" |
| 67 | + * }]) |
| 68 | + * |
| 69 | + * @example |
| 70 | + * await trophyApi.admin.attributes.update([{ |
| 71 | + * id: "550e8400-e29b-41d4-a716-446655440000", |
| 72 | + * name: "Subscription Plan" |
| 73 | + * }]) |
| 74 | + */ |
| 75 | + update(request: TrophyApi.UpdateAttributesRequest, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.UpdateAttributesResponse>; |
| 76 | + /** |
| 77 | + * Get an attribute by ID. |
| 78 | + * @throws {@link TrophyApi.UnauthorizedError} |
| 79 | + * @throws {@link TrophyApi.NotFoundError} |
| 80 | + * @throws {@link TrophyApi.UnprocessableEntityError} |
| 81 | + * |
| 82 | + * @example |
| 83 | + * await trophyApi.admin.attributes.get("550e8400-e29b-41d4-a716-446655440000") |
| 84 | + * |
| 85 | + * @example |
| 86 | + * await trophyApi.admin.attributes.get("550e8400-e29b-41d4-a716-446655440000") |
| 87 | + */ |
| 88 | + get(id: string, requestOptions?: Attributes.RequestOptions): Promise<TrophyApi.AdminAttribute>; |
| 89 | +} |
0 commit comments