# PaperdbClient.PeopleApi

All URIs are relative to *http://localhost:8880/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createPerson**](PeopleApi.md#createPerson) | **POST** /persons | 
[**deletePerson**](PeopleApi.md#deletePerson) | **DELETE** /person/{uuid} | 
[**fetchPerson**](PeopleApi.md#fetchPerson) | **GET** /person/{uuid} | 
[**getResourceDetails**](PeopleApi.md#getResourceDetails) | **GET** /person/{uuid}/resources | 
[**listPersons**](PeopleApi.md#listPersons) | **GET** /persons | 
[**personUuidPermissionsGet**](PeopleApi.md#personUuidPermissionsGet) | **GET** /person/{uuid}/permissions | Get all of the person&#39;s permissions
[**personUuidPermissionsPost**](PeopleApi.md#personUuidPermissionsPost) | **POST** /person/{uuid}/permissions | Grant a permission to the given person
[**replacePerson**](PeopleApi.md#replacePerson) | **PUT** /person/{uuid} | 
[**updatePerson**](PeopleApi.md#updatePerson) | **PATCH** /person/{uuid} | 


<a name="createPerson"></a>
# **createPerson**
> PersonDetails createPerson(person)



Add a new person to the database

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var person = new PaperdbClient.PersonCreationDetails(); // PersonCreationDetails | 

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **person** | [**PersonCreationDetails**](PersonCreationDetails.md)|  | 

### Return type

[**PersonDetails**](PersonDetails.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="deletePerson"></a>
# **deletePerson**
> deletePerson(uuid)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

apiInstance.deletePerson(uuid).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="fetchPerson"></a>
# **fetchPerson**
> PersonDetails fetchPerson(uuid)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 

### Return type

[**PersonDetails**](PersonDetails.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getResourceDetails"></a>
# **getResourceDetails**
> [ResourceDetails] getResourceDetails(uuid)



List resources owned by the specified person

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 

### Return type

[**[ResourceDetails]**](ResourceDetails.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="listPersons"></a>
# **listPersons**
> PersonDetails listPersons()



List all persons registered in this repository

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();
apiInstance.listPersons().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

[**PersonDetails**](PersonDetails.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="personUuidPermissionsGet"></a>
# **personUuidPermissionsGet**
> [&#39;String&#39;] personUuidPermissionsGet(uuid)

Get all of the person&#39;s permissions

This operation lists ALL of the person&#39;s permission, be it either directly set on the person itself or though a group the person is a member of. 

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 

### Return type

**[&#39;String&#39;]**

### Authorization

No authorization required

### HTTP request headers

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

<a name="personUuidPermissionsPost"></a>
# **personUuidPermissionsPost**
> personUuidPermissionsPost(uuid, opts)

Grant a permission to the given person

This link a certain permission directly to the specified person. 

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

var opts = { 
  'permissions': [new PaperdbClient.[String]()] // [String] | 
};
apiInstance.personUuidPermissionsPost(uuid, opts).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **permissions** | **[String]**|  | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="replacePerson"></a>
# **replacePerson**
> replacePerson(uuid, person)



Replace an existing person

### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

var person = new PaperdbClient.PersonCreationDetails(); // PersonCreationDetails | 

apiInstance.replacePerson(uuid, person).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **person** | [**PersonCreationDetails**](PersonCreationDetails.md)|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="updatePerson"></a>
# **updatePerson**
> updatePerson(uuid, person)



### Example
```javascript
var PaperdbClient = require('paperdb-client');

var apiInstance = new PaperdbClient.PeopleApi();

var uuid = "uuid_example"; // String | 

var person = new PaperdbClient.PersonDetailsDelta(); // PersonDetailsDelta | 

apiInstance.updatePerson(uuid, person).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **uuid** | **String**|  | 
 **person** | [**PersonDetailsDelta**](PersonDetailsDelta.md)|  | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

