app_store_server_library/primitives/advanced_commerce/
request_info.rs1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4#[derive(Debug, Clone, Deserialize, Serialize, Hash, PartialEq, Eq)]
8#[serde(rename_all = "camelCase")]
9pub struct RequestInfo {
10 #[serde(skip_serializing_if = "Option::is_none")]
14 pub app_account_token: Option<Uuid>,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
20 pub consistency_token: Option<String>,
21
22 pub request_reference_id: Uuid,
26}
27
28impl RequestInfo {
29 pub fn new(request_reference_id: Uuid) -> Self {
30 Self {
31 app_account_token: None,
32 consistency_token: None,
33 request_reference_id,
34 }
35 }
36
37 pub fn with_app_account_token(mut self, token: Uuid) -> Self {
38 self.app_account_token = Some(token);
39 self
40 }
41
42 pub fn with_consistency_token(mut self, token: String) -> Self {
43 self.consistency_token = Some(token);
44 self
45 }
46}