@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
49 lines (47 loc) • 2.16 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/google_geocoders.ts
var GoogleGeocoders = class _GoogleGeocoders extends ApiResource {
static TYPE = "google_geocoders";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _GoogleGeocoders.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _GoogleGeocoders.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _GoogleGeocoders.TYPE } : id, options);
}
async markets(googleGeocoderId, params, options) {
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
return this.resources.fetch({ type: "markets" }, `google_geocoders/${_googleGeocoderId}/markets`, params, options);
}
async addresses(googleGeocoderId, params, options) {
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
return this.resources.fetch({ type: "addresses" }, `google_geocoders/${_googleGeocoderId}/addresses`, params, options);
}
async attachments(googleGeocoderId, params, options) {
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
return this.resources.fetch({ type: "attachments" }, `google_geocoders/${_googleGeocoderId}/attachments`, params, options);
}
async event_stores(googleGeocoderId, params, options) {
const _googleGeocoderId = googleGeocoderId.id || googleGeocoderId;
return this.resources.fetch({ type: "event_stores" }, `google_geocoders/${_googleGeocoderId}/event_stores`, params, options);
}
isGoogleGeocoder(resource) {
return resource.type && resource.type === _GoogleGeocoders.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _GoogleGeocoders.TYPE;
}
};
var instance = new GoogleGeocoders();
var google_geocoders_default = instance;
export { google_geocoders_default };
//# sourceMappingURL=chunk-2QBP2WHJ.js.map
//# sourceMappingURL=chunk-2QBP2WHJ.js.map