diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index c4fc70f07334..f86e69f3f27c 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -68,39 +68,10 @@ class ClientController extends BaseController } /** - * @OA\Get( - * path="/api/v1/clients", - * operationId="getClients", - * tags={"clients"}, - * summary="Gets a list of clients", - * description="Lists clients, search and filters allow fine grained lists to be generated. - - * Query parameters can be added to performed more fine grained filtering of the clients, these are handled by the ClientFilters class which defines the methods available", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter(ref="#/components/parameters/index"), - * @OA\Response( - * response=200, - * description="A list of clients", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) + * * @param ClientFilters $filters - * @return Response|mixed + * @return Response + * */ public function index(ClientFilters $filters) { @@ -118,47 +89,6 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * - * @OA\Get( - * path="/api/v1/clients/{id}", - * operationId="showClient", - * tags={"clients"}, - * summary="Shows a client", - * description="Displays a client by id", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the cl.ient object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function show(ShowClientRequest $request, Client $client) { @@ -172,47 +102,6 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * - * @OA\Get( - * path="/api/v1/clients/{id}/edit", - * operationId="editClient", - * tags={"clients"}, - * summary="Shows a client for editting", - * description="Displays a client by id", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function edit(EditClientRequest $request, Client $client) { @@ -226,48 +115,6 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * - * - * @OA\Put( - * path="/api/v1/clients/{id}", - * operationId="updateClient", - * tags={"clients"}, - * summary="Updates a client", - * description="Handles the updating of a client by id", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function update(UpdateClientRequest $request, Client $client) { @@ -290,37 +137,6 @@ class ClientController extends BaseController * @param CreateClientRequest $request * @return Response * - * - * - * @OA\Get( - * path="/api/v1/clients/create", - * operationId="getClientsCreate", - * tags={"clients"}, - * summary="Gets a new blank client object", - * description="Returns a blank object with default values", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Response( - * response=200, - * description="A blank client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function create(CreateClientRequest $request) { @@ -335,37 +151,6 @@ class ClientController extends BaseController * @param StoreClientRequest $request * @return Response * - * - * - * @OA\Post( - * path="/api/v1/clients", - * operationId="storeClient", - * tags={"clients"}, - * summary="Adds a client", - * description="Adds an client to a company", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Response( - * response=200, - * description="Returns the saved client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function store(StoreClientRequest $request) { @@ -392,47 +177,7 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * * @throws \Exception - * @OA\Delete( - * path="/api/v1/clients/{id}", - * operationId="deleteClient", - * tags={"clients"}, - * summary="Deletes a client", - * description="Handles the deletion of a client by id", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns a HTTP status", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function destroy(DestroyClientRequest $request, Client $client) { @@ -446,61 +191,20 @@ class ClientController extends BaseController * * @return Response * - * - * @OA\Post( - * path="/api/v1/clients/bulk", - * operationId="bulkClients", - * tags={"clients"}, - * summary="Performs bulk actions on an array of clients", - * description="", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/index"), - * @OA\RequestBody( - * description="User credentials", - * required=true, - * @OA\MediaType( - * mediaType="application/json", - * @OA\Schema( - * type="array", - * @OA\Items( - * type="integer", - * description="Array of hashed IDs to be bulk 'actioned", - * example="[0,1,2,3]", - * ), - * ) - * ) - * ), - * @OA\Response( - * response=200, - * description="The Client User response", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function bulk(BulkClientRequest $request) { $action = $request->action; + /** @var \App\Models\User $user */ + $user = auth()->user(); + $clients = Client::withTrashed() ->company() ->whereIn('id', $request->ids) ->cursor() - ->each(function ($client) use ($action) { - if (auth()->user()->can('edit', $client)) { + ->each(function ($client) use ($action, $user) { + if ($user->can('edit', $client)) { $this->client_repo->{$action}($client); } }); @@ -515,48 +219,6 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * - * - * @OA\Put( - * path="/api/v1/clients/{id}/upload", - * operationId="uploadClient", - * tags={"clients"}, - * summary="Uploads a document to a client", - * description="Handles the uploading of a document to a client", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/Client"), - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function upload(UploadClientRequest $request, Client $client) { @@ -578,47 +240,6 @@ class ClientController extends BaseController * @param Client $client * @return Response * - * - * - * @OA\Post( - * path="/api/v1/clients/{id}/purge", - * operationId="purgeClient", - * tags={"clients"}, - * summary="Purges a client from the system", - * description="Handles purging a client", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit") - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function purge(PurgeClientRequest $request, Client $client) { @@ -647,58 +268,6 @@ class ClientController extends BaseController * @param string $mergeable_client * @return Response * - * - * - * @OA\Post( - * path="/api/v1/clients/{id}/{mergeable_client_hashed_id}/merge", - * operationId="mergeClient", - * tags={"clients"}, - * summary="Merges two clients", - * description="Handles merging 2 clients", - * @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"), - * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), - * @OA\Parameter(ref="#/components/parameters/include"), - * @OA\Parameter( - * name="id", - * in="path", - * description="The Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Parameter( - * name="mergeable_client_hashed_id", - * in="path", - * description="The Mergeable Client Hashed ID", - * example="D2J234DFA", - * required=true, - * @OA\Schema( - * type="string", - * format="string", - * ), - * ), - * @OA\Response( - * response=200, - * description="Returns the client object", - * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), - * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), - * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit") - * ), - * @OA\Response( - * response=422, - * description="Validation error", - * @OA\JsonContent(ref="#/components/schemas/ValidationError"), - * - * ), - * @OA\Response( - * response="default", - * description="Unexpected Error", - * @OA\JsonContent(ref="#/components/schemas/Error"), - * ), - * ) */ public function merge(PurgeClientRequest $request, Client $client, string $mergeable_client) diff --git a/openapi/api-docs.yaml b/openapi/api-docs.yaml index cd3c9f6800c7..8da027a59a66 100644 --- a/openapi/api-docs.yaml +++ b/openapi/api-docs.yaml @@ -8073,7 +8073,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -8105,7 +8109,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/projects/{id}": @@ -8146,7 +8154,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -8186,7 +8198,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -8222,7 +8238,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/projects/{id}/edit": @@ -8263,7 +8283,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/projects/create: @@ -8296,7 +8320,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/projects/bulk: @@ -8340,7 +8368,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/projects/{id}/upload": @@ -8381,7 +8413,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/clients: @@ -8519,7 +8555,11 @@ paths: tags: - clients summary: 'Create client' - description: 'Adds a client to a company' + description: | + Adds a client to a company + + When creating (or updating) a client you must include the child contacts with all mutating requests. Client contacts cannot be modified in isolation. + operationId: storeClient parameters: - $ref: '#/components/parameters/X-API-TOKEN' @@ -8684,7 +8724,7 @@ paths: tags: - clients summary: 'Edit Client' - description: 'Displays a client by id' + description: 'Displays a client by id, essentially an alias of the show route' operationId: editClient parameters: - $ref: '#/components/parameters/X-API-TOKEN' @@ -8769,19 +8809,16 @@ paths: - $ref: '#/components/parameters/X-Requested-With' - $ref: '#/components/parameters/index' requestBody: - description: 'User credentials' + description: 'Bulk action array' required: true content: application/json: schema: - type: array - items: - description: 'Array of hashed IDs to be bulk ''actioned' - type: integer - example: '[0,1,2,3]' + $ref: '#/components/schemas/GenericBulkAction' + responses: 200: - description: 'The Client User response' + description: 'The Client listresponse' headers: X-MINIMUM-CLIENT-VERSION: $ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' @@ -8870,6 +8907,7 @@ paths: parameters: - $ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With' + - $ref: '#/components/parameters/X-API-PASSWORD' - $ref: '#/components/parameters/client_include' - name: id in: path @@ -8910,6 +8948,7 @@ paths: - $ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With' - $ref: '#/components/parameters/client_include' + - $ref: '#/components/parameters/X-API-PASSWORD' - name: id in: path description: 'The Client Hashed ID' @@ -9085,7 +9124,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -9117,7 +9160,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}": @@ -9158,7 +9205,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -9198,7 +9249,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -9234,7 +9289,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}/edit": @@ -9275,7 +9334,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/quotes/create: @@ -9308,7 +9371,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/quotes/bulk: @@ -9352,7 +9419,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}/{action}": @@ -9402,7 +9473,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/quote/{invitation_key}/download": @@ -9439,7 +9514,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/quotes/{id}/upload": @@ -9480,7 +9559,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/products: @@ -9939,7 +10022,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -9971,7 +10058,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/tasks/{id}": @@ -10012,7 +10103,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -10052,7 +10147,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -10088,7 +10187,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/tasks/{id}/edit": @@ -10129,7 +10232,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/tasks/create: @@ -10162,7 +10269,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/tasks/bulk: @@ -10206,7 +10317,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/tasks/{id}/upload": @@ -10247,7 +10362,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/tasks/sort: @@ -10276,7 +10395,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/purchase_orders: @@ -10309,7 +10432,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -10341,7 +10468,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -10383,7 +10514,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/purchase_order/{id}": @@ -10424,7 +10559,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -10460,7 +10599,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/purchase_orders/{id}/edit": @@ -10501,7 +10644,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -10535,7 +10682,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/purchase_orders/bulk: @@ -10575,7 +10726,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/purchase_orders/{id}/{action}": @@ -10625,7 +10780,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/purchase_orders/{id}/upload": @@ -10666,7 +10825,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/purchase_order/{invitation_key}/download": @@ -10703,7 +10866,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/payments: @@ -10772,7 +10939,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -10811,7 +10982,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -10853,7 +11028,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -10893,7 +11072,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -10929,7 +11112,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/payments/{id}/edit": @@ -10970,7 +11157,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/payments/create: @@ -11003,7 +11194,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/payments/refund: @@ -11043,7 +11238,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/payments/bulk: @@ -11087,7 +11286,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/payments/{id}/{action}": @@ -11137,7 +11340,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -11179,7 +11386,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/vendors: @@ -11213,7 +11424,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -11245,7 +11460,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/vendors/{id}": @@ -11286,7 +11505,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -11326,7 +11549,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -11362,7 +11589,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/vendors/{id}/edit": @@ -11403,7 +11634,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/vendors/create: @@ -11436,7 +11671,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/vendors/bulk: @@ -11480,7 +11719,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/vendors/{id}/upload": @@ -11521,7 +11764,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/invoices: @@ -11639,7 +11886,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -11677,7 +11928,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -11719,7 +11974,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -11760,7 +12019,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -11796,7 +12059,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/invoices/{id}/edit": @@ -11837,7 +12104,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -11871,7 +12142,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -11954,7 +12229,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -12016,7 +12295,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/invoice/{invitation_key}/download": @@ -12053,7 +12336,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/invoices/{id}/delivery_note": @@ -12090,7 +12377,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/invoices/{id}/upload": @@ -12148,7 +12439,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/recurring_invoices: @@ -12220,7 +12515,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -12252,7 +12551,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -12294,7 +12597,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -12334,7 +12641,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -12370,7 +12681,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/recurring_invoices/{id}/edit": @@ -12411,7 +12726,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -12445,7 +12764,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/recurring_invoices/bulk: @@ -12513,7 +12836,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/recurring_invoices/{id}/{action}": @@ -12563,7 +12890,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/recurring_invoice/{invitation_key}/download": @@ -12600,7 +12931,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/recurring_invoices/{id}/upload": @@ -12641,7 +12976,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/credits: @@ -12673,9 +13012,12 @@ paths: $ref: "#/components/responses/401" 403: $ref: "#/components/responses/403" - 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" post: @@ -12708,7 +13050,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" @@ -12751,7 +13097,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" put: @@ -12792,7 +13142,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" delete: @@ -12829,7 +13183,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/credits/{id}/edit": @@ -12871,7 +13229,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/credits/create: @@ -12905,7 +13267,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/credits/bulk: @@ -12928,8 +13294,8 @@ paths: type: array items: description: "Array of hashed IDs to be bulk 'actioned" - type: integer - example: "[0,1,2,3]" + type: string + example: '[D2J234DFA,D2J234DFA,D2J234DFA]' responses: 200: description: "The Bulk Action response" @@ -12946,7 +13312,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/credit/{invitation_key}/download": @@ -12984,7 +13354,11 @@ paths: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" "/api/v1/credits/{id}/upload": @@ -13025,7 +13399,11 @@ paths: 403: $ref: "#/components/responses/403" 422: - $ref: "#/components/responses/422" + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' default: $ref: "#/components/responses/default" components: @@ -13110,7 +13488,7 @@ components: name: X-API-PASSWORD in: header description: 'The login password when challenged on certain protected routes' - required: false + required: true schema: type: string example: supersecretpassword @@ -18681,6 +19059,21 @@ components: format: integer example: '134341234234' type: object + + GenericBulkAction: + properties: + action: + type: string + example: archive + description: 'The action to perform ie. archive / restore / delete' + ids: + type: array + items: + format: string + type: string + example: 2J234DFA,D2J234DFA,D2J234DFA + description: string array of client hashed ids + type: object ClientGatewayToken: properties: id: diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index c5de428986f5..b0cc208bd7f8 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -28,7 +28,7 @@ name: X-API-PASSWORD in: header description: 'The login password when challenged on certain protected routes' - required: false + required: true schema: type: string example: supersecretpassword diff --git a/openapi/components/schemas/generic_bulk_action.yaml b/openapi/components/schemas/generic_bulk_action.yaml new file mode 100644 index 000000000000..c61d8ba1a09d --- /dev/null +++ b/openapi/components/schemas/generic_bulk_action.yaml @@ -0,0 +1,15 @@ + + GenericBulkAction: + properties: + action: + type: string + example: archive + description: 'The action to perform ie. archive / restore / delete' + ids: + type: array + items: + format: string + type: string + example: 2J234DFA,D2J234DFA,D2J234DFA + description: string array of client hashed ids + type: object \ No newline at end of file diff --git a/openapi/paths/clients.yaml b/openapi/paths/clients.yaml index 46cee5d1baf8..bc2085b8252d 100644 --- a/openapi/paths/clients.yaml +++ b/openapi/paths/clients.yaml @@ -133,7 +133,11 @@ tags: - clients summary: 'Create client' - description: 'Adds a client to a company' + description: | + Adds a client to a company + + When creating (or updating) a client you must include the child contacts with all mutating requests. Client contacts cannot be modified in isolation. + operationId: storeClient parameters: - $ref: '#/components/parameters/X-API-TOKEN' @@ -298,7 +302,7 @@ tags: - clients summary: 'Edit Client' - description: 'Displays a client by id' + description: 'Displays a client by id, essentially an alias of the show route' operationId: editClient parameters: - $ref: '#/components/parameters/X-API-TOKEN' @@ -383,19 +387,16 @@ - $ref: '#/components/parameters/X-Requested-With' - $ref: '#/components/parameters/index' requestBody: - description: 'User credentials' + description: 'Bulk action array' required: true content: application/json: schema: - type: array - items: - description: 'Array of hashed IDs to be bulk ''actioned' - type: integer - example: '[0,1,2,3]' + $ref: '#/components/schemas/GenericBulkAction' + responses: 200: - description: 'The Client User response' + description: 'The Client listresponse' headers: X-MINIMUM-CLIENT-VERSION: $ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' @@ -484,6 +485,7 @@ parameters: - $ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With' + - $ref: '#/components/parameters/X-API-PASSWORD' - $ref: '#/components/parameters/client_include' - name: id in: path @@ -524,6 +526,7 @@ - $ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-Requested-With' - $ref: '#/components/parameters/client_include' + - $ref: '#/components/parameters/X-API-PASSWORD' - name: id in: path description: 'The Client Hashed ID' diff --git a/openapi/paths/credits.yaml b/openapi/paths/credits.yaml index 2dcd72592d45..1317a8e24e95 100644 --- a/openapi/paths/credits.yaml +++ b/openapi/paths/credits.yaml @@ -309,8 +309,8 @@ type: array items: description: "Array of hashed IDs to be bulk 'actioned" - type: integer - example: "[0,1,2,3]" + type: string + example: '[D2J234DFA,D2J234DFA,D2J234DFA]' responses: 200: description: "The Bulk Action response"