# SwiftShiftApi.ServiceApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteService**](ServiceApi.md#deleteService) | **DELETE** /organizations/{organization_id}/sites/{site_id}/services/{id} | 
[**getService**](ServiceApi.md#getService) | **GET** /organizations/{organization_id}/sites/{site_id}/services/{id} | Gets service by id
[**listServices**](ServiceApi.md#listServices) | **GET** /organizations/{organization_id}/sites/{site_id}/services | Gets list of all services
[**postService**](ServiceApi.md#postService) | **POST** /organizations/{organization_id}/sites/{site_id}/services | Creates a service
[**putService**](ServiceApi.md#putService) | **PUT** /organizations/{organization_id}/sites/{site_id}/services/{id} | Updates service by id


<a name="deleteService"></a>
# **deleteService**
> Service deleteService(organizationId, siteId, id)



delete service

### Example
```javascript
import SwiftShiftApi from 'swift_shift_api';

let apiInstance = new SwiftShiftApi.ServiceApi();
let organizationId = "organizationId_example"; // String | id of the organization
let siteId = "siteId_example"; // String | id of the site
let id = "id_example"; // String | id of the service
apiInstance.deleteService(organizationId, siteId, id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organizationId** | **String**| id of the organization | 
 **siteId** | **String**| id of the site | 
 **id** | **String**| id of the service | 

### Return type

[**Service**](Service.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getService"></a>
# **getService**
> Service getService(organizationId, siteId, id)

Gets service by id

### Example
```javascript
import SwiftShiftApi from 'swift_shift_api';

let apiInstance = new SwiftShiftApi.ServiceApi();
let organizationId = "organizationId_example"; // String | id of the organization
let siteId = "siteId_example"; // String | id of the site
let id = "id_example"; // String | id of the service
apiInstance.getService(organizationId, siteId, id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organizationId** | **String**| id of the organization | 
 **siteId** | **String**| id of the site | 
 **id** | **String**| id of the service | 

### Return type

[**Service**](Service.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="listServices"></a>
# **listServices**
> InlineResponse2004 listServices(organizationId, siteId, opts)

Gets list of all services

### Example
```javascript
import SwiftShiftApi from 'swift_shift_api';

let apiInstance = new SwiftShiftApi.ServiceApi();
let organizationId = "organizationId_example"; // String | id of the organization
let siteId = "siteId_example"; // String | id of the site
let opts = {
  'take': 50, // Number | Page size.
  'skip': 0, // Number | The start index.
  'search': "search_example", // String | Search phrase.
  'select': ["null"], // [String] | List of the properties to return.
  'q': "q_example" // String | resource query language
};
apiInstance.listServices(organizationId, siteId, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organizationId** | **String**| id of the organization | 
 **siteId** | **String**| id of the site | 
 **take** | **Number**| Page size. | [optional] [default to 50]
 **skip** | **Number**| The start index. | [optional] [default to 0]
 **search** | **String**| Search phrase. | [optional] 
 **select** | [**[String]**](String.md)| List of the properties to return. | [optional] 
 **q** | **String**| resource query language | [optional] 

### Return type

[**InlineResponse2004**](InlineResponse2004.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="postService"></a>
# **postService**
> Service postService(organizationId, siteId, opts)

Creates a service

### Example
```javascript
import SwiftShiftApi from 'swift_shift_api';

let apiInstance = new SwiftShiftApi.ServiceApi();
let organizationId = "organizationId_example"; // String | id of the organization
let siteId = "siteId_example"; // String | id of the site
let opts = {
  'service': new SwiftShiftApi.Service() // Service | 
};
apiInstance.postService(organizationId, siteId, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organizationId** | **String**| id of the organization | 
 **siteId** | **String**| id of the site | 
 **service** | [**Service**](Service.md)|  | [optional] 

### Return type

[**Service**](Service.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="putService"></a>
# **putService**
> Service putService(organizationId, siteId, id, opts)

Updates service by id

### Example
```javascript
import SwiftShiftApi from 'swift_shift_api';

let apiInstance = new SwiftShiftApi.ServiceApi();
let organizationId = "organizationId_example"; // String | id of the organization
let siteId = "siteId_example"; // String | id of the site
let id = "id_example"; // String | id of the service
let opts = {
  'service': new SwiftShiftApi.Service() // Service | 
};
apiInstance.putService(organizationId, siteId, id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organizationId** | **String**| id of the organization | 
 **siteId** | **String**| id of the site | 
 **id** | **String**| id of the service | 
 **service** | [**Service**](Service.md)|  | [optional] 

### Return type

[**Service**](Service.md)

### Authorization

No authorization required

### HTTP request headers

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

