sendgrid2/
model.rs

1use serde::{Serialize, Deserialize};
2#[derive(Debug, Serialize, Deserialize, Default)]
3pub struct MailSettingsFooter {
4    ///The custom HTML content of your email footer.
5    pub html_content: Option<String>,
6    ///Indicates if the Footer mail setting is currently enabled.
7    pub enabled: Option<bool>,
8    ///The plain text content of your email footer.
9    pub plain_content: Option<String>,
10}
11impl std::fmt::Display for MailSettingsFooter {
12    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13        write!(f, "{}", serde_json::to_string(self).unwrap())
14    }
15}
16#[derive(Debug, Serialize, Deserialize)]
17pub struct PostMarketingSendersRequired {
18    pub country: String,
19    pub city: String,
20    pub nickname: String,
21    pub from: serde_json::Value,
22    pub address: String,
23}
24impl std::fmt::Display for PostMarketingSendersRequired {
25    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
26        write!(f, "{}", serde_json::to_string(self).unwrap())
27    }
28}
29#[derive(Debug, Serialize, Deserialize)]
30pub struct ContactdbCustomFieldWithId {
31    pub contactdb_custom_field: ContactdbCustomField,
32    ///The ID of the custom field.
33    pub id: f64,
34}
35impl std::fmt::Display for ContactdbCustomFieldWithId {
36    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
37        write!(f, "{}", serde_json::to_string(self).unwrap())
38    }
39}
40#[derive(Debug, Serialize, Deserialize, Default)]
41pub struct IpPool {
42    ///The name of the IP pool.
43    pub name: String,
44}
45impl std::fmt::Display for IpPool {
46    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
47        write!(f, "{}", serde_json::to_string(self).unwrap())
48    }
49}
50#[derive(Debug, Serialize, Deserialize)]
51pub struct SinglesendRequest {
52    pub email_config: Option<serde_json::Value>,
53    ///The name of the Single Send.
54    pub name: String,
55    ///The categories to associate with this Single Send.
56    pub categories: Option<Vec<String>>,
57    ///The ISO 8601 time at which to send the Single Send. This must be in future or the string "now". Emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to campaigns sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/).
58    pub send_at: Option<String>,
59    pub send_to: Option<serde_json::Value>,
60}
61impl std::fmt::Display for SinglesendRequest {
62    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
63        write!(f, "{}", serde_json::to_string(self).unwrap())
64    }
65}
66#[derive(Debug, Serialize, Deserialize, Default)]
67pub struct ContactdbRecipientCount {
68    ///The count of recipients.
69    pub recipient_count: f64,
70}
71impl std::fmt::Display for ContactdbRecipientCount {
72    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
73        write!(f, "{}", serde_json::to_string(self).unwrap())
74    }
75}
76#[derive(Debug, Serialize, Deserialize)]
77pub struct SingleContactRequest {
78    pub contact: Option<serde_json::Value>,
79    ///The contact's list IDs.
80    pub list_ids: Option<Vec<String>>,
81}
82impl std::fmt::Display for SingleContactRequest {
83    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
84        write!(f, "{}", serde_json::to_string(self).unwrap())
85    }
86}
87#[derive(Debug, Serialize, Deserialize)]
88pub struct ApiKeyNameIdScopes {
89    pub api_key_name_id: ApiKeyNameId,
90    ///The permissions this API Key has access to.
91    pub scopes: Vec<String>,
92}
93impl std::fmt::Display for ApiKeyNameIdScopes {
94    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
95        write!(f, "{}", serde_json::to_string(self).unwrap())
96    }
97}
98#[derive(Debug, Serialize, Deserialize, Default)]
99pub struct PartnerSettingsNewRelic {
100    ///Indicates if your subuser statistics will be sent to your New Relic Dashboard.
101    pub enable_subuser_statistics: Option<bool>,
102    ///The license key provided with your New Relic account.
103    pub license_key: String,
104    ///Indicates if this setting is enabled.
105    pub enabled: bool,
106}
107impl std::fmt::Display for PartnerSettingsNewRelic {
108    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
109        write!(f, "{}", serde_json::to_string(self).unwrap())
110    }
111}
112#[derive(Debug, Serialize, Deserialize, Default)]
113pub struct FromEmailObject {
114    ///The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account.
115    pub email: String,
116    ///A name or title associated with the sending email address.
117    pub name: Option<String>,
118}
119impl std::fmt::Display for FromEmailObject {
120    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
121        write!(f, "{}", serde_json::to_string(self).unwrap())
122    }
123}
124#[derive(Debug, Serialize, Deserialize)]
125pub struct List {
126    ///The name you gave your list.
127    pub name: Option<String>,
128    ///The number of contacts currently stored on the list.
129    pub contact_count: Option<i64>,
130    ///The generated ID for your list.
131    pub id: Option<String>,
132    pub metadata: Option<Selfmetadata>,
133}
134impl std::fmt::Display for List {
135    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
136        write!(f, "{}", serde_json::to_string(self).unwrap())
137    }
138}
139#[derive(Debug, Serialize, Deserialize, Default)]
140pub struct IpAccessResponse {
141    ///An array listing all of your allowed IPs.
142    pub result: Option<Vec<serde_json::Value>>,
143}
144impl std::fmt::Display for IpAccessResponse {
145    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
146        write!(f, "{}", serde_json::to_string(self).unwrap())
147    }
148}
149#[derive(Debug, Serialize, Deserialize)]
150pub struct IpWarmupResponse(pub Vec<serde_json::Value>);
151#[derive(Debug, Serialize, Deserialize, Default)]
152pub struct CustomFieldsById {}
153impl std::fmt::Display for CustomFieldsById {
154    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
155        write!(f, "{}", serde_json::to_string(self).unwrap())
156    }
157}
158#[derive(Debug, Serialize, Deserialize)]
159pub struct AdvancedStatsClicksOpens {
160    ///The individual events and their stats.
161    pub advanced_stats_clicks: AdvancedStatsClicks,
162    ///The individual events and their stats.
163    pub advanced_stats_opens: AdvancedStatsOpens,
164}
165impl std::fmt::Display for AdvancedStatsClicksOpens {
166    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
167        write!(f, "{}", serde_json::to_string(self).unwrap())
168    }
169}
170#[derive(Debug, Serialize, Deserialize, Default)]
171pub struct ContactdbList {
172    ///The reference ID of your list.
173    pub id: i64,
174    ///The count of recipients currently in the list.
175    pub recipient_count: i64,
176    ///The name of your list. Must be unique against all other list and segment names.
177    pub name: String,
178}
179impl std::fmt::Display for ContactdbList {
180    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
181        write!(f, "{}", serde_json::to_string(self).unwrap())
182    }
183}
184#[derive(Debug, Serialize, Deserialize, Default)]
185pub struct ClickTracking {
186    ///Indicates if click tracking is enabled or disabled.
187    pub enabled: bool,
188    ///Indicates if click tracking is enabled for plain text emails.
189    pub enable_text: bool,
190}
191impl std::fmt::Display for ClickTracking {
192    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
193        write!(f, "{}", serde_json::to_string(self).unwrap())
194    }
195}
196#[derive(Debug, Serialize, Deserialize, Default)]
197pub struct Link {
198    pub href: Option<String>,
199    pub rel: Option<String>,
200}
201impl std::fmt::Display for Link {
202    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
203        write!(f, "{}", serde_json::to_string(self).unwrap())
204    }
205}
206#[derive(Debug, Serialize, Deserialize)]
207pub struct SsoIntegration {
208    ///The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid.
209    pub audience_url: String,
210    pub create_integration_request: CreateIntegrationRequest,
211    ///The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid.
212    pub single_signon_url: String,
213    ///A timestamp representing the last time the configuration was modified.
214    pub last_updated: f64,
215    ///A unique ID assigned to the configuration by SendGrid.
216    pub id: String,
217}
218impl std::fmt::Display for SsoIntegration {
219    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
220        write!(f, "{}", serde_json::to_string(self).unwrap())
221    }
222}
223#[derive(Debug, Serialize, Deserialize)]
224pub struct TneSenderId {
225    ///The time the sender identity was last updated.
226    pub updated_at: i64,
227    ///The time the sender identity was created.
228    pub created_at: i64,
229    ///Only verified sender identities can be used to send email.
230    pub verified: serde_json::Value,
231    ///The unique identifier of the sender.
232    pub id: i64,
233    pub senders_id_request_body: SendersIdRequestBody,
234    ///A sender identity is locked when it is associated with a campaign in the Draft, Scheduled, or In Progress state. You can't update or delete a locked sender identity.
235    pub locked: bool,
236}
237impl std::fmt::Display for TneSenderId {
238    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
239        write!(f, "{}", serde_json::to_string(self).unwrap())
240    }
241}
242#[derive(Debug, Serialize, Deserialize, Default)]
243pub struct ContactdbSegments {
244    ///The count of recipients in this list. This is not included on creation of segments.
245    pub recipient_count: Option<f64>,
246    ///The name of this segment.
247    pub name: String,
248    ///The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list.
249    pub list_id: Option<i64>,
250    ///The conditions for a recipient to be included in this segment.
251    pub conditions: Vec<ContactdbSegmentsConditions>,
252}
253impl std::fmt::Display for ContactdbSegments {
254    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
255        write!(f, "{}", serde_json::to_string(self).unwrap())
256    }
257}
258#[derive(Debug, Serialize, Deserialize)]
259pub struct LinkBranding200Response {
260    ///Indicates if this is the default link branding.
261    pub default: bool,
262    ///The DNS records generated for this link branding.
263    pub dns: serde_json::Value,
264    ///The root domain of the branded link.
265    pub domain: String,
266    ///The ID of the user that this link branding is associated with.
267    pub user_id: i64,
268    ///The subdomain used to generate the DNS records for this link branding. This subdomain must be different from the subdomain used for your authenticated domain.
269    pub subdomain: Option<String>,
270    ///The username of the account that this link branding is associated with.
271    pub username: String,
272    ///The ID of the branded link.
273    pub id: i64,
274    ///Indicates if this link branding was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create new link branding if you need to update it.
275    pub legacy: bool,
276    ///Indicates if this link branding is valid.
277    pub valid: bool,
278}
279impl std::fmt::Display for LinkBranding200Response {
280    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
281        write!(f, "{}", serde_json::to_string(self).unwrap())
282    }
283}
284#[derive(Debug, Serialize, Deserialize)]
285pub struct SsoErrorResponse(pub Vec<serde_json::Value>);
286#[derive(Debug, Serialize, Deserialize)]
287pub struct SsoTeammatesPatchResponse {
288    ///The Teammate’s street address.
289    pub address: String,
290    ///A website associated with the Teammate
291    pub website: String,
292    ///The Teammate’s stored phone number.
293    pub phone: String,
294    pub sso_teammate_response: SsoTeammateResponse,
295    ///The Teammate’s company name.
296    pub company: String,
297    ///The Teammate’s zip code.
298    pub zip: String,
299    ///The Teammate's city.
300    pub city: String,
301    pub email: String,
302    ///The Teammate’s country of residence.
303    pub country: String,
304    ///The Teammate’s apartment number, suite number, or other secondary address information that is not part of the physical street address.
305    pub address2: String,
306    ///The Teammate’s state or province.
307    pub state: String,
308    ///A Teammate can be an “admin,” “owner,” or “teammate.” Each role is associated with the scope of the Teammate’s permissions.
309    pub user_type: String,
310    ///The permission scopes assigned to the Teammate.
311    pub scopes: Vec<String>,
312}
313impl std::fmt::Display for SsoTeammatesPatchResponse {
314    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
315        write!(f, "{}", serde_json::to_string(self).unwrap())
316    }
317}
318#[derive(Debug, Serialize, Deserialize)]
319pub struct ContactExport {
320    ///The ISO8601 timestamp when the exported file on S3 will expire.
321    pub expires_at: String,
322    pub id: String,
323    ///The ISO8601 timestamp when the export was begun.
324    pub created_at: String,
325    ///A human readable message if the status is `failure`.
326    pub message: Option<String>,
327    ///One or more download URLs for the contact file if the status is `ready`.
328    pub urls: Option<Vec<String>>,
329    ///The ISO8601 timestamp when the export was completed.
330    pub completed_at: Option<String>,
331    ///The ISO8601 timestamp when the export was updated.
332    pub updated_at: String,
333    pub metadata: Option<Metadata>,
334    ///The total number of exported contacts.
335    pub contact_count: Option<i64>,
336    ///The export job's status. Allowed values: `pending`, `ready`, or `failure`.
337    pub status: String,
338}
339impl std::fmt::Display for ContactExport {
340    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
341        write!(f, "{}", serde_json::to_string(self).unwrap())
342    }
343}
344#[derive(Debug, Serialize, Deserialize)]
345pub struct ReverseDns {
346    ///A Unix epoch timestamp representing the last time of a validation attempt.
347    pub last_validation_attempt_at: Option<i64>,
348    ///The root, or sending, domain.
349    pub domain: String,
350    ///The ID of the Reverse DNS.
351    pub id: i64,
352    ///The IP address that this Reverse DNS was created for.
353    pub ip: String,
354    ///The subdomain created for this reverse DNS. This is where the rDNS record points.
355    pub subdomain: Option<String>,
356    ///The users who are able to send mail from the IP address.
357    pub users: Vec<serde_json::Value>,
358    ///Indicates if this is a valid Reverse DNS.
359    pub valid: bool,
360    pub a_record: serde_json::Value,
361    ///The reverse DNS record for the IP address. This points to the Reverse DNS subdomain.
362    pub rdns: String,
363    ///Indicates if this Reverse DNS was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new Reverse DNS if you need to update it.
364    pub legacy: bool,
365}
366impl std::fmt::Display for ReverseDns {
367    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
368        write!(f, "{}", serde_json::to_string(self).unwrap())
369    }
370}
371#[derive(Debug, Serialize, Deserialize)]
372pub struct DesignInput {
373    pub design_duplicate_input: DesignDuplicateInput,
374    pub design_common_fields: DesignCommonFields,
375    ///Plain text content of the Design.
376    pub plain_content: String,
377    ///The HTML content of the Design.
378    pub html_content: String,
379}
380impl std::fmt::Display for DesignInput {
381    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
382        write!(f, "{}", serde_json::to_string(self).unwrap())
383    }
384}
385#[derive(Debug, Serialize, Deserialize, Default)]
386pub struct PatchAsmGroupsGroupIdRequired {
387    pub is_default: bool,
388    pub group_id: String,
389    pub description: String,
390    pub name: String,
391}
392impl std::fmt::Display for PatchAsmGroupsGroupIdRequired {
393    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
394        write!(f, "{}", serde_json::to_string(self).unwrap())
395    }
396}
397#[derive(Debug, Serialize, Deserialize, Default)]
398pub struct PostMarketingSegmentsRequired {
399    pub parent_list_id: String,
400    pub parent_list_ids: Vec<String>,
401    pub query_dsl: String,
402    pub name: String,
403}
404impl std::fmt::Display for PostMarketingSegmentsRequired {
405    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
406        write!(f, "{}", serde_json::to_string(self).unwrap())
407    }
408}
409#[derive(Debug, Serialize, Deserialize, Default)]
410pub struct UserProfile {
411    ///The street address for this user profile.
412    pub address: Option<String>,
413    ///That company that this user profile is associated with.
414    pub company: Option<String>,
415    ///The first name of the user.
416    pub first_name: Option<String>,
417    ///An optional second line for the street address of this user profile.
418    pub address2: Option<String>,
419    ///Th country of this user profile.
420    pub country: Option<String>,
421    ///The last name of the user.
422    pub last_name: Option<String>,
423    ///The website associated with this user.
424    pub website: Option<String>,
425    ///The city for the user profile.
426    pub city: Option<String>,
427    ///The phone number for the user.
428    pub phone: Option<String>,
429    ///The zip code for this user.
430    pub zip: Option<String>,
431    ///The state for this user.
432    pub state: Option<String>,
433}
434impl std::fmt::Display for UserProfile {
435    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
436        write!(f, "{}", serde_json::to_string(self).unwrap())
437    }
438}
439#[derive(Debug, Serialize, Deserialize, Default)]
440pub struct SegmentUpdate {
441    ///Name of the segment.
442    pub name: Option<String>,
443    ///SQL query which will filter contacts based on the conditions provided
444    pub query_dsl: Option<String>,
445}
446impl std::fmt::Display for SegmentUpdate {
447    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
448        write!(f, "{}", serde_json::to_string(self).unwrap())
449    }
450}
451#[derive(Debug, Serialize, Deserialize)]
452pub struct StatsAdvancedStatsBaseSchema(pub Vec<serde_json::Value>);
453#[derive(Debug, Serialize, Deserialize, Default)]
454pub struct Subuser {
455    ///Whether or not the user is enabled or disabled.
456    pub disabled: bool,
457    ///The name by which this subuser will be referred.
458    pub username: String,
459    ///The email address to contact this subuser.
460    pub email: String,
461    ///The ID of this subuser.
462    pub id: f64,
463}
464impl std::fmt::Display for Subuser {
465    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
466        write!(f, "{}", serde_json::to_string(self).unwrap())
467    }
468}
469#[derive(Debug, Serialize, Deserialize, Default)]
470pub struct TransactionalTemplateVersionCreate {
471    ///The editor used in the UI.
472    pub editor: Option<String>,
473    ///For dynamic templates only, the mock json data that will be used for template preview and test sends.
474    pub test_data: Option<String>,
475    ///Subject of the new transactional template version.
476    pub subject: String,
477    ///Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active.
478    pub active: Option<i64>,
479    ///The HTML content of the version. Maximum of 1048576 bytes allowed.
480    pub html_content: Option<String>,
481    ///Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.
482    pub plain_content: Option<String>,
483    ///Name of the transactional template version.
484    pub name: String,
485    ///If true, plain_content is always generated from html_content. If false, plain_content is not altered.
486    pub generate_plain_content: Option<bool>,
487}
488impl std::fmt::Display for TransactionalTemplateVersionCreate {
489    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
490        write!(f, "{}", serde_json::to_string(self).unwrap())
491    }
492}
493#[derive(Debug, Serialize, Deserialize, Default)]
494pub struct Webhook {
495    ///The one time nonce to use when "signature" is "hmac-sha1"
496    pub nonce: String,
497    ///The URL to invoke in the webhook
498    pub url: String,
499}
500impl std::fmt::Display for Webhook {
501    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
502        write!(f, "{}", serde_json::to_string(self).unwrap())
503    }
504}
505#[derive(Debug, Serialize, Deserialize)]
506pub struct ReservedFieldDefinitionsResponse(pub Vec<serde_json::Value>);
507#[derive(Debug, Serialize, Deserialize, Default)]
508pub struct InvalidEmail {
509    ///A Unix timestamp indicating when the email address was added to the invalid emails list.
510    pub created: Option<i64>,
511    ///The email address that was marked as invalid.
512    pub email: Option<String>,
513    ///The reason that the email address was marked as invalid.
514    pub reason: Option<String>,
515}
516impl std::fmt::Display for InvalidEmail {
517    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
518        write!(f, "{}", serde_json::to_string(self).unwrap())
519    }
520}
521#[derive(Debug, Serialize, Deserialize)]
522pub struct ToEmailArray(pub Vec<serde_json::Value>);
523#[derive(Debug, Serialize, Deserialize)]
524pub struct DesignCommonFields {
525    ///Subject of the Design.
526    pub subject: String,
527    ///The list of categories applied to the design
528    pub categories: Vec<String>,
529    pub design_duplicate_input: DesignDuplicateInput,
530    ///If true, plain_content is always generated from html_content. If false, plain_content is not altered.
531    pub generate_plain_content: bool,
532}
533impl std::fmt::Display for DesignCommonFields {
534    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
535        write!(f, "{}", serde_json::to_string(self).unwrap())
536    }
537}
538#[derive(Debug, Serialize, Deserialize, Default)]
539pub struct MailSettingsAddressWhitelabel {
540    ///All email addresses that are currently on the whitelist.
541    pub list: Option<Vec<String>>,
542    ///Indicates if you have an email address whitelist enabled.
543    pub enabled: Option<bool>,
544}
545impl std::fmt::Display for MailSettingsAddressWhitelabel {
546    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
547        write!(f, "{}", serde_json::to_string(self).unwrap())
548    }
549}
550#[derive(Debug, Serialize, Deserialize, Default)]
551pub struct ReplyToEmailObject {
552    ///A name or title associated with the `reply_to` email address.
553    pub name: Option<String>,
554    ///The email address where any replies or bounces will be returned.
555    pub email: String,
556}
557impl std::fmt::Display for ReplyToEmailObject {
558    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
559        write!(f, "{}", serde_json::to_string(self).unwrap())
560    }
561}
562#[derive(Debug, Serialize, Deserialize, Default)]
563pub struct PatchUserWebhooksEventSettingsRequired {
564    pub bounce: bool,
565    pub spam_report: bool,
566    pub click: bool,
567    pub enabled: bool,
568    pub unsubscribe: bool,
569    pub url: String,
570    pub deferred: bool,
571    pub processed: bool,
572    pub dropped: bool,
573    pub group_resubscribe: bool,
574    pub delivered: bool,
575    pub open: bool,
576    pub group_unsubscribe: bool,
577}
578impl std::fmt::Display for PatchUserWebhooksEventSettingsRequired {
579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
580        write!(f, "{}", serde_json::to_string(self).unwrap())
581    }
582}
583#[derive(Debug, Serialize, Deserialize, Default)]
584pub struct SegmentSummary {
585    ///ISO8601 timestamp the object was last updated
586    pub updated_at: String,
587    /**ISO8601 of created timestamp
588*/
589    pub created_at: String,
590    ///The id of the list if this segment is a child of a list.  This implies the query `AND CONTAINS(list_ids, ${parent_list_id})`
591    pub parent_list_id: Option<String>,
592    pub id: String,
593    ///ISO8601 timestamp the sample was last updated
594    pub sample_updated_at: String,
595    ///ISO8601 string that is equal to `sample_updated_at` plus an internally calculated offset that depends on how often contacts enter or exit segments as the scheduled pipeline updates the samples.
596    pub next_sample_update: Option<String>,
597    pub contacts_count: i64,
598    pub name: Option<String>,
599}
600impl std::fmt::Display for SegmentSummary {
601    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
602        write!(f, "{}", serde_json::to_string(self).unwrap())
603    }
604}
605#[derive(Debug, Serialize, Deserialize, Default)]
606pub struct TransactionalTemplateWarning {
607    ///Warning message for the user
608    pub message: Option<String>,
609}
610impl std::fmt::Display for TransactionalTemplateWarning {
611    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
612        write!(f, "{}", serde_json::to_string(self).unwrap())
613    }
614}
615#[derive(Debug, Serialize, Deserialize, Default)]
616pub struct Metrics {
617    pub bounces: i64,
618    pub unsubscribes: i64,
619    pub clicks: i64,
620    pub spam_report_drops: i64,
621    pub invalid_emails: i64,
622    pub requests: i64,
623    pub unique_clicks: i64,
624    pub spam_reports: i64,
625    pub bounce_drops: i64,
626    pub unique_opens: i64,
627    pub opens: i64,
628    pub delivered: i64,
629}
630impl std::fmt::Display for Metrics {
631    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
632        write!(f, "{}", serde_json::to_string(self).unwrap())
633    }
634}
635#[derive(Debug, Serialize, Deserialize)]
636pub struct AllSegmentsResponse {
637    ///If not set, segment contains a query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2.
638    pub query_version: String,
639    ///ISO8601 timestamp of when the object was created
640    pub created_at: String,
641    ///Segment status indicates whether the segment's contacts will be updated periodically
642    pub status: SegmentStatusResponse,
643    ///Total number of contacts present in the segment
644    pub contacts_count: i64,
645    pub metadata: Option<Metadata>,
646    ///ISO8601 timestamp of when the samples will be next updated
647    pub next_sample_update: String,
648    ///ISO8601 timestamp of when the object was last updated
649    pub updated_at: String,
650    ///ISO8601 timestamp of when the samples were last updated
651    pub sample_updated_at: String,
652    ///Name of the segment.
653    pub name: String,
654    ///The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future
655    pub parent_list_ids: Vec<String>,
656    ///ID assigned to the segment when created.
657    pub id: String,
658}
659impl std::fmt::Display for AllSegmentsResponse {
660    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
661        write!(f, "{}", serde_json::to_string(self).unwrap())
662    }
663}
664#[derive(Debug, Serialize, Deserialize, Default)]
665pub struct Monitor {
666    ///The frequency at which to forward monitoring emails. An email will be sent when your subuser sends this many (e.g., 1,000) emails.
667    pub frequency: f64,
668    ///The email address to which Sendgrid should send emails for monitoring.
669    pub email: String,
670}
671impl std::fmt::Display for Monitor {
672    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
673        write!(f, "{}", serde_json::to_string(self).unwrap())
674    }
675}
676#[derive(Debug, Serialize, Deserialize, Default)]
677pub struct ApiError {
678    pub message: String,
679    pub field: String,
680    pub error_id: String,
681}
682impl std::fmt::Display for ApiError {
683    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
684        write!(f, "{}", serde_json::to_string(self).unwrap())
685    }
686}
687#[derive(Debug, Serialize, Deserialize, Default)]
688pub struct ContactdbRecipient {
689    pub recipients: Option<Vec<serde_json::Value>>,
690}
691impl std::fmt::Display for ContactdbRecipient {
692    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
693        write!(f, "{}", serde_json::to_string(self).unwrap())
694    }
695}
696#[derive(Debug, Serialize, Deserialize, Default)]
697pub struct VerifiedSenderResponseSchema {
698    pub verified: Option<bool>,
699    pub zip: Option<String>,
700    pub address2: Option<String>,
701    pub city: Option<String>,
702    pub from_name: Option<String>,
703    pub reply_to: Option<String>,
704    pub nickname: Option<String>,
705    pub from_email: Option<String>,
706    pub locked: Option<bool>,
707    pub state: Option<String>,
708    pub country: Option<String>,
709    pub reply_to_name: Option<String>,
710    pub address: Option<String>,
711    pub id: Option<i64>,
712}
713impl std::fmt::Display for VerifiedSenderResponseSchema {
714    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
715        write!(f, "{}", serde_json::to_string(self).unwrap())
716    }
717}
718#[derive(Debug, Serialize, Deserialize)]
719pub struct AutomationsLinkStatsResponse {
720    pub total_clicks: i64,
721    ///
722    pub results: Vec<serde_json::Value>,
723    pub metadata: LinkTrackingMetadata,
724}
725impl std::fmt::Display for AutomationsLinkStatsResponse {
726    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
727        write!(f, "{}", serde_json::to_string(self).unwrap())
728    }
729}
730#[derive(Debug, Serialize, Deserialize, Default)]
731pub struct GlobalErrorResponseSchema {
732    pub id: Option<String>,
733    pub errors: Option<Vec<serde_json::Value>>,
734}
735impl std::fmt::Display for GlobalErrorResponseSchema {
736    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
737        write!(f, "{}", serde_json::to_string(self).unwrap())
738    }
739}
740#[derive(Debug, Serialize, Deserialize, Default)]
741pub struct ApiErrors {
742    pub errors: Option<Vec<ApiError>>,
743}
744impl std::fmt::Display for ApiErrors {
745    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
746        write!(f, "{}", serde_json::to_string(self).unwrap())
747    }
748}
749#[derive(Debug, Serialize, Deserialize, Default)]
750pub struct AbbvMessage {
751    ///iso 8601 format
752    pub last_event_time: String,
753    pub from_email: String,
754    pub msg_id: String,
755    pub subject: String,
756    pub to_email: String,
757    pub opens_count: i64,
758    pub status: String,
759    pub clicks_count: i64,
760}
761impl std::fmt::Display for AbbvMessage {
762    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
763        write!(f, "{}", serde_json::to_string(self).unwrap())
764    }
765}
766#[derive(Debug, Serialize, Deserialize, Default)]
767pub struct Metadata {
768    ///The URL of the previous page of results. If this field isn't present, you're at the start of the list.
769    pub prev: Option<String>,
770    ///The number of items in the entire list, i.e., across all pages.
771    pub count: Option<f64>,
772    ///The URL of the current page of results.
773    pub self_: Option<String>,
774    ///The URL of the next page of results. If this field isn't present, you're at the end of the list.
775    pub next: Option<String>,
776}
777impl std::fmt::Display for Metadata {
778    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
779        write!(f, "{}", serde_json::to_string(self).unwrap())
780    }
781}
782#[derive(Debug, Serialize, Deserialize, Default)]
783pub struct CustomFieldDefinitionsResponse {
784    pub name: String,
785    pub field_type: String,
786    pub id: String,
787}
788impl std::fmt::Display for CustomFieldDefinitionsResponse {
789    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
790        write!(f, "{}", serde_json::to_string(self).unwrap())
791    }
792}
793#[derive(Debug, Serialize, Deserialize, Default)]
794pub struct EventWebhookUpdateOauthRequest {
795    ///Message has been successfully delivered to the receiving server.
796    pub delivered: bool,
797    ///The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_token_url field.
798    pub oauth_client_id: Option<String>,
799    ///Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.
800    pub unsubscribe: bool,
801    ///Message has been received and is ready to be delivered.
802    pub processed: bool,
803    ///Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.
804    pub click: bool,
805    ///Indicates if the event webhook is enabled.
806    pub enabled: bool,
807    ///This secret is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again.  When passing data in this field, you must also include the oauth_client_id and oauth_token_url fields.
808    pub oauth_client_secret: Option<String>,
809    ///Receiving server could not or would not accept message.
810    pub bounce: bool,
811    ///Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.
812    pub group_resubscribe: bool,
813    ///You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota
814    pub dropped: bool,
815    ///Recipient's email server temporarily rejected message.
816    pub deferred: bool,
817    ///Recipient marked a message as spam.
818    pub spam_report: bool,
819    ///Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.
820    pub group_unsubscribe: bool,
821    ///The URL that you want the event webhook to POST to.
822    pub url: String,
823    ///Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.
824    pub open: bool,
825    ///The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id field.
826    pub oauth_token_url: Option<String>,
827}
828impl std::fmt::Display for EventWebhookUpdateOauthRequest {
829    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
830        write!(f, "{}", serde_json::to_string(self).unwrap())
831    }
832}
833#[derive(Debug, Serialize, Deserialize, Default)]
834pub struct Selfmetadata {
835    ///A link to this object.
836    pub self_: Option<String>,
837}
838impl std::fmt::Display for Selfmetadata {
839    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
840        write!(f, "{}", serde_json::to_string(self).unwrap())
841    }
842}
843#[derive(Debug, Serialize, Deserialize)]
844pub struct AuthenticationDomain {
845    ///The IPs to be included in the custom SPF record for this authenticated domain.
846    pub ips: Vec<String>,
847    ///The domain to be authenticated.
848    pub domain: String,
849    ///The ID of the authenticated domain.
850    pub id: f64,
851    ///The subdomain to use for this authenticated domain.
852    pub subdomain: String,
853    ///Indicates whether this authenticated domain uses custom SPF.
854    pub custom_spf: bool,
855    ///Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it.
856    pub legacy: bool,
857    ///The username that this domain will be associated with.
858    pub username: String,
859    ///Indicates if this is the default authenticated domain.
860    pub default: bool,
861    ///Indicates if this authenticated domain uses automated security.
862    pub automatic_security: bool,
863    ///The DNS records used to authenticate the sending domain.
864    pub dns: serde_json::Value,
865    ///The ID of the user that this domain is associated with.
866    pub user_id: f64,
867    ///Indicates if this is a valid authenticated domain.
868    pub valid: bool,
869}
870impl std::fmt::Display for AuthenticationDomain {
871    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
872        write!(f, "{}", serde_json::to_string(self).unwrap())
873    }
874}
875#[derive(Debug, Serialize, Deserialize, Default)]
876pub struct MailSettingsForwardSpam {
877    ///The email address where you would like the spam reports to be forwarded.
878    pub email: Option<String>,
879    ///Indicates if the Forward Spam setting is enabled.
880    pub enabled: Option<bool>,
881}
882impl std::fmt::Display for MailSettingsForwardSpam {
883    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
884        write!(f, "{}", serde_json::to_string(self).unwrap())
885    }
886}
887#[derive(Debug, Serialize, Deserialize, Default)]
888pub struct SinglesendWarning {
889    pub warnings: Option<Vec<serde_json::Value>>,
890}
891impl std::fmt::Display for SinglesendWarning {
892    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
893        write!(f, "{}", serde_json::to_string(self).unwrap())
894    }
895}
896#[derive(Debug, Serialize, Deserialize)]
897pub struct PostMailSendRequired {
898    pub subject: String,
899    pub content: Vec<serde_json::Value>,
900    pub from: FromEmailObject,
901    pub personalizations: Vec<serde_json::Value>,
902}
903impl std::fmt::Display for PostMailSendRequired {
904    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
905        write!(f, "{}", serde_json::to_string(self).unwrap())
906    }
907}
908#[derive(Debug, Serialize, Deserialize)]
909pub struct SsoTeammateResponse {
910    ///This should be set to the Teammate's email address.
911    pub username: String,
912    pub sso_teammate_common_fields: SsoTeammateCommonFields,
913    ///Indicates if the Teammate authenticates with SendGrid using SSO or with a username and password.
914    pub is_sso: bool,
915}
916impl std::fmt::Display for SsoTeammateResponse {
917    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
918        write!(f, "{}", serde_json::to_string(self).unwrap())
919    }
920}
921#[derive(Debug, Serialize, Deserialize, Default)]
922pub struct AdvancedStatsOpens {
923    ///The total number of times your emails were opened by recipients.
924    pub opens: Option<i64>,
925    ///The number of unique recipients who opened your emails.
926    pub unique_opens: Option<i64>,
927}
928impl std::fmt::Display for AdvancedStatsOpens {
929    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
930        write!(f, "{}", serde_json::to_string(self).unwrap())
931    }
932}
933#[derive(Debug, Serialize, Deserialize)]
934pub struct AutomationsResponse {
935    pub metadata: Option<Metadata>,
936    pub results: Vec<serde_json::Value>,
937}
938impl std::fmt::Display for AutomationsResponse {
939    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
940        write!(f, "{}", serde_json::to_string(self).unwrap())
941    }
942}
943#[derive(Debug, Serialize, Deserialize, Default)]
944pub struct CampaignRequest {
945    ///The pool of IPs that you would like to send this email from.
946    pub ip_pool: Option<String>,
947    ///The subject of your campaign that your recipients will see.
948    pub subject: Option<String>,
949    ///The categories you would like associated to this campaign.
950    pub categories: Option<Vec<String>>,
951    ///The plain text content of your emails.
952    pub plain_content: Option<String>,
953    ///This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups.
954    pub custom_unsubscribe_url: Option<String>,
955    ///The ID of the "sender" identity that you have created. Your recipients will see this as the "from" on your marketing emails.
956    pub sender_id: Option<i64>,
957    ///The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs
958    pub list_ids: Option<Vec<i64>>,
959    ///The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs.
960    pub segment_ids: Option<Vec<i64>>,
961    ///The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type.
962    pub suppression_group_id: Option<i64>,
963    ///The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI.
964    pub title: String,
965    ///The editor used in the UI.
966    pub editor: Option<String>,
967    ///The HTML of your marketing email.
968    pub html_content: Option<String>,
969}
970impl std::fmt::Display for CampaignRequest {
971    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
972        write!(f, "{}", serde_json::to_string(self).unwrap())
973    }
974}
975#[derive(Debug, Serialize, Deserialize, Default)]
976pub struct EventWebhookResponse {
977    ///The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token.
978    pub oauth_client_id: Option<String>,
979    ///The URL that you want the event webhook to POST to.
980    pub url: String,
981    ///Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.
982    pub group_resubscribe: bool,
983    ///Message has been received and is ready to be delivered.
984    pub processed: bool,
985    ///Indicates if the event webhook is enabled.
986    pub enabled: bool,
987    ///Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.
988    pub open: bool,
989    ///The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider.
990    pub oauth_token_url: Option<String>,
991    ///Message has been successfully delivered to the receiving server.
992    pub delivered: bool,
993    ///You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota
994    pub dropped: bool,
995    ///Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.
996    pub unsubscribe: bool,
997    ///Receiving server could not or would not accept message.
998    pub bounce: bool,
999    ///Recipient's email server temporarily rejected message.
1000    pub deferred: bool,
1001    ///Recipient marked a message as spam.
1002    pub spam_report: bool,
1003    ///Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.
1004    pub click: bool,
1005    ///Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.
1006    pub group_unsubscribe: bool,
1007}
1008impl std::fmt::Display for EventWebhookResponse {
1009    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1010        write!(f, "{}", serde_json::to_string(self).unwrap())
1011    }
1012}
1013#[derive(Debug, Serialize, Deserialize)]
1014pub struct BlocksResponse(pub Vec<serde_json::Value>);
1015#[derive(Debug, Serialize, Deserialize)]
1016pub struct SenderId {
1017    ///The time the sender identity was last updated.
1018    pub updated_at: i64,
1019    ///The unique identifier of the sender identity.
1020    pub id: i64,
1021    ///If the sender identity is verified or not. Only verified sender identities can be used to send email.
1022    pub verified: bool,
1023    pub sender_id_request: SenderIdRequest,
1024    ///The time the sender identity was created.
1025    pub created_at: i64,
1026    ///True when the sender id is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity.
1027    pub locked: bool,
1028}
1029impl std::fmt::Display for SenderId {
1030    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1031        write!(f, "{}", serde_json::to_string(self).unwrap())
1032    }
1033}
1034#[derive(Debug, Serialize, Deserialize, Default)]
1035pub struct PostSsoTeammatesRequired {
1036    pub first_name: String,
1037    pub email: String,
1038    pub is_admin: bool,
1039    pub is_read_only: bool,
1040    pub last_name: String,
1041    pub scopes: Vec<String>,
1042}
1043impl std::fmt::Display for PostSsoTeammatesRequired {
1044    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1045        write!(f, "{}", serde_json::to_string(self).unwrap())
1046    }
1047}
1048#[derive(Debug, Serialize, Deserialize, Default)]
1049pub struct SubuserStats {
1050    ///The list of statistics.
1051    pub stats: Option<Vec<serde_json::Value>>,
1052    ///The date the statistics were gathered.
1053    pub date: Option<String>,
1054}
1055impl std::fmt::Display for SubuserStats {
1056    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1057        write!(f, "{}", serde_json::to_string(self).unwrap())
1058    }
1059}
1060#[derive(Debug, Serialize, Deserialize, Default)]
1061pub struct VerifiedSenderRequestSchema {
1062    pub nickname: String,
1063    pub address2: Option<String>,
1064    pub reply_to_name: Option<String>,
1065    pub city: Option<String>,
1066    pub address: Option<String>,
1067    pub from_name: Option<String>,
1068    pub state: Option<String>,
1069    pub from_email: String,
1070    pub zip: Option<String>,
1071    pub country: Option<String>,
1072    pub reply_to: String,
1073}
1074impl std::fmt::Display for VerifiedSenderRequestSchema {
1075    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1076        write!(f, "{}", serde_json::to_string(self).unwrap())
1077    }
1078}
1079#[derive(Debug, Serialize, Deserialize, Default)]
1080pub struct PatchCampaignsCampaignIdRequired {
1081    pub campaign_id: i64,
1082    pub categories: Vec<String>,
1083    pub subject: String,
1084    pub html_content: String,
1085    pub title: String,
1086    pub plain_content: String,
1087}
1088impl std::fmt::Display for PatchCampaignsCampaignIdRequired {
1089    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1090        write!(f, "{}", serde_json::to_string(self).unwrap())
1091    }
1092}
1093#[derive(Debug, Serialize, Deserialize, Default)]
1094pub struct AbtestSummary {
1095    ///How the winner will be decided
1096    pub winner_criteria: String,
1097    ///Winner of the A/B Test
1098    pub winning_template_id: String,
1099    ///What percentage of your recipient will be included in your A/B testing
1100    pub test_percentage: i64,
1101    ///How long the A/B Testing will last
1102    pub duration: String,
1103    ///When the winner was selected
1104    pub winner_selected_at: Option<String>,
1105    ///Last day to select an A/B Test Winner
1106    pub expiration_date: Option<String>,
1107    ///What differs between the A/B tests
1108    pub type_: String,
1109}
1110impl std::fmt::Display for AbtestSummary {
1111    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1112        write!(f, "{}", serde_json::to_string(self).unwrap())
1113    }
1114}
1115#[derive(Debug, Serialize, Deserialize)]
1116pub struct GlobalEmptyRequest(pub serde_json::Value);
1117#[derive(Debug, Serialize, Deserialize, Default)]
1118pub struct SuppressionsRequest {
1119    ///The array of email addresses to add or find.
1120    pub recipient_emails: Vec<String>,
1121}
1122impl std::fmt::Display for SuppressionsRequest {
1123    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1124        write!(f, "{}", serde_json::to_string(self).unwrap())
1125    }
1126}
1127#[derive(Debug, Serialize, Deserialize)]
1128pub struct SendersIdRequestBody {
1129    ///The country of the sender identity.
1130    pub country: String,
1131    ///The physical address of the sender identity.
1132    pub address: String,
1133    ///The city of the sender identity.
1134    pub city: String,
1135    pub from: serde_json::Value,
1136    ///Additional sender identity address information.
1137    pub address2: Option<String>,
1138    ///The zipcode of the sender identity.
1139    pub zip: Option<String>,
1140    ///The state of the sender identity.
1141    pub state: Option<String>,
1142    ///A nickname for the sender identity. Not used for sending.
1143    pub nickname: String,
1144    pub reply_to: Option<serde_json::Value>,
1145}
1146impl std::fmt::Display for SendersIdRequestBody {
1147    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1148        write!(f, "{}", serde_json::to_string(self).unwrap())
1149    }
1150}
1151#[derive(Debug, Serialize, Deserialize, Default)]
1152pub struct MailSettingsBouncePurge {
1153    ///Indicates if the bounce purge mail setting is enabled.
1154    pub enabled: Option<bool>,
1155    ///The number of days after which SendGrid will purge all contacts from your hard bounces suppression lists.
1156    pub hard_bounces: Option<i64>,
1157    ///The number of days after which SendGrid will purge all contacts from your soft bounces suppression lists.
1158    pub soft_bounces: Option<i64>,
1159}
1160impl std::fmt::Display for MailSettingsBouncePurge {
1161    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1162        write!(f, "{}", serde_json::to_string(self).unwrap())
1163    }
1164}
1165#[derive(Debug, Serialize, Deserialize, Default)]
1166pub struct MailSettingsForwardBounce {
1167    ///The email address that you would like your bounce reports forwarded to.
1168    pub email: Option<String>,
1169    ///Indicates if the bounce forwarding mail setting is enabled.
1170    pub enabled: Option<bool>,
1171}
1172impl std::fmt::Display for MailSettingsForwardBounce {
1173    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1174        write!(f, "{}", serde_json::to_string(self).unwrap())
1175    }
1176}
1177#[derive(Debug, Serialize, Deserialize, Default)]
1178pub struct TransactionalTemplatesVersionOutputLean {
1179    ///ID of the transactional template.
1180    pub template_id: Option<String>,
1181    ///Name of the transactional template version.
1182    pub name: Option<String>,
1183    ///The date and time that this transactional template version was updated.
1184    pub updated_at: Option<String>,
1185    ///Subject of the new transactional template version.
1186    pub subject: Option<String>,
1187    ///The editor used in the UI.
1188    pub editor: Option<String>,
1189    ///ID of the transactional template version.
1190    pub id: Option<String>,
1191    ///If true, plain_content is always generated from html_content. If false, plain_content is not altered.
1192    pub generate_plain_content: Option<bool>,
1193    ///Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.
1194    pub active: Option<i64>,
1195    ///A Thumbnail preview of the template's html content.
1196    pub thumbnail_url: Option<String>,
1197}
1198impl std::fmt::Display for TransactionalTemplatesVersionOutputLean {
1199    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1200        write!(f, "{}", serde_json::to_string(self).unwrap())
1201    }
1202}
1203#[derive(Debug, Serialize, Deserialize)]
1204pub struct TransactionalTemplateVersionOutput {
1205    pub transactional_templates_version_output_lean: TransactionalTemplatesVersionOutputLean,
1206    pub warnings: Vec<TransactionalTemplateWarning>,
1207    pub transactional_template_version_create: TransactionalTemplateVersionCreate,
1208}
1209impl std::fmt::Display for TransactionalTemplateVersionOutput {
1210    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1211        write!(f, "{}", serde_json::to_string(self).unwrap())
1212    }
1213}
1214#[derive(Debug, Serialize, Deserialize, Default)]
1215pub struct ContactdbCustomField {
1216    ///The name of the field
1217    pub name: Option<String>,
1218    ///The type of the field.
1219    pub type_: Option<String>,
1220}
1221impl std::fmt::Display for ContactdbCustomField {
1222    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1223        write!(f, "{}", serde_json::to_string(self).unwrap())
1224    }
1225}
1226#[derive(Debug, Serialize, Deserialize, Default)]
1227pub struct IpPoolResponse {
1228    ///The name of the IP pool.
1229    pub name: Option<String>,
1230}
1231impl std::fmt::Display for IpPoolResponse {
1232    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1233        write!(f, "{}", serde_json::to_string(self).unwrap())
1234    }
1235}
1236#[derive(Debug, Serialize, Deserialize)]
1237pub struct SegmentResponse {
1238    ///ISO8601 timestamp of when the samples will be next updated
1239    pub next_sample_update: String,
1240    ///A subset of all contacts that are in this segment
1241    pub contacts_sample: Vec<ContactResponse>,
1242    ///Segment status indicates whether the segment's contacts will be updated periodically
1243    pub status: SegmentStatusResponse,
1244    ///ID assigned to the segment when created.
1245    pub id: String,
1246    ///Name of the segment.
1247    pub name: String,
1248    ///ISO8601 timestamp of when the object was last updated
1249    pub updated_at: String,
1250    ///ISO8601 timestamp of when the object was created
1251    pub created_at: String,
1252    ///If not set, segment contains a Query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2.
1253    pub query_version: String,
1254    ///The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future
1255    pub parent_list_ids: Vec<String>,
1256    ///ISO8601 timestamp of when the samples were last updated
1257    pub sample_updated_at: String,
1258    ///SQL query which will filter contacts based on the conditions provided
1259    pub query_dsl: String,
1260    ///Total number of contacts present in the segment
1261    pub contacts_count: i64,
1262}
1263impl std::fmt::Display for SegmentResponse {
1264    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1265        write!(f, "{}", serde_json::to_string(self).unwrap())
1266    }
1267}
1268#[derive(Debug, Serialize, Deserialize)]
1269pub struct SinglesendsLinkStatsResponse {
1270    pub metadata: LinkTrackingMetadata,
1271    ///This is the index of the link's location in the email contents.
1272    pub results: Vec<serde_json::Value>,
1273    pub total_clicks: Option<i64>,
1274}
1275impl std::fmt::Display for SinglesendsLinkStatsResponse {
1276    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1277        write!(f, "{}", serde_json::to_string(self).unwrap())
1278    }
1279}
1280#[derive(Debug, Serialize, Deserialize, Default)]
1281pub struct PostDesignRequired {
1282    pub plain_content: String,
1283    pub editor: String,
1284    pub categories: Vec<String>,
1285    pub name: String,
1286    pub generate_plain_content: bool,
1287    pub subject: String,
1288    pub html_content: String,
1289}
1290impl std::fmt::Display for PostDesignRequired {
1291    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1292        write!(f, "{}", serde_json::to_string(self).unwrap())
1293    }
1294}
1295#[derive(Debug, Serialize, Deserialize)]
1296pub struct ContactDetails3 {
1297    pub line: Option<String>,
1298    pub address_line2: Option<String>,
1299    pub country: Option<String>,
1300    pub id: String,
1301    pub custom_fields: Option<serde_json::Value>,
1302    pub state_province_region: Option<String>,
1303    pub first_name: Option<String>,
1304    pub phone_number: Option<String>,
1305    pub postal_code: Option<String>,
1306    pub email: Option<String>,
1307    pub city: Option<String>,
1308    pub facebook: Option<String>,
1309    pub created_at: String,
1310    pub alternate_emails: Option<Vec<String>>,
1311    pub segment_ids: Vec<String>,
1312    pub list_ids: Vec<String>,
1313    pub address_line1: Option<String>,
1314    pub metadata: Option<Selfmetadata>,
1315    pub updated_at: String,
1316    pub whatsapp: Option<String>,
1317    pub last_name: Option<String>,
1318    pub unique_name: Option<String>,
1319}
1320impl std::fmt::Display for ContactDetails3 {
1321    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1322        write!(f, "{}", serde_json::to_string(self).unwrap())
1323    }
1324}
1325#[derive(Debug, Serialize, Deserialize)]
1326pub struct ContactdbCustomFieldWithIdValue {
1327    ///The value of this recipient's custom field
1328    pub value: Option<String>,
1329    pub contactdb_custom_field_with_id: ContactdbCustomFieldWithId,
1330}
1331impl std::fmt::Display for ContactdbCustomFieldWithIdValue {
1332    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1333        write!(f, "{}", serde_json::to_string(self).unwrap())
1334    }
1335}
1336#[derive(Debug, Serialize, Deserialize, Default)]
1337pub struct PostSsoIntegrationsRequired {
1338    pub enabled: bool,
1339    pub entity_id: String,
1340    pub signout_url: String,
1341    pub name: String,
1342    pub signin_url: String,
1343}
1344impl std::fmt::Display for PostSsoIntegrationsRequired {
1345    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1346        write!(f, "{}", serde_json::to_string(self).unwrap())
1347    }
1348}
1349#[derive(Debug, Serialize, Deserialize, Default)]
1350pub struct Errors {
1351    pub errors: Vec<serde_json::Value>,
1352}
1353impl std::fmt::Display for Errors {
1354    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1355        write!(f, "{}", serde_json::to_string(self).unwrap())
1356    }
1357}
1358#[derive(Debug, Serialize, Deserialize, Default)]
1359pub struct WebhooksEventWebhookRequest {
1360    ///Message has been successfully delivered to the receiving server.
1361    pub delivered: bool,
1362    ///Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.
1363    pub group_unsubscribe: bool,
1364    ///Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.
1365    pub group_resubscribe: bool,
1366    ///Recipient's email server temporarily rejected message.
1367    pub deferred: bool,
1368    ///Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.
1369    pub open: bool,
1370    ///Message has been received and is ready to be delivered.
1371    pub processed: bool,
1372    ///The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_token_url field.
1373    pub oauth_client_id: Option<String>,
1374    ///Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.
1375    pub unsubscribe: bool,
1376    ///Receiving server could not or would not accept message.
1377    pub bounce: bool,
1378    ///Recipient marked a message as spam.
1379    pub spam_report: bool,
1380    ///The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id field.
1381    pub oauth_token_url: Option<String>,
1382    ///The URL that you want the event webhook to POST to.
1383    pub url: String,
1384    ///You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota
1385    pub dropped: bool,
1386    ///Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.
1387    pub click: bool,
1388    ///Indicates if the event webhook is enabled.
1389    pub enabled: bool,
1390}
1391impl std::fmt::Display for WebhooksEventWebhookRequest {
1392    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1393        write!(f, "{}", serde_json::to_string(self).unwrap())
1394    }
1395}
1396#[derive(Debug, Serialize, Deserialize, Default)]
1397pub struct PatchVerifiedSendersIdRequired {
1398    pub id: String,
1399    pub nickname: String,
1400    pub from_email: String,
1401    pub reply_to: String,
1402}
1403impl std::fmt::Display for PatchVerifiedSendersIdRequired {
1404    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1405        write!(f, "{}", serde_json::to_string(self).unwrap())
1406    }
1407}
1408#[derive(Debug, Serialize, Deserialize)]
1409pub struct SinglesendsResponse {
1410    pub results: Vec<serde_json::Value>,
1411    pub metadata: Metadata,
1412}
1413impl std::fmt::Display for SinglesendsResponse {
1414    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1415        write!(f, "{}", serde_json::to_string(self).unwrap())
1416    }
1417}
1418#[derive(Debug, Serialize, Deserialize, Default)]
1419pub struct CategoryStats {
1420    pub stats: Option<Vec<serde_json::Value>>,
1421    ///The date the statistics were gathered.
1422    pub date: String,
1423}
1424impl std::fmt::Display for CategoryStats {
1425    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1426        write!(f, "{}", serde_json::to_string(self).unwrap())
1427    }
1428}
1429#[derive(Debug, Serialize, Deserialize)]
1430pub struct SinglesendResponseShort {
1431    ///the ISO 8601 time at which the Single Send was created
1432    pub created_at: String,
1433    pub abtest: Option<AbtestSummary>,
1434    pub id: String,
1435    ///categories to associate with this Single Send
1436    pub categories: Vec<String>,
1437    ///name of the Single Send
1438    pub name: String,
1439    ///true if the Single Send's AB Test functionality has been toggled on
1440    pub is_abtest: bool,
1441    ///the ISO 8601 time at which the Single Send was last updated
1442    pub updated_at: String,
1443    ///The ISO 8601 time at which to send the Single Send. This must be in future or the string "now". Emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to campaigns sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/).
1444    pub send_at: Option<String>,
1445    ///current status of the Single Send
1446    pub status: String,
1447}
1448impl std::fmt::Display for SinglesendResponseShort {
1449    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1450        write!(f, "{}", serde_json::to_string(self).unwrap())
1451    }
1452}
1453#[derive(Debug, Serialize, Deserialize, Default)]
1454pub struct PatchSsoIntegrationsIdRequired {
1455    pub name: String,
1456    pub signin_url: String,
1457    pub id: String,
1458    pub signout_url: String,
1459    pub entity_id: String,
1460    pub enabled: bool,
1461}
1462impl std::fmt::Display for PatchSsoIntegrationsIdRequired {
1463    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1464        write!(f, "{}", serde_json::to_string(self).unwrap())
1465    }
1466}
1467#[derive(Debug, Serialize, Deserialize, Default)]
1468pub struct SubscriptionTrackingSettings {
1469    ///The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing.
1470    pub plain_content: Option<String>,
1471    ///The information and HTML for your unsubscribe link.
1472    pub html_content: Option<String>,
1473    ///Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate.
1474    pub replace: Option<String>,
1475    ///The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server.
1476    pub landing: Option<String>,
1477    ///Indicates if subscription tracking is enabled.
1478    pub enabled: Option<bool>,
1479    ///The URL where you would like your users sent to unsubscribe.
1480    pub url: Option<String>,
1481}
1482impl std::fmt::Display for SubscriptionTrackingSettings {
1483    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1484        write!(f, "{}", serde_json::to_string(self).unwrap())
1485    }
1486}
1487#[derive(Debug, Serialize, Deserialize, Default)]
1488pub struct ContactdbRecipientResponse {
1489    pub errors: Option<Vec<serde_json::Value>>,
1490    ///The number of errors found while adding recipients.
1491    pub error_count: f64,
1492    ///The indices of the recipient(s) sent that caused the error.
1493    pub error_indices: Option<Vec<f64>>,
1494    ///The count of new recipients added to the contactdb.
1495    pub new_count: f64,
1496    ///The recipient IDs of the recipients that already existed from this request.
1497    pub persisted_recipients: Vec<String>,
1498    ///The recipients who were updated from this request.
1499    pub updated_count: f64,
1500}
1501impl std::fmt::Display for ContactdbRecipientResponse {
1502    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1503        write!(f, "{}", serde_json::to_string(self).unwrap())
1504    }
1505}
1506#[derive(Debug, Serialize, Deserialize, Default)]
1507pub struct SegmentWriteV2 {
1508    ///The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future
1509    pub parent_list_ids: Option<Vec<String>>,
1510    ///SQL query which will filter contacts based on the conditions provided
1511    pub query_dsl: String,
1512    ///Name of the segment.
1513    pub name: String,
1514}
1515impl std::fmt::Display for SegmentWriteV2 {
1516    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1517        write!(f, "{}", serde_json::to_string(self).unwrap())
1518    }
1519}
1520#[derive(Debug, Serialize, Deserialize)]
1521pub struct SenderIdRequest {
1522    ///The city of the sender identity.
1523    pub city: Option<String>,
1524    ///The country of the sender identity.
1525    pub country: Option<String>,
1526    ///Additional sender identity address information.
1527    pub address2: Option<String>,
1528    pub from: Option<serde_json::Value>,
1529    ///The state of the sender identity.
1530    pub state: Option<String>,
1531    ///The physical address of the sender identity.
1532    pub address: Option<String>,
1533    pub reply_to: Option<serde_json::Value>,
1534    ///The zipcode of the sender identity.
1535    pub zip: Option<String>,
1536    ///A nickname for the sender identity. Not used for sending.
1537    pub nickname: Option<String>,
1538}
1539impl std::fmt::Display for SenderIdRequest {
1540    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1541        write!(f, "{}", serde_json::to_string(self).unwrap())
1542    }
1543}
1544#[derive(Debug, Serialize, Deserialize)]
1545pub struct DesignOutput {
1546    pub design_output_summary: DesignOutputSummary,
1547    pub design_input: DesignInput,
1548}
1549impl std::fmt::Display for DesignOutput {
1550    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1551        write!(f, "{}", serde_json::to_string(self).unwrap())
1552    }
1553}
1554#[derive(Debug, Serialize, Deserialize)]
1555pub struct AdvancedStatsMailboxProvider {
1556    ///The number of emails SendGrid was able to confirm were actually delivered to a recipient.
1557    pub delivered: i64,
1558    ///The number of recipients who marked your email as spam.
1559    pub spam_reports: i64,
1560    ///Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed.
1561    pub processed: i64,
1562    ///The number of emails that were not allowed to be delivered by ISPs.
1563    pub blocks: i64,
1564    ///The number of emails that temporarily could not be delivered.
1565    pub deferred: i64,
1566    ///The number of emails that were requested to be delivered.
1567    pub requests: i64,
1568    ///The individual events and their stats.
1569    pub advanced_stats_clicks_opens: AdvancedStatsClicksOpens,
1570    ///The number of emails that bounced instead of being delivered.
1571    pub bounces: i64,
1572    ///The number of emails that were not delivered due to the recipient email address being on a suppression list.
1573    pub drops: i64,
1574}
1575impl std::fmt::Display for AdvancedStatsMailboxProvider {
1576    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1577        write!(f, "{}", serde_json::to_string(self).unwrap())
1578    }
1579}
1580#[derive(Debug, Serialize, Deserialize)]
1581pub struct CampaignResponse {
1582    pub campaign_request: CampaignRequest,
1583    ///The status of your campaign.
1584    pub status: String,
1585    pub id: i64,
1586}
1587impl std::fmt::Display for CampaignResponse {
1588    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1589        write!(f, "{}", serde_json::to_string(self).unwrap())
1590    }
1591}
1592#[derive(Debug, Serialize, Deserialize)]
1593pub struct FullSegment {
1594    ///AST representation of the query DSL
1595    pub query_json: serde_json::Value,
1596    pub segment_summary: SegmentSummary,
1597    pub segment_write_v2: SegmentWriteV2,
1598    pub contacts_sample: Vec<ContactResponse>,
1599}
1600impl std::fmt::Display for FullSegment {
1601    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1602        write!(f, "{}", serde_json::to_string(self).unwrap())
1603    }
1604}
1605#[derive(Debug, Serialize, Deserialize)]
1606pub struct SegmentQueryJson {
1607    pub contacts: Option<serde_json::Value>,
1608}
1609impl std::fmt::Display for SegmentQueryJson {
1610    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1611        write!(f, "{}", serde_json::to_string(self).unwrap())
1612    }
1613}
1614#[derive(Debug, Serialize, Deserialize, Default)]
1615pub struct PostSubusersRequired {
1616    pub password: String,
1617    pub username: String,
1618    pub email: String,
1619    pub ips: Vec<String>,
1620}
1621impl std::fmt::Display for PostSubusersRequired {
1622    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1623        write!(f, "{}", serde_json::to_string(self).unwrap())
1624    }
1625}
1626#[derive(Debug, Serialize, Deserialize, Default)]
1627pub struct Message {
1628    ///List of events related to email message
1629    pub events: Vec<serde_json::Value>,
1630    pub from_email: String,
1631    pub template_id: String,
1632    ///JSON hash of arbitrary key-value pairs
1633    pub unique_args: String,
1634    pub subject: String,
1635    ///This is the IP of the user who sent the message.
1636    pub originating_ip: String,
1637    ///Teammate's username
1638    pub teammate: String,
1639    ///Quick summary of the status of a message
1640    pub status: String,
1641    pub api_key_id: String,
1642    ///IP used to send to the remote MTA. Used by UI to display IP in detailed view
1643    pub outbound_ip: String,
1644    ///Whether or not the outbound IP is dedicated vs shared
1645    pub outbound_ip_type: String,
1646    pub to_email: String,
1647    pub asm_group_id: i64,
1648    ///Categories users associated to the message
1649    pub categories: Vec<String>,
1650    pub msg_id: String,
1651}
1652impl std::fmt::Display for Message {
1653    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1654        write!(f, "{}", serde_json::to_string(self).unwrap())
1655    }
1656}
1657#[derive(Debug, Serialize, Deserialize, Default)]
1658pub struct ContactdbSegmentsConditions {
1659    pub and_or: Option<String>,
1660    pub field: String,
1661    pub value: String,
1662    pub operator: String,
1663}
1664impl std::fmt::Display for ContactdbSegmentsConditions {
1665    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1666        write!(f, "{}", serde_json::to_string(self).unwrap())
1667    }
1668}
1669#[derive(Debug, Serialize, Deserialize)]
1670pub struct Credentials {
1671    pub permissions: Option<serde_json::Value>,
1672    pub username: Option<String>,
1673}
1674impl std::fmt::Display for Credentials {
1675    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1676        write!(f, "{}", serde_json::to_string(self).unwrap())
1677    }
1678}
1679#[derive(Debug, Serialize, Deserialize, Default)]
1680pub struct SegmentStatusResponse {
1681    ///Status of query validation. PENDING, VALID, or INVALID
1682    pub query_validation: String,
1683    ///Describes any errors that were encountered during query validation
1684    pub error_message: Option<String>,
1685}
1686impl std::fmt::Display for SegmentStatusResponse {
1687    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1688        write!(f, "{}", serde_json::to_string(self).unwrap())
1689    }
1690}
1691#[derive(Debug, Serialize, Deserialize)]
1692pub struct GlobalId(pub i64);
1693#[derive(Debug, Serialize, Deserialize)]
1694pub struct ContactDetails2 {
1695    pub postal_code: Option<String>,
1696    pub email: Option<String>,
1697    pub facebook: Option<String>,
1698    pub first_name: Option<String>,
1699    pub unique_name: Option<String>,
1700    pub list_ids: Vec<String>,
1701    pub segment_ids: Option<Vec<String>>,
1702    pub address_line2: Option<String>,
1703    pub country: Option<String>,
1704    pub id: String,
1705    pub whatsapp: Option<String>,
1706    pub address_line1: Option<String>,
1707    pub created_at: String,
1708    pub line: Option<String>,
1709    pub custom_fields: Option<serde_json::Value>,
1710    pub phone_number: Option<String>,
1711    pub alternate_emails: Option<Vec<String>>,
1712    pub last_name: Option<String>,
1713    pub metadata: Option<Selfmetadata>,
1714    pub state_province_region: Option<String>,
1715    pub updated_at: String,
1716    pub city: Option<String>,
1717}
1718impl std::fmt::Display for ContactDetails2 {
1719    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1720        write!(f, "{}", serde_json::to_string(self).unwrap())
1721    }
1722}
1723#[derive(Debug, Serialize, Deserialize, Default)]
1724pub struct ErrorsSegV2 {
1725    pub errors: Vec<serde_json::Value>,
1726}
1727impl std::fmt::Display for ErrorsSegV2 {
1728    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1729        write!(f, "{}", serde_json::to_string(self).unwrap())
1730    }
1731}
1732#[derive(Debug, Serialize, Deserialize)]
1733pub struct SubuserPost {
1734    ///The email address for this subuser.
1735    pub email: String,
1736    pub authorization_token: Option<String>,
1737    pub credit_allocation: Option<serde_json::Value>,
1738    ///The user ID for this subuser.
1739    pub user_id: f64,
1740    ///The username of the subuser.
1741    pub username: String,
1742    pub signup_session_token: Option<String>,
1743}
1744impl std::fmt::Display for SubuserPost {
1745    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1746        write!(f, "{}", serde_json::to_string(self).unwrap())
1747    }
1748}
1749#[derive(Debug, Serialize, Deserialize, Default)]
1750pub struct SinglesendSearch {
1751    ///current status of the Single Send
1752    pub status: Option<Vec<String>>,
1753    ///leading and trailing wildcard search on name of the Single Send
1754    pub name: Option<String>,
1755    ///categories to associate with this Single Send, match any single send that has at least one of the categories
1756    pub categories: Option<Vec<String>>,
1757}
1758impl std::fmt::Display for SinglesendSearch {
1759    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1760        write!(f, "{}", serde_json::to_string(self).unwrap())
1761    }
1762}
1763#[derive(Debug, Serialize, Deserialize)]
1764pub struct ContactImport {
1765    ///The ISO8601 timestamp when the job was finished.
1766    pub finished_at: Option<String>,
1767    ///The job ID.
1768    pub id: Option<String>,
1769    ///The ISO8601 timestamp when the job was created.
1770    pub started_at: Option<String>,
1771    ///The job state. Allowed values: `pending`, `completed`, `errored`, or `failed`.
1772    pub status: Option<String>,
1773    ///The job type. Allowed values: `upsert`, or `delete`.
1774    pub job_type: Option<String>,
1775    ///Result map of the import job.
1776    pub results: Option<serde_json::Value>,
1777}
1778impl std::fmt::Display for ContactImport {
1779    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1780        write!(f, "{}", serde_json::to_string(self).unwrap())
1781    }
1782}
1783#[derive(Debug, Serialize, Deserialize)]
1784pub struct TransactionalTemplate {
1785    pub warning: TransactionalTemplateWarning,
1786    pub transactional_templates_template_lean: TransactionalTemplatesTemplateLean,
1787}
1788impl std::fmt::Display for TransactionalTemplate {
1789    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1790        write!(f, "{}", serde_json::to_string(self).unwrap())
1791    }
1792}
1793#[derive(Debug, Serialize, Deserialize)]
1794pub struct ContactSummary {
1795    pub first_name: Option<String>,
1796    ///Primary email address.
1797    pub email: Option<String>,
1798    pub last_name: Option<String>,
1799    ///Unix Epoch Timestamp.
1800    pub updated_at: f64,
1801    pub metadata: Option<Selfmetadata>,
1802    ///List UUID linked with this contact.
1803    pub list_ids: Vec<String>,
1804    ///Contact UUID.
1805    pub id: String,
1806    ///Unix Epoch Timestamp.
1807    pub created_at: f64,
1808}
1809impl std::fmt::Display for ContactSummary {
1810    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1811        write!(f, "{}", serde_json::to_string(self).unwrap())
1812    }
1813}
1814#[derive(Debug, Serialize, Deserialize, Default)]
1815pub struct MailSettingsTemplate {
1816    ///Indicates if the legacy email template setting is enabled.
1817    pub enabled: Option<bool>,
1818    ///The HTML content that you want to use for your legacy email template.
1819    pub html_content: Option<String>,
1820}
1821impl std::fmt::Display for MailSettingsTemplate {
1822    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1823        write!(f, "{}", serde_json::to_string(self).unwrap())
1824    }
1825}
1826#[derive(Debug, Serialize, Deserialize, Default)]
1827pub struct MailSettingsPatch {
1828    ///The email address of the recipient.
1829    pub email: Option<String>,
1830    ///Indicates if the mail setting is enabled.
1831    pub enabled: Option<bool>,
1832}
1833impl std::fmt::Display for MailSettingsPatch {
1834    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1835        write!(f, "{}", serde_json::to_string(self).unwrap())
1836    }
1837}
1838#[derive(Debug, Serialize, Deserialize, Default)]
1839pub struct ParseSetting {
1840    ///Indicates if you would like SendGrid to post the original MIME-type content of your parsed email. When this parameter is set to `true`, SendGrid will send a JSON payload of the content of your email.
1841    pub send_raw: Option<bool>,
1842    ///Indicates if you would like SendGrid to check the content parsed from your emails for spam before POSTing them to your domain.
1843    pub spam_check: Option<bool>,
1844    ///The public URL where you would like SendGrid to POST the data parsed from your email. Any emails sent with the given hostname provided (whose MX records have been updated to point to SendGrid) will be parsed and POSTed to this URL.
1845    pub url: Option<String>,
1846    ///A specific and unique domain or subdomain that you have created to use exclusively to parse your incoming email. For example, `parse.yourdomain.com`.
1847    pub hostname: Option<String>,
1848}
1849impl std::fmt::Display for ParseSetting {
1850    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1851        write!(f, "{}", serde_json::to_string(self).unwrap())
1852    }
1853}
1854#[derive(Debug, Serialize, Deserialize, Default)]
1855pub struct Error {
1856    pub field: Option<String>,
1857    pub error_id: Option<String>,
1858    pub message: String,
1859    pub parameter: Option<String>,
1860}
1861impl std::fmt::Display for Error {
1862    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1863        write!(f, "{}", serde_json::to_string(self).unwrap())
1864    }
1865}
1866#[derive(Debug, Serialize, Deserialize, Default)]
1867pub struct EmailActivityResponseCommonFields {
1868    ///The message's status.
1869    pub status: Option<String>,
1870    ///The intended recipient's email address.
1871    pub to_email: Option<String>,
1872    ///A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message.
1873    pub msg_id: Option<String>,
1874    ///The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account.
1875    pub from_email: Option<String>,
1876    ///The email's subject line.
1877    pub subject: Option<String>,
1878}
1879impl std::fmt::Display for EmailActivityResponseCommonFields {
1880    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1881        write!(f, "{}", serde_json::to_string(self).unwrap())
1882    }
1883}
1884#[derive(Debug, Serialize, Deserialize, Default)]
1885pub struct SegmentWrite {
1886    ///Use this field for adding your query string.
1887    pub query_dsl: String,
1888    pub name: String,
1889}
1890impl std::fmt::Display for SegmentWrite {
1891    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1892        write!(f, "{}", serde_json::to_string(self).unwrap())
1893    }
1894}
1895#[derive(Debug, Serialize, Deserialize, Default)]
1896pub struct SinglesendSchedule {
1897    pub status: Option<String>,
1898    ///The ISO 8601 time at which to send the Single Send. This must be in future or the string "now". Emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to campaigns sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/).
1899    pub send_at: String,
1900}
1901impl std::fmt::Display for SinglesendSchedule {
1902    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1903        write!(f, "{}", serde_json::to_string(self).unwrap())
1904    }
1905}
1906#[derive(Debug, Serialize, Deserialize, Default)]
1907pub struct AdvancedStatsClicks {
1908    ///The number of unique recipients who clicked links in your emails.
1909    pub unique_clicks: Option<i64>,
1910    ///The number of links that were clicked in your emails.
1911    pub clicks: Option<i64>,
1912}
1913impl std::fmt::Display for AdvancedStatsClicks {
1914    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1915        write!(f, "{}", serde_json::to_string(self).unwrap())
1916    }
1917}
1918#[derive(Debug, Serialize, Deserialize)]
1919pub struct ContactResponse {
1920    ///Email of the contact. This is a reserved field.
1921    pub email: String,
1922    ///Second line of address of the contact. This is a reserved field.
1923    pub address_line2: String,
1924    ///ID assigned to a contact when added to the system.
1925    pub id: String,
1926    ///IDs of all segments the contact is part of
1927    pub segment_ids: Option<Vec<String>>,
1928    ///First line of address of the contact. This is a reserved field.
1929    pub address_line1: String,
1930    ///The user may choose to create up to 120 custom fields or none at all. This is not a reserved field.
1931    pub custom_fields: serde_json::Value,
1932    ///Country associated with the address of the contact. This is a reserved field.
1933    pub country: String,
1934    ///First name of the contact. This is a reserved field.
1935    pub first_name: String,
1936    ///IDs of all lists the contact is part of
1937    pub list_ids: Option<Vec<String>>,
1938    ///Alternate emails of the contact. This is a reserved field.
1939    pub alternate_emails: Vec<String>,
1940    ///State associated with the contact. This is a reserved field.
1941    pub state_province_region: String,
1942    ///City associated with the contact. This is a reserved field.
1943    pub city: String,
1944    ///Zipcode associated with the address of the contact. This is a reserved field.
1945    pub postal_code: i64,
1946    ///Last name of the contact. This is a reserved field.
1947    pub last_name: String,
1948}
1949impl std::fmt::Display for ContactResponse {
1950    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1951        write!(f, "{}", serde_json::to_string(self).unwrap())
1952    }
1953}
1954#[derive(Debug, Serialize, Deserialize, Default)]
1955pub struct DesignDuplicateInput {
1956    ///The editor used in the UI.
1957    pub editor: Option<String>,
1958    ///The name of the new design.
1959    pub name: Option<String>,
1960}
1961impl std::fmt::Display for DesignDuplicateInput {
1962    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1963        write!(f, "{}", serde_json::to_string(self).unwrap())
1964    }
1965}
1966#[derive(Debug, Serialize, Deserialize, Default)]
1967pub struct TransactionalTemplatesTemplateLean {
1968    ///The different versions of this transactional template.
1969    pub versions: Option<Vec<TransactionalTemplatesVersionOutputLean>>,
1970    ///The date and time that this transactional template version was updated.
1971    pub updated_at: String,
1972    ///Defines the generation of the template.
1973    pub generation: String,
1974    ///The ID of the transactional template.
1975    pub id: String,
1976    ///The name for the transactional template.
1977    pub name: String,
1978}
1979impl std::fmt::Display for TransactionalTemplatesTemplateLean {
1980    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1981        write!(f, "{}", serde_json::to_string(self).unwrap())
1982    }
1983}
1984#[derive(Debug, Serialize, Deserialize)]
1985pub struct UserScheduledSendStatus {
1986    pub mail_batch_id: MailBatchId,
1987    ///The status of the scheduled send.
1988    pub status: String,
1989}
1990impl std::fmt::Display for UserScheduledSendStatus {
1991    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1992        write!(f, "{}", serde_json::to_string(self).unwrap())
1993    }
1994}
1995#[derive(Debug, Serialize, Deserialize)]
1996pub struct PostSendersRequired {
1997    pub nickname: String,
1998    pub address: String,
1999    pub country: String,
2000    pub from: serde_json::Value,
2001    pub state: String,
2002    pub city: String,
2003    pub reply_to: serde_json::Value,
2004    pub zip: String,
2005    pub address2: String,
2006}
2007impl std::fmt::Display for PostSendersRequired {
2008    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2009        write!(f, "{}", serde_json::to_string(self).unwrap())
2010    }
2011}
2012#[derive(Debug, Serialize, Deserialize, Default)]
2013pub struct PatchTemplatesTemplateIdVersionsVersionIdRequired {
2014    pub name: String,
2015    pub template_id: String,
2016    pub version_id: String,
2017    pub subject: String,
2018}
2019impl std::fmt::Display for PatchTemplatesTemplateIdVersionsVersionIdRequired {
2020    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2021        write!(f, "{}", serde_json::to_string(self).unwrap())
2022    }
2023}
2024#[derive(Debug, Serialize, Deserialize, Default)]
2025pub struct SsoCertificateBody {
2026    ///A unique ID assigned to the certificate by SendGrid.
2027    pub id: Option<f64>,
2028    ///A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid.
2029    pub not_before: Option<f64>,
2030    ///A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid.
2031    pub not_after: Option<f64>,
2032    ///This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI.
2033    pub public_certificate: Option<String>,
2034    ///An ID that matches a certificate to a specific IdP integration.
2035    pub intergration_id: Option<String>,
2036}
2037impl std::fmt::Display for SsoCertificateBody {
2038    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2039        write!(f, "{}", serde_json::to_string(self).unwrap())
2040    }
2041}
2042#[derive(Debug, Serialize, Deserialize, Default)]
2043pub struct CcBccEmailObject {
2044    ///The intended recipient's email address.
2045    pub email: String,
2046    ///The intended recipient's name.
2047    pub name: Option<String>,
2048}
2049impl std::fmt::Display for CcBccEmailObject {
2050    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2051        write!(f, "{}", serde_json::to_string(self).unwrap())
2052    }
2053}
2054#[derive(Debug, Serialize, Deserialize)]
2055pub struct ContactdbSegmentsWithId {
2056    pub contactdb_segments: ContactdbSegments,
2057    ///The ID of the segment.
2058    pub id: f64,
2059}
2060impl std::fmt::Display for ContactdbSegmentsWithId {
2061    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2062        write!(f, "{}", serde_json::to_string(self).unwrap())
2063    }
2064}
2065#[derive(Debug, Serialize, Deserialize)]
2066pub struct ContactRequest {
2067    pub custom_fields: Option<CustomFieldsById>,
2068    ///The contact's personal name.
2069    pub first_name: Option<String>,
2070    ///The contact's family name.
2071    pub last_name: Option<String>,
2072    ///The contact's ZIP code or other postal code.
2073    pub postal_code: Option<String>,
2074    ///The contact's primary email. This is required to be a valid email.
2075    pub email: String,
2076    ///The contact's city.
2077    pub city: Option<String>,
2078    ///The contact's state, province, or region.
2079    pub state_province_region: Option<String>,
2080    ///The contact's country. Can be a full name or an abbreviation.
2081    pub country: Option<String>,
2082    ///The first line of the address.
2083    pub address_line1: Option<String>,
2084    ///An optional second line for the address.
2085    pub address_line2: Option<String>,
2086    ///Additional emails associated with the contact.
2087    pub alternate_emails: Option<Vec<String>>,
2088}
2089impl std::fmt::Display for ContactRequest {
2090    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2091        write!(f, "{}", serde_json::to_string(self).unwrap())
2092    }
2093}
2094#[derive(Debug, Serialize, Deserialize)]
2095pub struct SpamReportsResponse(pub Vec<serde_json::Value>);
2096#[derive(Debug, Serialize, Deserialize, Default)]
2097pub struct SsoTeammateCommonFields {
2098    ///The Teammate’s first name.
2099    pub first_name: String,
2100    ///The Teammate’s email address. This email address will also function as the Teammate’s username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created.
2101    pub email: String,
2102    ///The Teammate’s last name.
2103    pub last_name: String,
2104    ///Indicates if the Teammate has admin permissions.
2105    pub is_admin: Option<bool>,
2106    ///Indicates if the Teammate has read_only permissions.
2107    pub is_read_only: Option<bool>,
2108}
2109impl std::fmt::Display for SsoTeammateCommonFields {
2110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2111        write!(f, "{}", serde_json::to_string(self).unwrap())
2112    }
2113}
2114#[derive(Debug, Serialize, Deserialize, Default)]
2115pub struct SuppressionGroup {
2116    ///Indicates if this is the default suppression group.
2117    pub is_default: Option<bool>,
2118    pub last_email_sent_at: Option<i64>,
2119    ///The unsubscribes associated with this group.
2120    pub unsubscribes: Option<i64>,
2121    ///A description of the suppression group.
2122    pub description: String,
2123    ///The name of the suppression group. Each group created by a user must have a unique name.
2124    pub name: String,
2125    ///The id of the suppression group.
2126    pub id: f64,
2127}
2128impl std::fmt::Display for SuppressionGroup {
2129    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2130        write!(f, "{}", serde_json::to_string(self).unwrap())
2131    }
2132}
2133#[derive(Debug, Serialize, Deserialize)]
2134pub struct Contacts {
2135    pub address: Option<String>,
2136    pub state: Option<String>,
2137    pub city: Option<String>,
2138    pub last_name: Option<String>,
2139    pub first_name: Option<String>,
2140    pub address2: Option<serde_json::Value>,
2141    pub country: Option<String>,
2142    pub email: Option<String>,
2143    pub company: Option<String>,
2144    pub zip: Option<String>,
2145    pub phone: Option<String>,
2146}
2147impl std::fmt::Display for Contacts {
2148    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2149        write!(f, "{}", serde_json::to_string(self).unwrap())
2150    }
2151}
2152#[derive(Debug, Serialize, Deserialize)]
2153pub struct ContactDetails {
2154    pub metadata: Option<Selfmetadata>,
2155    ///The ISO8601 timestamp when the contact was updated.
2156    pub updated_at: String,
2157    ///The ISO8601 timestamp when the contact was created.
2158    pub created_at: String,
2159    pub custom_fields: Option<CustomFieldsByName>,
2160    pub state_province_region: Option<String>,
2161    pub alternate_emails: Option<Vec<String>>,
2162    pub email: Option<String>,
2163    pub address_line2: Option<String>,
2164    pub country: Option<String>,
2165    pub first_name: Option<String>,
2166    pub address_line1: Option<String>,
2167    pub last_name: Option<String>,
2168    pub city: Option<String>,
2169    pub id: String,
2170    pub list_ids: Vec<String>,
2171    pub postal_code: Option<String>,
2172}
2173impl std::fmt::Display for ContactDetails {
2174    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2175        write!(f, "{}", serde_json::to_string(self).unwrap())
2176    }
2177}
2178#[derive(Debug, Serialize, Deserialize, Default)]
2179pub struct ApiKeyNameId {
2180    ///The name of your API Key.
2181    pub name: Option<String>,
2182    ///The ID of your API Key.
2183    pub api_key_id: Option<String>,
2184}
2185impl std::fmt::Display for ApiKeyNameId {
2186    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2187        write!(f, "{}", serde_json::to_string(self).unwrap())
2188    }
2189}
2190#[derive(Debug, Serialize, Deserialize)]
2191pub struct SsoTeammateRequest {
2192    pub sso_teammate_common_fields: SsoTeammateCommonFields,
2193    ///The permission scopes assigned to the Teammate.
2194    pub scopes: Vec<String>,
2195}
2196impl std::fmt::Display for SsoTeammateRequest {
2197    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2198        write!(f, "{}", serde_json::to_string(self).unwrap())
2199    }
2200}
2201#[derive(Debug, Serialize, Deserialize, Default)]
2202pub struct GoogleAnalyticsSettings {
2203    ///Name of the referrer source.
2204    pub utm_source: Option<String>,
2205    ///Used to differentiate ads
2206    pub utm_content: Option<String>,
2207    ///Indicates if Google Analytics is enabled.
2208    pub enabled: Option<bool>,
2209    ///The name of the campaign.
2210    pub utm_campaign: Option<String>,
2211    ///Name of the marketing medium (e.g. "Email").
2212    pub utm_medium: Option<String>,
2213    ///Any paid keywords.
2214    pub utm_term: Option<String>,
2215}
2216impl std::fmt::Display for GoogleAnalyticsSettings {
2217    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2218        write!(f, "{}", serde_json::to_string(self).unwrap())
2219    }
2220}
2221#[derive(Debug, Serialize, Deserialize)]
2222pub struct DomainAuthentication200Response(pub Vec<serde_json::Value>);
2223#[derive(Debug, Serialize, Deserialize)]
2224pub struct StatsAdvancedGlobalStats {
2225    ///The number of emails that temporarily could not be delivered.
2226    pub deferred: i64,
2227    ///The number of emails that were dropped due to a recipient previously marking your emails as spam.
2228    pub spam_report_drops: i64,
2229    ///The number of emails dropped due to a recipient unsubscribing from your emails.
2230    pub unsubscribe_drops: i64,
2231    ///The number of emails that were not allowed to be delivered by ISPs.
2232    pub blocks: i64,
2233    ///The number of emails that bounced instead of being delivered.
2234    pub bounces: i64,
2235    ///The number of emails that were dropped because of a bounce.
2236    pub bounce_drops: i64,
2237    ///The number of recipients who unsubscribed from your emails.
2238    pub unsubscribes: i64,
2239    ///The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.
2240    pub invalid_emails: i64,
2241    ///The number of emails that were requested to be delivered.
2242    pub requests: i64,
2243    ///The number of recipients who marked your email as spam.
2244    pub spam_reports: i64,
2245    ///Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.
2246    pub processed: i64,
2247    ///The individual events and their stats.
2248    pub advanced_stats_clicks_opens: AdvancedStatsClicksOpens,
2249    ///The number of emails SendGrid was able to confirm were actually delivered to a recipient.
2250    pub delivered: i64,
2251}
2252impl std::fmt::Display for StatsAdvancedGlobalStats {
2253    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2254        write!(f, "{}", serde_json::to_string(self).unwrap())
2255    }
2256}
2257#[derive(Debug, Serialize, Deserialize, Default)]
2258pub struct SuppressionGroupRequestBase {
2259    ///A brief description of your suppression group. Required when creating a group.
2260    pub description: Option<String>,
2261    ///Indicates if you would like this to be your default suppression group.
2262    pub is_default: Option<bool>,
2263    ///The name of your suppression group. Required when creating a group.
2264    pub name: Option<String>,
2265}
2266impl std::fmt::Display for SuppressionGroupRequestBase {
2267    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2268        write!(f, "{}", serde_json::to_string(self).unwrap())
2269    }
2270}
2271#[derive(Debug, Serialize, Deserialize, Default)]
2272pub struct CustomFieldsByName {}
2273impl std::fmt::Display for CustomFieldsByName {
2274    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2275        write!(f, "{}", serde_json::to_string(self).unwrap())
2276    }
2277}
2278#[derive(Debug, Serialize, Deserialize)]
2279pub struct DesignOutputSummary {
2280    ///Datetime that Design was created.
2281    pub created_at: String,
2282    pub design_common_fields: DesignCommonFields,
2283    ///ID of the Design.
2284    pub id: String,
2285    ///Datetime that Design was last updated.
2286    pub updated_at: String,
2287    ///A Thumbnail preview of the template's html content.
2288    pub thumbnail_url: String,
2289    pub design_duplicate_input: DesignDuplicateInput,
2290}
2291impl std::fmt::Display for DesignOutputSummary {
2292    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2293        write!(f, "{}", serde_json::to_string(self).unwrap())
2294    }
2295}
2296#[derive(Debug, Serialize, Deserialize, Default)]
2297pub struct EnforcedTlsRequestResponse {
2298    ///Indicates if you want to require your recipients to have a valid certificate.
2299    pub require_valid_cert: Option<bool>,
2300    ///The minimum required TLS certificate version.
2301    pub version: Option<f64>,
2302    ///Indicates if you want to require your recipients to support TLS.
2303    pub require_tls: Option<bool>,
2304}
2305impl std::fmt::Display for EnforcedTlsRequestResponse {
2306    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2307        write!(f, "{}", serde_json::to_string(self).unwrap())
2308    }
2309}
2310#[derive(Debug, Serialize, Deserialize, Default)]
2311pub struct SegmentSummaryV2 {
2312    pub results: Option<Vec<SegmentSummary>>,
2313}
2314impl std::fmt::Display for SegmentSummaryV2 {
2315    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2316        write!(f, "{}", serde_json::to_string(self).unwrap())
2317    }
2318}
2319#[derive(Debug, Serialize, Deserialize, Default)]
2320pub struct LinkTrackingMetadata {
2321    ///The URL of the previous page of results. If this field isn't present, you're at the start of the list.
2322    pub prev: Option<String>,
2323    ///The number of items in the entire list, i.e., across all pages.
2324    pub count: Option<f64>,
2325    ///The URL of the current page of results.
2326    pub self_: Option<String>,
2327    ///The URL of the next page of results. If this field isn't present, you're at the end of the list.
2328    pub next: Option<String>,
2329}
2330impl std::fmt::Display for LinkTrackingMetadata {
2331    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2332        write!(f, "{}", serde_json::to_string(self).unwrap())
2333    }
2334}
2335#[derive(Debug, Serialize, Deserialize, Default)]
2336pub struct MakoEvent {
2337    ///Use to distinguish between types of bounces
2338    pub bounce_type: String,
2339    ///Used with "deferred" events to indicate the attempt number out of 10. One "deferred" entry will exists under events array for each time a message was deferred with error message from the server.
2340    pub attempt_num: Option<i64>,
2341    ///For example mx.gmail.com
2342    pub mx_server: String,
2343    ///Date of when event occurred
2344    pub processed: String,
2345    ///Client recipient used to click or open message
2346    pub http_user_agent: String,
2347    ///Explanation of what caused "bounced", "deferred", or "blocked". Usually contains error message from the server - e.g. message from gmail why mail was deferred
2348    pub reason: Option<String>,
2349    ///Name of event
2350    pub event_name: String,
2351    ///Used with "clicked" event to indicate which url the user clicked.
2352    pub url: String,
2353}
2354impl std::fmt::Display for MakoEvent {
2355    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2356        write!(f, "{}", serde_json::to_string(self).unwrap())
2357    }
2358}
2359#[derive(Debug, Serialize, Deserialize)]
2360pub struct DomainAuthenticationDomainSpf {
2361    ///The user_id of the account that this authenticated domain is associated with.
2362    pub user_id: i64,
2363    ///Indicates if this authenticated domain uses custom SPF.
2364    pub custom_spf: bool,
2365    ///The domain authenticated.
2366    pub domain: String,
2367    ///The username of the account that this authenticated domain is associated with.
2368    pub username: String,
2369    ///The IP addresses that are included in the SPF record for this authenticated domain.
2370    pub ips: Vec<serde_json::Value>,
2371    ///The subdomain that was used to create this authenticated domain.
2372    pub subdomain: Option<String>,
2373    ///The DNS records for this authenticated domain.
2374    pub dns: serde_json::Value,
2375    ///Indicates if this authenticated domain uses automated security.
2376    pub automatic_security: bool,
2377    ///Indicates if this is a valid authenticated domain .
2378    pub valid: bool,
2379    ///Indicates if this is the default domain.
2380    pub default: bool,
2381    ///The ID of the authenticated domain.
2382    pub id: i64,
2383    ///Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it.
2384    pub legacy: bool,
2385}
2386impl std::fmt::Display for DomainAuthenticationDomainSpf {
2387    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2388        write!(f, "{}", serde_json::to_string(self).unwrap())
2389    }
2390}
2391#[derive(Debug, Serialize, Deserialize, Default)]
2392pub struct BounceResponse {
2393    ///Enhanced SMTP bounce response
2394    pub status: Option<String>,
2395    ///The email address that was added to the bounce list.
2396    pub email: Option<String>,
2397    ///The unix timestamp for when the bounce record was created at SendGrid.
2398    pub created: Option<f64>,
2399    ///The reason for the bounce. This typically will be a bounce code, an enhanced code, and a description.
2400    pub reason: Option<String>,
2401}
2402impl std::fmt::Display for BounceResponse {
2403    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2404        write!(f, "{}", serde_json::to_string(self).unwrap())
2405    }
2406}
2407#[derive(Debug, Serialize, Deserialize)]
2408pub struct SinglesendResponse {
2409    ///the ISO 8601 time at which the Single Send was created
2410    pub created_at: String,
2411    ///current status of the Single Send
2412    pub status: String,
2413    ///the ISO 8601 time at which the Single Send was last updated
2414    pub updated_at: String,
2415    pub warnings: Vec<serde_json::Value>,
2416    pub id: String,
2417    pub singlesend_request: SinglesendRequest,
2418}
2419impl std::fmt::Display for SinglesendResponse {
2420    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2421        write!(f, "{}", serde_json::to_string(self).unwrap())
2422    }
2423}
2424#[derive(Debug, Serialize, Deserialize, Default)]
2425pub struct MailBatchId {
2426    pub batch_id: String,
2427}
2428impl std::fmt::Display for MailBatchId {
2429    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2430        write!(f, "{}", serde_json::to_string(self).unwrap())
2431    }
2432}
2433#[derive(Debug, Serialize, Deserialize, Default)]
2434pub struct CreateIntegrationRequest {
2435    ///An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the "SAML Issuer ID" in the Twilio SendGrid UI.
2436    pub entity_id: String,
2437    ///The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the "Embed Link" in the Twilio SendGrid UI.
2438    pub signin_url: String,
2439    ///Indicates if the integration is enabled.
2440    pub enabled: bool,
2441    ///The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid)
2442    pub name: String,
2443    ///This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out.
2444    pub signout_url: String,
2445    ///Indicates if the integration is complete.
2446    pub completed_integration: Option<bool>,
2447}
2448impl std::fmt::Display for CreateIntegrationRequest {
2449    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2450        write!(f, "{}", serde_json::to_string(self).unwrap())
2451    }
2452}