@mikle7/litty-api-client
Version:
TypeScript client for Litty API with clean, semantic type definitions
81 lines (80 loc) • 4.4 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Litty API
* Complete API documentation for the Litty platform. ## Authentication Most endpoints require authentication via Supabase JWT tokens. Include the token in the Authorization header: `Bearer <token>` ## API Structure - **Contests**: Create and manage contests, entries, and settlements - **Markets**: Manage prediction markets within contests - **Transactions**: Handle financial transactions for contest entries and rewards - **Wallet**: Manage user wallet balances (cashable, points, tickets) - **Users**: User management and profiles - **Leaderboards**: Competition rankings and scoring - **Uploads**: File upload management - **Shows**: TV show and episode management (admin only) ## Response Formats All endpoints return JSON responses with consistent error handling. Error responses include `statusCode`, `message`, and `error` fields.
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateContestRequestToJSONTyped = exports.CreateContestRequestToJSON = exports.CreateContestRequestFromJSONTyped = exports.CreateContestRequestFromJSON = exports.instanceOfCreateContestRequest = void 0;
const CreateContestRequestEntriesInner_1 = require("./CreateContestRequestEntriesInner");
/**
* Check if a given object implements the CreateContestRequest interface.
*/
function instanceOfCreateContestRequest(value) {
if (!('name' in value) || value['name'] === undefined)
return false;
if (!('contestTypeId' in value) || value['contestTypeId'] === undefined)
return false;
if (!('startDate' in value) || value['startDate'] === undefined)
return false;
if (!('endDate' in value) || value['endDate'] === undefined)
return false;
if (!('entries' in value) || value['entries'] === undefined)
return false;
return true;
}
exports.instanceOfCreateContestRequest = instanceOfCreateContestRequest;
function CreateContestRequestFromJSON(json) {
return CreateContestRequestFromJSONTyped(json, false);
}
exports.CreateContestRequestFromJSON = CreateContestRequestFromJSON;
function CreateContestRequestFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'name': json['name'],
'contestTypeId': json['contestTypeId'],
'episodeId': json['episodeId'] == null ? undefined : json['episodeId'],
'showIds': json['showIds'] == null ? undefined : json['showIds'],
'seasonIds': json['seasonIds'] == null ? undefined : json['seasonIds'],
'episodeIds': json['episodeIds'] == null ? undefined : json['episodeIds'],
'isStandalone': json['isStandalone'] == null ? undefined : json['isStandalone'],
'imageUrl': json['imageUrl'] == null ? undefined : json['imageUrl'],
'startDate': (new Date(json['startDate'])),
'endDate': (new Date(json['endDate'])),
'entries': (json['entries'].map(CreateContestRequestEntriesInner_1.CreateContestRequestEntriesInnerFromJSON)),
};
}
exports.CreateContestRequestFromJSONTyped = CreateContestRequestFromJSONTyped;
function CreateContestRequestToJSON(json) {
return CreateContestRequestToJSONTyped(json, false);
}
exports.CreateContestRequestToJSON = CreateContestRequestToJSON;
function CreateContestRequestToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'name': value['name'],
'contestTypeId': value['contestTypeId'],
'episodeId': value['episodeId'],
'showIds': value['showIds'],
'seasonIds': value['seasonIds'],
'episodeIds': value['episodeIds'],
'isStandalone': value['isStandalone'],
'imageUrl': value['imageUrl'],
'startDate': ((value['startDate']).toISOString()),
'endDate': ((value['endDate']).toISOString()),
'entries': (value['entries'].map(CreateContestRequestEntriesInner_1.CreateContestRequestEntriesInnerToJSON)),
};
}
exports.CreateContestRequestToJSONTyped = CreateContestRequestToJSONTyped;