AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { ampecoAuth } from '../../../common/auth';
import { handleApiError, makeAmpecoApiCall, prepareQueryParams, processPathParameters } from '../../../common/utils';
import { ChargePointDowntimePeriodReadResponse } from '../../../models/responses';
/**
* Generated from API version: 3.96.4
*/
// Endpoint: GET /public-api/resources/charge-point-downtime-periods/v1.0/{chargePointDowntimePeriod}
export const chargePointDowntimePeriodReadAction = createAction({
auth: ampecoAuth,
name: 'chargePointDowntimePeriodRead',
displayName: 'Resources - Charge Point Downtime Periods - Read',
description: 'Get Charge Point Downtime Period.',
audience: 'both',
aiMetadata: { description: 'Retrieve a single charge-point downtime period by its numeric ID. Read-only and idempotent; use it when you already know the period ID. To search or enumerate periods (e.g. by charge point, type, or date range) use the downtime periods listing action.', idempotent: true },
props: {
chargePointDowntimePeriod: Property.Number({
displayName: 'Charge Point Downtime Period',
required: true,
}),
},
async run(context): Promise<ChargePointDowntimePeriodReadResponse> {
try {
const url = processPathParameters('/public-api/resources/charge-point-downtime-periods/v1.0/{chargePointDowntimePeriod}', context.propsValue);
const queryParams = prepareQueryParams(context.propsValue, []);
const body = undefined;
return await makeAmpecoApiCall(
context.auth,
url,
HttpMethod.GET,
body,
queryParams
) as ChargePointDowntimePeriodReadResponse;
} catch (error) {
handleApiError(error);
}
},
});