/* tslint:disable */ /* eslint-disable */ /** * Tapis Workflows API * Create and manage pipelines * * The version of the OpenAPI document: 1.6.0 * Contact: cicsupport@tacc.utexas.edu * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { ReqDockerhubIdentity, ReqGithubIdentity, ReqDockerhubIdentityFromJSONTyped, ReqDockerhubIdentityToJSON, ReqGithubIdentityFromJSONTyped, ReqGithubIdentityToJSON, EnumIdentityType } from './'; /** * @type ReqIdentity * * @export */ export type ReqIdentity = { type: EnumIdentityType.Dockerhub } & ReqDockerhubIdentity | { type: EnumIdentityType.Github } & ReqGithubIdentity; export function ReqIdentityFromJSON(json: any): ReqIdentity { return ReqIdentityFromJSONTyped(json, false); } export function ReqIdentityFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqIdentity { if ((json === undefined) || (json === null)) { return json; } switch (json['type']) { case EnumIdentityType.Dockerhub: return {...ReqDockerhubIdentityFromJSONTyped(json, true), type: EnumIdentityType.Dockerhub}; case EnumIdentityType.Github: return {...ReqGithubIdentityFromJSONTyped(json, true), type: EnumIdentityType.Github}; default: throw new Error(`No variant of ReqIdentity exists with 'type=${json['type']}'`); } } export function ReqIdentityToJSON(value?: ReqIdentity | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } switch (value['type']) { case EnumIdentityType.Dockerhub: return ReqDockerhubIdentityToJSON(value); case EnumIdentityType.Github: return ReqGithubIdentityToJSON(value); default: throw new Error(`No variant of ReqIdentity exists with 'type=${value['type']}'`); } }