MCPcopy Index your code
hub / github.com/OneSignal/onesignal-node-api / parse

Method parse

models/ObjectSerializer.ts:435–445  ·  view source on GitHub ↗

* Parse data from a string according to the given media type

(rawData: string, mediaType: string | undefined)

Source from the content-addressed store, hash-verified

433 * Parse data from a string according to the given media type
434 */
435 public static parse(rawData: string, mediaType: string | undefined) {
436 if (mediaType === undefined) {
437 throw new Error("Cannot parse content. No Content-Type defined.");
438 }
439
440 if (mediaType === "application/json") {
441 return JSON.parse(rawData);
442 }
443
444 throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.parse.");
445 }
446}

Callers 15

cancelNotificationMethod · 0.80
copyTemplateToAppMethod · 0.80
createAliasMethod · 0.80
createApiKeyMethod · 0.80
createAppMethod · 0.80
createCustomEventsMethod · 0.80
createNotificationMethod · 0.80
createSegmentMethod · 0.80
createSubscriptionMethod · 0.80
createTemplateMethod · 0.80
createUserMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected