Skip to content

Commit

Permalink
Merge pull request #114 from CSML-by-Clevy/fs/fix/dynamodb-client-fla…
Browse files Browse the repository at this point in the history
…tten-optional

fix: make flattened client optional in dynamodb
  • Loading branch information
frsechet authored Sep 22, 2020
2 parents 0ce5a1e + 6d76e10 commit fc7a3c8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 52 additions & 52 deletions csml_engine/src/db_connectors/dynamodb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ pub struct Conversation {
pub range_time: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
pub flow_id: String,
pub step_id: String,
pub metadata: String,
Expand Down Expand Up @@ -116,10 +116,10 @@ impl Conversation {
range: Self::get_range("OPEN", &id),
range_time: make_range(&[class_name, status, &now, &id]),
id,
client: client.to_owned(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.to_owned()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
class: class_name.to_owned(),
metadata: encrypted_metadata.to_owned(),
flow_id: flow_id.to_owned(),
Expand All @@ -144,10 +144,10 @@ impl Conversation {
&conversation.id,
]),
id: conversation.id.to_owned(),
client: conversation.client.to_owned(),
bot_id: conversation.client.bot_id.to_owned(),
channel_id: conversation.client.channel_id.to_owned(),
user_id: conversation.client.user_id.to_owned(),
client: Some(conversation.client.to_owned()),
bot_id: Some(conversation.client.bot_id.to_owned()),
channel_id: Some(conversation.client.channel_id.to_owned()),
user_id: Some(conversation.client.user_id.to_owned()),
class: class_name.to_string(),
metadata,
flow_id: conversation.flow_id.to_owned(),
Expand All @@ -167,10 +167,10 @@ pub struct Interaction {
pub range_time: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
pub success: bool,
pub event: String,
pub updated_at: String,
Expand Down Expand Up @@ -207,10 +207,10 @@ impl Interaction {
range_time: make_range(&[class_name, &now, &id]),
class: class_name.to_string(),
id: id.to_owned(),
client: client.clone(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.clone()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
success: false,
event: encrypted_event.to_owned(),
updated_at: now.to_owned(),
Expand All @@ -226,10 +226,10 @@ pub struct Memory {
pub range_time: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
pub interaction_id: String,
pub conversation_id: String,
pub flow_id: String,
Expand Down Expand Up @@ -284,10 +284,10 @@ impl Memory {
]),
class: class_name.to_owned(),
id: id.to_string(),
client: client.to_owned(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.to_owned()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
interaction_id: interaction_id.to_owned(),
conversation_id: conversation_id.to_owned(),
flow_id: flow_id.to_owned(),
Expand All @@ -309,10 +309,10 @@ pub struct Message {
pub range_time: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
pub interaction_id: String,
pub conversation_id: String,
pub flow_id: String,
Expand Down Expand Up @@ -366,10 +366,10 @@ impl Message {
]),
class: class_name.to_owned(),
id: id.to_owned(),
client: client.to_owned(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.to_owned()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
interaction_id: interaction_id.to_owned(),
conversation_id: conversation_id.to_owned(),
flow_id: flow_id.to_owned(),
Expand All @@ -391,10 +391,10 @@ pub struct Node {
pub range_time: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
pub conversation_id: String,
pub interaction_id: String,
pub flow_id: String,
Expand Down Expand Up @@ -428,10 +428,10 @@ impl Node {
range_time: make_range(&[class_name, &now, &id]),
class: class_name.to_owned(),
id: id.to_owned(),
client: client.to_owned(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.to_owned()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
conversation_id: conversation_id.to_owned(),
interaction_id: interaction_id.to_owned(),
flow_id: flow_id.to_owned(),
Expand All @@ -449,10 +449,10 @@ pub struct State {
pub range: String,
pub class: String,
pub id: String,
pub client: Client,
pub bot_id: String,
pub channel_id: String,
pub user_id: String,
pub client: Option<Client>,
pub bot_id: Option<String>,
pub channel_id: Option<String>,
pub user_id: Option<String>,
#[serde(rename = "type")]
pub _type: String,
pub key: String,
Expand Down Expand Up @@ -482,10 +482,10 @@ impl State {
range: Self::get_range(_type, key),
class: class_name.to_string(),
id,
client: client.to_owned(),
bot_id: client.bot_id.to_owned(),
channel_id: client.channel_id.to_owned(),
user_id: client.user_id.to_owned(),
client: Some(client.to_owned()),
bot_id: Some(client.bot_id.to_owned()),
channel_id: Some(client.channel_id.to_owned()),
user_id: Some(client.user_id.to_owned()),
_type: _type.to_string(),
key: key.to_owned(),
value: encrypted_value.to_owned(),
Expand Down

0 comments on commit fc7a3c8

Please sign in to comment.