@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
254 lines (253 loc) • 34.8 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 { V4MarketsDeleteMarketResponseDtoFromJSON, V4MarketsGetMarketColumnsResponseDtoFromJSON, V4MarketsGetMarketResponseDtoFromJSON, V4MarketsGetMarketsInViewResponseDtoFromJSON, V4MarketsGetMarketsResponseDtoFromJSON, V4MarketsUpdateMarketBodyDtoToJSON, V4MarketsUpdateMarketResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class MarketsAPIV4Api extends runtime.BaseAPI {
/**
* # DELETE /v4/markets/{marketId} ## Overview Deletes an existing real estate market from the system. This is a permanent operation that removes the market and may affect associated properties, territories, and business operations. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to delete | ## Access Control - **Organization Scope**: Market must belong to the authenticated user\'s organization - **Market Validation**: Invalid or non-existent market IDs will return a 404 error - **Data Privacy**: Only markets within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Market record is permanently deleted from the system - **Cascade Effects**: Associated relationships and references are handled appropriately - **Territory Impact**: May affect sales territories and coverage areas - **Property Impact**: Properties assigned to this market may need reassignment - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes ## Response Structure Returns confirmation that the market was successfully deleted. ## Use Cases This endpoint is ideal for: - **Market Consolidation**: Remove markets during business consolidation - **Territory Reorganization**: Delete markets as part of territory restructuring - **Data Cleanup**: Remove unused or obsolete markets - **Business Restructuring**: Delete markets during organizational changes - **Market Exit**: Remove markets when exiting specific geographic areas - **System Maintenance**: Clean up test or duplicate market data ## Important Considerations Before deleting a market, consider: - **Associated Properties**: Check if properties are assigned to this market - **Territory Dependencies**: Consider impact on sales territories and coverage - **Business Operations**: Assess impact on ongoing business operations - **Historical Data**: Consider preserving historical data and reporting - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider deactivating instead of permanent deletion ## Error Handling Common errors include: - **Market Not Found**: Market ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete markets - **Referential Constraints**: Market cannot be deleted due to active references - **Business Rules**: Market deletion violates business rules or constraints - **System Errors**: Database or system issues preventing deletion ## Recovery - **No Recovery**: Deleted market records cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Business Impact**: Consider business continuity and data recovery policies
* Delete a specific market by marketId
*/
async v4MarketsControllerDeleteMarketV4Raw(requestParameters, initOverrides) {
if (requestParameters['marketId'] == null) {
throw new runtime.RequiredError('marketId', 'Required parameter "marketId" was null or undefined when calling v4MarketsControllerDeleteMarketV4().');
}
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/markets/{marketId}`;
urlPath = urlPath.replace(`{${"marketId"}}`, encodeURIComponent(String(requestParameters['marketId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4MarketsDeleteMarketResponseDtoFromJSON(jsonValue));
}
/**
* # DELETE /v4/markets/{marketId} ## Overview Deletes an existing real estate market from the system. This is a permanent operation that removes the market and may affect associated properties, territories, and business operations. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to delete | ## Access Control - **Organization Scope**: Market must belong to the authenticated user\'s organization - **Market Validation**: Invalid or non-existent market IDs will return a 404 error - **Data Privacy**: Only markets within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Market record is permanently deleted from the system - **Cascade Effects**: Associated relationships and references are handled appropriately - **Territory Impact**: May affect sales territories and coverage areas - **Property Impact**: Properties assigned to this market may need reassignment - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes ## Response Structure Returns confirmation that the market was successfully deleted. ## Use Cases This endpoint is ideal for: - **Market Consolidation**: Remove markets during business consolidation - **Territory Reorganization**: Delete markets as part of territory restructuring - **Data Cleanup**: Remove unused or obsolete markets - **Business Restructuring**: Delete markets during organizational changes - **Market Exit**: Remove markets when exiting specific geographic areas - **System Maintenance**: Clean up test or duplicate market data ## Important Considerations Before deleting a market, consider: - **Associated Properties**: Check if properties are assigned to this market - **Territory Dependencies**: Consider impact on sales territories and coverage - **Business Operations**: Assess impact on ongoing business operations - **Historical Data**: Consider preserving historical data and reporting - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider deactivating instead of permanent deletion ## Error Handling Common errors include: - **Market Not Found**: Market ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete markets - **Referential Constraints**: Market cannot be deleted due to active references - **Business Rules**: Market deletion violates business rules or constraints - **System Errors**: Database or system issues preventing deletion ## Recovery - **No Recovery**: Deleted market records cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Business Impact**: Consider business continuity and data recovery policies
* Delete a specific market by marketId
*/
async v4MarketsControllerDeleteMarketV4(requestParameters, initOverrides) {
const response = await this.v4MarketsControllerDeleteMarketV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/markets/{marketId}/{columns} ## Overview Retrieves specific columns of a market by its unique identifier. This endpoint allows you to fetch only the data you need, improving performance and reducing bandwidth usage for market information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Available columns include: - **mid**: Market identifier - **name**: Market name - **state**: State or region - **city**: Primary city - **organizationId**: Organization identifier - **createdAt**: Creation timestamp - **updatedAt**: Last update timestamp ### Examples - Single column: `name` - Multiple columns: `name,state,city` - Location data: `name,state,city` - All metadata: `name,state,city,createdAt,updatedAt` ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Fetch only required data to reduce response size - **Bandwidth Conservation**: Minimize data transfer for mobile or limited connections - **Specific Data Needs**: Get only the columns needed for specific use cases - **List Views**: Fetch minimal data for displaying market lists - **Reporting**: Extract specific columns for reporting purposes - **Data Integration**: Get specific market data for integration with other systems
* Get specific columns of a market by marketId
*/
async v4MarketsControllerGetMarketColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4MarketsControllerGetMarketColumnsV4().');
}
if (requestParameters['marketId'] == null) {
throw new runtime.RequiredError('marketId', 'Required parameter "marketId" was null or undefined when calling v4MarketsControllerGetMarketColumnsV4().');
}
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/markets/{marketId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"marketId"}}`, encodeURIComponent(String(requestParameters['marketId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4MarketsGetMarketColumnsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/markets/{marketId}/{columns} ## Overview Retrieves specific columns of a market by its unique identifier. This endpoint allows you to fetch only the data you need, improving performance and reducing bandwidth usage for market information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Available columns include: - **mid**: Market identifier - **name**: Market name - **state**: State or region - **city**: Primary city - **organizationId**: Organization identifier - **createdAt**: Creation timestamp - **updatedAt**: Last update timestamp ### Examples - Single column: `name` - Multiple columns: `name,state,city` - Location data: `name,state,city` - All metadata: `name,state,city,createdAt,updatedAt` ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Fetch only required data to reduce response size - **Bandwidth Conservation**: Minimize data transfer for mobile or limited connections - **Specific Data Needs**: Get only the columns needed for specific use cases - **List Views**: Fetch minimal data for displaying market lists - **Reporting**: Extract specific columns for reporting purposes - **Data Integration**: Get specific market data for integration with other systems
* Get specific columns of a market by marketId
*/
async v4MarketsControllerGetMarketColumnsV4(requestParameters, initOverrides) {
const response = await this.v4MarketsControllerGetMarketColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/markets/{marketId} ## Overview Retrieves a specific real estate market by its unique identifier. This endpoint provides detailed information about a single market, including all relevant market data and attributes. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply specific column selection and formatting | ## Access Control - **Organization Scope**: Only markets within the authenticated user\'s organization are accessible - **Market Validation**: Invalid or non-existent market IDs will return a 404 error - **Data Privacy**: Sensitive market data is protected by organization boundaries ## Response Structure Returns detailed information about the specified market. ## Use Cases This endpoint is ideal for: - **Market Details**: Get complete information about a specific market - **Market Analysis**: Analyze specific market characteristics and performance - **Territory Management**: Access detailed information for territory planning - **Market Verification**: Verify market properties and attributes - **Portfolio Analysis**: Get detailed market data for investment analysis - **Regional Planning**: Access market details for regional business planning
* Get a specific market by marketId
*/
async v4MarketsControllerGetMarketV4Raw(requestParameters, initOverrides) {
if (requestParameters['marketId'] == null) {
throw new runtime.RequiredError('marketId', 'Required parameter "marketId" was null or undefined when calling v4MarketsControllerGetMarketV4().');
}
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/markets/{marketId}`;
urlPath = urlPath.replace(`{${"marketId"}}`, encodeURIComponent(String(requestParameters['marketId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4MarketsGetMarketResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/markets/{marketId} ## Overview Retrieves a specific real estate market by its unique identifier. This endpoint provides detailed information about a single market, including all relevant market data and attributes. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply specific column selection and formatting | ## Access Control - **Organization Scope**: Only markets within the authenticated user\'s organization are accessible - **Market Validation**: Invalid or non-existent market IDs will return a 404 error - **Data Privacy**: Sensitive market data is protected by organization boundaries ## Response Structure Returns detailed information about the specified market. ## Use Cases This endpoint is ideal for: - **Market Details**: Get complete information about a specific market - **Market Analysis**: Analyze specific market characteristics and performance - **Territory Management**: Access detailed information for territory planning - **Market Verification**: Verify market properties and attributes - **Portfolio Analysis**: Get detailed market data for investment analysis - **Regional Planning**: Access market details for regional business planning
* Get a specific market by marketId
*/
async v4MarketsControllerGetMarketV4(requestParameters, initOverrides) {
const response = await this.v4MarketsControllerGetMarketV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/markets/viewId/{viewId} ## Overview Retrieves real estate markets using a specific view configuration. Views define custom filtering, sorting, and column selection for markets, allowing for organized and consistent data presentation based on business needs and market analysis requirements. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of markets to return (default: 20, max: 100) | | `offset` | number | No | Number of markets to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count without the actual data | ## View Configuration Views can define: - **Column Selection**: Specific columns to include in the response - **Filtering Rules**: Criteria for which markets to include (by state, region, performance, etc.) - **Sorting Options**: Default sorting for the results - **Access Controls**: Additional permission checks ## Use Cases This endpoint is ideal for: - **Market Dashboards**: Display markets according to predefined dashboard configurations - **Regional Views**: Use views to organize markets by regions or territories - **Performance Views**: Apply views that filter markets by performance metrics - **User Preferences**: Apply user-specific view settings for consistent experience - **Filtered Lists**: Show only relevant markets based on view criteria - **Specialized Reports**: Create specialized views for different types of market analysis
* Get markets with a specific viewId
*/
async v4MarketsControllerGetMarketsInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4MarketsControllerGetMarketsInViewV4().');
}
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/markets/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) => V4MarketsGetMarketsInViewResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/markets/viewId/{viewId} ## Overview Retrieves real estate markets using a specific view configuration. Views define custom filtering, sorting, and column selection for markets, allowing for organized and consistent data presentation based on business needs and market analysis requirements. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of markets to return (default: 20, max: 100) | | `offset` | number | No | Number of markets to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count without the actual data | ## View Configuration Views can define: - **Column Selection**: Specific columns to include in the response - **Filtering Rules**: Criteria for which markets to include (by state, region, performance, etc.) - **Sorting Options**: Default sorting for the results - **Access Controls**: Additional permission checks ## Use Cases This endpoint is ideal for: - **Market Dashboards**: Display markets according to predefined dashboard configurations - **Regional Views**: Use views to organize markets by regions or territories - **Performance Views**: Apply views that filter markets by performance metrics - **User Preferences**: Apply user-specific view settings for consistent experience - **Filtered Lists**: Show only relevant markets based on view criteria - **Specialized Reports**: Create specialized views for different types of market analysis
* Get markets with a specific viewId
*/
async v4MarketsControllerGetMarketsInViewV4(requestParameters, initOverrides) {
const response = await this.v4MarketsControllerGetMarketsInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/markets ## Overview Retrieves real estate markets with optional filtering, sorting, and pagination capabilities. This endpoint provides access to all market data for real estate analysis, territory management, and geographic organization. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of markets to return (default: 20, max: 100) | | `offset` | number | No | Number of markets to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of markets without the actual data | ## Use Cases This endpoint is ideal for: - **Market Analysis**: Browse and analyze real estate markets for investment decisions - **Territory Management**: Organize sales territories and market coverage - **Geographic Organization**: Manage properties and operations by market regions - **Market Research**: Study market trends and performance across different areas - **Portfolio Management**: Track investment portfolios across multiple markets - **Reporting**: Generate market-based reports and analytics
* Get markets with optional viewId
*/
async v4MarketsControllerGetMarketsV4Raw(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/markets`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4MarketsGetMarketsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/markets ## Overview Retrieves real estate markets with optional filtering, sorting, and pagination capabilities. This endpoint provides access to all market data for real estate analysis, territory management, and geographic organization. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of markets to return (default: 20, max: 100) | | `offset` | number | No | Number of markets to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of markets without the actual data | ## Use Cases This endpoint is ideal for: - **Market Analysis**: Browse and analyze real estate markets for investment decisions - **Territory Management**: Organize sales territories and market coverage - **Geographic Organization**: Manage properties and operations by market regions - **Market Research**: Study market trends and performance across different areas - **Portfolio Management**: Track investment portfolios across multiple markets - **Reporting**: Generate market-based reports and analytics
* Get markets with optional viewId
*/
async v4MarketsControllerGetMarketsV4(requestParameters = {}, initOverrides) {
const response = await this.v4MarketsControllerGetMarketsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # PATCH /v4/markets/{marketId} ## Overview Updates information of an existing real estate market. This endpoint allows you to modify market properties such as name, location details, and other market attributes. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to update | ## Request Body The request body should contain the fields to update. All fields are optional. ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Market name or description | | `state` | string | State or region where the market is located | | `city` | string | Primary city in the market | ### Validation Rules - **Name**: Must be a non-empty string if provided - **State**: Should be a valid state/region code if provided - **City**: Must be a non-empty string if provided ## Use Cases This endpoint is ideal for: - **Market Information Updates**: Update market names, locations, or descriptions - **Territory Adjustments**: Modify market boundaries or coverage areas - **Market Reorganization**: Update market structures during business reorganization - **Data Correction**: Fix incorrect market information or location data - **Market Evolution**: Update market information as business needs change - **Regional Changes**: Modify market details due to regional business changes ## Access Control - **Organization Scope**: Market must belong to the authenticated user\'s organization - **Update Validation**: Only valid market IDs can be updated - **Data Privacy**: Updates are isolated to the user\'s organization
* Update a specific market by marketId
*/
async v4MarketsControllerUpdateMarketV4Raw(requestParameters, initOverrides) {
if (requestParameters['marketId'] == null) {
throw new runtime.RequiredError('marketId', 'Required parameter "marketId" was null or undefined when calling v4MarketsControllerUpdateMarketV4().');
}
if (requestParameters['v4MarketsUpdateMarketBodyDto'] == null) {
throw new runtime.RequiredError('v4MarketsUpdateMarketBodyDto', 'Required parameter "v4MarketsUpdateMarketBodyDto" was null or undefined when calling v4MarketsControllerUpdateMarketV4().');
}
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/markets/{marketId}`;
urlPath = urlPath.replace(`{${"marketId"}}`, encodeURIComponent(String(requestParameters['marketId'])));
const response = await this.request({
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: V4MarketsUpdateMarketBodyDtoToJSON(requestParameters['v4MarketsUpdateMarketBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4MarketsUpdateMarketResponseDtoFromJSON(jsonValue));
}
/**
* # PATCH /v4/markets/{marketId} ## Overview Updates information of an existing real estate market. This endpoint allows you to modify market properties such as name, location details, and other market attributes. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `marketId` | number | Yes | The unique identifier of the market to update | ## Request Body The request body should contain the fields to update. All fields are optional. ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Market name or description | | `state` | string | State or region where the market is located | | `city` | string | Primary city in the market | ### Validation Rules - **Name**: Must be a non-empty string if provided - **State**: Should be a valid state/region code if provided - **City**: Must be a non-empty string if provided ## Use Cases This endpoint is ideal for: - **Market Information Updates**: Update market names, locations, or descriptions - **Territory Adjustments**: Modify market boundaries or coverage areas - **Market Reorganization**: Update market structures during business reorganization - **Data Correction**: Fix incorrect market information or location data - **Market Evolution**: Update market information as business needs change - **Regional Changes**: Modify market details due to regional business changes ## Access Control - **Organization Scope**: Market must belong to the authenticated user\'s organization - **Update Validation**: Only valid market IDs can be updated - **Data Privacy**: Updates are isolated to the user\'s organization
* Update a specific market by marketId
*/
async v4MarketsControllerUpdateMarketV4(requestParameters, initOverrides) {
const response = await this.v4MarketsControllerUpdateMarketV4Raw(requestParameters, initOverrides);
return await response.value();
}
}