@@ -62,6 +62,7 @@ type Operation =
6262 | [<CompiledName( " DELETE" ) >] DELETE
6363 | [<CompiledName( " READ" ) >] READ
6464 | [<CompiledName( " EXECUTE" ) >] EXECUTE
65+ | [<CompiledName( " RENAME" ) >] RENAME
6566
6667[<AttachMembers>]
6768type Contract =
@@ -79,12 +80,14 @@ type Contract =
7980 [<NamedParams( fromIndex= 2 ) >]
8081 #endif
8182 static member create ( op , path , ? dtoType , ? dto ) = { Operation= op; Path = path; DTOType = dtoType; DTO = dto}
83+
8284 /// <summary >Create a CREATE contract with all necessary information.</summary >
8385 /// <param name =" path " >The path relative from ARC root, at which the new file should be created.</param >
8486 /// <param name =" dtoType " >The file type.</param >
8587 /// <param name =" dto " >The file data.</param >
8688 /// <returns >Returns a CREATE contract.</returns >
8789 static member createCreate ( path , dtoType : DTOType , ? dto : DTO ) = { Operation= Operation.CREATE; Path = path; DTOType = Some dtoType; DTO = dto}
90+
8891 /// <summary >Create a UPDATE contract with all necessary information.
8992 ///
9093 /// Update contracts will overwrite in case of a string as DTO and will specifically update relevant changes only for spreadsheet files.
@@ -98,6 +101,7 @@ type Contract =
98101 /// <param name =" path " >The path relative from ARC root, at which the file should be deleted.</param >
99102 /// <returns >Returns a DELETE contract.</returns >
100103 static member createDelete ( path ) = { Operation= Operation.DELETE; Path = path; DTOType = None; DTO = None}
104+
101105 /// <summary >Create a READ contract with all necessary information.
102106 ///
103107 /// Created without DTO, any api user should update the READ contract with the io read result for further api use.
@@ -107,6 +111,7 @@ type Contract =
107111 /// <param name =" dtoType " >The file type.</param >
108112 /// <returns >Returns a READ contract.</returns >
109113 static member createRead ( path , dtoType : DTOType ) = { Operation= Operation.READ; Path = path; DTOType = Some dtoType; DTO = None}
114+
110115 /// <summary >Create a EXECUTE contract with all necessary information.
111116 ///
112117 /// This contract type is used to communicate cli tool execution.
@@ -117,3 +122,14 @@ type Contract =
117122 static member createExecute ( dto : CLITool , ? path : string ) =
118123 let path = Option.defaultValue " " path
119124 { Operation= Operation.EXECUTE; Path = path; DTOType = Some DTOType.CLI; DTO = Some <| DTO.CLITool dto}
125+
126+ /// <summary >Create a RENAME contract with all necessary information.
127+ ///
128+ /// This contract type is used to communicate file renaming.
129+ ///
130+ /// ** Note:** The path is the old path, the DTO is the new path.
131+ /// </summary >
132+ /// <param name =" oldPath " >The old path relative from ARC root.</param >
133+ /// <param name =" newPath " >The new path relative from ARC root.</param >
134+ /// <returns >Returns a RENAME contract.</returns >
135+ static member createRename ( oldPath , newPath ) = { Operation= Operation.RENAME; Path = oldPath; DTOType = None; DTO = Some <| DTO.Text newPath}
0 commit comments