Skip to content

Commit 82a9178

Browse files
authored
Merge pull request #17 from uv-vuongsyty/main
add engagements field to NonPublicMetrics and media metrics structs
2 parents 52ecbcd + 2e95bcf commit 82a9178

82 files changed

Lines changed: 750 additions & 165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

maker/responses/media.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ response:
1313
type: string
1414
preview_image_url:
1515
type: string
16+
non_public_metrics:
17+
type: object
18+
ref: media_non_public_metrics
19+
organic_metrics:
20+
type: object
21+
ref: media_organic_metrics
22+
promoted_metrics:
23+
type: object
24+
ref: media_promoted_metrics
1625
public_metrics:
1726
type: object
1827
ref: media_public_metrics
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
3+
response:
4+
type: object
5+
properties:
6+
playback_0_count:
7+
type: integer
8+
playback_25_count:
9+
type: integer
10+
playback_50_count:
11+
type: integer
12+
playback_75_count:
13+
type: integer
14+
playback_100_count:
15+
type: integer
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
3+
response:
4+
type: object
5+
properties:
6+
view_count:
7+
type: integer
8+
playback_0_count:
9+
type: integer
10+
playback_25_count:
11+
type: integer
12+
playback_50_count:
13+
type: integer
14+
playback_75_count:
15+
type: integer
16+
playback_100_count:
17+
type: integer
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
3+
response:
4+
type: object
5+
properties:
6+
view_count:
7+
type: integer
8+
playback_0_count:
9+
type: integer
10+
playback_25_count:
11+
type: integer
12+
playback_50_count:
13+
type: integer
14+
playback_75_count:
15+
type: integer
16+
playback_100_count:
17+
type: integer

maker/responses/non_public_metrics.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
response:
44
type: object
55
properties:
6+
engagements:
7+
type: integer
68
impression_count:
79
type: integer
810
url_link_clicks:

src/api/get_2_compliance_jobs.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ use serde::{Deserialize, Serialize};
99

1010
const URL: &str = "/2/compliance/jobs";
1111

12-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
12+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
1313
pub enum Type {
1414
#[serde(rename = "tweets")]
15-
#[default]
1615
Tweets,
1716
#[serde(rename = "users")]
1817
Users,
@@ -27,10 +26,15 @@ impl std::fmt::Display for Type {
2726
}
2827
}
2928

30-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
29+
impl Default for Type {
30+
fn default() -> Self {
31+
Self::Tweets
32+
}
33+
}
34+
35+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
3136
pub enum Status {
3237
#[serde(rename = "created")]
33-
#[default]
3438
Created,
3539
#[serde(rename = "in_progress")]
3640
InProgress,
@@ -51,6 +55,12 @@ impl std::fmt::Display for Status {
5155
}
5256
}
5357

58+
impl Default for Status {
59+
fn default() -> Self {
60+
Self::Created
61+
}
62+
}
63+
5464
#[derive(Debug, Clone, Default)]
5565
pub struct Api {
5666
r#type: Type,

src/api/get_2_dm_conversations_dm_conversation_id_dm_events.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use std::collections::HashSet;
1515

1616
const URL: &str = "/2/dm_conversations/:dm_conversation_id/dm_events";
1717

18-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
18+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
1919
pub enum EventTypes {
2020
#[serde(rename = "MessageCreate")]
21-
#[default]
2221
Messagecreate,
2322
#[serde(rename = "ParticipantsJoin")]
2423
Participantsjoin,
@@ -36,10 +35,15 @@ impl std::fmt::Display for EventTypes {
3635
}
3736
}
3837

39-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
38+
impl Default for EventTypes {
39+
fn default() -> Self {
40+
Self::Messagecreate
41+
}
42+
}
43+
44+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
4045
pub enum Expansions {
4146
#[serde(rename = "attachments.media_keys")]
42-
#[default]
4347
AttachmentsMediaKeys,
4448
#[serde(rename = "referenced_tweets.id")]
4549
ReferencedTweetsId,
@@ -71,6 +75,12 @@ impl std::fmt::Display for Expansions {
7175
}
7276
}
7377

78+
impl Default for Expansions {
79+
fn default() -> Self {
80+
Self::AttachmentsMediaKeys
81+
}
82+
}
83+
7484
#[derive(Debug, Clone, Default)]
7585
pub struct Api {
7686
dm_conversation_id: String,

src/api/get_2_dm_conversations_with_participant_id_dm_events.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use std::collections::HashSet;
1515

1616
const URL: &str = "/2/dm_conversations/with/:participant_id/dm_events";
1717

18-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
18+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
1919
pub enum EventTypes {
2020
#[serde(rename = "MessageCreate")]
21-
#[default]
2221
Messagecreate,
2322
#[serde(rename = "ParticipantsJoin")]
2423
Participantsjoin,
@@ -36,10 +35,15 @@ impl std::fmt::Display for EventTypes {
3635
}
3736
}
3837

39-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
38+
impl Default for EventTypes {
39+
fn default() -> Self {
40+
Self::Messagecreate
41+
}
42+
}
43+
44+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
4045
pub enum Expansions {
4146
#[serde(rename = "attachments.media_keys")]
42-
#[default]
4347
AttachmentsMediaKeys,
4448
#[serde(rename = "referenced_tweets.id")]
4549
ReferencedTweetsId,
@@ -71,6 +75,12 @@ impl std::fmt::Display for Expansions {
7175
}
7276
}
7377

78+
impl Default for Expansions {
79+
fn default() -> Self {
80+
Self::AttachmentsMediaKeys
81+
}
82+
}
83+
7484
#[derive(Debug, Clone, Default)]
7585
pub struct Api {
7686
participant_id: String,

src/api/get_2_dm_events.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use std::collections::HashSet;
1515

1616
const URL: &str = "/2/dm_events";
1717

18-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
18+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
1919
pub enum EventTypes {
2020
#[serde(rename = "MessageCreate")]
21-
#[default]
2221
Messagecreate,
2322
#[serde(rename = "ParticipantsJoin")]
2423
Participantsjoin,
@@ -36,10 +35,15 @@ impl std::fmt::Display for EventTypes {
3635
}
3736
}
3837

39-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
38+
impl Default for EventTypes {
39+
fn default() -> Self {
40+
Self::Messagecreate
41+
}
42+
}
43+
44+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
4045
pub enum Expansions {
4146
#[serde(rename = "attachments.media_keys")]
42-
#[default]
4347
AttachmentsMediaKeys,
4448
#[serde(rename = "referenced_tweets.id")]
4549
ReferencedTweetsId,
@@ -71,6 +75,12 @@ impl std::fmt::Display for Expansions {
7175
}
7276
}
7377

78+
impl Default for Expansions {
79+
fn default() -> Self {
80+
Self::AttachmentsMediaKeys
81+
}
82+
}
83+
7484
#[derive(Debug, Clone, Default)]
7585
pub struct Api {
7686
dm_event_fields: Option<HashSet<DmEventFields>>,

src/api/get_2_lists_id.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ use std::collections::HashSet;
1212

1313
const URL: &str = "/2/lists/:id";
1414

15-
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone, Default)]
15+
#[derive(Serialize, Deserialize, Debug, Eq, Hash, PartialEq, Clone)]
1616
pub enum Expansions {
1717
#[serde(rename = "owner_id")]
18-
#[default]
1918
OwnerId,
2019
}
2120

@@ -35,6 +34,12 @@ impl std::fmt::Display for Expansions {
3534
}
3635
}
3736

37+
impl Default for Expansions {
38+
fn default() -> Self {
39+
Self::OwnerId
40+
}
41+
}
42+
3843
#[derive(Debug, Clone, Default)]
3944
pub struct Api {
4045
id: String,

0 commit comments

Comments
 (0)