# SdPublicProdApi.PolicyEndpointsApi

All URIs are relative to *https://core-api.stardust.gg/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**policyCreatePost**](PolicyEndpointsApi.md#policyCreatePost) | **POST** /policy/create | Create a Policy
[**policyGetGet**](PolicyEndpointsApi.md#policyGetGet) | **GET** /policy/get | Get Policies for Game
[**policyMutatePut**](PolicyEndpointsApi.md#policyMutatePut) | **PUT** /policy/mutate | Mutate a Policy

<a name="policyCreatePost"></a>
# **policyCreatePost**
> SDPolicyCreateResponse policyCreatePost(body)

Create a Policy

Create a new policy for a game. Returns policy id. Only 2 active policies are allowed per game at a time.

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.PolicyEndpointsApi();
let body = new SdPublicProdApi.SDPolicyCreateRequest(); // SDPolicyCreateRequest | 

apiInstance.policyCreatePost(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**SDPolicyCreateResponse**](SDPolicyCreateResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="policyGetGet"></a>
# **policyGetGet**
> SDPolicyGetResponses policyGetGet(policyIds)

Get Policies for Game

Gets a Policies via ids

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.PolicyEndpointsApi();
let policyIds = "policyIds_example"; // String | Stringify Array of policy ids (ex. '[3589, 3580]')

apiInstance.policyGetGet(policyIds, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **policyIds** | **String**| Stringify Array of policy ids (ex. &#x27;[3589, 3580]&#x27;) | 

### Return type

[**SDPolicyGetResponses**](SDPolicyGetResponses.md)

### Authorization

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

### HTTP request headers

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

<a name="policyMutatePut"></a>
# **policyMutatePut**
> Empty policyMutatePut(body)

Mutate a Policy

Mutate a policy. Returns policy id

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.PolicyEndpointsApi();
let body = new SdPublicProdApi.SDPolicyMutateRequest(); // SDPolicyMutateRequest | 

apiInstance.policyMutatePut(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**Empty**](Empty.md)

### Authorization

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

### HTTP request headers

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

