import Client from './client'; export default class Attributes extends Client { constructor(opts) { let options = opts; if (typeof opts === 'string') { options = { host: opts }; // convert host string to options object } options.serviceName = 'apibuilder api'; super(options); } get(options = {}) { return this.makeRequest(`${this.host}/attributes`, options); } getByName(name, options = {}) { return this.makeRequest(`${this.host}/attributes/${name}`, options); } post(options = {}) { return this.makeRequest(`${this.host}/attributes`, { ...options, method: 'POST', }); } deleteByName(name, options = {}) { return this.makeRequest(`${this.host}/attributes/${name}`, { ...options, method: 'DELETE', }); } }