@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
94 lines (93 loc) • 5.12 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 { V4LeasingTenantRelationsCreateRelLeasingTenantBodyDtoToJSON, V4LeasingTenantRelationsCreateRelLeasingTenantResponseDtoFromJSON, V4LeasingTenantRelationsDeleteRelLeasingTenantResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class RelLeasingTenantsAPIV4Api extends runtime.BaseAPI {
/**
* Create a new relationship between a leasing and a tenant
* Create a new rel-leasing-tenant
*/
async v4LeasingTenantRelationsControllerCreateRelLeasingTenantV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4LeasingTenantRelationsCreateRelLeasingTenantBodyDto'] == null) {
throw new runtime.RequiredError('v4LeasingTenantRelationsCreateRelLeasingTenantBodyDto', 'Required parameter "v4LeasingTenantRelationsCreateRelLeasingTenantBodyDto" was null or undefined when calling v4LeasingTenantRelationsControllerCreateRelLeasingTenantV4().');
}
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/leasing-tenant-relations`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4LeasingTenantRelationsCreateRelLeasingTenantBodyDtoToJSON(requestParameters['v4LeasingTenantRelationsCreateRelLeasingTenantBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeasingTenantRelationsCreateRelLeasingTenantResponseDtoFromJSON(jsonValue));
}
/**
* Create a new relationship between a leasing and a tenant
* Create a new rel-leasing-tenant
*/
async v4LeasingTenantRelationsControllerCreateRelLeasingTenantV4(requestParameters, initOverrides) {
const response = await this.v4LeasingTenantRelationsControllerCreateRelLeasingTenantV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* Remove the relationship between a leasing and a tenant
* Delete a specific rel-leasing-tenant by leasingId and tenantId
*/
async v4LeasingTenantRelationsControllerDeleteRelLeasingTenantV4Raw(requestParameters, initOverrides) {
if (requestParameters['leasingId'] == null) {
throw new runtime.RequiredError('leasingId', 'Required parameter "leasingId" was null or undefined when calling v4LeasingTenantRelationsControllerDeleteRelLeasingTenantV4().');
}
if (requestParameters['tenantId'] == null) {
throw new runtime.RequiredError('tenantId', 'Required parameter "tenantId" was null or undefined when calling v4LeasingTenantRelationsControllerDeleteRelLeasingTenantV4().');
}
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/leasing-tenant-relations/leasings/{leasingId}/tenants/{tenantId}`;
urlPath = urlPath.replace(`{${"leasingId"}}`, encodeURIComponent(String(requestParameters['leasingId'])));
urlPath = urlPath.replace(`{${"tenantId"}}`, encodeURIComponent(String(requestParameters['tenantId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LeasingTenantRelationsDeleteRelLeasingTenantResponseDtoFromJSON(jsonValue));
}
/**
* Remove the relationship between a leasing and a tenant
* Delete a specific rel-leasing-tenant by leasingId and tenantId
*/
async v4LeasingTenantRelationsControllerDeleteRelLeasingTenantV4(requestParameters, initOverrides) {
const response = await this.v4LeasingTenantRelationsControllerDeleteRelLeasingTenantV4Raw(requestParameters, initOverrides);
return await response.value();
}
}