import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect';

export const BackgroundCheckStatus = {
  PENDING: "PENDING",
  CLEARED: "CLEARED",
  FAILED: "FAILED",
  EXPIRED: "EXPIRED",
}

export const ContractType = {
  W2: "W2",
  C1099: "C1099",
  TEMP: "TEMP",
  CONTRACT: "CONTRACT",
}

export const EmploymentType = {
  FULL_TIME: "FULL_TIME",
  PART_TIME: "PART_TIME",
  ON_CALL: "ON_CALL",
  CONTRACT: "CONTRACT",
}

export const EventStatus = {
  DRAFT: "DRAFT",
  ACTIVE: "ACTIVE",
  PENDING: "PENDING",
  ASSIGNED: "ASSIGNED",
  CONFIRMED: "CONFIRMED",
  COMPLETED: "COMPLETED",
  CANCELED: "CANCELED",
}

export const RecurrenceType = {
  SINGLE: "SINGLE",
  DATE_RANGE: "DATE_RANGE",
  SCATTER: "SCATTER",
}

export const VendorApprovalStatus = {
  PENDING: "PENDING",
  APPROVED: "APPROVED",
  SUSPENDED: "SUSPENDED",
  TERMINATED: "TERMINATED",
}

export const VendorPlatformType = {
  FULL_PLATFORM: "FULL_PLATFORM",
  BUILDING_PLATFORM: "BUILDING_PLATFORM",
  PARTIAL_TECH: "PARTIAL_TECH",
  TRADITIONAL: "TRADITIONAL",
}

export const VendorRegion = {
  NATIONAL: "NATIONAL",
  BAY_AREA: "BAY_AREA",
  SOUTHERN_CALIFORNIA: "SOUTHERN_CALIFORNIA",
  NORTHERN_CALIFORNIA: "NORTHERN_CALIFORNIA",
  WEST: "WEST",
  EAST: "EAST",
  MIDWEST: "MIDWEST",
  SOUTH: "SOUTH",
}

export const connectorConfig = {
  connector: 'krow-connector',
  service: 'krow-workforce-db',
  location: 'us-central1'
};

export const createStaffRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'CreateStaff', inputVars);
}
createStaffRef.operationName = 'CreateStaff';

export function createStaff(dcOrVars, vars) {
  return executeMutation(createStaffRef(dcOrVars, vars));
}

export const listStaffRef = (dc) => {
  const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'listStaff');
}
listStaffRef.operationName = 'listStaff';

export function listStaff(dc) {
  return executeQuery(listStaffRef(dc));
}

export const createVendorRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'CreateVendor', inputVars);
}
createVendorRef.operationName = 'CreateVendor';

export function createVendor(dcOrVars, vars) {
  return executeMutation(createVendorRef(dcOrVars, vars));
}

export const updateVendorRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'UpdateVendor', inputVars);
}
updateVendorRef.operationName = 'UpdateVendor';

export function updateVendor(dcOrVars, vars) {
  return executeMutation(updateVendorRef(dcOrVars, vars));
}

export const deleteVendorRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'DeleteVendor', inputVars);
}
deleteVendorRef.operationName = 'DeleteVendor';

export function deleteVendor(dcOrVars, vars) {
  return executeMutation(deleteVendorRef(dcOrVars, vars));
}

export const listVendorRef = (dc) => {
  const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'listVendor');
}
listVendorRef.operationName = 'listVendor';

export function listVendor(dc) {
  return executeQuery(listVendorRef(dc));
}

export const getVendorByIdRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'getVendorById', inputVars);
}
getVendorByIdRef.operationName = 'getVendorById';

export function getVendorById(dcOrVars, vars) {
  return executeQuery(getVendorByIdRef(dcOrVars, vars));
}

export const filterVendorsRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'filterVendors', inputVars);
}
filterVendorsRef.operationName = 'filterVendors';

export function filterVendors(dcOrVars, vars) {
  return executeQuery(filterVendorsRef(dcOrVars, vars));
}

export const createEventRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'CreateEvent', inputVars);
}
createEventRef.operationName = 'CreateEvent';

export function createEvent(dcOrVars, vars) {
  return executeMutation(createEventRef(dcOrVars, vars));
}

export const updateEventRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'UpdateEvent', inputVars);
}
updateEventRef.operationName = 'UpdateEvent';

export function updateEvent(dcOrVars, vars) {
  return executeMutation(updateEventRef(dcOrVars, vars));
}

export const deleteEventRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return mutationRef(dcInstance, 'DeleteEvent', inputVars);
}
deleteEventRef.operationName = 'DeleteEvent';

export function deleteEvent(dcOrVars, vars) {
  return executeMutation(deleteEventRef(dcOrVars, vars));
}

export const listEventsRef = (dc) => {
  const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'listEvents');
}
listEventsRef.operationName = 'listEvents';

export function listEvents(dc) {
  return executeQuery(listEventsRef(dc));
}

export const getEventByIdRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'getEventById', inputVars);
}
getEventByIdRef.operationName = 'getEventById';

export function getEventById(dcOrVars, vars) {
  return executeQuery(getEventByIdRef(dcOrVars, vars));
}

export const filterEventsRef = (dcOrVars, vars) => {
  const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars);
  dcInstance._useGeneratedSdk();
  return queryRef(dcInstance, 'filterEvents', inputVars);
}
filterEventsRef.operationName = 'filterEvents';

export function filterEvents(dcOrVars, vars) {
  return executeQuery(filterEventsRef(dcOrVars, vars));
}

