UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

305 lines (304 loc) 36.6 kB
/* 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 { V4ContactSourceRelationsCreateRelContactSourceBodyDtoToJSON, V4ContactSourceRelationsCreateRelContactSourceResponseDtoFromJSON, V4ContactSourceRelationsDeleteRelContactSourceResponseDtoFromJSON, V4ContactSourceRelationsGetRelContactSourceColumnsResponseDtoFromJSON, V4ContactSourceRelationsGetRelContactSourceResponseDtoFromJSON, V4ContactSourceRelationsGetRelContactSourcesInViewResponseDtoFromJSON, V4ContactSourceRelationsGetRelContactSourcesResponseDtoFromJSON, V4ContactSourceRelationsUpdateRelContactSourceBodyDtoToJSON, V4ContactSourceRelationsUpdateRelContactSourceResponseDtoFromJSON, } from '../models/index'; /** * */ export class ContactSourceRelationsAPIV4Api extends runtime.BaseAPI { /** * ## POST /v4/contact-source-relations ### Overview Creates a new contact-source relationship, establishing a connection between an existing contact and an existing source. This endpoint is used to track which sources generated or are associated with specific contacts. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the relationship details: #### Required Fields - **contactId** (number): The ID of the existing contact - **sourceId** (number): The ID of the existing source #### Optional Fields - **type** (string): The type of relationship (e.g., \"Realtor\", \"Wholesaler\") ### Business Use Cases - **Source Attribution**: Track which marketing sources generated specific contacts - **Referral Management**: Record referral relationships between contacts and sources - **Lead Source Analysis**: Build data for analyzing source effectiveness - **Contact Organization**: Organize contacts by their originating sources - **Performance Tracking**: Enable tracking of source performance metrics ### Validation Rules - Contact must exist in the organization - Source must exist in the organization - Combination of contactId and sourceId must be unique (no duplicate relationships) - Type field is optional and can contain any descriptive text * Create a new contact-source relation */ async v4ContactSourceRelationsControllerCreateRelContactSourceV4Raw(requestParameters, initOverrides) { if (requestParameters['v4ContactSourceRelationsCreateRelContactSourceBodyDto'] == null) { throw new runtime.RequiredError('v4ContactSourceRelationsCreateRelContactSourceBodyDto', 'Required parameter "v4ContactSourceRelationsCreateRelContactSourceBodyDto" was null or undefined when calling v4ContactSourceRelationsControllerCreateRelContactSourceV4().'); } 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/contact-source-relations`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: V4ContactSourceRelationsCreateRelContactSourceBodyDtoToJSON(requestParameters['v4ContactSourceRelationsCreateRelContactSourceBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4ContactSourceRelationsCreateRelContactSourceResponseDtoFromJSON(jsonValue)); } /** * ## POST /v4/contact-source-relations ### Overview Creates a new contact-source relationship, establishing a connection between an existing contact and an existing source. This endpoint is used to track which sources generated or are associated with specific contacts. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the relationship details: #### Required Fields - **contactId** (number): The ID of the existing contact - **sourceId** (number): The ID of the existing source #### Optional Fields - **type** (string): The type of relationship (e.g., \"Realtor\", \"Wholesaler\") ### Business Use Cases - **Source Attribution**: Track which marketing sources generated specific contacts - **Referral Management**: Record referral relationships between contacts and sources - **Lead Source Analysis**: Build data for analyzing source effectiveness - **Contact Organization**: Organize contacts by their originating sources - **Performance Tracking**: Enable tracking of source performance metrics ### Validation Rules - Contact must exist in the organization - Source must exist in the organization - Combination of contactId and sourceId must be unique (no duplicate relationships) - Type field is optional and can contain any descriptive text * Create a new contact-source relation */ async v4ContactSourceRelationsControllerCreateRelContactSourceV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerCreateRelContactSourceV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## DELETE /v4/contact-source-relations/:contactId/:sourceId ### Overview Permanently deletes a contact-source relationship. This removes the association between a specific contact and source, but does not affect the contact or source entities themselves. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The contact identifier of the relationship to delete - **sourceId** (number, required): The source identifier of the relationship to delete ### Business Use Cases - **Data Cleanup**: Remove incorrect or outdated relationships - **Source Deactivation**: Remove relationships when sources are no longer relevant - **Contact Reassignment**: Remove old source associations before creating new ones - **Privacy Compliance**: Remove relationships as part of data deletion requests - **Migration**: Remove relationships during system migrations or consolidations ### Validation Rules - Relationship must exist (contactId + sourceId combination must exist) - Both contact and source must belong to the requesting organization - Deletion is permanent and cannot be undone ### Impact Analysis Deleting a contact-source relationship: - **Does NOT** delete the contact entity - **Does NOT** delete the source entity - **ONLY** removes the association between them - **May affect** reports or analytics that depend on the relationship - **Cannot be undone** - relationship data will be permanently lost * Delete a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerDeleteRelContactSourceV4Raw(requestParameters, initOverrides) { if (requestParameters['contactId'] == null) { throw new runtime.RequiredError('contactId', 'Required parameter "contactId" was null or undefined when calling v4ContactSourceRelationsControllerDeleteRelContactSourceV4().'); } if (requestParameters['sourceId'] == null) { throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4ContactSourceRelationsControllerDeleteRelContactSourceV4().'); } 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/contact-source-relations/contacts/{contactId}/sources/{sourceId}`; urlPath = urlPath.replace(`{${"contactId"}}`, encodeURIComponent(String(requestParameters['contactId']))); 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) => V4ContactSourceRelationsDeleteRelContactSourceResponseDtoFromJSON(jsonValue)); } /** * ## DELETE /v4/contact-source-relations/:contactId/:sourceId ### Overview Permanently deletes a contact-source relationship. This removes the association between a specific contact and source, but does not affect the contact or source entities themselves. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The contact identifier of the relationship to delete - **sourceId** (number, required): The source identifier of the relationship to delete ### Business Use Cases - **Data Cleanup**: Remove incorrect or outdated relationships - **Source Deactivation**: Remove relationships when sources are no longer relevant - **Contact Reassignment**: Remove old source associations before creating new ones - **Privacy Compliance**: Remove relationships as part of data deletion requests - **Migration**: Remove relationships during system migrations or consolidations ### Validation Rules - Relationship must exist (contactId + sourceId combination must exist) - Both contact and source must belong to the requesting organization - Deletion is permanent and cannot be undone ### Impact Analysis Deleting a contact-source relationship: - **Does NOT** delete the contact entity - **Does NOT** delete the source entity - **ONLY** removes the association between them - **May affect** reports or analytics that depend on the relationship - **Cannot be undone** - relationship data will be permanently lost * Delete a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerDeleteRelContactSourceV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerDeleteRelContactSourceV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## GET /v4/contact-source-relations/:contactId/:sourceId/:columns ### Overview Retrieves specific columns of a contact-source relationship, allowing for optimized data retrieval when only certain fields are needed. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The unique identifier of the contact - **sourceId** (number, required): The unique identifier of the source - **columns** (string, required): Comma-separated list of column names to retrieve ### Available Columns - **contactId**: Contact identifier - **sourceId**: Source identifier - **type**: Relationship type - Related entity columns when joined (contact.*, source.*) ### Column Selection Examples - `type`: Get only the relationship type - `contactId,sourceId,type`: Get basic relationship info - `contact.name,contact.email`: Get contact details only - `source.name,source.type`: Get source details only ### Business Use Cases - **Performance Optimization**: Reduce payload size for mobile or low-bandwidth scenarios - **Specific Data Extraction**: Extract only required fields for reports or exports - **API Efficiency**: Minimize data transfer for high-frequency queries * Get specific columns of a contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4Raw(requestParameters, initOverrides) { if (requestParameters['columns'] == null) { throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4().'); } if (requestParameters['contactId'] == null) { throw new runtime.RequiredError('contactId', 'Required parameter "contactId" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4().'); } if (requestParameters['sourceId'] == null) { throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4().'); } 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/contact-source-relations/contacts/{contactId}/sources/{sourceId}/{columns}`; urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns']))); urlPath = urlPath.replace(`{${"contactId"}}`, encodeURIComponent(String(requestParameters['contactId']))); 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) => V4ContactSourceRelationsGetRelContactSourceColumnsResponseDtoFromJSON(jsonValue)); } /** * ## GET /v4/contact-source-relations/:contactId/:sourceId/:columns ### Overview Retrieves specific columns of a contact-source relationship, allowing for optimized data retrieval when only certain fields are needed. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The unique identifier of the contact - **sourceId** (number, required): The unique identifier of the source - **columns** (string, required): Comma-separated list of column names to retrieve ### Available Columns - **contactId**: Contact identifier - **sourceId**: Source identifier - **type**: Relationship type - Related entity columns when joined (contact.*, source.*) ### Column Selection Examples - `type`: Get only the relationship type - `contactId,sourceId,type`: Get basic relationship info - `contact.name,contact.email`: Get contact details only - `source.name,source.type`: Get source details only ### Business Use Cases - **Performance Optimization**: Reduce payload size for mobile or low-bandwidth scenarios - **Specific Data Extraction**: Extract only required fields for reports or exports - **API Efficiency**: Minimize data transfer for high-frequency queries * Get specific columns of a contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerGetRelContactSourceColumnsV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## GET /v4/contact-source-relations/:contactId/:sourceId ### Overview Retrieves a specific contact-source relationship by its composite primary key (contactId and sourceId). Returns detailed information about the relationship between a specific contact and source. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The unique identifier of the contact - **sourceId** (number, required): The unique identifier of the source ### Query Parameters - **viewId** (number, optional): View ID to apply specific column selection and related data inclusion ### Business Use Cases - **Relationship Verification**: Verify existence of specific contact-source relationships - **Detailed Analysis**: Get detailed information about a specific relationship - **Data Validation**: Validate relationship data during import or synchronization - **Audit Trail**: Track specific relationship details for compliance or reporting * Get a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerGetRelContactSourceV4Raw(requestParameters, initOverrides) { if (requestParameters['contactId'] == null) { throw new runtime.RequiredError('contactId', 'Required parameter "contactId" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourceV4().'); } if (requestParameters['sourceId'] == null) { throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourceV4().'); } 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/contact-source-relations/contacts/{contactId}/sources/{sourceId}`; urlPath = urlPath.replace(`{${"contactId"}}`, encodeURIComponent(String(requestParameters['contactId']))); 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) => V4ContactSourceRelationsGetRelContactSourceResponseDtoFromJSON(jsonValue)); } /** * ## GET /v4/contact-source-relations/:contactId/:sourceId ### Overview Retrieves a specific contact-source relationship by its composite primary key (contactId and sourceId). Returns detailed information about the relationship between a specific contact and source. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The unique identifier of the contact - **sourceId** (number, required): The unique identifier of the source ### Query Parameters - **viewId** (number, optional): View ID to apply specific column selection and related data inclusion ### Business Use Cases - **Relationship Verification**: Verify existence of specific contact-source relationships - **Detailed Analysis**: Get detailed information about a specific relationship - **Data Validation**: Validate relationship data during import or synchronization - **Audit Trail**: Track specific relationship details for compliance or reporting * Get a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerGetRelContactSourceV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerGetRelContactSourceV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## GET /v4/contact-source-relations/viewId/:viewId ### Overview Retrieves contact-source relationships within a specific predefined view. This endpoint applies the filters, sorts, and column selections defined in the specified view configuration. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): The unique identifier of the view to apply ### Query Parameters - **limit** (number, optional): Maximum number of relationships to return (default: 20, max: 100) - **offset** (number, optional): Number of relationships to skip for pagination (default: 0) - **countOnly** (boolean, optional): Return only the count without actual data ### View Configuration Views can include: - **Filters**: Pre-configured filters for relationship type, contact attributes, or source attributes - **Sorts**: Predefined sorting by contact name, source name, creation date, etc. - **Columns**: Specific column selections to optimize response size and content ### Business Use Cases - **Filtered Reports**: Generate reports for specific relationship types (e.g., only \"Realtor\" relationships) - **Source Performance**: View relationships from high-performing sources - **Contact Segmentation**: View relationships for specific contact segments - **Custom Dashboards**: Power custom dashboard views with pre-configured data sets * Get contact-source relations with a specific viewId */ async v4ContactSourceRelationsControllerGetRelContactSourcesInViewV4Raw(requestParameters, initOverrides) { if (requestParameters['viewId'] == null) { throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4ContactSourceRelationsControllerGetRelContactSourcesInViewV4().'); } 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/contact-source-relations/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) => V4ContactSourceRelationsGetRelContactSourcesInViewResponseDtoFromJSON(jsonValue)); } /** * ## GET /v4/contact-source-relations/viewId/:viewId ### Overview Retrieves contact-source relationships within a specific predefined view. This endpoint applies the filters, sorts, and column selections defined in the specified view configuration. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): The unique identifier of the view to apply ### Query Parameters - **limit** (number, optional): Maximum number of relationships to return (default: 20, max: 100) - **offset** (number, optional): Number of relationships to skip for pagination (default: 0) - **countOnly** (boolean, optional): Return only the count without actual data ### View Configuration Views can include: - **Filters**: Pre-configured filters for relationship type, contact attributes, or source attributes - **Sorts**: Predefined sorting by contact name, source name, creation date, etc. - **Columns**: Specific column selections to optimize response size and content ### Business Use Cases - **Filtered Reports**: Generate reports for specific relationship types (e.g., only \"Realtor\" relationships) - **Source Performance**: View relationships from high-performing sources - **Contact Segmentation**: View relationships for specific contact segments - **Custom Dashboards**: Power custom dashboard views with pre-configured data sets * Get contact-source relations with a specific viewId */ async v4ContactSourceRelationsControllerGetRelContactSourcesInViewV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerGetRelContactSourcesInViewV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## GET /v4/contact-source-relations ### Overview Retrieves contact-source relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between contacts and sources, typically representing referral relationships or source attribution in the real estate investment pipeline. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Query Parameters - **viewId** (number, optional): View ID to apply specific filters and column selection - **limit** (number, optional): Maximum number of relationships to return (default: 20, max: 100) - **offset** (number, optional): Number of relationships to skip for pagination (default: 0) - **countOnly** (boolean, optional): Return only the count without actual data ### Business Use Cases - **Source Attribution**: Understanding which sources generated which contacts - **Referral Tracking**: Tracking referral relationships between contacts and sources - **Lead Source Analysis**: Analyzing effectiveness of different sources - **Contact Organization**: Organizing contacts by their originating sources - **Performance Analysis**: Analyzing source performance for contact generation - **Marketing ROI**: Measuring return on investment for different marketing sources ### Response Format Returns paginated list of contact-source relationships with metadata including total count. * Get contact-source relations with optional viewId */ async v4ContactSourceRelationsControllerGetRelContactSourcesV4Raw(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/contact-source-relations`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4ContactSourceRelationsGetRelContactSourcesResponseDtoFromJSON(jsonValue)); } /** * ## GET /v4/contact-source-relations ### Overview Retrieves contact-source relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between contacts and sources, typically representing referral relationships or source attribution in the real estate investment pipeline. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Query Parameters - **viewId** (number, optional): View ID to apply specific filters and column selection - **limit** (number, optional): Maximum number of relationships to return (default: 20, max: 100) - **offset** (number, optional): Number of relationships to skip for pagination (default: 0) - **countOnly** (boolean, optional): Return only the count without actual data ### Business Use Cases - **Source Attribution**: Understanding which sources generated which contacts - **Referral Tracking**: Tracking referral relationships between contacts and sources - **Lead Source Analysis**: Analyzing effectiveness of different sources - **Contact Organization**: Organizing contacts by their originating sources - **Performance Analysis**: Analyzing source performance for contact generation - **Marketing ROI**: Measuring return on investment for different marketing sources ### Response Format Returns paginated list of contact-source relationships with metadata including total count. * Get contact-source relations with optional viewId */ async v4ContactSourceRelationsControllerGetRelContactSourcesV4(requestParameters = {}, initOverrides) { const response = await this.v4ContactSourceRelationsControllerGetRelContactSourcesV4Raw(requestParameters, initOverrides); return await response.value(); } /** * ## PATCH /v4/contact-source-relations/:contactId/:sourceId ### Overview Updates an existing contact-source relationship. Since the relationship is identified by the composite key (contactId + sourceId), only the relationship attributes can be modified, not the identifying keys themselves. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The contact identifier of the relationship to update - **sourceId** (number, required): The source identifier of the relationship to update ### Request Body The request body should contain the relationship fields to update: #### Updatable Fields - **type** (string, optional): Update the relationship type ### Business Use Cases - **Relationship Refinement**: Update relationship type as more information becomes available - **Data Correction**: Correct incorrectly categorized relationships - **Type Standardization**: Update relationship types to match new classification standards - **Data Migration**: Update relationships during data migration or cleanup processes ### Validation Rules - Relationship must exist (contactId + sourceId combination must exist) - Both contact and source must belong to the requesting organization - Only non-key fields can be updated (contactId and sourceId are immutable) * Update a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerUpdateRelContactSourceV4Raw(requestParameters, initOverrides) { if (requestParameters['contactId'] == null) { throw new runtime.RequiredError('contactId', 'Required parameter "contactId" was null or undefined when calling v4ContactSourceRelationsControllerUpdateRelContactSourceV4().'); } if (requestParameters['sourceId'] == null) { throw new runtime.RequiredError('sourceId', 'Required parameter "sourceId" was null or undefined when calling v4ContactSourceRelationsControllerUpdateRelContactSourceV4().'); } if (requestParameters['v4ContactSourceRelationsUpdateRelContactSourceBodyDto'] == null) { throw new runtime.RequiredError('v4ContactSourceRelationsUpdateRelContactSourceBodyDto', 'Required parameter "v4ContactSourceRelationsUpdateRelContactSourceBodyDto" was null or undefined when calling v4ContactSourceRelationsControllerUpdateRelContactSourceV4().'); } 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/contact-source-relations/contacts/{contactId}/sources/{sourceId}`; urlPath = urlPath.replace(`{${"contactId"}}`, encodeURIComponent(String(requestParameters['contactId']))); urlPath = urlPath.replace(`{${"sourceId"}}`, encodeURIComponent(String(requestParameters['sourceId']))); const response = await this.request({ path: urlPath, method: 'PATCH', headers: headerParameters, query: queryParameters, body: V4ContactSourceRelationsUpdateRelContactSourceBodyDtoToJSON(requestParameters['v4ContactSourceRelationsUpdateRelContactSourceBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4ContactSourceRelationsUpdateRelContactSourceResponseDtoFromJSON(jsonValue)); } /** * ## PATCH /v4/contact-source-relations/:contactId/:sourceId ### Overview Updates an existing contact-source relationship. Since the relationship is identified by the composite key (contactId + sourceId), only the relationship attributes can be modified, not the identifying keys themselves. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **contactId** (number, required): The contact identifier of the relationship to update - **sourceId** (number, required): The source identifier of the relationship to update ### Request Body The request body should contain the relationship fields to update: #### Updatable Fields - **type** (string, optional): Update the relationship type ### Business Use Cases - **Relationship Refinement**: Update relationship type as more information becomes available - **Data Correction**: Correct incorrectly categorized relationships - **Type Standardization**: Update relationship types to match new classification standards - **Data Migration**: Update relationships during data migration or cleanup processes ### Validation Rules - Relationship must exist (contactId + sourceId combination must exist) - Both contact and source must belong to the requesting organization - Only non-key fields can be updated (contactId and sourceId are immutable) * Update a specific contact-source relation by contactId and sourceId */ async v4ContactSourceRelationsControllerUpdateRelContactSourceV4(requestParameters, initOverrides) { const response = await this.v4ContactSourceRelationsControllerUpdateRelContactSourceV4Raw(requestParameters, initOverrides); return await response.value(); } }