@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
17 lines (15 loc) • 736 B
text/typescript
import { DeploymentSchedule } from '@/models/DeploymentSchedule'
import { DeploymentScheduleResponse } from '@/models/api/DeploymentScheduleResponse'
import { MapFunction } from '@/services/Mapper'
export const mapDeploymentScheduleResponseToDeploymentSchedule: MapFunction<DeploymentScheduleResponse, DeploymentSchedule> = function(source) {
return new DeploymentSchedule({
id: source.id,
created: this.map('string', source.created, 'Date'),
updated: this.map('string', source.updated, 'Date'),
slug: source.slug ?? null,
active: source.active,
schedule: this.map('ScheduleResponse', source.schedule, 'Schedule'),
jobVariables: source.job_variables ?? {},
parameters: source.parameters ?? {},
})
}