1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
pub use anyhow::{Error, Result};
pub use tonic::transport::{Channel, Endpoint};
pub mod ventmere {
pub mod s2 {
pub mod core {
use anyhow::Result;
use tonic::transport::{Channel, Endpoint};
pub mod auth {
tonic::include_proto!("ventmere.s2.core.auth");
}
pub mod brand {
tonic::include_proto!("ventmere.s2.core.brand");
}
pub mod inbound_shipment {
tonic::include_proto!("ventmere.s2.core.inbound_shipment");
}
pub mod inventory {
tonic::include_proto!("ventmere.s2.core.inventory");
}
pub mod product {
tonic::include_proto!("ventmere.s2.core.product");
}
pub mod order {
tonic::include_proto!("ventmere.s2.core.order");
}
pub mod channel_account {
tonic::include_proto!("ventmere.s2.core.channel_account");
}
pub mod settings {
tonic::include_proto!("ventmere.s2.core.settings");
}
#[cfg(feature = "client")]
pub mod client {
use super::*;
#[derive(Clone)]
pub struct S2CoreGrpcClient {
pub product: product::s2_product_client::S2ProductClient<Channel>,
pub inbound_shipment:
inbound_shipment::s2_inbound_shipment_client::S2InboundShipmentClient<
Channel,
>,
pub inventory: inventory::s2_inventory_client::S2InventoryClient<Channel>,
pub order: order::s2_order_client::S2OrderClient<Channel>,
pub channel_account: channel_account::s2_channel_account_client::S2ChannelAccountClient<Channel>,
pub settings: settings::s2_settings_client::S2SettingsClient<Channel>,
}
impl S2CoreGrpcClient {
pub async fn connect(uri: &str) -> Result<Self> {
let channel = Endpoint::from_shared(uri.to_string())?.connect().await?;
Ok(S2CoreGrpcClient {
product: product::s2_product_client::S2ProductClient::new(channel.clone()),
inbound_shipment: inbound_shipment::s2_inbound_shipment_client::S2InboundShipmentClient::new(
channel.clone(),
),
inventory: inventory::s2_inventory_client::S2InventoryClient::new(channel.clone()),
order: order::s2_order_client::S2OrderClient::new(channel.clone()),
channel_account: channel_account::s2_channel_account_client::S2ChannelAccountClient::new(channel.clone()),
settings: settings::s2_settings_client::S2SettingsClient::new(channel.clone()),
})
}
pub fn connect_lazy(uri: &str) -> Result<Self> {
let channel = Endpoint::from_shared(uri.to_string())?.connect_lazy();
Ok(S2CoreGrpcClient {
product: product::s2_product_client::S2ProductClient::new(channel.clone()),
inbound_shipment: inbound_shipment::s2_inbound_shipment_client::S2InboundShipmentClient::new(
channel.clone(),
),
inventory: inventory::s2_inventory_client::S2InventoryClient::new(channel.clone()),
order: order::s2_order_client::S2OrderClient::new(channel.clone()),
channel_account: channel_account::s2_channel_account_client::S2ChannelAccountClient::new(channel.clone()),
settings: settings::s2_settings_client::S2SettingsClient::new(channel.clone()),
})
}
}
}
}
pub mod sync {
use anyhow::Result;
use tonic::transport::{Channel, Endpoint};
pub mod product_link {
tonic::include_proto!("ventmere.s2.sync.product_link");
}
pub mod amazon {
tonic::include_proto!("ventmere.s2.sync.amazon");
}
pub mod shopify {
tonic::include_proto!("ventmere.s2.sync.shopify");
}
#[cfg(feature = "client")]
pub mod client {
use super::*;
#[derive(Clone)]
pub struct S2SyncGrpcClient {
pub amazon: amazon::s2_sync_amazon_client::S2SyncAmazonClient<Channel>,
pub product_link:
product_link::s2_sync_product_link_client::S2SyncProductLinkClient<Channel>,
pub shopify: shopify::s2_sync_shopify_client::S2SyncShopifyClient<Channel>,
}
impl S2SyncGrpcClient {
pub async fn connect(uri: &str) -> Result<Self> {
let channel = Endpoint::from_shared(uri.to_string())?.connect().await?;
Ok(S2SyncGrpcClient {
amazon: amazon::s2_sync_amazon_client::S2SyncAmazonClient::new(channel.clone()),
product_link:
product_link::s2_sync_product_link_client::S2SyncProductLinkClient::new(
channel.clone(),
),
shopify: shopify::s2_sync_shopify_client::S2SyncShopifyClient::new(channel.clone()),
})
}
pub fn connect_lazy(uri: &str) -> Result<Self> {
let channel = Endpoint::from_shared(uri.to_string())?.connect_lazy();
Ok(S2SyncGrpcClient {
amazon: amazon::s2_sync_amazon_client::S2SyncAmazonClient::new(channel.clone()),
product_link:
product_link::s2_sync_product_link_client::S2SyncProductLinkClient::new(
channel.clone(),
),
shopify: shopify::s2_sync_shopify_client::S2SyncShopifyClient::new(channel.clone()),
})
}
}
}
}
}
}