/* 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 { ReqDockerhubContext, ReqGithubContext, ReqGitlabContext, ReqLocalContext, ReqDockerhubContextFromJSONTyped, ReqDockerhubContextToJSON, ReqGithubContextFromJSONTyped, ReqGithubContextToJSON, ReqGitlabContextFromJSONTyped, ReqGitlabContextToJSON, ReqLocalContextFromJSONTyped, ReqLocalContextToJSON, EnumContextType } from './'; /** * @type ReqContext * * @export */ export type ReqContext = { type: EnumContextType.Dockerhub } & ReqDockerhubContext | { type: EnumContextType.Github } & ReqGithubContext | { type: EnumContextType.Gitlab } & ReqGitlabContext | { type: EnumContextType.Local } & ReqLocalContext; export function ReqContextFromJSON(json: any): ReqContext { return ReqContextFromJSONTyped(json, false); } export function ReqContextFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqContext { if ((json === undefined) || (json === null)) { return json; } switch (json['type']) { case EnumContextType.Dockerhub: return {...ReqDockerhubContextFromJSONTyped(json, true), type: EnumContextType.Dockerhub}; case EnumContextType.Github: return {...ReqGithubContextFromJSONTyped(json, true), type: EnumContextType.Github}; case EnumContextType.Gitlab: return {...ReqGitlabContextFromJSONTyped(json, true), type: EnumContextType.Gitlab}; case EnumContextType.Local: return {...ReqLocalContextFromJSONTyped(json, true), type: EnumContextType.Local}; default: throw new Error(`No variant of ReqContext exists with 'type=${json['type']}'`); } } export function ReqContextToJSON(value?: ReqContext | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } switch (value['type']) { case EnumContextType.Dockerhub: return ReqDockerhubContextToJSON(value); case EnumContextType.Github: return ReqGithubContextToJSON(value); case EnumContextType.Gitlab: return ReqGitlabContextToJSON(value); case EnumContextType.Local: return ReqLocalContextToJSON(value); default: throw new Error(`No variant of ReqContext exists with 'type=${value['type']}'`); } }