UNPKG

@commercelayer/sdk

Version:
51 lines (48 loc) 2.22 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/google_geocoders.ts var GoogleGeocoders = class _GoogleGeocoders extends chunkU22VLCMN_cjs.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; exports.google_geocoders_default = google_geocoders_default; //# sourceMappingURL=chunk-I64U2VMD.cjs.map //# sourceMappingURL=chunk-I64U2VMD.cjs.map