Skip to content

Latest commit

 

History

History
397 lines (235 loc) · 7.51 KB

StubsApi.md

File metadata and controls

397 lines (235 loc) · 7.51 KB

GripmockSdk.StubsApi

All URIs are relative to https://raw.githubusercontent.com/api

Method HTTP request Description
addStub POST /stubs Add a new stub to the store
batchStubsDelete POST /stubs/batchDelete Deletes a pack by IDs
deleteStubByID DELETE /stubs/{uuid} Deletes stub by ID
findByID GET /stubs/{uuid} Get Stub by ID
listStubs GET /stubs Getting a list of stubs
listUnusedStubs GET /stubs/unused Getting a list of unused stubs
listUsedStubs GET /stubs/used Getting a list of used stubs
purgeStubs DELETE /stubs Remove all stubs
searchStubs POST /stubs/search Stub storage search

addStub

AddStub200Response addStub(addStubRequest)

Add a new stub to the store

Add a new stub to the store

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
let addStubRequest = new GripmockSdk.AddStubRequest(); // AddStubRequest | Create a new pet in the store
apiInstance.addStub(addStubRequest).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
addStubRequest AddStubRequest Create a new pet in the store

Return type

AddStub200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

batchStubsDelete

batchStubsDelete(requestBody)

Deletes a pack by IDs

Takes IDs as input and deletes them

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
let requestBody = ["51c50050-ec27-4dae-a583-a32ca71a1dd5"]; // [String] | Create a new pet in the store
apiInstance.batchStubsDelete(requestBody).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
requestBody [String] Create a new pet in the store

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

deleteStubByID

deleteStubByID(uuid)

Deletes stub by ID

The method removes the stub by ID

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
let uuid = "uuid_example"; // String | ID of stub
apiInstance.deleteStubByID(uuid).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of stub

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

findByID

Stub findByID(uuid)

Get Stub by ID

Searches for Stub by ID

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
let uuid = "uuid_example"; // String | ID of stub
apiInstance.findByID(uuid).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of stub

Return type

Stub

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listStubs

[Stub] listStubs()

Getting a list of stubs

The list of stubs is required to view all added stubs

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
apiInstance.listStubs().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

[Stub]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listUnusedStubs

[Stub] listUnusedStubs()

Getting a list of unused stubs

The list is needed to quickly find unused stubs

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
apiInstance.listUnusedStubs().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

[Stub]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listUsedStubs

[Stub] listUsedStubs()

Getting a list of used stubs

The list is needed to quickly find used stubs

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
apiInstance.listUsedStubs().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

[Stub]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

purgeStubs

purgeStubs()

Remove all stubs

Completely clears the stub storage

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
apiInstance.purgeStubs().then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

searchStubs

SearchResponse searchStubs(searchRequest)

Stub storage search

Performs a search for a stub by the given conditions

Example

import GripmockSdk from '@bavix/gripmock-sdk';

let apiInstance = new GripmockSdk.StubsApi();
let searchRequest = new GripmockSdk.SearchRequest(); // SearchRequest | Description of filtering
apiInstance.searchStubs(searchRequest).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
searchRequest SearchRequest Description of filtering

Return type

SearchResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json