# APIConsumersApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**_delete**](#_delete) | **DELETE** /consumers/{apiConsumerId} | Delete API consumer|
|[**create**](#create) | **POST** /consumers | Create API consumer|
|[**createApiKeyForConsumer**](#createapikeyforconsumer) | **POST** /consumers/{apiConsumerId}/apikeys | Create API key|
|[**createSecretKeyForConsumer**](#createsecretkeyforconsumer) | **POST** /consumers/{apiConsumerId}/secretkeys | Create secret key|
|[**deleteApiKeyForConsumer**](#deleteapikeyforconsumer) | **DELETE** /consumers/{apiConsumerId}/apikeys/{apiKeyId} | Delete API key|
|[**getAll**](#getall) | **GET** /consumers | Get all API consumers|
|[**getById**](#getbyid) | **GET** /consumers/{apiConsumerId} | Get API consumer|
|[**getKeysByConsumerId**](#getkeysbyconsumerid) | **GET** /consumers/{apiConsumerId}/keys | Get API keys|
|[**patch**](#patch) | **PATCH** /consumers/{apiConsumerId} | Partially update API consumer|
|[**update**](#update) | **PUT** /consumers/{apiConsumerId} | Update API consumer|

# **_delete**
> _delete()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer to be deleted. (default to undefined)

const { status, data } = await apiInstance._delete(
    apiConsumerId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer to be deleted. | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | API consumer deleted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create**
> ApiConsumer create(apiConsumer)


### Example

```typescript
import {
    APIConsumersApi,
    Configuration,
    ApiConsumer
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumer: ApiConsumer; //API consumer to be created.
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.create(
    apiConsumer,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumer** | **ApiConsumer**| API consumer to be created. | |
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**ApiConsumer**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**201** | API consumer created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **createApiKeyForConsumer**
> ApiKey createApiKeyForConsumer()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration,
    ApiKeyInput
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer. (default to undefined)
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)
let apiKeyInput: ApiKeyInput; //API key expiration time in seconds. (optional)

const { status, data } = await apiInstance.createApiKeyForConsumer(
    apiConsumerId,
    idempotencyKey,
    apiKeyInput
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiKeyInput** | **ApiKeyInput**| API key expiration time in seconds. | |
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**ApiKey**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**201** | API key created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **createSecretKeyForConsumer**
> SecretKey createSecretKeyForConsumer()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer. (default to undefined)
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.createSecretKeyForConsumer(
    apiConsumerId,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**SecretKey**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**201** | Secret key created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **deleteApiKeyForConsumer**
> deleteApiKeyForConsumer()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer. (default to undefined)
let apiKeyId: string; //The ID of the API key. (default to undefined)

const { status, data } = await apiInstance.deleteApiKeyForConsumer(
    apiConsumerId,
    apiKeyId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer. | defaults to undefined|
| **apiKeyId** | [**string**] | The ID of the API key. | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | API key deleted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer or key not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getAll**
> Array<ApiConsumer> getAll()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let offset: number; //Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results (optional) (default to undefined)
let limit: number; //Pagination, the number of elements to retrieve, used in combination with offset to paginate results (optional) (default to undefined)
let paginationDetails: 'ON' | 'OFF'; //Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs (optional) (default to 'OFF')

const { status, data } = await apiInstance.getAll(
    offset,
    limit,
    paginationDetails
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **offset** | [**number**] | Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results | (optional) defaults to undefined|
| **limit** | [**number**] | Pagination, the number of elements to retrieve, used in combination with offset to paginate results | (optional) defaults to undefined|
| **paginationDetails** | [**&#39;ON&#39; | &#39;OFF&#39;**]**Array<&#39;ON&#39; &#124; &#39;OFF&#39;>** | Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs | (optional) defaults to 'OFF'|


### Return type

**Array<ApiConsumer>**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | API consumers list returned. |  * Items-Limit - Pagination details, the requested page size <br>  * Items-Offset - Pagination details, the index of the first returned item <br>  * Items-Total - Pagination details, the total available items <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getById**
> ApiConsumer getById()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer. (default to undefined)

const { status, data } = await apiInstance.getById(
    apiConsumerId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer. | defaults to undefined|


### Return type

**ApiConsumer**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | API consumer returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getKeysByConsumerId**
> Array<ApiKey> getKeysByConsumerId()


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer. (default to undefined)

const { status, data } = await apiInstance.getKeysByConsumerId(
    apiConsumerId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer. | defaults to undefined|


### Return type

**Array<ApiKey>**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | API keys returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **patch**
> patch(patchOperation)


### Example

```typescript
import {
    APIConsumersApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer to be updated. (default to undefined)
let patchOperation: Array<PatchOperation>; //Patch operations to be applied to a resource.
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.patch(
    apiConsumerId,
    patchOperation,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **patchOperation** | **Array<PatchOperation>**| Patch operations to be applied to a resource. | |
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer to be updated. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

void (empty response body)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | API consumer updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **update**
> ApiConsumer update(apiConsumer)


### Example

```typescript
import {
    APIConsumersApi,
    Configuration,
    ApiConsumer
} from './api';

const configuration = new Configuration();
const apiInstance = new APIConsumersApi(configuration);

let apiConsumerId: string; //The ID or encoded key of the API consumer to be updated. (default to undefined)
let apiConsumer: ApiConsumer; //API consumer to be updated.
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.update(
    apiConsumerId,
    apiConsumer,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiConsumer** | **ApiConsumer**| API consumer to be updated. | |
| **apiConsumerId** | [**string**] | The ID or encoded key of the API consumer to be updated. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**ApiConsumer**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**200** | API consumer updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | API consumer not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

