# SwiftShiftApi.AgencyApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrganization**](AgencyApi.md#deleteOrganization) | **DELETE** /organizations/{organization_id} | 
[**deleteSite**](AgencyApi.md#deleteSite) | **DELETE** /organizations/{organization_id}/sites/{site_id} | 
[**getOrganization**](AgencyApi.md#getOrganization) | **GET** /organizations/{organization_id} | 
[**getSite**](AgencyApi.md#getSite) | **GET** /organizations/{organization_id}/sites/{site_id} | 
[**getSiteSettings**](AgencyApi.md#getSiteSettings) | **GET** /organizations/{organization_id}/sites/{site_id}/settings | 
[**getSiteStats**](AgencyApi.md#getSiteStats) | **GET** /organizations/{organization_id}/sites/{site_id}/statistics/{view_name} | 
[**listOrganizations**](AgencyApi.md#listOrganizations) | **GET** /organizations | list organizations
[**listSites**](AgencyApi.md#listSites) | **GET** /organizations/{organization_id}/sites | list sites
[**postOrganization**](AgencyApi.md#postOrganization) | **POST** /organizations | creates an organization
[**postSite**](AgencyApi.md#postSite) | **POST** /organizations/{organization_id}/sites | creates a site
[**putOrganization**](AgencyApi.md#putOrganization) | **PUT** /organizations/{organization_id} | 
[**putSite**](AgencyApi.md#putSite) | **PUT** /organizations/{organization_id}/sites/{site_id} | 


<a name="deleteOrganization"></a>
# **deleteOrganization**
> Organization deleteOrganization(organizationId)



delete organization

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let organizationId = "organizationId_example"; // String | id of the organization
apiInstance.deleteOrganization(organizationId, (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 | 

### Return type

[**Organization**](Organization.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="deleteSite"></a>
# **deleteSite**
> Site deleteSite(siteId, organizationId)



delete site

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

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

### Parameters

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

### Return type

[**Site**](Site.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getOrganization"></a>
# **getOrganization**
> Organization getOrganization(organizationId)



get organization details

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let organizationId = "organizationId_example"; // String | id of the organization
apiInstance.getOrganization(organizationId, (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 | 

### Return type

[**Organization**](Organization.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getSite"></a>
# **getSite**
> Site getSite(siteId, organizationId)



get site details

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

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

### Parameters

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

### Return type

[**Site**](Site.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getSiteSettings"></a>
# **getSiteSettings**
> SiteSettings getSiteSettings(siteId, organizationId)



get site settings

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

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

### Parameters

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

### Return type

[**SiteSettings**](SiteSettings.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="getSiteStats"></a>
# **getSiteStats**
> InlineResponse2001 getSiteStats(viewName, siteId, organizationId, opts)



get site stats

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let viewName = "viewName_example"; // String | the name of the statistics db view
let siteId = "siteId_example"; // String | id of the site
let organizationId = "organizationId_example"; // String | id of the organization
let opts = {
  'orderBy': "orderBy_example", // String | a type orm json orderBy compliant statement
  'groupBy': "groupBy_example", // String | a type orm json groupBy compliant statement
  'where': "where_example", // String | a type orm json where compliant statement
  'select': "select_example", // String | a type orm json select compliant statement
  'q': "q_example" // String | resource query language
};
apiInstance.getSiteStats(viewName, siteId, organizationId, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **viewName** | **String**| the name of the statistics db view | 
 **siteId** | **String**| id of the site | 
 **organizationId** | **String**| id of the organization | 
 **orderBy** | **String**| a type orm json orderBy compliant statement | [optional] 
 **groupBy** | **String**| a type orm json groupBy compliant statement | [optional] 
 **where** | **String**| a type orm json where compliant statement | [optional] 
 **select** | **String**| a type orm json select compliant statement | [optional] 
 **q** | **String**| resource query language | [optional] 

### Return type

[**InlineResponse2001**](InlineResponse2001.md)

### Authorization

No authorization required

### HTTP request headers

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

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

list organizations

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let opts = {
  'take': 56, // Number | Page size.
  'skip': 56, // Number | The start index.
  'search': "search_example", // String | Search phrase.
  'select': ["null"], // [String] | 
  'q': "q_example" // String | resource query language
};
apiInstance.listOrganizations(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **take** | **Number**| Page size. | [optional] 
 **skip** | **Number**| The start index. | [optional] 
 **search** | **String**| Search phrase. | [optional] 
 **select** | [**[String]**](String.md)|  | [optional] 
 **q** | **String**| resource query language | [optional] 

### Return type

[**InlineResponse2003**](InlineResponse2003.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="listSites"></a>
# **listSites**
> InlineResponse200 listSites(organizationId, opts)

list sites

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let organizationId = "organizationId_example"; // String | id of the organization
let opts = {
  'take': 56, // Number | Page size.
  'skip': 56, // Number | The start index.
  'search': "search_example", // String | Search phrase.
  'select': ["null"], // [String] | 
  'q': "q_example" // String | resource query language
};
apiInstance.listSites(organizationId, 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 | 
 **take** | **Number**| Page size. | [optional] 
 **skip** | **Number**| The start index. | [optional] 
 **search** | **String**| Search phrase. | [optional] 
 **select** | [**[String]**](String.md)|  | [optional] 
 **q** | **String**| resource query language | [optional] 

### Return type

[**InlineResponse200**](InlineResponse200.md)

### Authorization

No authorization required

### HTTP request headers

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

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

creates an organization

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let opts = {
  'organization': new SwiftShiftApi.Organization() // Organization | 
};
apiInstance.postOrganization(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **organization** | [**Organization**](Organization.md)|  | [optional] 

### Return type

[**Organization**](Organization.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="postSite"></a>
# **postSite**
> Site postSite(organizationId, opts)

creates a site

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let organizationId = "organizationId_example"; // String | id of the organization
let opts = {
  'site': new SwiftShiftApi.Site() // Site | 
};
apiInstance.postSite(organizationId, 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 | 
 **site** | [**Site**](Site.md)|  | [optional] 

### Return type

[**Site**](Site.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="putOrganization"></a>
# **putOrganization**
> Organization putOrganization(organizationId, opts)



update organization details

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

let apiInstance = new SwiftShiftApi.AgencyApi();
let organizationId = "organizationId_example"; // String | id of the organization
let opts = {
  'organization': new SwiftShiftApi.Organization() // Organization | 
};
apiInstance.putOrganization(organizationId, 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 | 
 **organization** | [**Organization**](Organization.md)|  | [optional] 

### Return type

[**Organization**](Organization.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="putSite"></a>
# **putSite**
> Site putSite(siteId, organizationId, opts)



update site details

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

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

### Parameters

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

### Return type

[**Site**](Site.md)

### Authorization

No authorization required

### HTTP request headers

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

