import type { AxiosInstance } from 'contentful-sdk-core' ; import { CollectionProp , GetSpaceEnvironmentParams , GetSpaceParams , QueryParams , } from '../../../common-types' ; import { ScheduledActionProps } from '../../../entities/scheduled-action' ; import { RestEndpoint } from '../types' ; import * as raw from './raw' ; import { normalizeSelect } from './utils' ; export const get = ( http , params ) => { return raw . get < ScheduledActionProps > ( http , `/spaces/${ params . spaceId }/scheduled_actions/${ params . scheduledActionId }` , { params : { 'environment.sys.id' : params . environmentId , } , } ) ; } ; export const getMany = ( http , params ) => { return raw . get < CollectionProp < ScheduledActionProps > > ( http , `/spaces/${ params . spaceId }/scheduled_actions` , { params : normalizeSelect ( params . query ) , } ) ; } ; export const create = ( http , params , data ) => { return raw . post < ScheduledActionProps > ( http , `/spaces/${ params . spaceId }/scheduled_actions` , data ) ; } ; export const del = ( http , params ) => { return raw . del ( http , `/spaces/${ params . spaceId }/scheduled_actions/${ params . scheduledActionId }` , { params : { 'environment.sys.id' : params . environmentId , } , } ) ; } ; export const update = ( http , params , data ) => { return raw . put ( http , `/spaces/${ params . spaceId }/scheduled_actions/${ params . scheduledActionId }` , data , { params : { 'environment.sys.id' : data . environment ?. sys . id , } , headers : { 'X-Contentful-Version' : params . version , } , } ) ; } ;