/**
 * Generated by orval v8.23.0 🍺
 * Do not edit manually.
 * FastAPI
 * OpenAPI spec version: v2.2.0
 */
import type {
  EventRepairRequest,
  GamePieceRepairRequest,
  HTTPValidationError,
  MatchScoutingAnswerRepairRequest,
  MatchScoutingFieldRepairRequest,
  MatchScoutingFieldRepairResponse,
  MatchScoutingSubmissionRepairRequest,
  MessageResponse,
  PitScoutingAnswerRepairRequest,
  PitScoutingFieldRepairRequest,
  PitScoutingFieldRepairResponse,
  RepairResponse,
  TeamPitRepairRequest
} from '../model';

import { customInstance } from '.././client';

export type getRepairsRepairsGetGetResponse200 = {
  data: RepairResponse[]
  status: 200
}

export type getRepairsRepairsGetGetResponseSuccess = (getRepairsRepairsGetGetResponse200) & {
  headers: Headers;
};
;

export type getRepairsRepairsGetGetResponse = (getRepairsRepairsGetGetResponseSuccess)

export const getGetRepairsRepairsGetGetUrl = () => {




  return `/repairs/get`
}

/**
 * Get all available repairs
 *
 * Requires superuser access
 *
 * The following repairs are able to be returned here:
 *     - `Event` is missing a `season`
 *     - `GamePiece` is mising a `season`
 *     - `MatchScoutingField` is missing a `season`
 *     - `MatchScoutingField` is missing a `game_piece` if `stat_type` is `auton_score`, `auton_miss`, `teleop_score` or `teleop_miss`
 *     - `MatchScoutingSubmission` is missing an `event`
 *     - `MatchScoutingAnswer` is missing a `field`
 *     - `MatchScoutingAnswer` is missing a `submission`
 *     - `PitScoutingField` is missing a `season`
 *     - `TeamPit` is missing a `season`
 *     - `TeamPit` is missing an `event`
 *     - `PitScoutingAnswer` is missing a `field`
 *     - `PitScoutingAnswer` is missing a `team`
 * @summary Get Repairs
 */
export const getRepairsRepairsGetGet = async ( options?: Parameters<typeof customInstance>[1]): Promise<getRepairsRepairsGetGetResponse> => {

  return customInstance<getRepairsRepairsGetGetResponse>(getGetRepairsRepairsGetGetUrl(),
  {
    ...options,
    method: 'GET'


  }
);}


export type getRepairCountRepairsGetCountGetResponse200 = {
  data: number
  status: 200
}

export type getRepairCountRepairsGetCountGetResponseSuccess = (getRepairCountRepairsGetCountGetResponse200) & {
  headers: Headers;
};
;

export type getRepairCountRepairsGetCountGetResponse = (getRepairCountRepairsGetCountGetResponseSuccess)

export const getGetRepairCountRepairsGetCountGetUrl = () => {




  return `/repairs/get/count`
}

/**
 * Get the number of available repairs
 *
 * Requires superuser access
 *
 * Returns:
 *     int: The number of available repairs
 * @summary Get Repair Count
 */
export const getRepairCountRepairsGetCountGet = async ( options?: Parameters<typeof customInstance>[1]): Promise<getRepairCountRepairsGetCountGetResponse> => {

  return customInstance<getRepairCountRepairsGetCountGetResponse>(getGetRepairCountRepairsGetCountGetUrl(),
  {
    ...options,
    method: 'GET'


  }
);}


export type createRepairsForTestingRepairsCreatePostResponse200 = {
  data: unknown
  status: 200
}

export type createRepairsForTestingRepairsCreatePostResponseSuccess = (createRepairsForTestingRepairsCreatePostResponse200) & {
  headers: Headers;
};
;

export type createRepairsForTestingRepairsCreatePostResponse = (createRepairsForTestingRepairsCreatePostResponseSuccess)

export const getCreateRepairsForTestingRepairsCreatePostUrl = () => {




  return `/repairs/create`
}

/**
 * @summary Create Repairs For Testing
 */
export const createRepairsForTestingRepairsCreatePost = async ( options?: Parameters<typeof customInstance>[1]): Promise<createRepairsForTestingRepairsCreatePostResponse> => {

  return customInstance<createRepairsForTestingRepairsCreatePostResponse>(getCreateRepairsForTestingRepairsCreatePostUrl(),
  {
    ...options,
    method: 'POST'


  }
);}


export type getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponse200 = {
  data: MatchScoutingFieldRepairResponse[]
  status: 200
}

export type getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponseSuccess = (getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponse200) & {
  headers: Headers;
};
;

export type getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponse = (getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponseSuccess)

export const getGetAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetUrl = () => {




  return `/repairs/get/match_scouting_fields`
}

/**
 * Get all match scouting fields. Used on the admin repair page when setting the match scouting field on a piece of data.
 *
 * Requires superuser access
 *
 * Returns:
 *     list[MatchScoutingFieldRepairResponse]: A list of all match scouting fields
 * @summary Get All Match Scouting Fields
 */
export const getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGet = async ( options?: Parameters<typeof customInstance>[1]): Promise<getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponse> => {

  return customInstance<getAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetResponse>(getGetAllMatchScoutingFieldsRepairsGetMatchScoutingFieldsGetUrl(),
  {
    ...options,
    method: 'GET'


  }
);}


export type getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponse200 = {
  data: PitScoutingFieldRepairResponse[]
  status: 200
}

export type getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponseSuccess = (getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponse200) & {
  headers: Headers;
};
;

export type getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponse = (getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponseSuccess)

export const getGetAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetUrl = () => {




  return `/repairs/get/pit_scouting_fields`
}

/**
 * Get all pit scouting fields. Used on the admin repair page when setting the pit scouting field on a piece of data.
 *
 * Requires superuser access
 *
 * Returns:
 *     list[PitScoutingFieldRepairResponse]: A list of all pit scouting fields
 * @summary Get All Pit Scouting Fields
 */
export const getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGet = async ( options?: Parameters<typeof customInstance>[1]): Promise<getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponse> => {

  return customInstance<getAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetResponse>(getGetAllPitScoutingFieldsRepairsGetPitScoutingFieldsGetUrl(),
  {
    ...options,
    method: 'GET'


  }
);}


export type fixRepairRepairsFixPostResponse200 = {
  data: MessageResponse
  status: 200
}

export type fixRepairRepairsFixPostResponse422 = {
  data: HTTPValidationError
  status: 422
}

export type fixRepairRepairsFixPostResponseSuccess = (fixRepairRepairsFixPostResponse200) & {
  headers: Headers;
};
export type fixRepairRepairsFixPostResponseError = (fixRepairRepairsFixPostResponse422) & {
  headers: Headers;
};

export type fixRepairRepairsFixPostResponse = (fixRepairRepairsFixPostResponseSuccess | fixRepairRepairsFixPostResponseError)

export const getFixRepairRepairsFixPostUrl = () => {




  return `/repairs/fix`
}

/**
 * Fix a repair
 *
 * Requires superuser access
 *
 * Parameters:
 *     data (`RepairRequest`): The data to fix
 *
 * Returns:
 *     `MessageResponse`: A message indicating that the repair was fixed (or failed to fix)
 * @summary Fix Repair
 */
export const fixRepairRepairsFixPost = async (eventRepairRequestGamePieceRepairRequestMatchScoutingFieldRepairRequestMatchScoutingSubmissionRepairRequestMatchScoutingAnswerRepairRequestPitScoutingFieldRepairRequestTeamPitRepairRequestPitScoutingAnswerRepairRequest: EventRepairRequest | GamePieceRepairRequest | MatchScoutingFieldRepairRequest | MatchScoutingSubmissionRepairRequest | MatchScoutingAnswerRepairRequest | PitScoutingFieldRepairRequest | TeamPitRepairRequest | PitScoutingAnswerRepairRequest, options?: Parameters<typeof customInstance>[1]): Promise<fixRepairRepairsFixPostResponse> => {

  return customInstance<fixRepairRepairsFixPostResponse>(getFixRepairRepairsFixPostUrl(),
  {
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(eventRepairRequestGamePieceRepairRequestMatchScoutingFieldRepairRequestMatchScoutingSubmissionRepairRequestMatchScoutingAnswerRepairRequestPitScoutingFieldRepairRequestTeamPitRepairRequestPitScoutingAnswerRepairRequest)
  }
);}


export type deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse200 = {
  data: MessageResponse
  status: 200
}

export type deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse422 = {
  data: HTTPValidationError
  status: 422
}

export type deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponseSuccess = (deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse200) & {
  headers: Headers;
};
export type deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponseError = (deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse422) & {
  headers: Headers;
};

export type deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse = (deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponseSuccess | deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponseError)

export const getDeleteRepairDataRepairsDeleteDataTypeDataUuidDeleteUrl = (dataType: 'event' | 'game_piece' | 'match_scouting_field' | 'match_scouting_submission' | 'match_scouting_answer' | 'pit_scouting_field' | 'team_pit' | 'pit_scouting_answer',
    dataUuid: string,) => {




  return `/repairs/delete/${dataType}/${dataUuid}`
}

/**
 * Delete data associated with a repair
 *
 * Requires superuser access
 *
 * Parameters:
 *     data_type: The type of data to delete
 *     data_uuid (`UUID`): The uuid of the data to delete
 * @summary Delete Repair Data
 */
export const deleteRepairDataRepairsDeleteDataTypeDataUuidDelete = async (dataType: 'event' | 'game_piece' | 'match_scouting_field' | 'match_scouting_submission' | 'match_scouting_answer' | 'pit_scouting_field' | 'team_pit' | 'pit_scouting_answer',
    dataUuid: string, options?: Parameters<typeof customInstance>[1]): Promise<deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse> => {

  return customInstance<deleteRepairDataRepairsDeleteDataTypeDataUuidDeleteResponse>(getDeleteRepairDataRepairsDeleteDataTypeDataUuidDeleteUrl(dataType,dataUuid),
  {
    ...options,
    method: 'DELETE'


  }
);}


