# OrganizationSourceAuthenticationApi

All URIs are relative to *http://../..*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createOrganizationSource**](OrganizationSourceAuthenticationApi.md#createorganizationsource) | **POST** /authentications/organizations/{organizationId}/sources | Create a new source for an organization and authenticate |
| [**deleteOrganizationSource**](OrganizationSourceAuthenticationApi.md#deleteorganizationsource) | **DELETE** /authentications/organizations/{organizationId}/sources/{sourceKey} | Delete an existing source |
| [**listOrganizationSources**](OrganizationSourceAuthenticationApi.md#listorganizationsources) | **GET** /authentications/organizations/{organizationId}/sources | Get all the authentication sources for an organization |
| [**toggleOrganizationSource**](OrganizationSourceAuthenticationApi.md#toggleorganizationsource) | **PUT** /authentications/organizations/{organizationId}/sources/{sourceKey}/state | Enable or disable a given source for an organization |
| [**updateOrganizationSource**](OrganizationSourceAuthenticationApi.md#updateorganizationsource) | **PUT** /authentications/organizations/{organizationId}/sources/{sourceKey} | Update the credentials of a given source for an organization |



## createOrganizationSource

> OrganizationSourceAuthenticationResultSchema createOrganizationSource(organizationId, payload, certificate)

Create a new source for an organization and authenticate

### Example

```ts
import {
  Configuration,
  OrganizationSourceAuthenticationApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { CreateOrganizationSourceRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new OrganizationSourceAuthenticationApi(config);

  const body = {
    // string
    organizationId: organizationId_example,
    // CreatePayloadSourceAuthenticationSchema
    payload: ...,
    // Blob | Certificate file (optional)
    certificate: BINARY_DATA_HERE,
  } satisfies CreateOrganizationSourceRequest;

  try {
    const data = await api.createOrganizationSource(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **organizationId** | `string` |  | [Defaults to `undefined`] |
| **payload** | [CreatePayloadSourceAuthenticationSchema](CreatePayloadSourceAuthenticationSchema.md) |  | [Defaults to `undefined`] |
| **certificate** | `Blob` | Certificate file | [Optional] [Defaults to `undefined`] |

### Return type

[**OrganizationSourceAuthenticationResultSchema**](OrganizationSourceAuthenticationResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Created |  -  |
| **400** | Source not created. Authentication may have failed. |  -  |
| **409** | The source already exists |  -  |
| **500** | An unexpected error happened. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


## deleteOrganizationSource

> deleteOrganizationSource(organizationId, sourceKey)

Delete an existing source

### Example

```ts
import {
  Configuration,
  OrganizationSourceAuthenticationApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { DeleteOrganizationSourceRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new OrganizationSourceAuthenticationApi(config);

  const body = {
    // string
    organizationId: organizationId_example,
    // string
    sourceKey: sourceKey_example,
  } satisfies DeleteOrganizationSourceRequest;

  try {
    const data = await api.deleteOrganizationSource(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **organizationId** | `string` |  | [Defaults to `undefined`] |
| **sourceKey** | `string` |  | [Defaults to `undefined`] |

### Return type

`void` (Empty response body)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | Successfully deleted the source |  -  |
| **404** | Source not found |  -  |
| **500** | An unexpected error happened. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


## listOrganizationSources

> ListOrganizationSourceAuthenticationResultSchema listOrganizationSources(organizationId)

Get all the authentication sources for an organization

### Example

```ts
import {
  Configuration,
  OrganizationSourceAuthenticationApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { ListOrganizationSourcesRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new OrganizationSourceAuthenticationApi(config);

  const body = {
    // string
    organizationId: organizationId_example,
  } satisfies ListOrganizationSourcesRequest;

  try {
    const data = await api.listOrganizationSources(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **organizationId** | `string` |  | [Defaults to `undefined`] |

### Return type

[**ListOrganizationSourceAuthenticationResultSchema**](ListOrganizationSourceAuthenticationResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Success |  -  |
| **500** | An unexpected error happened. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


## toggleOrganizationSource

> OrganizationSourceAuthenticationResultSchema toggleOrganizationSource(organizationId, sourceKey, toggleSourceAuthenticationSchema)

Enable or disable a given source for an organization

### Example

```ts
import {
  Configuration,
  OrganizationSourceAuthenticationApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { ToggleOrganizationSourceRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new OrganizationSourceAuthenticationApi(config);

  const body = {
    // string
    organizationId: organizationId_example,
    // string
    sourceKey: sourceKey_example,
    // ToggleSourceAuthenticationSchema
    toggleSourceAuthenticationSchema: ...,
  } satisfies ToggleOrganizationSourceRequest;

  try {
    const data = await api.toggleOrganizationSource(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **organizationId** | `string` |  | [Defaults to `undefined`] |
| **sourceKey** | `string` |  | [Defaults to `undefined`] |
| **toggleSourceAuthenticationSchema** | [ToggleSourceAuthenticationSchema](ToggleSourceAuthenticationSchema.md) |  | |

### Return type

[**OrganizationSourceAuthenticationResultSchema**](OrganizationSourceAuthenticationResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Success |  -  |
| **404** | Source Authentication not found |  -  |
| **500** | An unexpected error happened. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


## updateOrganizationSource

> OrganizationSourceAuthenticationResultSchema updateOrganizationSource(organizationId, sourceKey, payload, certificate)

Update the credentials of a given source for an organization

### Example

```ts
import {
  Configuration,
  OrganizationSourceAuthenticationApi,
} from '@equisoft/ucx-proxy-sdk-typescript';
import type { UpdateOrganizationSourceRequest } from '@equisoft/ucx-proxy-sdk-typescript';

async function example() {
  console.log("🚀 Testing @equisoft/ucx-proxy-sdk-typescript SDK...");
  const config = new Configuration({ 
    // To configure OAuth2 access token for authorization: default accessCode
    accessToken: "YOUR ACCESS TOKEN",
  });
  const api = new OrganizationSourceAuthenticationApi(config);

  const body = {
    // string
    organizationId: organizationId_example,
    // string
    sourceKey: sourceKey_example,
    // UpdatePayloadSourceAuthenticationSchema
    payload: ...,
    // Blob | Certificate file (optional)
    certificate: BINARY_DATA_HERE,
  } satisfies UpdateOrganizationSourceRequest;

  try {
    const data = await api.updateOrganizationSource(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description  | Notes |
|------------- | ------------- | ------------- | -------------|
| **organizationId** | `string` |  | [Defaults to `undefined`] |
| **sourceKey** | `string` |  | [Defaults to `undefined`] |
| **payload** | [UpdatePayloadSourceAuthenticationSchema](UpdatePayloadSourceAuthenticationSchema.md) |  | [Defaults to `undefined`] |
| **certificate** | `Blob` | Certificate file | [Optional] [Defaults to `undefined`] |

### Return type

[**OrganizationSourceAuthenticationResultSchema**](OrganizationSourceAuthenticationResultSchema.md)

### Authorization

[default accessCode](../README.md#default-accessCode)

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Success |  -  |
| **400** | Source not updated. Authentication may have failed. |  -  |
| **404** | Source Authentication not found |  -  |
| **500** | An unexpected error happened. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

