# InsightsHsdmApi.UsersApi

All URIs are relative to *https://virtserver.swaggerhub.com/mkanoor/InsightsCatalog/1.0.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addProvider**](UsersApi.md#addProvider) | **POST** /providers | Temporary API to add a new provider
[**addToOrder**](UsersApi.md#addToOrder) | **POST** /orders/{order_id}/items | Add a Catalog to the Order in Pending State
[**catalogItems**](UsersApi.md#catalogItems) | **GET** /catalog_items | fetches catalog items from all providers
[**fetchCatalogItemWithProvider**](UsersApi.md#fetchCatalogItemWithProvider) | **GET** /providers/{provider_id}/catalog_items | Fetch all or a specific catalog item from a specific provider
[**fetchCatalogItemWithProviderAndCatalogID**](UsersApi.md#fetchCatalogItemWithProviderAndCatalogID) | **GET** /providers/{provider_id}/catalog_items/{catalog_id} | Fetches a specific catalog item for a provider
[**listOrderItem**](UsersApi.md#listOrderItem) | **GET** /orders/{order_id}/items/{order_item_id} | Get an individual item from a given order
[**listOrderItems**](UsersApi.md#listOrderItems) | **GET** /orders/{order_id}/items | Get a list of items in a given order
[**listOrders**](UsersApi.md#listOrders) | **GET** /orders | Get a list of orders
[**listProgressMessages**](UsersApi.md#listProgressMessages) | **GET** /order_items/{order_item_id}/progress_messages | Get a list of progress messages in an item
[**listProviders**](UsersApi.md#listProviders) | **GET** /providers | Temporary API to list provider
[**newOrder**](UsersApi.md#newOrder) | **POST** /orders | Create a new order
[**planParameters**](UsersApi.md#planParameters) | **GET** /providers/{provider_id}/catalog_items/{catalog_id}/catalog_plans/{plan_id}/parameters | Fetches plan parameters, it needs the provider id, the catalog_id and plan_id
[**searchPlans**](UsersApi.md#searchPlans) | **GET** /providers/{provider_id}/catalog_items/{catalog_id}/catalog_plans | searches avaliable plans for a catalog item
[**submitOrder**](UsersApi.md#submitOrder) | **POST** /orders/{order_id} | Submit the given order


<a name="addProvider"></a>
# **addProvider**
> Object addProvider(body)

Temporary API to add a new provider

Returns the added provider object 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var body = new InsightsHsdmApi.Provider(); // Provider | 

apiInstance.addProvider(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Provider**](Provider.md)|  | 

### Return type

**Object**

### Authorization

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

### HTTP request headers

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

<a name="addToOrder"></a>
# **addToOrder**
> addToOrder(orderId, item)

Add a Catalog to the Order in Pending State

Add a catalog item to the order in Pending State 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var orderId = "orderId_example"; // String | The Order ID

var item = new InsightsHsdmApi.OrderItem(); // OrderItem | 

apiInstance.addToOrder(orderId, item).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **orderId** | [**String**](.md)| The Order ID | 
 **item** | [**OrderItem**](OrderItem.md)|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="catalogItems"></a>
# **catalogItems**
> [CatalogItem] catalogItems()

fetches catalog items from all providers

Fetch catalog item from all defined providers 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();
apiInstance.catalogItems().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[CatalogItem]**](CatalogItem.md)

### Authorization

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

### HTTP request headers

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

<a name="fetchCatalogItemWithProvider"></a>
# **fetchCatalogItemWithProvider**
> [CatalogItem] fetchCatalogItemWithProvider(providerId, opts)

Fetch all or a specific catalog item from a specific provider

By passing in the provider id you can fetch all the catalog items in the provider. You can limit to a specific catalog item by passing its id 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var providerId = "providerId_example"; // String | The Provider ID

var opts = { 
  'catalogId': "catalogId_example" // String | The Catalog ID
};
apiInstance.fetchCatalogItemWithProvider(providerId, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **providerId** | [**String**](.md)| The Provider ID | 
 **catalogId** | [**String**](.md)| The Catalog ID | [optional] 

### Return type

[**[CatalogItem]**](CatalogItem.md)

### Authorization

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

### HTTP request headers

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

<a name="fetchCatalogItemWithProviderAndCatalogID"></a>
# **fetchCatalogItemWithProviderAndCatalogID**
> [CatalogItem] fetchCatalogItemWithProviderAndCatalogID(providerId, catalogId)

Fetches a specific catalog item for a provider

Fetch a catalog item by its ID and provider ID 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var providerId = "providerId_example"; // String | The Provider ID

var catalogId = "catalogId_example"; // String | The Catalog ID

apiInstance.fetchCatalogItemWithProviderAndCatalogID(providerId, catalogId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **providerId** | [**String**](.md)| The Provider ID | 
 **catalogId** | [**String**](.md)| The Catalog ID | 

### Return type

[**[CatalogItem]**](CatalogItem.md)

### Authorization

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

### HTTP request headers

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

<a name="listOrderItem"></a>
# **listOrderItem**
> OrderItem listOrderItem(orderId, orderItemId)

Get an individual item from a given order

Get an item associated with an order. 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var orderId = "orderId_example"; // String | The Order ID

var orderItemId = "orderItemId_example"; // String | The Order Item ID

apiInstance.listOrderItem(orderId, orderItemId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **orderId** | [**String**](.md)| The Order ID | 
 **orderItemId** | [**String**](.md)| The Order Item ID | 

### Return type

[**OrderItem**](OrderItem.md)

### Authorization

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

### HTTP request headers

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

<a name="listOrderItems"></a>
# **listOrderItems**
> [OrderItem] listOrderItems(orderId)

Get a list of items in a given order

Get a list of items associated with an order. 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var orderId = "orderId_example"; // String | The Order ID

apiInstance.listOrderItems(orderId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **orderId** | [**String**](.md)| The Order ID | 

### Return type

[**[OrderItem]**](OrderItem.md)

### Authorization

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

### HTTP request headers

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

<a name="listOrders"></a>
# **listOrders**
> [Order] listOrders()

Get a list of orders

Get a list of orders associated with the logged in user. 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();
apiInstance.listOrders().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[Order]**](Order.md)

### Authorization

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

### HTTP request headers

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

<a name="listProgressMessages"></a>
# **listProgressMessages**
> [ProgressMessage] listProgressMessages(orderItemId)

Get a list of progress messages in an item

Get a list of progress messages associated with an order item. As the item is being processed the provider can update the progress messages 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var orderItemId = "orderItemId_example"; // String | The Order Item ID

apiInstance.listProgressMessages(orderItemId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **orderItemId** | [**String**](.md)| The Order Item ID | 

### Return type

[**[ProgressMessage]**](ProgressMessage.md)

### Authorization

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

### HTTP request headers

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

<a name="listProviders"></a>
# **listProviders**
> [Provider] listProviders()

Temporary API to list provider

Returns the array of provider object 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();
apiInstance.listProviders().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[Provider]**](Provider.md)

### Authorization

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

### HTTP request headers

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

<a name="newOrder"></a>
# **newOrder**
> Order newOrder()

Create a new order

Create a new order. 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();
apiInstance.newOrder().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters
This endpoint does not need any parameter.

### Return type

[**Order**](Order.md)

### Authorization

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

### HTTP request headers

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

<a name="planParameters"></a>
# **planParameters**
> [PlanParameter] planParameters(providerId, catalogId, planId)

Fetches plan parameters, it needs the provider id, the catalog_id and plan_id

Return a JSON object with the parameters needed for a plan 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var providerId = "providerId_example"; // String | The Provider ID

var catalogId = "catalogId_example"; // String | The Catalog ID

var planId = "planId_example"; // String | The Plan ID

apiInstance.planParameters(providerId, catalogId, planId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **providerId** | [**String**](.md)| The Provider ID | 
 **catalogId** | [**String**](.md)| The Catalog ID | 
 **planId** | [**String**](.md)| The Plan ID | 

### Return type

[**[PlanParameter]**](PlanParameter.md)

### Authorization

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

### HTTP request headers

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

<a name="searchPlans"></a>
# **searchPlans**
> [CatalogPlan] searchPlans(providerId, catalogId)

searches avaliable plans for a catalog item

List all the available plans for a given catalog item 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var providerId = "providerId_example"; // String | The Provider ID

var catalogId = "catalogId_example"; // String | The Catalog ID

apiInstance.searchPlans(providerId, catalogId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **providerId** | [**String**](.md)| The Provider ID | 
 **catalogId** | [**String**](.md)| The Catalog ID | 

### Return type

[**[CatalogPlan]**](CatalogPlan.md)

### Authorization

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

### HTTP request headers

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

<a name="submitOrder"></a>
# **submitOrder**
> Order submitOrder(orderId)

Submit the given order

Returns an updated order object 

### Example
```javascript
var InsightsHsdmApi = require('insights_hsdm_api');
var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME';
UserSecurity.password = 'YOUR PASSWORD';

var apiInstance = new InsightsHsdmApi.UsersApi();

var orderId = "orderId_example"; // String | The Order ID

apiInstance.submitOrder(orderId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **orderId** | [**String**](.md)| The Order ID | 

### Return type

[**Order**](Order.md)

### Authorization

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

### HTTP request headers

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

