@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
485 lines • 24.9 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* Commander Spellbook API
* API for Commander Spellbook, the combo database engine for Magic: The Gathering
*
* The version of the OpenAPI document: 5.4.10
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import * as runtime from '../runtime.js';
import { PaginatedVariantUpdateSuggestionListFromJSON, } from '../models/PaginatedVariantUpdateSuggestionList.js';
import { PatchedVariantUpdateSuggestionRequestToJSON, } from '../models/PatchedVariantUpdateSuggestionRequest.js';
import { VariantUpdateSuggestionFromJSON, } from '../models/VariantUpdateSuggestion.js';
import { VariantUpdateSuggestionRequestToJSON, } from '../models/VariantUpdateSuggestionRequest.js';
/**
*
*/
export class VariantUpdateSuggestionsApi extends runtime.BaseAPI {
/**
* Creates request options for variantUpdateSuggestionsCreate without sending the request
*/
variantUpdateSuggestionsCreateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['variantUpdateSuggestionRequest'] == null) {
throw new runtime.RequiredError('variantUpdateSuggestionRequest', 'Required parameter "variantUpdateSuggestionRequest" was null or undefined when calling variantUpdateSuggestionsCreate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/`;
return {
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: VariantUpdateSuggestionRequestToJSON(requestParameters['variantUpdateSuggestionRequest']),
};
});
}
/**
*/
variantUpdateSuggestionsCreateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsCreateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
*/
variantUpdateSuggestionsCreate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsCreateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsDestroy without sending the request
*/
variantUpdateSuggestionsDestroyRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsDestroy().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
};
});
}
/**
*/
variantUpdateSuggestionsDestroyRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsDestroyRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
*/
variantUpdateSuggestionsDestroy(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.variantUpdateSuggestionsDestroyRaw(requestParameters, initOverrides);
});
}
/**
* Creates request options for variantUpdateSuggestionsList without sending the request
*/
variantUpdateSuggestionsListRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
if (requestParameters['count'] != null) {
queryParameters['count'] = requestParameters['count'];
}
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['suggestedBy'] != null) {
queryParameters['suggestedBy'] = requestParameters['suggestedBy'];
}
const headerParameters = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/`;
return {
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
};
});
}
/**
*/
variantUpdateSuggestionsListRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsListRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedVariantUpdateSuggestionListFromJSON(jsonValue));
});
}
/**
*/
variantUpdateSuggestionsList() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.variantUpdateSuggestionsListRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsPartialUpdate without sending the request
*/
variantUpdateSuggestionsPartialUpdateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsPartialUpdate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: PatchedVariantUpdateSuggestionRequestToJSON(requestParameters['patchedVariantUpdateSuggestionRequest']),
};
});
}
/**
*/
variantUpdateSuggestionsPartialUpdateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsPartialUpdateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
*/
variantUpdateSuggestionsPartialUpdate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsPartialUpdateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsRetrieve without sending the request
*/
variantUpdateSuggestionsRetrieveRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsRetrieve().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
};
});
}
/**
*/
variantUpdateSuggestionsRetrieveRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsRetrieveRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
*/
variantUpdateSuggestionsRetrieve(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsRetrieveRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsUpdate without sending the request
*/
variantUpdateSuggestionsUpdateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsUpdate().');
}
if (requestParameters['variantUpdateSuggestionRequest'] == null) {
throw new runtime.RequiredError('variantUpdateSuggestionRequest', 'Required parameter "variantUpdateSuggestionRequest" was null or undefined when calling variantUpdateSuggestionsUpdate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: VariantUpdateSuggestionRequestToJSON(requestParameters['variantUpdateSuggestionRequest']),
};
});
}
/**
*/
variantUpdateSuggestionsUpdateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsUpdateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
*/
variantUpdateSuggestionsUpdate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsUpdateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsValidateCreate without sending the request
*/
variantUpdateSuggestionsValidateCreateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['variantUpdateSuggestionRequest'] == null) {
throw new runtime.RequiredError('variantUpdateSuggestionRequest', 'Required parameter "variantUpdateSuggestionRequest" was null or undefined when calling variantUpdateSuggestionsValidateCreate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/validate/`;
return {
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: VariantUpdateSuggestionRequestToJSON(requestParameters['variantUpdateSuggestionRequest']),
};
});
}
/**
* Validate the variant suggestion data.
*/
variantUpdateSuggestionsValidateCreateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsValidateCreateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
* Validate the variant suggestion data.
*/
variantUpdateSuggestionsValidateCreate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsValidateCreateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsValidatePartialUpdate without sending the request
*/
variantUpdateSuggestionsValidatePartialUpdateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsValidatePartialUpdate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/validate/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: PatchedVariantUpdateSuggestionRequestToJSON(requestParameters['patchedVariantUpdateSuggestionRequest']),
};
});
}
/**
* Validate the variant suggestion update data.
*/
variantUpdateSuggestionsValidatePartialUpdateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsValidatePartialUpdateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
* Validate the variant suggestion update data.
*/
variantUpdateSuggestionsValidatePartialUpdate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsValidatePartialUpdateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Creates request options for variantUpdateSuggestionsValidateUpdate without sending the request
*/
variantUpdateSuggestionsValidateUpdateRequestOpts(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling variantUpdateSuggestionsValidateUpdate().');
}
if (requestParameters['variantUpdateSuggestionRequest'] == null) {
throw new runtime.RequiredError('variantUpdateSuggestionRequest', 'Required parameter "variantUpdateSuggestionRequest" was null or undefined when calling variantUpdateSuggestionsValidateUpdate().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = yield token("jwtAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
let urlPath = `/variant-update-suggestions/{id}/validate/`;
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
return {
path: urlPath,
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: VariantUpdateSuggestionRequestToJSON(requestParameters['variantUpdateSuggestionRequest']),
};
});
}
/**
* Validate the variant suggestion update data.
*/
variantUpdateSuggestionsValidateUpdateRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const requestOptions = yield this.variantUpdateSuggestionsValidateUpdateRequestOpts(requestParameters);
const response = yield this.request(requestOptions, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VariantUpdateSuggestionFromJSON(jsonValue));
});
}
/**
* Validate the variant suggestion update data.
*/
variantUpdateSuggestionsValidateUpdate(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.variantUpdateSuggestionsValidateUpdateRaw(requestParameters, initOverrides);
return yield response.value();
});
}
}
//# sourceMappingURL=VariantUpdateSuggestionsApi.js.map