Skip to main content

mlb_api/requests/meta/
pitch_codes.rs

1use serde::Deserialize;
2
3id!(PitchCodeId { code: String });
4
5#[allow(clippy::struct_excessive_bools, reason = "false positive")]
6#[derive(Debug, Deserialize, Clone)]
7#[serde(rename_all = "camelCase")]
8pub struct PitchCode {
9	pub description: String,
10	#[serde(rename = "swingStatus")]
11	pub has_swing: bool,
12	#[serde(rename = "swingMissStatus")]
13	pub is_whiff: bool,
14	#[serde(rename = "swingContactStatus")]
15	pub swing_made_contact: bool,
16	#[serde(rename = "strikeStatus")]
17	pub is_strike: bool,
18	#[serde(rename = "ballStatus")]
19	pub is_ball: bool,
20	#[serde(rename = "pitchStatus")]
21	pub is_pitch: bool,
22	pub pitch_result_text: String,
23	#[serde(rename = "buntAttemptStatus")]
24	pub is_bunt_attempt: bool,
25	#[serde(rename = "contactStatus")]
26	pub made_contact: bool,
27	#[serde(flatten)]
28	pub id: PitchCodeId,
29}
30
31id_only_eq_impl!(PitchCode, id);
32meta_kind_impl!("pitchCodes" => PitchCode);
33tiered_request_entry_cache_impl!(PitchCode.id: PitchCodeId);
34test_impl!(PitchCode);