@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
305 lines (304 loc) • 32.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 { V4InspectionUserRelationsCreateRelInspectionUserBodyDtoToJSON, V4InspectionUserRelationsCreateRelInspectionUserResponseDtoFromJSON, V4InspectionUserRelationsDeleteRelInspectionUserResponseDtoFromJSON, V4InspectionUserRelationsGetRelInspectionUserColumnsResponseDtoFromJSON, V4InspectionUserRelationsGetRelInspectionUserResponseDtoFromJSON, V4InspectionUserRelationsGetRelInspectionUsersInViewResponseDtoFromJSON, V4InspectionUserRelationsGetRelInspectionUsersResponseDtoFromJSON, V4InspectionUserRelationsUpdateRelInspectionUserBodyDtoToJSON, V4InspectionUserRelationsUpdateRelInspectionUserResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class RelInspectionUsersAPIV4Api extends runtime.BaseAPI {
/**
* ## POST /v4/inspection-user-relations ### Overview Creates a new relationship between an inspection and a user. This endpoint allows you to assign inspections to users for management, ownership, or follow-up responsibilities in the property inspection process. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the inspection and user identifiers to create the relationship. #### Required Fields - **inspectionId** (number): Inspection identifier - **userId** (string): User identifier ### Request Body Example ```json { \"inspectionId\": 123, \"userId\": \"user_456\" } ``` ### Business Use Cases - **Inspection Assignment**: Assigning inspections to specific users for execution - **Ownership Management**: Establishing inspection ownership and responsibility - **Team Coordination**: Distributing inspections across team members - **Workflow Management**: Managing the flow of inspections through the process - **Performance Tracking**: Connecting users to inspections for performance analysis - **Territory Assignment**: Assigning inspections based on geographic territories - **Specialization**: Assigning inspections based on user expertise areas
* Create a new rel-inspection-user
*/
async v4InspectionUserRelationsControllerCreateRelInspectionUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4InspectionUserRelationsCreateRelInspectionUserBodyDto'] == null) {
throw new runtime.RequiredError('v4InspectionUserRelationsCreateRelInspectionUserBodyDto', 'Required parameter "v4InspectionUserRelationsCreateRelInspectionUserBodyDto" was null or undefined when calling v4InspectionUserRelationsControllerCreateRelInspectionUserV4().');
}
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/inspection-user-relations`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4InspectionUserRelationsCreateRelInspectionUserBodyDtoToJSON(requestParameters['v4InspectionUserRelationsCreateRelInspectionUserBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4InspectionUserRelationsCreateRelInspectionUserResponseDtoFromJSON(jsonValue));
}
/**
* ## POST /v4/inspection-user-relations ### Overview Creates a new relationship between an inspection and a user. This endpoint allows you to assign inspections to users for management, ownership, or follow-up responsibilities in the property inspection process. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Request Body The request body should contain the inspection and user identifiers to create the relationship. #### Required Fields - **inspectionId** (number): Inspection identifier - **userId** (string): User identifier ### Request Body Example ```json { \"inspectionId\": 123, \"userId\": \"user_456\" } ``` ### Business Use Cases - **Inspection Assignment**: Assigning inspections to specific users for execution - **Ownership Management**: Establishing inspection ownership and responsibility - **Team Coordination**: Distributing inspections across team members - **Workflow Management**: Managing the flow of inspections through the process - **Performance Tracking**: Connecting users to inspections for performance analysis - **Territory Assignment**: Assigning inspections based on geographic territories - **Specialization**: Assigning inspections based on user expertise areas
* Create a new rel-inspection-user
*/
async v4InspectionUserRelationsControllerCreateRelInspectionUserV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerCreateRelInspectionUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## DELETE /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Deletes an existing inspection-user relationship. This endpoint allows you to remove the association between an inspection and a user. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user ### Business Use Cases - **Assignment Removal**: Remove user assignments from inspections - **Reassignment**: Clear existing assignments before creating new ones - **Cleanup**: Remove outdated or incorrect relationships - **Access Management**: Revoke user access to specific inspections
* Delete a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerDeleteRelInspectionUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['inspectionId'] == null) {
throw new runtime.RequiredError('inspectionId', 'Required parameter "inspectionId" was null or undefined when calling v4InspectionUserRelationsControllerDeleteRelInspectionUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4InspectionUserRelationsControllerDeleteRelInspectionUserV4().');
}
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/inspection-user-relations/inspections/{inspectionId}/users/{userId}`;
urlPath = urlPath.replace(`{${"inspectionId"}}`, encodeURIComponent(String(requestParameters['inspectionId'])));
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) => V4InspectionUserRelationsDeleteRelInspectionUserResponseDtoFromJSON(jsonValue));
}
/**
* ## DELETE /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Deletes an existing inspection-user relationship. This endpoint allows you to remove the association between an inspection and a user. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user ### Business Use Cases - **Assignment Removal**: Remove user assignments from inspections - **Reassignment**: Clear existing assignments before creating new ones - **Cleanup**: Remove outdated or incorrect relationships - **Access Management**: Revoke user access to specific inspections
* Delete a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerDeleteRelInspectionUserV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerDeleteRelInspectionUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/inspection-user-relations/inspections/:inspectionId/users/:userId/:columns ### Overview Retrieves specific columns of an inspection-user relationship. This endpoint allows you to fetch only the data you need, reducing bandwidth and improving performance. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user - **columns** (string, required): Comma-separated list of column names to retrieve ### Business Use Cases - **Optimized Queries**: Fetch only required fields for performance - **Selective Data Retrieval**: Get specific relationship attributes - **Bandwidth Optimization**: Reduce data transfer in constrained environments - **Custom Views**: Build custom UI views with specific data requirements
* Get specific columns of a rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4().');
}
if (requestParameters['inspectionId'] == null) {
throw new runtime.RequiredError('inspectionId', 'Required parameter "inspectionId" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4().');
}
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/inspection-user-relations/inspections/{inspectionId}/users/{userId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"inspectionId"}}`, encodeURIComponent(String(requestParameters['inspectionId'])));
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) => V4InspectionUserRelationsGetRelInspectionUserColumnsResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/inspection-user-relations/inspections/:inspectionId/users/:userId/:columns ### Overview Retrieves specific columns of an inspection-user relationship. This endpoint allows you to fetch only the data you need, reducing bandwidth and improving performance. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user - **columns** (string, required): Comma-separated list of column names to retrieve ### Business Use Cases - **Optimized Queries**: Fetch only required fields for performance - **Selective Data Retrieval**: Get specific relationship attributes - **Bandwidth Optimization**: Reduce data transfer in constrained environments - **Custom Views**: Build custom UI views with specific data requirements
* Get specific columns of a rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerGetRelInspectionUserColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Retrieves a specific inspection-user relationship by its composite key (inspectionId and userId). This endpoint allows you to get detailed information about a particular assignment or responsibility relationship. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, 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 an inspection - **Relationship Details**: Get detailed information about an inspection-user relationship - **Audit Trail**: Track specific assignment relationships for compliance - **Status Checking**: Check the status of a particular inspection assignment
* Get a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['inspectionId'] == null) {
throw new runtime.RequiredError('inspectionId', 'Required parameter "inspectionId" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUserV4().');
}
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/inspection-user-relations/inspections/{inspectionId}/users/{userId}`;
urlPath = urlPath.replace(`{${"inspectionId"}}`, encodeURIComponent(String(requestParameters['inspectionId'])));
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) => V4InspectionUserRelationsGetRelInspectionUserResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Retrieves a specific inspection-user relationship by its composite key (inspectionId and userId). This endpoint allows you to get detailed information about a particular assignment or responsibility relationship. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, 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 an inspection - **Relationship Details**: Get detailed information about an inspection-user relationship - **Audit Trail**: Track specific assignment relationships for compliance - **Status Checking**: Check the status of a particular inspection assignment
* Get a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUserV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerGetRelInspectionUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/inspection-user-relations/viewId/:viewId ### Overview Retrieves inspection-user relationships filtered by a specific view. Views provide predefined filtering, sorting, and column selection for efficient data retrieval. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): Unique identifier for 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 ### Business Use Cases - **Custom Filters**: Apply saved filter configurations for common inspection-user queries - **Team Views**: View inspection assignments for specific teams or roles - **Status Monitoring**: Monitor inspections by status with user assignments - **Reporting**: Generate reports with specific inspection-user relationship criteria
* Get rel-inspection-users with a specific viewId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUsersInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4InspectionUserRelationsControllerGetRelInspectionUsersInViewV4().');
}
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/inspection-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) => V4InspectionUserRelationsGetRelInspectionUsersInViewResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/inspection-user-relations/viewId/:viewId ### Overview Retrieves inspection-user relationships filtered by a specific view. Views provide predefined filtering, sorting, and column selection for efficient data retrieval. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **viewId** (number, required): Unique identifier for 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 ### Business Use Cases - **Custom Filters**: Apply saved filter configurations for common inspection-user queries - **Team Views**: View inspection assignments for specific teams or roles - **Status Monitoring**: Monitor inspections by status with user assignments - **Reporting**: Generate reports with specific inspection-user relationship criteria
* Get rel-inspection-users with a specific viewId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUsersInViewV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerGetRelInspectionUsersInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## GET /v4/inspection-user-relations ### Overview Retrieves inspection-user relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between inspections and users, typically representing assignment or responsibility for property inspections. ### 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 - **Inspection Assignment**: Understanding which users are assigned to which inspections - **Responsibility Tracking**: Tracking inspection ownership and responsibility across team members - **Team Management**: Managing inspection distribution and workload balance - **Performance Analysis**: Analyzing user performance with inspection completions - **Workload Distribution**: Balancing inspection assignments for optimal productivity - **Territory Management**: Managing inspection assignments by geographic or specialty areas ### Response Format Returns paginated list of inspection-user relationships with metadata including total count.
* Get rel-inspection-users with optional viewId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUsersV4Raw(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/inspection-user-relations`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4InspectionUserRelationsGetRelInspectionUsersResponseDtoFromJSON(jsonValue));
}
/**
* ## GET /v4/inspection-user-relations ### Overview Retrieves inspection-user relationships with optional filtering, sorting, and pagination capabilities. This endpoint provides access to the associations between inspections and users, typically representing assignment or responsibility for property inspections. ### 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 - **Inspection Assignment**: Understanding which users are assigned to which inspections - **Responsibility Tracking**: Tracking inspection ownership and responsibility across team members - **Team Management**: Managing inspection distribution and workload balance - **Performance Analysis**: Analyzing user performance with inspection completions - **Workload Distribution**: Balancing inspection assignments for optimal productivity - **Territory Management**: Managing inspection assignments by geographic or specialty areas ### Response Format Returns paginated list of inspection-user relationships with metadata including total count.
* Get rel-inspection-users with optional viewId
*/
async v4InspectionUserRelationsControllerGetRelInspectionUsersV4(requestParameters = {}, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerGetRelInspectionUsersV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* ## PATCH /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Updates an existing inspection-user relationship. This endpoint allows you to modify the relationship properties. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user ### Request Body The request body can contain any updateable fields of the relationship. ### Business Use Cases - **Relationship Modification**: Update relationship properties as needed - **Status Changes**: Modify relationship status or attributes - **Assignment Updates**: Change assignment details
* Update a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerUpdateRelInspectionUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['inspectionId'] == null) {
throw new runtime.RequiredError('inspectionId', 'Required parameter "inspectionId" was null or undefined when calling v4InspectionUserRelationsControllerUpdateRelInspectionUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4InspectionUserRelationsControllerUpdateRelInspectionUserV4().');
}
if (requestParameters['v4InspectionUserRelationsUpdateRelInspectionUserBodyDto'] == null) {
throw new runtime.RequiredError('v4InspectionUserRelationsUpdateRelInspectionUserBodyDto', 'Required parameter "v4InspectionUserRelationsUpdateRelInspectionUserBodyDto" was null or undefined when calling v4InspectionUserRelationsControllerUpdateRelInspectionUserV4().');
}
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/inspection-user-relations/inspections/{inspectionId}/users/{userId}`;
urlPath = urlPath.replace(`{${"inspectionId"}}`, encodeURIComponent(String(requestParameters['inspectionId'])));
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
const response = await this.request({
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: V4InspectionUserRelationsUpdateRelInspectionUserBodyDtoToJSON(requestParameters['v4InspectionUserRelationsUpdateRelInspectionUserBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4InspectionUserRelationsUpdateRelInspectionUserResponseDtoFromJSON(jsonValue));
}
/**
* ## PATCH /v4/inspection-user-relations/inspections/:inspectionId/users/:userId ### Overview Updates an existing inspection-user relationship. This endpoint allows you to modify the relationship properties. ### Authentication - **x-api-key**: Required API key for authentication - **organization-id**: Required organization identifier in header ### Path Parameters - **inspectionId** (number, required): Unique identifier for the inspection - **userId** (string, required): Unique identifier for the user ### Request Body The request body can contain any updateable fields of the relationship. ### Business Use Cases - **Relationship Modification**: Update relationship properties as needed - **Status Changes**: Modify relationship status or attributes - **Assignment Updates**: Change assignment details
* Update a specific rel-inspection-user by inspectionId and userId
*/
async v4InspectionUserRelationsControllerUpdateRelInspectionUserV4(requestParameters, initOverrides) {
const response = await this.v4InspectionUserRelationsControllerUpdateRelInspectionUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
}