-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubscriberResponseDto.cs
More file actions
239 lines (197 loc) · 10.3 KB
/
SubscriberResponseDto.cs
File metadata and controls
239 lines (197 loc) · 10.3 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Novu.Models.Errors
{
using Newtonsoft.Json;
using Novu.Models.Components;
using Novu.Utils;
using System;
using System.Collections.Generic;
using System.Net.Http;
public class SubscriberResponseDtoPayload
{
/// <summary>
/// The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier.
/// </summary>
[JsonProperty("_id")]
public string? Id { get; set; }
/// <summary>
/// The first name of the subscriber.
/// </summary>
[JsonProperty("firstName")]
public string? FirstName { get; set; }
/// <summary>
/// The last name of the subscriber.
/// </summary>
[JsonProperty("lastName")]
public string? LastName { get; set; }
/// <summary>
/// The email address of the subscriber.
/// </summary>
[JsonProperty("email")]
public string? Email { get; set; }
/// <summary>
/// The phone number of the subscriber.
/// </summary>
[JsonProperty("phone")]
public string? Phone { get; set; }
/// <summary>
/// The URL of the subscriber's avatar image.
/// </summary>
[JsonProperty("avatar")]
public string? Avatar { get; set; }
/// <summary>
/// The locale setting of the subscriber, indicating their preferred language or region.
/// </summary>
[JsonProperty("locale")]
public string? Locale { get; set; }
/// <summary>
/// An array of channel settings associated with the subscriber.
/// </summary>
[JsonProperty("channels")]
public List<ChannelSettingsDto>? Channels { get; set; }
/// <summary>
/// An array of topics that the subscriber is subscribed to.
/// </summary>
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")]
[JsonProperty("topics")]
public List<string>? Topics { get; set; }
/// <summary>
/// Indicates whether the subscriber is currently online.
/// </summary>
[JsonProperty("isOnline")]
public bool? IsOnline { get; set; }
/// <summary>
/// The timestamp indicating when the subscriber was last online, in ISO 8601 format.
/// </summary>
[JsonProperty("lastOnlineAt")]
public string? LastOnlineAt { get; set; }
/// <summary>
/// The version of the subscriber document.
/// </summary>
[JsonProperty("__v")]
public double? V { get; set; }
/// <summary>
/// Additional custom data for the subscriber.
/// </summary>
[JsonProperty("data")]
public Dictionary<string, object>? Data { get; set; }
/// <summary>
/// Timezone of the subscriber.
/// </summary>
[JsonProperty("timezone")]
public string? Timezone { get; set; }
/// <summary>
/// The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
/// </summary>
[JsonProperty("subscriberId")]
public string SubscriberId { get; set; } = default!;
/// <summary>
/// The unique identifier of the organization to which the subscriber belongs.
/// </summary>
[JsonProperty("_organizationId")]
public string OrganizationId { get; set; } = default!;
/// <summary>
/// The unique identifier of the environment associated with this subscriber.
/// </summary>
[JsonProperty("_environmentId")]
public string EnvironmentId { get; set; } = default!;
/// <summary>
/// Indicates whether the subscriber has been deleted.
/// </summary>
[JsonProperty("deleted")]
public bool Deleted { get; set; } = default!;
/// <summary>
/// The timestamp indicating when the subscriber was created, in ISO 8601 format.
/// </summary>
[JsonProperty("createdAt")]
public string CreatedAt { get; set; } = default!;
/// <summary>
/// The timestamp indicating when the subscriber was last updated, in ISO 8601 format.
/// </summary>
[JsonProperty("updatedAt")]
public string UpdatedAt { get; set; } = default!;
}
public class SubscriberResponseDto : BaseException
{
/// <summary>
/// The original data that was passed to this exception.
/// </summary>
public SubscriberResponseDtoPayload Payload { get; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Id instead.")]
public string? Id { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.FirstName instead.")]
public string? FirstName { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.LastName instead.")]
public string? LastName { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Email instead.")]
public string? Email { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Phone instead.")]
public string? Phone { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Avatar instead.")]
public string? Avatar { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Locale instead.")]
public string? Locale { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Channels instead.")]
public List<ChannelSettingsDto>? Channels { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Topics instead.")]
public List<string>? Topics { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.IsOnline instead.")]
public bool? IsOnline { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.LastOnlineAt instead.")]
public string? LastOnlineAt { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.V instead.")]
public double? V { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Timezone instead.")]
public string? Timezone { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.SubscriberId instead.")]
public string SubscriberId { get; set; } = default!;
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.OrganizationId instead.")]
public string OrganizationId { get; set; } = default!;
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.EnvironmentId instead.")]
public string EnvironmentId { get; set; } = default!;
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.Deleted instead.")]
public bool Deleted { get; set; } = default!;
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.CreatedAt instead.")]
public string CreatedAt { get; set; } = default!;
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use SubscriberResponseDto.Payload.UpdatedAt instead.")]
public string UpdatedAt { get; set; } = default!;
public SubscriberResponseDto(
SubscriberResponseDtoPayload payload,
HttpRequestMessage request,
HttpResponseMessage response,
string body
): base("API error occurred", request, response, body)
{
Payload = payload;
#pragma warning disable CS0618
Id = payload.Id;
FirstName = payload.FirstName;
LastName = payload.LastName;
Email = payload.Email;
Phone = payload.Phone;
Avatar = payload.Avatar;
Locale = payload.Locale;
Channels = payload.Channels;
Topics = payload.Topics;
IsOnline = payload.IsOnline;
LastOnlineAt = payload.LastOnlineAt;
V = payload.V;
Timezone = payload.Timezone;
SubscriberId = payload.SubscriberId;
OrganizationId = payload.OrganizationId;
EnvironmentId = payload.EnvironmentId;
Deleted = payload.Deleted;
CreatedAt = payload.CreatedAt;
UpdatedAt = payload.UpdatedAt;
#pragma warning restore CS0618
}
}
}