/
Reachability.ts
88 lines (85 loc) · 2.84 KB
/
Reachability.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import {EventData} from '.';
/**
* The type of reason for updating the reachability status of a messaging identifier
*/
export type ReachabilityUpdateType =
| 'hard_bounce'
| 'soft_bounce'
| 'spam_report'
| 'uninstall'
| 'invalid_identifier'
| 'returned_to_sender'
| 'unknown'
| 'expired'
| 'other';
/* eslint-disable max-len */
/**
* The payload for an ODP messaging identifier reachability update via v3 APIs.
* See [V3 Reachability API](https://docs.developers.optimizely.com/optimizely-data-platform/reference/update-reachability-1)
*/
/* eslint-enable max-len */
export interface ReachabilityUpdate {
/**
* The name of the messaging identifier field you want to update, e.g., email
*/
identifier_field_name: string;
/**
* A valid messaging identifier value, such as an email address for the email identifier
*/
identifier_value: string;
/**
* true indicates the identifier value is now reachable, false indicates it is no longer reachable
*/
reachable: boolean;
/**
* The type of change to the reachability status.
* If reachable is set to true, this field must be left null.
* If reachable is false, this field is required.
*/
reachable_update_type?: ReachabilityUpdateType;
/**
* A specific error code or note for the change type. Should be human readable.
*/
reachable_update_reason?: string;
/**
* The time of the event if this is a historical change (defaults to current time).
* Must be formated in ISO8601, provided as a Date object, or as a unix epoch.
*/
reachable_update_ts?: Date | string | number;
/**
* Additional event fields/values that should be included if an ODP event is generated as a result of this update
*/
event_data?: EventData;
}
/* eslint-disable max-len */
/**
* The response payload for fetching the reachability details of a messaging identifier.
* See [V3 Reachability API](https://docs.developers.optimizely.com/optimizely-data-platform/reference/get-reachability-1)
*/
/* eslint-enable max-len */
export interface GetReachabilityResponse {
/**
* The name of the messaging identifier field, e.g., email
*/
identifier_field_name: string;
/**
* The messaging identifier value this information is relevant to, such as a customer's email address
*/
identifier_value: string;
/**
* true if this specific messaging identifier is considered reachable by ODP, false otherwise
*/
reachable: boolean;
/**
* The type of update that last changed the reachability of this identifier
*/
reachable_update_type: ReachabilityUpdateType;
/**
* The reason for the update that last changed the reachability of this identifier
*/
reachable_update_reason: string | null;
/**
* The time (unix epoch, seconds) of the last update that last changed the reachability of this identifier
*/
reachable_update_ts: number | null;
}