Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions crates/cloud_objects/src/cloud_object/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,10 @@ pub enum UpdateCloudObjectResult<T> {
}

/// Helper struct that contains all the info needed to fetch changed objects from the server.
#[derive(Default)]
#[derive(Default, Clone)]
pub struct ObjectsToUpdate {
pub notebooks: Vec<UpdatedObjectInput>,
pub workflows: Vec<UpdatedObjectInput>,
pub folders: Vec<UpdatedObjectInput>,
pub generic_string_objects: Vec<UpdatedObjectInput>,
}

impl Clone for ObjectsToUpdate {
fn clone(&self) -> Self {
Self {
notebooks: self
.notebooks
.iter()
.map(copy_updated_object_input)
.collect(),
workflows: self
.workflows
.iter()
.map(copy_updated_object_input)
.collect(),
folders: self.folders.iter().map(copy_updated_object_input).collect(),
generic_string_objects: self
.generic_string_objects
.iter()
.map(copy_updated_object_input)
.collect(),
}
}
}

fn copy_updated_object_input(input: &UpdatedObjectInput) -> UpdatedObjectInput {
UpdatedObjectInput {
uid: input.uid.clone(),
actions_ts: input.actions_ts,
metadata_ts: input.metadata_ts,
permissions_ts: input.permissions_ts,
revision_ts: input.revision_ts,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct UpdatedCloudObjectsInput {
pub workflows: Option<Vec<UpdatedObjectInput>>,
}

#[derive(cynic::InputObject, Debug)]
#[derive(cynic::InputObject, Debug, Clone)]
pub struct UpdatedObjectInput {
pub actions_ts: Option<Time>,
pub metadata_ts: Option<Time>,
Expand Down
Loading