UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

94 lines (93 loc) 5.17 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 { V4RenovationUserRelationsCreateRelRenovationUserBodyDtoToJSON, V4RenovationUserRelationsCreateRelRenovationUserResponseDtoFromJSON, V4RenovationUserRelationsDeleteRelRenovationUserResponseDtoFromJSON, } from '../models/index'; /** * */ export class RelRenovationUsersAPIV4Api extends runtime.BaseAPI { /** * Create a new relationship between a renovation and a user * Create a new rel-renovation-user */ async v4RenovationUserRelationsControllerCreateRelRenovationUserV4Raw(requestParameters, initOverrides) { if (requestParameters['v4RenovationUserRelationsCreateRelRenovationUserBodyDto'] == null) { throw new runtime.RequiredError('v4RenovationUserRelationsCreateRelRenovationUserBodyDto', 'Required parameter "v4RenovationUserRelationsCreateRelRenovationUserBodyDto" was null or undefined when calling v4RenovationUserRelationsControllerCreateRelRenovationUserV4().'); } 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/renovation-user-relations`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: V4RenovationUserRelationsCreateRelRenovationUserBodyDtoToJSON(requestParameters['v4RenovationUserRelationsCreateRelRenovationUserBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationUserRelationsCreateRelRenovationUserResponseDtoFromJSON(jsonValue)); } /** * Create a new relationship between a renovation and a user * Create a new rel-renovation-user */ async v4RenovationUserRelationsControllerCreateRelRenovationUserV4(requestParameters, initOverrides) { const response = await this.v4RenovationUserRelationsControllerCreateRelRenovationUserV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Remove the relationship between a renovation and a user * Delete a specific rel-renovation-user by renovationId and userId */ async v4RenovationUserRelationsControllerDeleteRelRenovationUserV4Raw(requestParameters, initOverrides) { if (requestParameters['renovationId'] == null) { throw new runtime.RequiredError('renovationId', 'Required parameter "renovationId" was null or undefined when calling v4RenovationUserRelationsControllerDeleteRelRenovationUserV4().'); } if (requestParameters['userId'] == null) { throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4RenovationUserRelationsControllerDeleteRelRenovationUserV4().'); } 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/renovation-user-relations/renovations/{renovationId}/users/{userId}`; urlPath = urlPath.replace(`{${"renovationId"}}`, encodeURIComponent(String(requestParameters['renovationId']))); 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) => V4RenovationUserRelationsDeleteRelRenovationUserResponseDtoFromJSON(jsonValue)); } /** * Remove the relationship between a renovation and a user * Delete a specific rel-renovation-user by renovationId and userId */ async v4RenovationUserRelationsControllerDeleteRelRenovationUserV4(requestParameters, initOverrides) { const response = await this.v4RenovationUserRelationsControllerDeleteRelRenovationUserV4Raw(requestParameters, initOverrides); return await response.value(); } }