UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

94 lines (93 loc) 5 kB
/* tslint:disable */ /* eslint-disable */ /** * API v4 * Swagger documentation for API v4 * * The version of the OpenAPI document: 4.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { V4LeasingUserRelationsCreateRelLeasingUserBodyDtoToJSON, V4LeasingUserRelationsCreateRelLeasingUserResponseDtoFromJSON, V4LeasingUserRelationsDeleteRelLeasingUserResponseDtoFromJSON, } from '../models/index'; /** * */ export class RelLeasingUsersAPIV4Api extends runtime.BaseAPI { /** * Create a new relationship between a leasing and a user * Create a new rel-leasing-user */ async v4LeasingUserRelationsControllerCreateRelLeasingUserV4Raw(requestParameters, initOverrides) { if (requestParameters['v4LeasingUserRelationsCreateRelLeasingUserBodyDto'] == null) { throw new runtime.RequiredError('v4LeasingUserRelationsCreateRelLeasingUserBodyDto', 'Required parameter "v4LeasingUserRelationsCreateRelLeasingUserBodyDto" was null or undefined when calling v4LeasingUserRelationsControllerCreateRelLeasingUserV4().'); } 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-user-relations`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: V4LeasingUserRelationsCreateRelLeasingUserBodyDtoToJSON(requestParameters['v4LeasingUserRelationsCreateRelLeasingUserBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4LeasingUserRelationsCreateRelLeasingUserResponseDtoFromJSON(jsonValue)); } /** * Create a new relationship between a leasing and a user * Create a new rel-leasing-user */ async v4LeasingUserRelationsControllerCreateRelLeasingUserV4(requestParameters, initOverrides) { const response = await this.v4LeasingUserRelationsControllerCreateRelLeasingUserV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Remove the relationship between a leasing and a user * Delete a specific rel-leasing-user by leasingId and userId */ async v4LeasingUserRelationsControllerDeleteRelLeasingUserV4Raw(requestParameters, initOverrides) { if (requestParameters['leasingId'] == null) { throw new runtime.RequiredError('leasingId', 'Required parameter "leasingId" was null or undefined when calling v4LeasingUserRelationsControllerDeleteRelLeasingUserV4().'); } if (requestParameters['userId'] == null) { throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4LeasingUserRelationsControllerDeleteRelLeasingUserV4().'); } 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-user-relations/leasings/{leasingId}/users/{userId}`; urlPath = urlPath.replace(`{${"leasingId"}}`, encodeURIComponent(String(requestParameters['leasingId']))); 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) => V4LeasingUserRelationsDeleteRelLeasingUserResponseDtoFromJSON(jsonValue)); } /** * Remove the relationship between a leasing and a user * Delete a specific rel-leasing-user by leasingId and userId */ async v4LeasingUserRelationsControllerDeleteRelLeasingUserV4(requestParameters, initOverrides) { const response = await this.v4LeasingUserRelationsControllerDeleteRelLeasingUserV4Raw(requestParameters, initOverrides); return await response.value(); } }