@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
305 lines (304 loc) • 32.4 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 { V4LeadUserRelationsCreateRelLeadUserBodyDtoToJSON, V4LeadUserRelationsCreateRelLeadUserResponseDtoFromJSON, V4LeadUserRelationsDeleteRelLeadUserResponseDtoFromJSON, V4LeadUserRelationsGetRelLeadUserColumnsResponseDtoFromJSON, V4LeadUserRelationsGetRelLeadUserResponseDtoFromJSON, V4LeadUserRelationsGetRelLeadUsersInViewResponseDtoFromJSON, V4LeadUserRelationsGetRelLeadUsersResponseDtoFromJSON, V4LeadUserRelationsUpdateRelLeadUserBodyDtoToJSON, V4LeadUserRelationsUpdateRelLeadUserResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class RelLeadUsersAPIV4Api extends runtime.BaseAPI {
/**
* ## POST /v4/rel-lead-users ### Overview Creates a new relationship between a lead and a user. This endpoint allows you to assign leads to users for management, ownership, or follow-up responsibilities in the real estate investment pipeline. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the lead and user identifiers to create the relationship. #### Required Fields - **leadId** (number): Lead identifier - **userId** (number): User identifier ### Request Body Example ```json { \"leadId\": 123, \"userId\": 456 } ``` ### Business Use Cases - **Lead Assignment**: Assigning leads to specific users for follow-up - **Ownership Management**: Establishing lead ownership and responsibility - **Team Coordination**: Distributing leads across team members - **Workflow Management**: Managing the flow of leads through the sales process - **Performance Tracking**: Connecting users to leads for performance analysis - **Territory Assignment**: Assigning leads based on geographic territories - **Specialization**: Assigning leads based on user expertise areas
* Create a new rel-lead-user
*/
async v4LeadUserRelationsControllerCreateRelLeadUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4LeadUserRelationsCreateRelLeadUserBodyDto'] == null) {
throw new runtime.RequiredError('v4LeadUserRelationsCreateRelLeadUserBodyDto', 'Required parameter "v4LeadUserRelationsCreateRelLeadUserBodyDto" was null or undefined when calling v4LeadUserRelationsControllerCreateRelLeadUserV4().');
}
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/lead-user-relations`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4LeadUserRelationsCreateRelLeadUserBodyDtoToJSON(requestParameters['v4LeadUserRelationsCreateRelLeadUserBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsCreateRelLeadUserResponseDtoFromJSON(jsonValue));
}
/**
* ## POST /v4/rel-lead-users ### Overview Creates a new relationship between a lead and a user. This endpoint allows you to assign leads to users for management, ownership, or follow-up responsibilities in the real estate investment pipeline. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the lead and user identifiers to create the relationship. #### Required Fields - **leadId** (number): Lead identifier - **userId** (number): User identifier ### Request Body Example ```json { \"leadId\": 123, \"userId\": 456 } ``` ### Business Use Cases - **Lead Assignment**: Assigning leads to specific users for follow-up - **Ownership Management**: Establishing lead ownership and responsibility - **Team Coordination**: Distributing leads across team members - **Workflow Management**: Managing the flow of leads through the sales process - **Performance Tracking**: Connecting users to leads for performance analysis - **Territory Assignment**: Assigning leads based on geographic territories - **Specialization**: Assigning leads based on user expertise areas
* Create a new rel-lead-user
*/
async v4LeadUserRelationsControllerCreateRelLeadUserV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerCreateRelLeadUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## DELETE /v4/rel-lead-users/{leadId}/{userId} ### Overview Deletes a specific lead-user relationship by its composite key. This endpoint removes the association between a lead and user, effectively unassigning the lead from the user. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Business Use Cases - **Lead Reassignment**: Remove current assignment before reassigning to another user - **Team Changes**: Unassign leads when team members change roles or leave - **Workflow Management**: Remove assignments when leads move to different stages - **Cleanup Operations**: Remove outdated or incorrect assignments - **Territory Changes**: Unassign leads during territory restructuring ### Important Notes - This operation is irreversible - Ensure proper authorization before deleting relationships - Consider audit trail requirements for compliance
* Delete a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerDeleteRelLeadUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['leadId'] == null) {
throw new runtime.RequiredError('leadId', 'Required parameter "leadId" was null or undefined when calling v4LeadUserRelationsControllerDeleteRelLeadUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4LeadUserRelationsControllerDeleteRelLeadUserV4().');
}
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/lead-user-relations/leads/{leadId}/users/{userId}`;
urlPath = urlPath.replace(`{${"leadId"}}`, encodeURIComponent(String(requestParameters['leadId'])));
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsDeleteRelLeadUserResponseDtoFromJSON(jsonValue));
}
/**
* ## DELETE /v4/rel-lead-users/{leadId}/{userId} ### Overview Deletes a specific lead-user relationship by its composite key. This endpoint removes the association between a lead and user, effectively unassigning the lead from the user. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Business Use Cases - **Lead Reassignment**: Remove current assignment before reassigning to another user - **Team Changes**: Unassign leads when team members change roles or leave - **Workflow Management**: Remove assignments when leads move to different stages - **Cleanup Operations**: Remove outdated or incorrect assignments - **Territory Changes**: Unassign leads during territory restructuring ### Important Notes - This operation is irreversible - Ensure proper authorization before deleting relationships - Consider audit trail requirements for compliance
* Delete a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerDeleteRelLeadUserV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerDeleteRelLeadUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/rel-lead-users/{leadId}/{userId}/{columns} ### Overview Retrieves specific columns of a lead-user relationship by its composite key. This endpoint allows you to get only the specified columns/fields of a particular relationship, which is useful for optimizing data transfer and focusing on specific information. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user - **columns** (string, required): Comma-separated list of column names to retrieve ### Business Use Cases - **Optimized Queries**: Retrieve only the needed columns to reduce data transfer - **Specific Information**: Get targeted information from relationships - **Performance Optimization**: Minimize payload size for better performance - **Custom Data Views**: Create custom data views with specific column sets
* Get specific columns of a rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerGetRelLeadUserColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUserColumnsV4().');
}
if (requestParameters['leadId'] == null) {
throw new runtime.RequiredError('leadId', 'Required parameter "leadId" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUserColumnsV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUserColumnsV4().');
}
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/lead-user-relations/leads/{leadId}/users/{userId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"leadId"}}`, encodeURIComponent(String(requestParameters['leadId'])));
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsGetRelLeadUserColumnsResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/rel-lead-users/{leadId}/{userId}/{columns} ### Overview Retrieves specific columns of a lead-user relationship by its composite key. This endpoint allows you to get only the specified columns/fields of a particular relationship, which is useful for optimizing data transfer and focusing on specific information. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user - **columns** (string, required): Comma-separated list of column names to retrieve ### Business Use Cases - **Optimized Queries**: Retrieve only the needed columns to reduce data transfer - **Specific Information**: Get targeted information from relationships - **Performance Optimization**: Minimize payload size for better performance - **Custom Data Views**: Create custom data views with specific column sets
* Get specific columns of a rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerGetRelLeadUserColumnsV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerGetRelLeadUserColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/rel-lead-users/{leadId}/{userId} ### Overview Retrieves a specific lead-user relationship by its composite key (leadId and userId). This endpoint allows you to get detailed information about a particular assignment or ownership relationship. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Query Parameters - **viewId** (number, optional): View ID to apply specific column selection and related data ### Business Use Cases - **Assignment Verification**: Verify if a specific user is assigned to a lead - **Relationship Details**: Get detailed information about a lead-user relationship - **Audit Trail**: Track specific assignment relationships for compliance - **Status Checking**: Check the status of a particular assignment
* Get a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerGetRelLeadUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['leadId'] == null) {
throw new runtime.RequiredError('leadId', 'Required parameter "leadId" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUserV4().');
}
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/lead-user-relations/leads/{leadId}/users/{userId}`;
urlPath = urlPath.replace(`{${"leadId"}}`, encodeURIComponent(String(requestParameters['leadId'])));
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsGetRelLeadUserResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/rel-lead-users/{leadId}/{userId} ### Overview Retrieves a specific lead-user relationship by its composite key (leadId and userId). This endpoint allows you to get detailed information about a particular assignment or ownership relationship. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Query Parameters - **viewId** (number, optional): View ID to apply specific column selection and related data ### Business Use Cases - **Assignment Verification**: Verify if a specific user is assigned to a lead - **Relationship Details**: Get detailed information about a lead-user relationship - **Audit Trail**: Track specific assignment relationships for compliance - **Status Checking**: Check the status of a particular assignment
* Get a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerGetRelLeadUserV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerGetRelLeadUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/rel-lead-users/viewId/{viewId} ### Overview Retrieves lead-user relationships filtered by a specific view configuration. This endpoint allows you to get relationships with pre-defined filters, sorting, and column selections based on the view settings. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): The ID of the view to apply filters and column selection ### 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 ### Business Use Cases - **Custom Views**: Apply saved view configurations for specific business needs - **Team Views**: Get relationships filtered by team-specific criteria - **Status Views**: Filter relationships by assignment status or activity - **Performance Views**: Apply filters for performance analysis and reporting
* Get rel-lead-users with a specific viewId
*/
async v4LeadUserRelationsControllerGetRelLeadUsersInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4LeadUserRelationsControllerGetRelLeadUsersInViewV4().');
}
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/lead-user-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) => V4LeadUserRelationsGetRelLeadUsersInViewResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/rel-lead-users/viewId/{viewId} ### Overview Retrieves lead-user relationships filtered by a specific view configuration. This endpoint allows you to get relationships with pre-defined filters, sorting, and column selections based on the view settings. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): The ID of the view to apply filters and column selection ### 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 ### Business Use Cases - **Custom Views**: Apply saved view configurations for specific business needs - **Team Views**: Get relationships filtered by team-specific criteria - **Status Views**: Filter relationships by assignment status or activity - **Performance Views**: Apply filters for performance analysis and reporting
* Get rel-lead-users with a specific viewId
*/
async v4LeadUserRelationsControllerGetRelLeadUsersInViewV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerGetRelLeadUsersInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/rel-lead-users ### Overview Retrieves lead-user relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between leads and users, typically representing assignment or ownership relationships 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 - **Lead Assignment**: Understanding which users are assigned to which leads - **Ownership Tracking**: Tracking lead ownership and responsibility across team members - **Team Management**: Managing lead distribution and workload balance - **Performance Analysis**: Analyzing user performance with lead conversions - **Workload Distribution**: Balancing lead assignments for optimal productivity - **Territory Management**: Managing lead assignments by geographic or specialty areas ### Response Format Returns paginated list of lead-user relationships with metadata including total count.
* Get rel-lead-users with optional viewId
*/
async v4LeadUserRelationsControllerGetRelLeadUsersV4Raw(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/lead-user-relations`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsGetRelLeadUsersResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/rel-lead-users ### Overview Retrieves lead-user relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between leads and users, typically representing assignment or ownership relationships 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 - **Lead Assignment**: Understanding which users are assigned to which leads - **Ownership Tracking**: Tracking lead ownership and responsibility across team members - **Team Management**: Managing lead distribution and workload balance - **Performance Analysis**: Analyzing user performance with lead conversions - **Workload Distribution**: Balancing lead assignments for optimal productivity - **Territory Management**: Managing lead assignments by geographic or specialty areas ### Response Format Returns paginated list of lead-user relationships with metadata including total count.
* Get rel-lead-users with optional viewId
*/
async v4LeadUserRelationsControllerGetRelLeadUsersV4(requestParameters = {}, initOverrides) {
const response = await this.v4LeadUserRelationsControllerGetRelLeadUsersV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## PATCH /v4/rel-lead-users/{leadId}/{userId} ### Overview Updates a specific lead-user relationship by its composite key. Note that relationship tables typically have minimal updateable fields since they primarily manage associations between entities. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Request Body The request body should contain the fields to update. For relationship tables, this is typically empty or contains metadata fields. ### Business Use Cases - **Relationship Metadata**: Update any metadata associated with the relationship - **Status Changes**: Modify relationship status or flags if applicable - **Audit Trail**: Update relationship audit information ### Note This endpoint is rarely used for pure relationship tables as they typically only contain foreign keys. It\'s included for API completeness and future extensibility.
* Update a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerUpdateRelLeadUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['leadId'] == null) {
throw new runtime.RequiredError('leadId', 'Required parameter "leadId" was null or undefined when calling v4LeadUserRelationsControllerUpdateRelLeadUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4LeadUserRelationsControllerUpdateRelLeadUserV4().');
}
if (requestParameters['v4LeadUserRelationsUpdateRelLeadUserBodyDto'] == null) {
throw new runtime.RequiredError('v4LeadUserRelationsUpdateRelLeadUserBodyDto', 'Required parameter "v4LeadUserRelationsUpdateRelLeadUserBodyDto" was null or undefined when calling v4LeadUserRelationsControllerUpdateRelLeadUserV4().');
}
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/lead-user-relations/leads/{leadId}/users/{userId}`;
urlPath = urlPath.replace(`{${"leadId"}}`, encodeURIComponent(String(requestParameters['leadId'])));
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
const response = await this.request({
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: V4LeadUserRelationsUpdateRelLeadUserBodyDtoToJSON(requestParameters['v4LeadUserRelationsUpdateRelLeadUserBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeadUserRelationsUpdateRelLeadUserResponseDtoFromJSON(jsonValue));
}
/**
* ## PATCH /v4/rel-lead-users/{leadId}/{userId} ### Overview Updates a specific lead-user relationship by its composite key. Note that relationship tables typically have minimal updateable fields since they primarily manage associations between entities. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **leadId** (number, required): Unique identifier for the lead - **userId** (number, required): Unique identifier for the user ### Request Body The request body should contain the fields to update. For relationship tables, this is typically empty or contains metadata fields. ### Business Use Cases - **Relationship Metadata**: Update any metadata associated with the relationship - **Status Changes**: Modify relationship status or flags if applicable - **Audit Trail**: Update relationship audit information ### Note This endpoint is rarely used for pure relationship tables as they typically only contain foreign keys. It\'s included for API completeness and future extensibility.
* Update a specific rel-lead-user by leadId and userId
*/
async v4LeadUserRelationsControllerUpdateRelLeadUserV4(requestParameters, initOverrides) {
const response = await this.v4LeadUserRelationsControllerUpdateRelLeadUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
}