/* tslint:disable */ /* eslint-disable */ /** * Hathora Cloud API * Welcome to the Hathora Cloud API documentation! Learn how to use the Hathora Cloud APIs to build and scale your game servers globally. * * The version of the OpenAPI document: 0.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; import type { BuildRegionalContainerTagsInner } from './BuildRegionalContainerTagsInner'; import { BuildRegionalContainerTagsInnerFromJSON, BuildRegionalContainerTagsInnerFromJSONTyped, BuildRegionalContainerTagsInnerToJSON, } from './BuildRegionalContainerTagsInner'; import type { BuildStatus } from './BuildStatus'; import { BuildStatusFromJSON, BuildStatusFromJSONTyped, BuildStatusToJSON, } from './BuildStatus'; /** * A build represents a game server artifact and its associated metadata. * @export * @interface Build */ export interface Build { /** * Tag to associate an external version with a build. It is accessible via [`GetBuildInfo()`](https://hathora.dev/api#tag/BuildV2/operation/GetBuildInfo). * @type {string} * @memberof Build */ buildTag?: string | null; /** * * @type {Array} * @memberof Build * @deprecated */ regionalContainerTags: Array; /** * The size (in bytes) of the Docker image built by Hathora. * @type {number} * @memberof Build */ imageSize: number; /** * * @type {BuildStatus} * @memberof Build */ status: BuildStatus; /** * When the build was deleted. * @type {Date} * @memberof Build */ deletedAt: Date | null; /** * When [`RunBuild()`](https://hathora.dev/api#tag/BuildV2/operation/RunBuild) finished executing. * @type {Date} * @memberof Build */ finishedAt: Date | null; /** * When [`RunBuild()`](https://hathora.dev/api#tag/BuildV2/operation/RunBuild) is called. * @type {Date} * @memberof Build */ startedAt: Date | null; /** * When [`CreateBuild()`](https://hathora.dev/api#tag/BuildV2/operation/CreateBuild) is called. * @type {Date} * @memberof Build */ createdAt: Date; /** * UserId or email address for the user that created the build. * @type {string} * @memberof Build */ createdBy: string; /** * System generated id for a build. Increments by 1. * @type {number} * @memberof Build */ buildId: number; /** * System generated unique identifier for an application. * @type {string} * @memberof Build */ appId: string; } /** * Check if a given object implements the Build interface. */ export function instanceOfBuild(value: object): boolean { let isInstance = true; isInstance = isInstance && "regionalContainerTags" in value; isInstance = isInstance && "imageSize" in value; isInstance = isInstance && "status" in value; isInstance = isInstance && "deletedAt" in value; isInstance = isInstance && "finishedAt" in value; isInstance = isInstance && "startedAt" in value; isInstance = isInstance && "createdAt" in value; isInstance = isInstance && "createdBy" in value; isInstance = isInstance && "buildId" in value; isInstance = isInstance && "appId" in value; return isInstance; } export function BuildFromJSON(json: any): Build { return BuildFromJSONTyped(json, false); } export function BuildFromJSONTyped(json: any, ignoreDiscriminator: boolean): Build { if ((json === undefined) || (json === null)) { return json; } return { 'buildTag': !exists(json, 'buildTag') ? undefined : json['buildTag'], 'regionalContainerTags': ((json['regionalContainerTags'] as Array).map(BuildRegionalContainerTagsInnerFromJSON)), 'imageSize': json['imageSize'], 'status': BuildStatusFromJSON(json['status']), 'deletedAt': (json['deletedAt'] === null ? null : new Date(json['deletedAt'])), 'finishedAt': (json['finishedAt'] === null ? null : new Date(json['finishedAt'])), 'startedAt': (json['startedAt'] === null ? null : new Date(json['startedAt'])), 'createdAt': (new Date(json['createdAt'])), 'createdBy': json['createdBy'], 'buildId': json['buildId'], 'appId': json['appId'], }; } export function BuildToJSON(value?: Build | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'buildTag': value.buildTag, 'regionalContainerTags': ((value.regionalContainerTags as Array).map(BuildRegionalContainerTagsInnerToJSON)), 'imageSize': value.imageSize, 'status': BuildStatusToJSON(value.status), 'deletedAt': (value.deletedAt === null ? null : value.deletedAt.toISOString()), 'finishedAt': (value.finishedAt === null ? null : value.finishedAt.toISOString()), 'startedAt': (value.startedAt === null ? null : value.startedAt.toISOString()), 'createdAt': (value.createdAt.toISOString()), 'createdBy': value.createdBy, 'buildId': value.buildId, 'appId': value.appId, }; }