@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
177 lines (176 loc) • 10.3 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 { V4RentalListingUserRelationsCreateRelRentalListingUserBodyDtoToJSON, V4RentalListingUserRelationsCreateRelRentalListingUserResponseDtoFromJSON, V4RentalListingUserRelationsDeleteRelRentalListingUserResponseDtoFromJSON, V4RentalListingUserRelationsGetRelRentalListingUserResponseDtoFromJSON, V4RentalListingUserRelationsGetRelRentalListingUsersResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class RentalListingUserRelationsAPIV4Api extends runtime.BaseAPI {
/**
* Create a new relation between a rental listing and a user
* Create a new rental-listing-user relation
*/
async v4RentalListingUserRelationsControllerCreateRelRentalListingUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4RentalListingUserRelationsCreateRelRentalListingUserBodyDto'] == null) {
throw new runtime.RequiredError('v4RentalListingUserRelationsCreateRelRentalListingUserBodyDto', 'Required parameter "v4RentalListingUserRelationsCreateRelRentalListingUserBodyDto" was null or undefined when calling v4RentalListingUserRelationsControllerCreateRelRentalListingUserV4().');
}
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/rental-listing-user-relations`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4RentalListingUserRelationsCreateRelRentalListingUserBodyDtoToJSON(requestParameters['v4RentalListingUserRelationsCreateRelRentalListingUserBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4RentalListingUserRelationsCreateRelRentalListingUserResponseDtoFromJSON(jsonValue));
}
/**
* Create a new relation between a rental listing and a user
* Create a new rental-listing-user relation
*/
async v4RentalListingUserRelationsControllerCreateRelRentalListingUserV4(requestParameters, initOverrides) {
const response = await this.v4RentalListingUserRelationsControllerCreateRelRentalListingUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* Remove a relation between a rental listing and a user
* Delete a specific rental-listing-user relation by rentalListingId and userId
*/
async v4RentalListingUserRelationsControllerDeleteRelRentalListingUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['rentalListingId'] == null) {
throw new runtime.RequiredError('rentalListingId', 'Required parameter "rentalListingId" was null or undefined when calling v4RentalListingUserRelationsControllerDeleteRelRentalListingUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4RentalListingUserRelationsControllerDeleteRelRentalListingUserV4().');
}
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/rental-listing-user-relations/rental-listings/{rentalListingId}/users/{userId}`;
urlPath = urlPath.replace(`{${"rentalListingId"}}`, encodeURIComponent(String(requestParameters['rentalListingId'])));
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) => V4RentalListingUserRelationsDeleteRelRentalListingUserResponseDtoFromJSON(jsonValue));
}
/**
* Remove a relation between a rental listing and a user
* Delete a specific rental-listing-user relation by rentalListingId and userId
*/
async v4RentalListingUserRelationsControllerDeleteRelRentalListingUserV4(requestParameters, initOverrides) {
const response = await this.v4RentalListingUserRelationsControllerDeleteRelRentalListingUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* Retrieve a specific rental-listing-user relation using composite key
* Get a specific rental-listing-user relation by rentalListingId and userId
*/
async v4RentalListingUserRelationsControllerGetRelRentalListingUserV4Raw(requestParameters, initOverrides) {
if (requestParameters['rentalListingId'] == null) {
throw new runtime.RequiredError('rentalListingId', 'Required parameter "rentalListingId" was null or undefined when calling v4RentalListingUserRelationsControllerGetRelRentalListingUserV4().');
}
if (requestParameters['userId'] == null) {
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling v4RentalListingUserRelationsControllerGetRelRentalListingUserV4().');
}
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/rental-listing-user-relations/rental-listings/{rentalListingId}/users/{userId}`;
urlPath = urlPath.replace(`{${"rentalListingId"}}`, encodeURIComponent(String(requestParameters['rentalListingId'])));
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) => V4RentalListingUserRelationsGetRelRentalListingUserResponseDtoFromJSON(jsonValue));
}
/**
* Retrieve a specific rental-listing-user relation using composite key
* Get a specific rental-listing-user relation by rentalListingId and userId
*/
async v4RentalListingUserRelationsControllerGetRelRentalListingUserV4(requestParameters, initOverrides) {
const response = await this.v4RentalListingUserRelationsControllerGetRelRentalListingUserV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* Retrieve a list of rental-listing-user relations with pagination and view filtering support
* Get rental-listing-user relations with optional viewId
*/
async v4RentalListingUserRelationsControllerGetRelRentalListingUsersV4Raw(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/rental-listing-user-relations`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4RentalListingUserRelationsGetRelRentalListingUsersResponseDtoFromJSON(jsonValue));
}
/**
* Retrieve a list of rental-listing-user relations with pagination and view filtering support
* Get rental-listing-user relations with optional viewId
*/
async v4RentalListingUserRelationsControllerGetRelRentalListingUsersV4(requestParameters = {}, initOverrides) {
const response = await this.v4RentalListingUserRelationsControllerGetRelRentalListingUsersV4Raw(requestParameters, initOverrides);
return await response.value();
}
}