# Nr1CatalogApp.LinkGroupsApi

All URIs are relative to *http://api.ncr.com/catalog/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**linkGroupsFindByCriteria**](LinkGroupsApi.md#linkGroupsFindByCriteria) | **GET** /link-groups | Retrieve active link-group documents by the specified search criteria.
[**linkGroupsGet**](LinkGroupsApi.md#linkGroupsGet) | **GET** /link-groups/{linkGroupCode} | Retrieves a link group document by the resource identifier.
[**linkGroupsGetSnapshot**](LinkGroupsApi.md#linkGroupsGetSnapshot) | **GET** /link-groups/snapshot | Get the snapshot based on the provided client snapshot version.
[**linkGroupsSave**](LinkGroupsApi.md#linkGroupsSave) | **PUT** /link-groups/{linkGroupCode} | Creates/Updates a link-group document.
[**linkGroupsSaveMultiple**](LinkGroupsApi.md#linkGroupsSaveMultiple) | **PUT** /link-groups | Imports a mini-batch of link group documents.


<a name="linkGroupsFindByCriteria"></a>
# **linkGroupsFindByCriteria**
> FindLinkGroupsResponse linkGroupsFindByCriteria(opts)

Retrieve active link-group documents by the specified search criteria.

<p>This API fetches link-group documents matching the specified search criteria.<br/>The search criteria is passed as a query parameter with the API request. </p><p><h3>Input parameter:- </h3> <code>request:</code> Link group search criteria.<br/><h3>Returns:</h3>  A page of link-group objects that match the specified search criteria.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.LinkGroupsApi();

var opts = { 
  'pageNumber': 0, // Number | The requested page number (starting from zero)
  'pageSize': 200, // Number | The page size
  'descriptionPattern': "descriptionPattern_example", // String | Title pattern to filter the search results. May be null, in that case all groups are returned.<p>Fields named '*Pattern' support wild-card characters.</p>Examples:<ul><li>descriptionPattern=group1 (exact match)</li><li>descriptionPattern=so* (starts with so)</li><li>descriptionPattern=*so* (contains so)</li><li>descriptionPattern=* (any value)</li></ul>
  'type': "type_example", // String | LinkGroupType to filter the search results.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.linkGroupsFindByCriteria(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **pageNumber** | **Number**| The requested page number (starting from zero) | [optional] [default to 0]
 **pageSize** | **Number**| The page size | [optional] [default to 200]
 **descriptionPattern** | **String**| Title pattern to filter the search results. May be null, in that case all groups are returned.<p>Fields named '*Pattern' support wild-card characters.</p>Examples:<ul><li>descriptionPattern=group1 (exact match)</li><li>descriptionPattern=so* (starts with so)</li><li>descriptionPattern=*so* (contains so)</li><li>descriptionPattern=* (any value)</li></ul> | [optional] 
 **type** | **String**| LinkGroupType to filter the search results. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**FindLinkGroupsResponse**](FindLinkGroupsResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="linkGroupsGet"></a>
# **linkGroupsGet**
> LinkGroupViewData linkGroupsGet(linkGroupCode, opts)

Retrieves a link group document by the resource identifier.

<p>This API retrieves a document of a link-group based on the provided <b>linkGroupCode</b></p>.<p><h3>Input parameter:- </h3> <code>linkGroupId:</code> Identifies the link group document to retrieve.<br/><h3>Returns:</h3> Link group document containing writable and read-only attributes of the retrieved link group.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.LinkGroupsApi();

var linkGroupCode = "linkGroupCode_example"; // String | A unique (per tenant) link group code that identifies the link group.

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.linkGroupsGet(linkGroupCode, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **linkGroupCode** | **String**| A unique (per tenant) link group code that identifies the link group. | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**LinkGroupViewData**](LinkGroupViewData.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="linkGroupsGetSnapshot"></a>
# **linkGroupsGetSnapshot**
> GetLinkGroupsSnapshotResponse linkGroupsGetSnapshot(opts)

Get the snapshot based on the provided client snapshot version.

<p>Link-group document synchronization API that is used to synchronize the resource state with the remote client such as POS, store server or mobile device. Results are filterable by <i>STATUS</i> using the query parameter <code>status=<i>desiredResourceStatus</i></code>.</p><p><h3>Input parameter:- </h3> <code>request:</code> Snapshot request containing snapshotVersion.<br/><br/><h3>Returns:</h3> A snapshot that matches the request parameters (e.g. all link groups modified since the submitted client version).<br/><br/></p><p><b>If the the result payload exceeds maximum size (generally around 10K records), the document synchronization cannot be accomplished using APIs. The client should wait a few moments for the file to be available at the provided URI in the details.</b></p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.LinkGroupsApi();

var opts = { 
  'nepEnterpriseUnit': "nepEnterpriseUnit_example", // String | Enterprise unit id.
  'nepSnapshotVersion': 789, // Number | Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp.
  'status': "status_example", // String | Flag to filter just one status type.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.linkGroupsGetSnapshot(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit id. | [optional] 
 **nepSnapshotVersion** | **Number**| Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp. | [optional] 
 **status** | **String**| Flag to filter just one status type. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetLinkGroupsSnapshotResponse**](GetLinkGroupsSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="linkGroupsSave"></a>
# **linkGroupsSave**
> linkGroupsSave(linkGroupCode, opts)

Creates/Updates a link-group document.

<p>This API creates or updates a link-group with the provided identifier <b>linkGroupCode</b>. If the link-group already exists, the document will be updated only if the version number in the request is greater than the version number of the existing document. If enterprise unit header is specified with the request, the object is saved with the specified enterprise unit making the link group applicable only for the specified unit (site/store).<br/></p><p><h3>Input parameter:- </h3> <code>linkGroupId:</code> Request containing link group identifier and optional enterprise unit information.<br/> <code>linkGroup:</code> Object containing the link group to save.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.LinkGroupsApi();

var linkGroupCode = "linkGroupCode_example"; // String | A unique (per tenant) link group code that identifies the link group.

var opts = { 
  'body': new Nr1CatalogApp.LinkGroupData(), // LinkGroupData | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.linkGroupsSave(linkGroupCode, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **linkGroupCode** | **String**| A unique (per tenant) link group code that identifies the link group. | 
 **body** | [**LinkGroupData**](LinkGroupData.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="linkGroupsSaveMultiple"></a>
# **linkGroupsSaveMultiple**
> linkGroupsSaveMultiple(opts)

Imports a mini-batch of link group documents.

<p>This import API will either create or update existing link group documents. It allows specifying multiple enterprise units in the request, with a maximum of 100 enterprise units per request. The API will perform an authorization check on the supplied enterprise units.<br/> If the link-group already exists, the document will be updated only if the version number in the request is greater than the version number of the existing document. </p><p><h3>Input parameter:- </h3> request: contains the list of link groups to save</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.LinkGroupsApi();

var opts = { 
  'body': new Nr1CatalogApp.SaveMultipleLinkGroupsRequest(), // SaveMultipleLinkGroupsRequest | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.linkGroupsSaveMultiple(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SaveMultipleLinkGroupsRequest**](SaveMultipleLinkGroupsRequest.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

