fetch-statuspage
Version:
271 lines (270 loc) • 20.5 kB
JavaScript
// tslint:disable
/**
* Statuspage API
* # Code of Conduct Please don\'t abuse the API, and please report all feature requests and issues to https://help.statuspage.io/help/contact-us-30 # Rate Limiting Each API token is limited to 1 request / second as measured on a 60 second rolling window. To get this limit increased or lifted, please contact us at https://help.statuspage.io/help/contact-us-30 # Basics ## HTTPS It\'s required ## URL Prefix In order to maintain version integrity into the future, the API is versioned. All calls currently begin with the following prefix: https://api.statuspage.io/v1/ ## RESTful Interface Wherever possible, the API seeks to implement repeatable patterns with logical, representative URLs and descriptive HTTP verbs. Below are some examples and conventions you will see throughout the documentation. * Collections are buckets: https://api.statuspage.io/v1/pages/asdf123/incidents.json * Elements have unique IDs: https://api.statuspage.io/v1/pages/asdf123/incidents/jklm456.json * GET will retrieve information about a collection/element * POST will create an element in a collection * PATCH will update a single element * PUT will replace a single element in a collection (rarely used) * DELETE will destroy a single element ## Sending Data Information can be sent in the body as form urlencoded or JSON, but make sure the Content-Type header matches the body structure or the server gremlins will be angry. All examples are provided in JSON format, however they can easily be converted to form encoding if required. Some examples of how to convert things are below: // JSON { \"incident\": { \"name\": \"test incident\", \"components\": [\"8kbf7d35c070\", \"vtnh60py4yd7\"] } } // Form Encoded (using curl as an example): curl -X POST https://api.statuspage.io/v1/example \\ -d \"incident[name]=test incident\" \\ -d \"incident[components][]=8kbf7d35c070\" \\ -d \"incident[components][]=vtnh60py4yd7\" # Authentication <!-- ReDoc-Inject: <security-definitions> -->
*
* The version of the OpenAPI document: 1.0.0
*
*
* 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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const runtime = require("../runtime");
const models_1 = require("../models");
/**
* no description
*/
class PageAccessGroupComponentsApi extends runtime.BaseAPI {
/**
* Delete components for a page access group
* Delete components for a page access group
*/
deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents === null || requestParameters.DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents === undefined) {
throw new runtime.RequiredError('DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents', 'Required parameter requestParameters.DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: models_1.DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsToJSON(requestParameters.DeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents),
});
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.PageAccessGroupFromJSON(jsonValue));
});
}
/**
* Delete components for a page access group
* Delete components for a page access group
*/
deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponents(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters);
return yield response.value();
});
}
/**
* Remove a component from a page access group
* Remove a component from a page access group
*/
deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentIdRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentId.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentId.');
}
if (requestParameters.component_id === null || requestParameters.component_id === undefined) {
throw new runtime.RequiredError('component_id', 'Required parameter requestParameters.component_id was null or undefined when calling deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentId.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components/{component_id}`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))).replace(`{${"component_id"}}`, encodeURIComponent(String(requestParameters.component_id))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
});
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.PageAccessGroupFromJSON(jsonValue));
});
}
/**
* Remove a component from a page access group
* Remove a component from a page access group
*/
deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentId(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.deletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentIdRaw(requestParameters);
return yield response.value();
});
}
/**
* List components for a page access group
* List components for a page access group
*/
getPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling getPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling getPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.ComponentFromJSON));
});
}
/**
* List components for a page access group
* List components for a page access group
*/
getPagesPageIdPageAccessGroupsPageAccessGroupIdComponents(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters);
return yield response.value();
});
}
/**
* Add components to page access group
* Add components to page access group
*/
patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === null || requestParameters.PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === undefined) {
throw new runtime.RequiredError('PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents', 'Required parameter requestParameters.PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents was null or undefined when calling patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: models_1.PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsToJSON(requestParameters.PatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents),
});
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.PageAccessGroupFromJSON(jsonValue));
});
}
/**
* Add components to page access group
* Add components to page access group
*/
patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponents(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters);
return yield response.value();
});
}
/**
* Replace components for a page access group
* Replace components for a page access group
*/
postPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling postPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling postPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === null || requestParameters.PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === undefined) {
throw new runtime.RequiredError('PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponents', 'Required parameter requestParameters.PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponents was null or undefined when calling postPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: models_1.PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsToJSON(requestParameters.PostPagesPageIdPageAccessGroupsPageAccessGroupIdComponents),
});
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.PageAccessGroupFromJSON(jsonValue));
});
}
/**
* Replace components for a page access group
* Replace components for a page access group
*/
postPagesPageIdPageAccessGroupsPageAccessGroupIdComponents(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters);
return yield response.value();
});
}
/**
* Add components to page access group
* Add components to page access group
*/
putPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.page_id === null || requestParameters.page_id === undefined) {
throw new runtime.RequiredError('page_id', 'Required parameter requestParameters.page_id was null or undefined when calling putPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.page_access_group_id === null || requestParameters.page_access_group_id === undefined) {
throw new runtime.RequiredError('page_access_group_id', 'Required parameter requestParameters.page_access_group_id was null or undefined when calling putPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
if (requestParameters.PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === null || requestParameters.PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponents === undefined) {
throw new runtime.RequiredError('PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponents', 'Required parameter requestParameters.PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponents was null or undefined when calling putPagesPageIdPageAccessGroupsPageAccessGroupIdComponents.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api_key authentication
}
const response = yield this.request({
path: `/pages/{page_id}/page_access_groups/{page_access_group_id}/components`.replace(`{${"page_id"}}`, encodeURIComponent(String(requestParameters.page_id))).replace(`{${"page_access_group_id"}}`, encodeURIComponent(String(requestParameters.page_access_group_id))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: models_1.PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsToJSON(requestParameters.PutPagesPageIdPageAccessGroupsPageAccessGroupIdComponents),
});
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.PageAccessGroupFromJSON(jsonValue));
});
}
/**
* Add components to page access group
* Add components to page access group
*/
putPagesPageIdPageAccessGroupsPageAccessGroupIdComponents(requestParameters) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.putPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsRaw(requestParameters);
return yield response.value();
});
}
}
exports.PageAccessGroupComponentsApi = PageAccessGroupComponentsApi;
;