@onesignal/node-onesignal
Version:
OpenAPI client for @onesignal/node-onesignal
157 lines (147 loc) • 7.79 kB
text/typescript
/**
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
* API Version: 5.2.0
* Contact: devrel@onesignal.com
*/
import { SegmentNotificationTarget } from './SegmentNotificationTarget';
import { SubscriptionNotificationTarget } from './SubscriptionNotificationTarget';
import { HttpFile } from '../http/http';
export class NotificationTarget {
/**
* The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
*/
'included_segments'?: Array<string>;
/**
* Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
*/
'excluded_segments'?: Array<string>;
/**
* Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call
*/
'include_subscription_ids'?: Array<string>;
/**
* Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call
*/
'include_email_tokens'?: Array<string>;
/**
* Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call
*/
'include_phone_numbers'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call
*/
'include_ios_tokens'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call
*/
'include_wp_wns_uris'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call
*/
'include_amazon_reg_ids'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
*/
'include_chrome_reg_ids'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
*/
'include_chrome_web_reg_ids'?: Array<string>;
/**
* Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
*/
'include_android_reg_ids'?: Array<string>;
/**
* Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
*/
'include_aliases'?: { [key: string]: Array<string>; };
'target_channel'?: NotificationTargetTargetChannelEnum;
static readonly discriminator: string | undefined = undefined;
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "included_segments",
"baseName": "included_segments",
"type": "Array<string>",
"format": ""
},
{
"name": "excluded_segments",
"baseName": "excluded_segments",
"type": "Array<string>",
"format": ""
},
{
"name": "include_subscription_ids",
"baseName": "include_subscription_ids",
"type": "Array<string>",
"format": ""
},
{
"name": "include_email_tokens",
"baseName": "include_email_tokens",
"type": "Array<string>",
"format": ""
},
{
"name": "include_phone_numbers",
"baseName": "include_phone_numbers",
"type": "Array<string>",
"format": ""
},
{
"name": "include_ios_tokens",
"baseName": "include_ios_tokens",
"type": "Array<string>",
"format": ""
},
{
"name": "include_wp_wns_uris",
"baseName": "include_wp_wns_uris",
"type": "Array<string>",
"format": ""
},
{
"name": "include_amazon_reg_ids",
"baseName": "include_amazon_reg_ids",
"type": "Array<string>",
"format": ""
},
{
"name": "include_chrome_reg_ids",
"baseName": "include_chrome_reg_ids",
"type": "Array<string>",
"format": ""
},
{
"name": "include_chrome_web_reg_ids",
"baseName": "include_chrome_web_reg_ids",
"type": "Array<string>",
"format": ""
},
{
"name": "include_android_reg_ids",
"baseName": "include_android_reg_ids",
"type": "Array<string>",
"format": ""
},
{
"name": "include_aliases",
"baseName": "include_aliases",
"type": "{ [key: string]: Array<string>; }",
"format": ""
},
{
"name": "target_channel",
"baseName": "target_channel",
"type": "NotificationTargetTargetChannelEnum",
"format": ""
} ];
static getAttributeTypeMap() {
return NotificationTarget.attributeTypeMap;
}
public constructor() {
}
}
export type NotificationTargetTargetChannelEnum = "push" | "email" | "sms" ;