@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
61 lines • 1.87 kB
JavaScript
import * as Utils from '@datocms/rest-client-utils';
import BaseResource from '../../BaseResource';
export default class WhiteLabelSettings extends BaseResource {
/**
* Retrieve white-label settings
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/white-label_settings/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find() {
return this.rawFind().then((body) => Utils.deserializeResponseBody(body));
}
/**
* Retrieve white-label settings
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/white-label_settings/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawFind() {
return this.client.request({
method: 'GET',
url: '/white-label-settings',
});
}
/**
* Update white-label settings
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/white-label_settings/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
update(body) {
return this.rawUpdate(Utils.serializeRequestBody(body, {
type: 'white_label_settings',
attributes: ['custom_i18n_messages_template_url'],
relationships: [],
})).then((body) => Utils.deserializeResponseBody(body));
}
/**
* Update white-label settings
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/white-label_settings/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawUpdate(body) {
return this.client.request({
method: 'PUT',
url: '/white-label-settings',
body,
});
}
}
WhiteLabelSettings.TYPE = 'white_label_settings';
//# sourceMappingURL=WhiteLabelSettings.js.map