@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
293 lines • 57.6 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* API v4
* Swagger documentation for API v4
*
* The version of the OpenAPI document: 4.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { V4SourcesCreateSourceBodyDtoToJSON, V4SourcesCreateSourceResponseDtoFromJSON, V4SourcesDeleteSourceResponseDtoFromJSON, V4SourcesGetSourceColumnsResponseDtoFromJSON, V4SourcesGetSourceResponseDtoFromJSON, V4SourcesGetSourcesInViewResponseDtoFromJSON, V4SourcesGetSourcesResponseDtoFromJSON, V4SourcesGetUniqueValuesResponseDtoFromJSON, V4SourcesUpdateSourceBodyDtoToJSON, V4SourcesUpdateSourceResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class SourcesAPIV4Api extends runtime.BaseAPI {
/**
* # POST /v4/sources ## Overview Creates a new source in the system. This endpoint allows you to add new data sources that can be used for property relationships and data management operations. Each source represents a data provider or acquisition channel. ## Controller Reference See `V4_Sources_Controller.createSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body must contain a JSON object with the source information. ### Content Type - **application/json** ### Request Structure ```json { \"source\": \"MLS\" } ``` ### Required Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `source` | string | Yes | The type of source (enum value) | ### Source Types Available source types (enum values): - **MLS**: Multiple Listing Service - **DTS**: Data Transfer Service - **Wholesaler**: Wholesale property sources - **Airtable**: Airtable integration sources - **Generic**: Generic data sources - **HomeSmart/OneHome.com**: Specific platform integration ## Access Control - **Organization Scope**: Source will be created within the user\'s organization - **Creation Permissions**: User must have permission to create sources - **Data Isolation**: Sources are isolated between organizations ## Business Rules - **Source Validation**: Source type must be one of the predefined enum values - **Organization Assignment**: Source is automatically assigned to user\'s organization - **Unique Creation**: Each source creation gets a unique system-generated ID - **Audit Trail**: Source creation is logged for compliance and tracking ## Use Cases This endpoint is ideal for: - **Data Source Management**: Adding new data acquisition channels - **System Integration**: Registering external data providers - **Property Relations**: Creating sources for property relationship management - **Workflow Setup**: Establishing sources for automated data processing - **Multi-source Strategy**: Managing multiple data acquisition channels ## Validation Rules The system validates: - **Required Fields**: Source type must be provided - **Enum Values**: Source must be one of the predefined types - **Organization Access**: User must have creation permissions - **Data Format**: Request body must be valid JSON - **Business Logic**: Source creation follows business validation rules ## Creation Process When a source is created: 1. **Validation**: Request data is validated against business rules 2. **ID Generation**: Unique source ID (sid) is automatically generated 3. **Organization Assignment**: Source is assigned to user\'s organization 4. **Timestamp**: Creation timestamp is automatically set 5. **Audit Log**: Creation event is logged for tracking 6. **Response**: Source ID is returned for further operations
* Create a new source
*/
async v4SourcesControllerCreateSourceV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4SourcesCreateSourceBodyDto'] == null) {
throw new runtime.RequiredError('v4SourcesCreateSourceBodyDto', 'Required parameter "v4SourcesCreateSourceBodyDto" was null or undefined when calling v4SourcesControllerCreateSourceV4().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4SourcesCreateSourceBodyDtoToJSON(requestParameters['v4SourcesCreateSourceBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesCreateSourceResponseDtoFromJSON(jsonValue));
}
/**
* # POST /v4/sources ## Overview Creates a new source in the system. This endpoint allows you to add new data sources that can be used for property relationships and data management operations. Each source represents a data provider or acquisition channel. ## Controller Reference See `V4_Sources_Controller.createSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body must contain a JSON object with the source information. ### Content Type - **application/json** ### Request Structure ```json { \"source\": \"MLS\" } ``` ### Required Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `source` | string | Yes | The type of source (enum value) | ### Source Types Available source types (enum values): - **MLS**: Multiple Listing Service - **DTS**: Data Transfer Service - **Wholesaler**: Wholesale property sources - **Airtable**: Airtable integration sources - **Generic**: Generic data sources - **HomeSmart/OneHome.com**: Specific platform integration ## Access Control - **Organization Scope**: Source will be created within the user\'s organization - **Creation Permissions**: User must have permission to create sources - **Data Isolation**: Sources are isolated between organizations ## Business Rules - **Source Validation**: Source type must be one of the predefined enum values - **Organization Assignment**: Source is automatically assigned to user\'s organization - **Unique Creation**: Each source creation gets a unique system-generated ID - **Audit Trail**: Source creation is logged for compliance and tracking ## Use Cases This endpoint is ideal for: - **Data Source Management**: Adding new data acquisition channels - **System Integration**: Registering external data providers - **Property Relations**: Creating sources for property relationship management - **Workflow Setup**: Establishing sources for automated data processing - **Multi-source Strategy**: Managing multiple data acquisition channels ## Validation Rules The system validates: - **Required Fields**: Source type must be provided - **Enum Values**: Source must be one of the predefined types - **Organization Access**: User must have creation permissions - **Data Format**: Request body must be valid JSON - **Business Logic**: Source creation follows business validation rules ## Creation Process When a source is created: 1. **Validation**: Request data is validated against business rules 2. **ID Generation**: Unique source ID (sid) is automatically generated 3. **Organization Assignment**: Source is assigned to user\'s organization 4. **Timestamp**: Creation timestamp is automatically set 5. **Audit Log**: Creation event is logged for tracking 6. **Response**: Source ID is returned for further operations
* Create a new source
*/
async v4SourcesControllerCreateSourceV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerCreateSourceV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # DELETE /v4/sources/{sourceId} ## Overview Deletes a specific source by its unique source ID. This endpoint permanently removes a source from the system along with any associated metadata. Use with caution as this operation cannot be undone. ## Controller Reference See `V4_Sources_Controller.deleteSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source to delete | ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Delete Permissions**: User must have permission to delete sources - **Ownership Validation**: Only sources within the organization can be deleted ## Business Rules - **Relationship Check**: System validates that source can be safely deleted - **Data Integrity**: Ensures referential integrity is maintained - **Audit Trail**: Deletion is logged for compliance and tracking - **Permanent Operation**: Deletion cannot be undone ## Pre-deletion Validation Before deletion, the system checks: - **Source Existence**: Source must exist in the system - **Organization Ownership**: Source must belong to user\'s organization - **Dependency Check**: Validates impact on related data - **Permission Verification**: User must have delete permissions ## Use Cases This endpoint should be used for: - **Source Cleanup**: Removing outdated or unused data sources - **System Maintenance**: Cleaning up test or development sources - **Data Governance**: Managing source lifecycle and retirement - **Organization Management**: Removing sources no longer needed - **Integration Cleanup**: Removing deprecated integration sources ## Impact Assessment Deleting a source may affect: - **Property Relations**: Existing property-source relationships - **Analytics Data**: Historical data and reporting - **Integration Points**: External system integrations - **User Workflows**: Processes that depend on the source ## Safety Considerations ⚠️ **Warning**: This operation permanently deletes the source and cannot be undone. Before deletion, consider: - **Backup Requirements**: Whether source data needs to be preserved - **Dependency Impact**: Effect on related properties and relationships - **User Communication**: Notifying users who may be affected - **Alternative Solutions**: Whether archiving might be more appropriate ## Deletion Process When a source is deleted: 1. **Validation**: System validates deletion is safe and permitted 2. **Dependency Check**: Verifies impact on related data 3. **Audit Log**: Deletion event is logged with user and timestamp 4. **Data Removal**: Source record is permanently removed 5. **Cleanup**: Associated metadata and references are cleaned up 6. **Response**: Confirmation of successful deletion is returned
* Delete a specific source by sourceId
*/
async v4SourcesControllerDeleteSourceV4Raw(requestParameters, initOverrides) {
if (requestParameters['sourceId'] == null) {
throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4SourcesControllerDeleteSourceV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources/{sourceId}`;
urlPath = urlPath.replace(`{${"sourceId"}}`, encodeURIComponent(String(requestParameters['sourceId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesDeleteSourceResponseDtoFromJSON(jsonValue));
}
/**
* # DELETE /v4/sources/{sourceId} ## Overview Deletes a specific source by its unique source ID. This endpoint permanently removes a source from the system along with any associated metadata. Use with caution as this operation cannot be undone. ## Controller Reference See `V4_Sources_Controller.deleteSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source to delete | ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Delete Permissions**: User must have permission to delete sources - **Ownership Validation**: Only sources within the organization can be deleted ## Business Rules - **Relationship Check**: System validates that source can be safely deleted - **Data Integrity**: Ensures referential integrity is maintained - **Audit Trail**: Deletion is logged for compliance and tracking - **Permanent Operation**: Deletion cannot be undone ## Pre-deletion Validation Before deletion, the system checks: - **Source Existence**: Source must exist in the system - **Organization Ownership**: Source must belong to user\'s organization - **Dependency Check**: Validates impact on related data - **Permission Verification**: User must have delete permissions ## Use Cases This endpoint should be used for: - **Source Cleanup**: Removing outdated or unused data sources - **System Maintenance**: Cleaning up test or development sources - **Data Governance**: Managing source lifecycle and retirement - **Organization Management**: Removing sources no longer needed - **Integration Cleanup**: Removing deprecated integration sources ## Impact Assessment Deleting a source may affect: - **Property Relations**: Existing property-source relationships - **Analytics Data**: Historical data and reporting - **Integration Points**: External system integrations - **User Workflows**: Processes that depend on the source ## Safety Considerations ⚠️ **Warning**: This operation permanently deletes the source and cannot be undone. Before deletion, consider: - **Backup Requirements**: Whether source data needs to be preserved - **Dependency Impact**: Effect on related properties and relationships - **User Communication**: Notifying users who may be affected - **Alternative Solutions**: Whether archiving might be more appropriate ## Deletion Process When a source is deleted: 1. **Validation**: System validates deletion is safe and permitted 2. **Dependency Check**: Verifies impact on related data 3. **Audit Log**: Deletion event is logged with user and timestamp 4. **Data Removal**: Source record is permanently removed 5. **Cleanup**: Associated metadata and references are cleaned up 6. **Response**: Confirmation of successful deletion is returned
* Delete a specific source by sourceId
*/
async v4SourcesControllerDeleteSourceV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerDeleteSourceV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/sources/{sourceId}/{columns} ## Overview Retrieves specific columns for a source by its unique source ID. This endpoint allows you to fetch only the specified columns from the source data, optimizing response size and performance for targeted data access. ## Controller Reference See `V4_Sources_Controller.getSourceColumns()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection The `columns` parameter allows you to specify which columns to retrieve: - **Format**: Comma-separated string (e.g., \"sid,source,createdAt\") - **Case Sensitive**: Column names must match exactly - **Validation**: Only valid column names are accepted - **Performance**: Fewer columns result in faster responses ### Available Columns - **sid**: Source numeric identifier - **source**: Source type (MLS, DTS, etc.) - **createdAt**: Creation timestamp - **hubspotDealIds**: Associated HubSpot deal IDs ## Use Cases This endpoint is ideal for: - **Optimized Queries**: Fetching only required data fields - **Performance Optimization**: Reducing response payload size - **Bandwidth Conservation**: Minimizing data transfer - **Targeted Data Access**: Getting specific source attributes - **Mobile Applications**: Optimizing for limited bandwidth - **Dashboard Widgets**: Loading only necessary data for UI components ## Performance Benefits - **Reduced Payload**: Only requested columns are included in response - **Faster Queries**: Database queries are optimized for selected columns - **Lower Bandwidth**: Smaller responses improve network performance - **Memory Efficiency**: Less memory usage on both client and server - **Cache Optimization**: Smaller responses improve caching efficiency ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Column Validation**: Only valid source columns can be requested - **Read Permissions**: User must have permission to access source data - **Data Privacy**: Source data is isolated between organizations
* Get specific columns of a source by sourceId
*/
async v4SourcesControllerGetSourceColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4SourcesControllerGetSourceColumnsV4().');
}
if (requestParameters['sourceId'] == null) {
throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4SourcesControllerGetSourceColumnsV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources/{sourceId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"sourceId"}}`, encodeURIComponent(String(requestParameters['sourceId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesGetSourceColumnsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/sources/{sourceId}/{columns} ## Overview Retrieves specific columns for a source by its unique source ID. This endpoint allows you to fetch only the specified columns from the source data, optimizing response size and performance for targeted data access. ## Controller Reference See `V4_Sources_Controller.getSourceColumns()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection The `columns` parameter allows you to specify which columns to retrieve: - **Format**: Comma-separated string (e.g., \"sid,source,createdAt\") - **Case Sensitive**: Column names must match exactly - **Validation**: Only valid column names are accepted - **Performance**: Fewer columns result in faster responses ### Available Columns - **sid**: Source numeric identifier - **source**: Source type (MLS, DTS, etc.) - **createdAt**: Creation timestamp - **hubspotDealIds**: Associated HubSpot deal IDs ## Use Cases This endpoint is ideal for: - **Optimized Queries**: Fetching only required data fields - **Performance Optimization**: Reducing response payload size - **Bandwidth Conservation**: Minimizing data transfer - **Targeted Data Access**: Getting specific source attributes - **Mobile Applications**: Optimizing for limited bandwidth - **Dashboard Widgets**: Loading only necessary data for UI components ## Performance Benefits - **Reduced Payload**: Only requested columns are included in response - **Faster Queries**: Database queries are optimized for selected columns - **Lower Bandwidth**: Smaller responses improve network performance - **Memory Efficiency**: Less memory usage on both client and server - **Cache Optimization**: Smaller responses improve caching efficiency ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Column Validation**: Only valid source columns can be requested - **Read Permissions**: User must have permission to access source data - **Data Privacy**: Source data is isolated between organizations
* Get specific columns of a source by sourceId
*/
async v4SourcesControllerGetSourceColumnsV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerGetSourceColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/sources/{sourceId} ## Overview Retrieves a specific source by its unique source ID. This endpoint provides detailed information about a single source including its metadata, creation information, and associated HubSpot deal IDs. ## Controller Reference See `V4_Sources_Controller.getSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection | ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Source Ownership**: Only sources within the organization can be accessed - **Data Privacy**: Source data is isolated between organizations ## Use Cases This endpoint is ideal for: - **Source Details**: Getting complete information about a specific source - **Property Relations**: Retrieving source data for relationship operations - **Data Verification**: Checking source information and metadata - **System Integration**: Fetching specific source data for external systems - **Edit Operations**: Getting current source data before updates ## Validation The system validates: - **Source Existence**: Source must exist in the system - **Organization Access**: Source must belong to the user\'s organization - **Read Permissions**: User must have permission to access source data - **Data Integrity**: Response data integrity is maintained ## Performance Considerations - **Single Record**: Optimized for single source retrieval - **Minimal Overhead**: Direct ID-based lookup for fast response - **View Integration**: Optional view application for column selection - **Cache Friendly**: Source data may be cached for improved performance
* Get a specific source by sourceId
*/
async v4SourcesControllerGetSourceV4Raw(requestParameters, initOverrides) {
if (requestParameters['sourceId'] == null) {
throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4SourcesControllerGetSourceV4().');
}
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources/{sourceId}`;
urlPath = urlPath.replace(`{${"sourceId"}}`, encodeURIComponent(String(requestParameters['sourceId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesGetSourceResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/sources/{sourceId} ## Overview Retrieves a specific source by its unique source ID. This endpoint provides detailed information about a single source including its metadata, creation information, and associated HubSpot deal IDs. ## Controller Reference See `V4_Sources_Controller.getSource()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `sourceId` | number | Yes | The numeric identifier of the source | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection | ## Access Control - **Organization Scope**: Source must belong to the user\'s organization - **Source Ownership**: Only sources within the organization can be accessed - **Data Privacy**: Source data is isolated between organizations ## Use Cases This endpoint is ideal for: - **Source Details**: Getting complete information about a specific source - **Property Relations**: Retrieving source data for relationship operations - **Data Verification**: Checking source information and metadata - **System Integration**: Fetching specific source data for external systems - **Edit Operations**: Getting current source data before updates ## Validation The system validates: - **Source Existence**: Source must exist in the system - **Organization Access**: Source must belong to the user\'s organization - **Read Permissions**: User must have permission to access source data - **Data Integrity**: Response data integrity is maintained ## Performance Considerations - **Single Record**: Optimized for single source retrieval - **Minimal Overhead**: Direct ID-based lookup for fast response - **View Integration**: Optional view application for column selection - **Cache Friendly**: Source data may be cached for improved performance
* Get a specific source by sourceId
*/
async v4SourcesControllerGetSourceV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerGetSourceV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/sources/viewId/{viewId} ## Overview Retrieves sources filtered by a specific view configuration. This endpoint applies view-based filtering, sorting, and column selection to provide a customized dataset of sources based on predefined view settings. ## Controller Reference See `V4_Sources_Controller.getSourcesInView()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of sources to return (1-100, default: 10) | | `offset` | number | No | Number of sources to skip for pagination (default: 0) | ## View Configuration Views can control: - **Column Selection**: Which source fields are returned - **Filtering**: Conditions to filter the source dataset - **Sorting**: Order of results based on specified criteria - **Formatting**: How data is presented and formatted ## Access Control - **View Ownership**: User must have access to the specified view - **Organization Scope**: View and sources must belong to user\'s organization - **Permission**: User must have read access to both views and sources ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Displaying sources according to predefined views - **Filtered Lists**: Getting sources that match specific criteria - **Report Generation**: Creating reports with view-specific data formatting - **User Preferences**: Applying user-customized source display settings - **Workflow Integration**: Using predefined views in automated workflows ## Performance Benefits - **Optimized Queries**: Views optimize database queries for better performance - **Reduced Payload**: Column selection reduces response size - **Cached Results**: View results may be cached for improved speed - **Efficient Filtering**: Database-level filtering reduces processing overhead
* Get sources with a specific viewId
*/
async v4SourcesControllerGetSourcesInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4SourcesControllerGetSourcesInViewV4().');
}
const queryParameters = {};
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources/viewId/{viewId}`;
urlPath = urlPath.replace(`{${"viewId"}}`, encodeURIComponent(String(requestParameters['viewId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesGetSourcesInViewResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/sources/viewId/{viewId} ## Overview Retrieves sources filtered by a specific view configuration. This endpoint applies view-based filtering, sorting, and column selection to provide a customized dataset of sources based on predefined view settings. ## Controller Reference See `V4_Sources_Controller.getSourcesInView()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of sources to return (1-100, default: 10) | | `offset` | number | No | Number of sources to skip for pagination (default: 0) | ## View Configuration Views can control: - **Column Selection**: Which source fields are returned - **Filtering**: Conditions to filter the source dataset - **Sorting**: Order of results based on specified criteria - **Formatting**: How data is presented and formatted ## Access Control - **View Ownership**: User must have access to the specified view - **Organization Scope**: View and sources must belong to user\'s organization - **Permission**: User must have read access to both views and sources ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Displaying sources according to predefined views - **Filtered Lists**: Getting sources that match specific criteria - **Report Generation**: Creating reports with view-specific data formatting - **User Preferences**: Applying user-customized source display settings - **Workflow Integration**: Using predefined views in automated workflows ## Performance Benefits - **Optimized Queries**: Views optimize database queries for better performance - **Reduced Payload**: Column selection reduces response size - **Cached Results**: View results may be cached for improved speed - **Efficient Filtering**: Database-level filtering reduces processing overhead
* Get sources with a specific viewId
*/
async v4SourcesControllerGetSourcesInViewV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerGetSourcesInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/sources ## Overview Retrieves all sources with optional pagination and view filtering. This endpoint provides access to source data that can be used for property relationship management and data sourcing operations. ## Controller Reference See `V4_Sources_Controller.getSources()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of sources to return (1-100, default: 10) | | `offset` | number | No | Number of sources to skip for pagination (default: 0) | | `viewId` | number | No | Optional view ID to apply filters and column selection | ## Access Control - **Organization Scope**: Only sources within the user\'s organization are returned - **Data Privacy**: Source data is isolated between organizations - **Permission**: User must have read access to sources ## Use Cases This endpoint is ideal for: - **Source Management**: Listing all available data sources - **Property Relations**: Finding sources for property relationship creation - **Data Quality**: Reviewing source information and metadata - **System Integration**: Fetching source data for external integrations - **Analytics**: Generating reports on data source usage ## Performance Notes - **Pagination**: Use limit and offset parameters for large datasets - **View Filtering**: Apply viewId to reduce response size and improve performance - **Caching**: Responses are cached for improved performance - **Rate Limiting**: Standard API rate limits apply ## Response Format Returns an array of source objects with pagination metadata including source ID, source type, creation date, and associated HubSpot deal IDs.
* Get sources with optional viewId
*/
async v4SourcesControllerGetSourcesV4Raw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesGetSourcesResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/sources ## Overview Retrieves all sources with optional pagination and view filtering. This endpoint provides access to source data that can be used for property relationship management and data sourcing operations. ## Controller Reference See `V4_Sources_Controller.getSources()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of sources to return (1-100, default: 10) | | `offset` | number | No | Number of sources to skip for pagination (default: 0) | | `viewId` | number | No | Optional view ID to apply filters and column selection | ## Access Control - **Organization Scope**: Only sources within the user\'s organization are returned - **Data Privacy**: Source data is isolated between organizations - **Permission**: User must have read access to sources ## Use Cases This endpoint is ideal for: - **Source Management**: Listing all available data sources - **Property Relations**: Finding sources for property relationship creation - **Data Quality**: Reviewing source information and metadata - **System Integration**: Fetching source data for external integrations - **Analytics**: Generating reports on data source usage ## Performance Notes - **Pagination**: Use limit and offset parameters for large datasets - **View Filtering**: Apply viewId to reduce response size and improve performance - **Caching**: Responses are cached for improved performance - **Rate Limiting**: Standard API rate limits apply ## Response Format Returns an array of source objects with pagination metadata including source ID, source type, creation date, and associated HubSpot deal IDs.
* Get sources with optional viewId
*/
async v4SourcesControllerGetSourcesV4(requestParameters = {}, initOverrides) {
const response = await this.v4SourcesControllerGetSourcesV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/sources/unique-values/:column ## Overview Retrieves unique values for a specified source column along with their occurrence counts. This endpoint provides statistical data about source field values, ideal for analytics, filtering options, and data quality assessment. ## Controller Reference See `V4_Sources_Controller.getUniqueValues()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/get-unique-values.dto.ts` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `column` | string | Yes | Source table column name to analyze (e.g., \'source\', \'type\', \'status\') | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of unique values to return (1-100, default: 100) | | `offset` | number | No | Number of unique values to skip for pagination (default: 0) | | `viewId` | number | No | Optional view ID to apply additional filters | ## Access Control - **Organization Scope**: Only analyzes sources within the user\'s organization - **Data Privacy**: Source data is isolated between organizations - **Permission**: User must have read access to sources ## Use Cases This endpoint is ideal for: - **Dynamic Filters**: Generating filter options for source management UIs - **Data Analytics**: Understanding source type distribution and usage patterns - **Form Population**: Creating dropdown options for source-related forms - **Data Quality**: Identifying data inconsistencies and outliers - **Reporting**: Statistical analysis of source characteristics ## Performance Notes - **Pagination**: Use limit and offset parameters for columns with many unique values - **View Filtering**: Apply viewId to focus analysis on specific source subsets - **Column Selection**: Different columns may have vastly different unique value counts - **Rate Limiting**: Standard API rate limits apply ## Response Format Returns an array of unique value objects with their occurrence counts, plus pagination metadata including total unique value count and the analyzed column name.
* Get unique values for a specific column with counts
*/
async v4SourcesControllerGetUniqueValuesV4Raw(requestParameters, initOverrides) {
if (requestParameters['column'] == null) {
throw new runtime.RequiredError('column', 'Required parameter "column" was null or undefined when calling v4SourcesControllerGetUniqueValuesV4().');
}
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/sources/unique-values/{column}`;
urlPath = urlPath.replace(`{${"column"}}`, encodeURIComponent(String(requestParameters['column'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4SourcesGetUniqueValuesResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/sources/unique-values/:column ## Overview Retrieves unique values for a specified source column along with their occurrence counts. This endpoint provides statistical data about source field values, ideal for analytics, filtering options, and data quality assessment. ## Controller Reference See `V4_Sources_Controller.getUniqueValues()` in `/src/api/v4/sources/sources.controller.ts` for implementation details. ## DTO Reference See the DTO definitions in `/src/api/v4/sources/dto/get-unique-values.dto.ts` for complete field specifications and validation rules. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `column` | string | Yes | Source table column name to analyze (e.g., \'source\', \'type\', \'status\') | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of unique values to return (1-100, default: 100) | | `offset` | number | No | Number of unique values to skip for pagination (default: 0) | | `viewId` | number | No | Optional view ID to apply additional filters | ## Access Control - **Organization Scope**: Only analyzes sources within the user\'s organization - **Data Privacy**: Source data is isolated between organizations - **Permission**: User must have read access to sources ## Use Cases This endpoint is ideal for: - **Dynamic Filters**: Generating filter options for source management UIs - **Data Analytics**: Understanding source type distribution and usage patterns - **Form Population**: Creating dropdown options for source-related forms - **Data Quality**: Identifying data inconsistencies and outliers - **Reporting**: Statistical analysis of source characteristics ## Performance Notes - **Pagination**: Use limit and offset parameters for columns with many unique values - **View Filtering**: Apply viewId to focus analysis on specific source subsets - **Column Selection**: Different columns may have vastly different unique value counts - **Rate Limiting**: Standard API rate limits apply ## Response Format Returns an array of unique value objects with their occurrence counts, plus pagination metadata including total unique value count and the analyzed column name.
* Get unique values for a specific column with counts
*/
async v4SourcesControllerGetUniqueValuesV4(requestParameters, initOverrides) {
const response = await this.v4SourcesControllerGetUniqueValuesV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # PATCH /v4/sources/{sourceId} ## Overview Updates an existing source with new information. This endpoint allows you to modify the source type for a specific source identified by its source ID. ## Controller Reference See `V4_Sources_Controller.updateSource()` in `/src/api/v