diff --git a/README.md b/README.md
index 2f393c0..fcd68a7 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
Dime.Scheduler CLI
-Connect with Dime.Scheduler through a .NET Tool. Check out the [📚 wiki](https://github.com/dime-scheduler/cli/wiki) for all the information on the CLI.
+Connect with Dime.Scheduler through the CLI. Check out the [📚 docs](https://docs.dimescheduler.com/develop/cli/intro) for all the information on the CLI.
## Installation
@@ -36,22 +36,18 @@ To clone and run this application, you'll need Visual Studio 16.7 or higher. The
The following example adds or updates a category in Dime.Scheduler:
```cmd
-dimescheduler category
--a
--u https://mydimescheduler.io
--c myadministrator@mydimescheduler.com
--p mystrongpassword
--n Service order status
--h #32a852
+dimescheduler category add -k "MYAPIKEY" -n 'Service order 123' -h #32a852
```
+To specify an environment, add `--env` followed by either `Dev`, `Test`, or `Staging`.
+
The entry point of the global tool is the `dimescheduler` command.
-See the repo's [📚 wiki](https://github.com/dime-scheduler/cli/wiki) for a list of all commands and their parameters.
+See the [📚 docs](https://docs.dimescheduler.com/develop/cli/intro) for a list of all commands and their parameters.
-To see the parameters of a command, simply run the `dimescheduler` + `entity` + `--help` command and you'll get all the information you need:
+To see the parameters of a command, simply run the `dimescheduler` + `verb` + `entity` + `--help` command and you'll get all the information you need:
diff --git a/src/cli/Commands/ActionUriCommand.cs b/src/cli/Commands/ActionUriCommand.cs
index dc6e1d5..f011bf9 100644
--- a/src/cli/Commands/ActionUriCommand.cs
+++ b/src/cli/Commands/ActionUriCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ActionUriCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ActionUriOptions options) => $"Adding action URI.";
diff --git a/src/cli/Commands/AppointmentCategoryCommand.cs b/src/cli/Commands/AppointmentCategoryCommand.cs
index 18fec28..3cb9188 100644
--- a/src/cli/Commands/AppointmentCategoryCommand.cs
+++ b/src/cli/Commands/AppointmentCategoryCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentCategoryCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentCategoryOptions options)
diff --git a/src/cli/Commands/AppointmentCommand.cs b/src/cli/Commands/AppointmentCommand.cs
index 44044f5..b3a8c1c 100644
--- a/src/cli/Commands/AppointmentCommand.cs
+++ b/src/cli/Commands/AppointmentCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentOptions options)
diff --git a/src/cli/Commands/AppointmentContainerCommand.cs b/src/cli/Commands/AppointmentContainerCommand.cs
index aa8a03c..11229d3 100644
--- a/src/cli/Commands/AppointmentContainerCommand.cs
+++ b/src/cli/Commands/AppointmentContainerCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentContainerCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentContainerOptions options)
diff --git a/src/cli/Commands/AppointmentContentCommand.cs b/src/cli/Commands/AppointmentContentCommand.cs
index 033b0e8..93de030 100644
--- a/src/cli/Commands/AppointmentContentCommand.cs
+++ b/src/cli/Commands/AppointmentContentCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentContentCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentContentOptions options)
diff --git a/src/cli/Commands/AppointmentImportanceCommand.cs b/src/cli/Commands/AppointmentImportanceCommand.cs
index 33524e6..6359b16 100644
--- a/src/cli/Commands/AppointmentImportanceCommand.cs
+++ b/src/cli/Commands/AppointmentImportanceCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentImportanceCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentImportanceOptions options)
diff --git a/src/cli/Commands/AppointmentLockedCommand.cs b/src/cli/Commands/AppointmentLockedCommand.cs
index 50e7346..148cfc5 100644
--- a/src/cli/Commands/AppointmentLockedCommand.cs
+++ b/src/cli/Commands/AppointmentLockedCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentLockedCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentLockedOptions options)
diff --git a/src/cli/Commands/AppointmentPlanningQuantityCommand.cs b/src/cli/Commands/AppointmentPlanningQuantityCommand.cs
index 7beb3e9..0749622 100644
--- a/src/cli/Commands/AppointmentPlanningQuantityCommand.cs
+++ b/src/cli/Commands/AppointmentPlanningQuantityCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentPlanningQuantityCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentPlanningQuantityOptions options)
diff --git a/src/cli/Commands/AppointmentTimeMarkerCommand.cs b/src/cli/Commands/AppointmentTimeMarkerCommand.cs
index b5243b9..912b533 100644
--- a/src/cli/Commands/AppointmentTimeMarkerCommand.cs
+++ b/src/cli/Commands/AppointmentTimeMarkerCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentTimeMarkerCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentTimeMarkerOptions options)
diff --git a/src/cli/Commands/AppointmentUriCommand.cs b/src/cli/Commands/AppointmentUriCommand.cs
index d8cc368..a4e784c 100644
--- a/src/cli/Commands/AppointmentUriCommand.cs
+++ b/src/cli/Commands/AppointmentUriCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AppointmentUriCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AppointmentUriOptions options)
diff --git a/src/cli/Commands/AssignmentCommand.cs b/src/cli/Commands/AssignmentCommand.cs
index 8c2f9dc..bf0db1f 100644
--- a/src/cli/Commands/AssignmentCommand.cs
+++ b/src/cli/Commands/AssignmentCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class AssignmentCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(AssignmentOptions options)
diff --git a/src/cli/Commands/CaptionCommand.cs b/src/cli/Commands/CaptionCommand.cs
index dbb3b89..b45d4d9 100644
--- a/src/cli/Commands/CaptionCommand.cs
+++ b/src/cli/Commands/CaptionCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class CaptionCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(CaptionOptions options)
diff --git a/src/cli/Commands/CategoryCommand.cs b/src/cli/Commands/CategoryCommand.cs
index fe2e5e0..9f6a7f6 100644
--- a/src/cli/Commands/CategoryCommand.cs
+++ b/src/cli/Commands/CategoryCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class CategoryCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(CategoryOptions options)
diff --git a/src/cli/Commands/Command.cs b/src/cli/Commands/Command.cs
new file mode 100644
index 0000000..6da0985
--- /dev/null
+++ b/src/cli/Commands/Command.cs
@@ -0,0 +1,37 @@
+using System;
+using Dime.Scheduler.CLI.Options;
+using Dime.Scheduler.Entities;
+using Task = System.Threading.Tasks.Task;
+
+namespace Dime.Scheduler.CLI.Commands
+{
+ public abstract class Command
+ where TOptions : BaseOptions, IImportConvertable
+ where TImportable : class, IImportRequestable
+ {
+ protected abstract string WriteIntro(TOptions options);
+
+ public virtual async Task ProcessAsync(TOptions options)
+ {
+ try
+ {
+ Console.WriteLine(WriteIntro(options));
+
+ DimeSchedulerClient client = new(options.Key, options.Environment.GetDescription());
+
+ CrudAction action = options.Action.GetValueFromDescription();
+ ImportSet result = await client.Import.ProcessAsync(options.ToImport(), action != CrudAction.Delete ? TransactionType.Append : TransactionType.Delete);
+
+ Console.WriteLine(result.Success ? "Completed successfully" : "Request failed: " + result.Message);
+ }
+ catch (ArgumentException argException)
+ {
+ Console.WriteLine("Action for this type was not recognized. Supported actions: add, update, delete");
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.Message);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/cli/Commands/ContainerCommand.cs b/src/cli/Commands/ContainerCommand.cs
index 21c6b56..1ff7389 100644
--- a/src/cli/Commands/ContainerCommand.cs
+++ b/src/cli/Commands/ContainerCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ContainerCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ContainerOptions options)
diff --git a/src/cli/Commands/FilterGroupCommand.cs b/src/cli/Commands/FilterGroupCommand.cs
index e97e1f1..951202f 100644
--- a/src/cli/Commands/FilterGroupCommand.cs
+++ b/src/cli/Commands/FilterGroupCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class FilterGroupCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(FilterGroupOptions options)
diff --git a/src/cli/Commands/FilterValueCommand.cs b/src/cli/Commands/FilterValueCommand.cs
index 4ce6cd4..ca52355 100644
--- a/src/cli/Commands/FilterValueCommand.cs
+++ b/src/cli/Commands/FilterValueCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class FilterValueCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(FilterValueOptions options)
diff --git a/src/cli/Commands/ImportCommand.cs b/src/cli/Commands/ImportCommand.cs
deleted file mode 100644
index 879c6cc..0000000
--- a/src/cli/Commands/ImportCommand.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk;
-using Dime.Scheduler.Sdk.Import;
-using Task = System.Threading.Tasks.Task;
-
-namespace Dime.Scheduler.CLI.Commands
-{
- public abstract class ImportCommand
- where TOptions : BaseOptions, IImportConvertable
- where TImportable : class, IImportRequestable
- {
- protected abstract string WriteIntro(TOptions options);
-
- public async Task ProcessAsync(TOptions options)
- {
- try
- {
- Console.WriteLine(WriteIntro(options));
-
- IAuthenticator authenticator = new FormsAuthenticator(options.Uri, options.User, options.Password);
- DimeSchedulerClient client = new(options.Uri, authenticator);
- IImportEndpoint importEndpoint = await client.Import.Request();
- ImportSet result = await importEndpoint.ProcessAsync(
- options.ToImport(),
- options.Append ? TransactionType.Append : TransactionType.Delete);
-
- Console.WriteLine(result.Success ? "Completed successfully" : "Did not complete successfully");
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/cli/Commands/JobCommand.cs b/src/cli/Commands/JobCommand.cs
index d37d0fd..635514f 100644
--- a/src/cli/Commands/JobCommand.cs
+++ b/src/cli/Commands/JobCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class JobCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(JobOptions options)
diff --git a/src/cli/Commands/LiveResourceLocationCommand.cs b/src/cli/Commands/LiveResourceLocationCommand.cs
index 5ffd9c8..2c0b0ca 100644
--- a/src/cli/Commands/LiveResourceLocationCommand.cs
+++ b/src/cli/Commands/LiveResourceLocationCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class LiveResourceLocationCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceLiveLocationOptions options)
diff --git a/src/cli/Commands/NotificationCommand.cs b/src/cli/Commands/NotificationCommand.cs
index b5d8c42..abacca4 100644
--- a/src/cli/Commands/NotificationCommand.cs
+++ b/src/cli/Commands/NotificationCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class NotificationCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(NotificationOptions options)
diff --git a/src/cli/Commands/PinCommand.cs b/src/cli/Commands/PinCommand.cs
index 52f15d8..c9c2b4d 100644
--- a/src/cli/Commands/PinCommand.cs
+++ b/src/cli/Commands/PinCommand.cs
@@ -1,11 +1,11 @@
using Dime.Scheduler.CLI.Options;
using Dime.Scheduler.CLI.Utils;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class PinCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(PinOptions options)
diff --git a/src/cli/Commands/ResourceCalendarCommand.cs b/src/cli/Commands/ResourceCalendarCommand.cs
index 6700640..7a07abf 100644
--- a/src/cli/Commands/ResourceCalendarCommand.cs
+++ b/src/cli/Commands/ResourceCalendarCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ResourceCalendarCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceCalendarOptions options)
diff --git a/src/cli/Commands/ResourceCapacityCommand.cs b/src/cli/Commands/ResourceCapacityCommand.cs
index 2276f1a..03fd443 100644
--- a/src/cli/Commands/ResourceCapacityCommand.cs
+++ b/src/cli/Commands/ResourceCapacityCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ResourceCapacityCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceCapacityOptions options)
diff --git a/src/cli/Commands/ResourceCommand.cs b/src/cli/Commands/ResourceCommand.cs
index 035d69c..a932813 100644
--- a/src/cli/Commands/ResourceCommand.cs
+++ b/src/cli/Commands/ResourceCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Resource = Dime.Scheduler.Sdk.Import.Resource;
+using Resource = Dime.Scheduler.Entities.Resource;
namespace Dime.Scheduler.CLI.Commands
{
public class ResourceCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceOptions options) => $"Adding resource.";
diff --git a/src/cli/Commands/ResourceFilterValueCommand.cs b/src/cli/Commands/ResourceFilterValueCommand.cs
index 1097611..856bddd 100644
--- a/src/cli/Commands/ResourceFilterValueCommand.cs
+++ b/src/cli/Commands/ResourceFilterValueCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ResourceFilterValueCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceFilterValueOptions options)
diff --git a/src/cli/Commands/ResourceUriCommand.cs b/src/cli/Commands/ResourceUriCommand.cs
index 6a431d1..9ccf391 100644
--- a/src/cli/Commands/ResourceUriCommand.cs
+++ b/src/cli/Commands/ResourceUriCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class ResourceUriCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(ResourceUriOptions options) => $"Creates a resource URI.";
diff --git a/src/cli/Commands/TaskCommand.cs b/src/cli/Commands/TaskCommand.cs
index efcff5a..f814236 100644
--- a/src/cli/Commands/TaskCommand.cs
+++ b/src/cli/Commands/TaskCommand.cs
@@ -1,12 +1,43 @@
-using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using System;
+using Dime.Scheduler.CLI.Options;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TaskCommand :
- ImportCommand,
+ Command,
ICommand
{
+ public override async System.Threading.Tasks.Task ProcessAsync(TaskOptions options)
+ {
+ try
+ {
+ Console.WriteLine(WriteIntro(options));
+
+ DimeSchedulerClient client = new(options.Environment.GetDescription(), options.Key);
+
+ if (options.CreateJob)
+ {
+ await client.Jobs.CreateAsync(new Job()
+ {
+ SourceApp = options.SourceApp,
+ SourceType = options.SourceType,
+ ShortDescription = !string.IsNullOrEmpty(options.ShortDescription) ? options.ShortDescription : options.Description?[0..Math.Min(options.Description.Length, 50)],
+ Description = options.Description,
+ JobNo = options.JobNo
+ });
+ }
+
+ CrudAction action = options.Action.GetValueFromDescription();
+ ImportSet result = await client.Import.ProcessAsync(options.ToImport(), action != CrudAction.Delete ? TransactionType.Append : TransactionType.Delete);
+ Console.WriteLine(result.Success ? "Completed successfully" : "Request failed: " + result.Message);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.Message);
+ }
+ }
+
protected override string WriteIntro(TaskOptions options)
=> $"Adding task for job {options.JobNo} with number {options.TaskNo}.";
}
diff --git a/src/cli/Commands/TaskContainerCommand.cs b/src/cli/Commands/TaskContainerCommand.cs
index d4fca71..63d65ae 100644
--- a/src/cli/Commands/TaskContainerCommand.cs
+++ b/src/cli/Commands/TaskContainerCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TaskContainerCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(TaskContainerOptions options)
diff --git a/src/cli/Commands/TaskFilterValueCommand.cs b/src/cli/Commands/TaskFilterValueCommand.cs
index 8ba5f55..121943c 100644
--- a/src/cli/Commands/TaskFilterValueCommand.cs
+++ b/src/cli/Commands/TaskFilterValueCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TaskFilterValueCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(TaskFilterValueOptions options)
diff --git a/src/cli/Commands/TaskLockedCommand.cs b/src/cli/Commands/TaskLockedCommand.cs
index e6787b9..6ef308e 100644
--- a/src/cli/Commands/TaskLockedCommand.cs
+++ b/src/cli/Commands/TaskLockedCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TaskLockedCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(TaskLockedOptions options)
diff --git a/src/cli/Commands/TaskUriCommand.cs b/src/cli/Commands/TaskUriCommand.cs
index 5d20e96..5d7be8f 100644
--- a/src/cli/Commands/TaskUriCommand.cs
+++ b/src/cli/Commands/TaskUriCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TaskUriCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(TaskUriOptions options)
diff --git a/src/cli/Commands/TimeMarkerCommand.cs b/src/cli/Commands/TimeMarkerCommand.cs
index 8a67eb2..1a4af88 100644
--- a/src/cli/Commands/TimeMarkerCommand.cs
+++ b/src/cli/Commands/TimeMarkerCommand.cs
@@ -1,10 +1,10 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Commands
{
public class TimeMarkerCommand :
- ImportCommand,
+ Command,
ICommand
{
protected override string WriteIntro(TimeMarkerOptions options)
diff --git a/src/cli/Commands/TransientMessageCommand.cs b/src/cli/Commands/TransientMessageCommand.cs
index 6f06404..0b7ce12 100644
--- a/src/cli/Commands/TransientMessageCommand.cs
+++ b/src/cli/Commands/TransientMessageCommand.cs
@@ -1,6 +1,6 @@
using System;
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk;
+using Dime.Scheduler.Entities;
using Task = System.Threading.Tasks.Task;
namespace Dime.Scheduler.CLI.Commands
@@ -13,19 +13,8 @@ public async Task ProcessAsync(TransientMessageOptions options)
{
Console.WriteLine("Adding transient message");
- IAuthenticator authenticator = new FormsAuthenticator(options.Uri, options.User, options.Password);
- DimeSchedulerClient client = new(options.Uri, authenticator);
-
- IMessageEndpoint endpoint = await client.Messages.Request();
-
- MessageRequest message = new()
- {
- Severity = options.Severity,
- Text = options.Text,
- User = options.To
- };
-
- await endpoint.PostAsync(message);
+ DimeSchedulerClient client = new(options.Environment.GetDescription(), options.Key);
+ await client.Messages.PostAsync(new Message(options.Text, options.To, options.Severity));
}
catch (Exception ex)
{
diff --git a/src/cli/Commands/UserCommand.cs b/src/cli/Commands/UserCommand.cs
index 01f1a12..705eab2 100644
--- a/src/cli/Commands/UserCommand.cs
+++ b/src/cli/Commands/UserCommand.cs
@@ -1,6 +1,5 @@
using System;
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk;
using Task = System.Threading.Tasks.Task;
namespace Dime.Scheduler.CLI.Commands
@@ -13,20 +12,9 @@ public async Task ProcessAsync(UserOptions options)
{
Console.WriteLine($"Adding user with e-mail {options.Email}");
- IAuthenticator authenticator = new FormsAuthenticator(options.Uri, options.User, options.Password);
- DimeSchedulerClient client = new(options.Uri, authenticator);
+ DimeSchedulerClient client = new(options.Environment.GetDescription(), options.Key);
+ await client.Users.CreateAsync(new(options.Email, options.Type, options.Email, options.Password, options.Language, options.TimeZone));
- ICrudEndpoint usersEndpoint = await client.Users.Request();
- UserRequest user = new()
- {
- Email = options.Email,
- Password = options.Password,
- Language = options.Language,
- TimeZone = options.TimeZone,
- Type = options.Type
- };
-
- await usersEndpoint.Create(user);
Console.WriteLine("Finished successfully.");
}
catch (Exception ex)
diff --git a/src/cli/Constants/CrudAction.cs b/src/cli/Constants/CrudAction.cs
new file mode 100644
index 0000000..7e771bb
--- /dev/null
+++ b/src/cli/Constants/CrudAction.cs
@@ -0,0 +1,16 @@
+using System.ComponentModel;
+
+namespace Dime.Scheduler.CLI.Options
+{
+ public enum CrudAction
+ {
+ [Description("add")]
+ Create,
+
+ [Description("update")]
+ Update,
+
+ [Description("delete")]
+ Delete
+ }
+}
\ No newline at end of file
diff --git a/src/cli/Constants/Environment.cs b/src/cli/Constants/Environment.cs
new file mode 100644
index 0000000..de05780
--- /dev/null
+++ b/src/cli/Constants/Environment.cs
@@ -0,0 +1,19 @@
+using System.ComponentModel;
+
+namespace Dime.Scheduler.CLI.Options
+{
+ public enum Environment
+ {
+ [Description("https://api.dimescheduler.com")]
+ Production,
+
+ [Description("https://api-d.dimescheduler.com")]
+ Dev,
+
+ [Description("https://api-t.dimescheduler.com")]
+ Test,
+
+ [Description("https://api-u.dimescheduler.com")]
+ Staging
+ }
+}
\ No newline at end of file
diff --git a/src/cli/Dime.Scheduler.CLI.csproj b/src/cli/Dime.Scheduler.CLI.csproj
index eb8d2ad..5cbba44 100644
--- a/src/cli/Dime.Scheduler.CLI.csproj
+++ b/src/cli/Dime.Scheduler.CLI.csproj
@@ -1,52 +1,48 @@
-
- Exe
- net7.0
- true
- dimescheduler
- en
- latest
-
-
- ./nupkg
- true
- true
- https://cdn.dimescheduler.com/dime-software/logo-shape.png
- Dime;Scheduler;SDK;REST;dotnet;dotnettool
- https://github.com/dime-scheduler/cli
- https://github.com/dime-scheduler/cli
-
-
- Dime Software
- Dime Software
- Dime.Scheduler
- Dime.Scheduler
- MIT
- Dime.Scheduler CLI
- A command-line interface for Dime.Scheduler
- README.md
-
+
+ Exe
+ net8.0
+ true
+ dimescheduler
+ en
+ latest
+
+
+ ./nupkg
+ true
+ true
+ https://cdn.dimescheduler.com/dime-scheduler/v2/shape.png
+ Dime;Scheduler;SDK;REST;dotnet;dotnettool
+ https://github.com/dime-scheduler/cli
+ https://github.com/dime-scheduler/cli
+
+
+ Dime Software
+ Dime Software
+ Dime.Scheduler
+ Dime.Scheduler
+ MIT
+ Dime.Scheduler CLI
+ A command-line interface for Dime.Scheduler
+ README.md
+
-
- 1.0.0
-
- 1.0.0.0
- 1.0.0.0
-
-
-
-
-
+
+ 2.0.0
+ beta.1
+ 2.0.0.0
+ 2.0.0.0
+
+
+
+
+
-
-
- Always
-
-
+
+
+ Always
+
+
-
-
-
-
diff --git a/src/cli/Options/ActionUriOptions.cs b/src/cli/Options/ActionUriOptions.cs
index 0b7e089..0b110cd 100644
--- a/src/cli/Options/ActionUriOptions.cs
+++ b/src/cli/Options/ActionUriOptions.cs
@@ -1,6 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentCategoryOptions.cs b/src/cli/Options/AppointmentCategoryOptions.cs
index a3a8a7c..ef5aba0 100644
--- a/src/cli/Options/AppointmentCategoryOptions.cs
+++ b/src/cli/Options/AppointmentCategoryOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentContainerOptions.cs b/src/cli/Options/AppointmentContainerOptions.cs
index d308b47..4a5b97b 100644
--- a/src/cli/Options/AppointmentContainerOptions.cs
+++ b/src/cli/Options/AppointmentContainerOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentContentOptions.cs b/src/cli/Options/AppointmentContentOptions.cs
index 3244c6e..6e62ae5 100644
--- a/src/cli/Options/AppointmentContentOptions.cs
+++ b/src/cli/Options/AppointmentContentOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentImportanceOptions.cs b/src/cli/Options/AppointmentImportanceOptions.cs
index 66c451d..bd74d07 100644
--- a/src/cli/Options/AppointmentImportanceOptions.cs
+++ b/src/cli/Options/AppointmentImportanceOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentLockedOptions.cs b/src/cli/Options/AppointmentLockedOptions.cs
index bc95c91..d0f130b 100644
--- a/src/cli/Options/AppointmentLockedOptions.cs
+++ b/src/cli/Options/AppointmentLockedOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentOptions.cs b/src/cli/Options/AppointmentOptions.cs
index d190f33..ae183c8 100644
--- a/src/cli/Options/AppointmentOptions.cs
+++ b/src/cli/Options/AppointmentOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentPlanningQuantityOptions.cs b/src/cli/Options/AppointmentPlanningQuantityOptions.cs
index 17fabb6..520c1c3 100644
--- a/src/cli/Options/AppointmentPlanningQuantityOptions.cs
+++ b/src/cli/Options/AppointmentPlanningQuantityOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentTimeMarkerOptions.cs b/src/cli/Options/AppointmentTimeMarkerOptions.cs
index 927bdae..0254e85 100644
--- a/src/cli/Options/AppointmentTimeMarkerOptions.cs
+++ b/src/cli/Options/AppointmentTimeMarkerOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/AppointmentUriOptions.cs b/src/cli/Options/AppointmentUriOptions.cs
index 990b08d..a8fb211 100644
--- a/src/cli/Options/AppointmentUriOptions.cs
+++ b/src/cli/Options/AppointmentUriOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
@@ -19,7 +19,7 @@ public static implicit operator AppointmentUri(AppointmentUriOptions options)
{
AppointmentGuid = options.AppointmentGuid,
AppointmentId = options.AppointmentId,
- Uri = options.Uri,
+ Uri = options.Link,
SourceApp = options.SourceApp,
SourceType = options.SourceType,
Description = options.Description
diff --git a/src/cli/Options/AssignmentOptions.cs b/src/cli/Options/AssignmentOptions.cs
index 1b41ee4..26f407b 100644
--- a/src/cli/Options/AssignmentOptions.cs
+++ b/src/cli/Options/AssignmentOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/BaseOptions.cs b/src/cli/Options/BaseOptions.cs
index 3c3378f..12ef802 100644
--- a/src/cli/Options/BaseOptions.cs
+++ b/src/cli/Options/BaseOptions.cs
@@ -2,15 +2,17 @@
namespace Dime.Scheduler.CLI.Options
{
- public abstract class BaseOptions : ImportBaseOptions
+ public abstract class BaseOptions
{
- [Option('u', "URI", Required = true, HelpText = "The base URI of Dime.Scheduler.")]
- public string Uri { get; set; }
+ [Value(0)]
+ public string Action { get; set; }
- [Option('c', "user", Required = true, HelpText = "The Dime.Scheduler user's email address.")]
- public string User { get; set; }
+ [Option('k', "key", Required = true, HelpText = "Your API key")]
+ public string Key { get; set; }
- [Option('p', "password", Required = true, HelpText = "The Dime.Scheduler user's password.")]
- public string Password { get; set; }
+ [Option("env")]
+ public Environment Environment { get; set; } = Environment.Production;
+
+ public static implicit operator EndpointOptions(BaseOptions opts) => new(opts.Environment.GetDescription(), opts.Key);
}
}
\ No newline at end of file
diff --git a/src/cli/Options/CaptionOptions.cs b/src/cli/Options/CaptionOptions.cs
index 264120b..ebac457 100644
--- a/src/cli/Options/CaptionOptions.cs
+++ b/src/cli/Options/CaptionOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/CategoryOptions.cs b/src/cli/Options/CategoryOptions.cs
index fcc68e1..9d7c55c 100644
--- a/src/cli/Options/CategoryOptions.cs
+++ b/src/cli/Options/CategoryOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ContainerOptions.cs b/src/cli/Options/ContainerOptions.cs
index 4242a33..56d37b8 100644
--- a/src/cli/Options/ContainerOptions.cs
+++ b/src/cli/Options/ContainerOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/FilterGroupOptions.cs b/src/cli/Options/FilterGroupOptions.cs
index 48bf71a..263e489 100644
--- a/src/cli/Options/FilterGroupOptions.cs
+++ b/src/cli/Options/FilterGroupOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/FilterValueOptions.cs b/src/cli/Options/FilterValueOptions.cs
index d2bbd34..a5493f6 100644
--- a/src/cli/Options/FilterValueOptions.cs
+++ b/src/cli/Options/FilterValueOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/IImportConvertable.cs b/src/cli/Options/IImportConvertable.cs
index 3f67b33..06b1e3c 100644
--- a/src/cli/Options/IImportConvertable.cs
+++ b/src/cli/Options/IImportConvertable.cs
@@ -1,4 +1,4 @@
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ImportBaseOptions.cs b/src/cli/Options/ImportBaseOptions.cs
deleted file mode 100644
index f93b6df..0000000
--- a/src/cli/Options/ImportBaseOptions.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using CommandLine;
-
-namespace Dime.Scheduler.CLI.Options
-{
- public abstract class ImportBaseOptions
- {
- [Option('a', "append", Group = "action", HelpText = "Append the record to Dime.Scheduler.")]
- public bool Append { get; set; }
-
- [Option('d', "delete", Group = "action", HelpText = "Remove the record from Dime.Scheduler.")]
- public bool Delete { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/cli/Options/JobOptions.cs b/src/cli/Options/JobOptions.cs
index a450739..ac1c254 100644
--- a/src/cli/Options/JobOptions.cs
+++ b/src/cli/Options/JobOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
@@ -16,7 +16,7 @@ public class JobOptions : BaseOptions, IImportConvertable
[Option(Required = true, HelpText = "The unique job number.")]
public string JobNo { get; set; }
- [Option(Required = true, HelpText = "A short text describing the job.")]
+ [Option(Required = false, HelpText = "A short text describing the job.")]
public string ShortDescription { get; set; }
[Option(HelpText = "A longer text to describe the job.")]
@@ -351,7 +351,7 @@ public static implicit operator Job(JobOptions options)
SourceApp = options.SourceApp,
SourceType = options.SourceType,
JobNo = options.JobNo,
- ShortDescription = options.ShortDescription,
+ ShortDescription = !string.IsNullOrEmpty(options.ShortDescription) ? options.ShortDescription : options.Description?[0..Math.Min(options.Description.Length, 50)],
Description = options.Description,
AllowDependencies = options.AllowDependencies,
AvailableInGantt = options.AvailableInGantt,
diff --git a/src/cli/Options/NotificationOptions.cs b/src/cli/Options/NotificationOptions.cs
index eae721e..b27a36d 100644
--- a/src/cli/Options/NotificationOptions.cs
+++ b/src/cli/Options/NotificationOptions.cs
@@ -1,7 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
@@ -38,6 +37,9 @@ public class NotificationOptions : BaseOptions, IImportConvertable
[Option(HelpText = "Optional reference to a task.")]
public string TaskNo { get; set; }
+ [Option(HelpText = "Optional reference to an appointment.")]
+ public string AppointmentNo { get; set; }
+
[Option(HelpText = "The appointment's GUID.")]
public Guid? AppointmentGuid { get; set; }
@@ -60,7 +62,8 @@ public static implicit operator Notification(NotificationOptions options)
SourceType = options.SourceType,
TaskNo = options.TaskNo,
Text = options.Text,
- Type = options.Type
+ Type = options.Type,
+ AppointmentNo = options.AppointmentNo
};
}
}
\ No newline at end of file
diff --git a/src/cli/Options/PinOptions.cs b/src/cli/Options/PinOptions.cs
index ebfd744..717e594 100644
--- a/src/cli/Options/PinOptions.cs
+++ b/src/cli/Options/PinOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceCalendarOptions.cs b/src/cli/Options/ResourceCalendarOptions.cs
index 2aea82b..e542ae8 100644
--- a/src/cli/Options/ResourceCalendarOptions.cs
+++ b/src/cli/Options/ResourceCalendarOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceCapacityOptions.cs b/src/cli/Options/ResourceCapacityOptions.cs
index 6d50817..1439fd6 100644
--- a/src/cli/Options/ResourceCapacityOptions.cs
+++ b/src/cli/Options/ResourceCapacityOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceFilterValueOptions.cs b/src/cli/Options/ResourceFilterValueOptions.cs
index 75321b3..7dee7f5 100644
--- a/src/cli/Options/ResourceFilterValueOptions.cs
+++ b/src/cli/Options/ResourceFilterValueOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceLiveLocationOptions.cs b/src/cli/Options/ResourceLiveLocationOptions.cs
index 307cf5d..c75932a 100644
--- a/src/cli/Options/ResourceLiveLocationOptions.cs
+++ b/src/cli/Options/ResourceLiveLocationOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceOptions.cs b/src/cli/Options/ResourceOptions.cs
index ceff510..edad135 100644
--- a/src/cli/Options/ResourceOptions.cs
+++ b/src/cli/Options/ResourceOptions.cs
@@ -1,6 +1,6 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/ResourceUriOptions.cs b/src/cli/Options/ResourceUriOptions.cs
index 1d99877..5e34b57 100644
--- a/src/cli/Options/ResourceUriOptions.cs
+++ b/src/cli/Options/ResourceUriOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TaskContainerOptions.cs b/src/cli/Options/TaskContainerOptions.cs
index 58e21b6..7e65ead 100644
--- a/src/cli/Options/TaskContainerOptions.cs
+++ b/src/cli/Options/TaskContainerOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TaskFilterValueOptions.cs b/src/cli/Options/TaskFilterValueOptions.cs
index 95fcae5..0d1fc21 100644
--- a/src/cli/Options/TaskFilterValueOptions.cs
+++ b/src/cli/Options/TaskFilterValueOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TaskLockedOptions.cs b/src/cli/Options/TaskLockedOptions.cs
index 3df423a..92dcfb4 100644
--- a/src/cli/Options/TaskLockedOptions.cs
+++ b/src/cli/Options/TaskLockedOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TaskOptions.cs b/src/cli/Options/TaskOptions.cs
index 6c60531..e2ad1a6 100644
--- a/src/cli/Options/TaskOptions.cs
+++ b/src/cli/Options/TaskOptions.cs
@@ -1,12 +1,15 @@
using System;
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
[Verb("task", HelpText = "Add or remove a task.")]
public class TaskOptions : BaseOptions, IImportConvertable
{
+ [Option(HelpText = "Set to true to create a job for this task")]
+ public bool CreateJob { get; set; }
+
[Option(Required = true, HelpText = "The source app.")]
public string SourceApp { get; set; }
@@ -22,7 +25,7 @@ public class TaskOptions : BaseOptions, IImportConvertable
[Option(HelpText = "The task type.")]
public TaskType TaskType { get; set; }
- [Option(Required = true, HelpText = "A short text describing the task.")]
+ [Option(HelpText = "A short text describing the task.")]
public string ShortDescription { get; set; }
[Option(HelpText = "A longer text to describe the task")]
@@ -522,7 +525,7 @@ public static implicit operator Task(TaskOptions options)
ServiceName = options.ServiceName,
ServiceNo = options.ServiceNo,
ServiceSerialNo = options.ServiceSerialNo,
- ShortDescription = options.ShortDescription,
+ ShortDescription = !string.IsNullOrEmpty(options.ShortDescription) ? options.ShortDescription : options.Description?[0..Math.Min(options.Description.Length, 50)],
Skill1 = options.Skill1,
Skill2 = options.Skill2,
Skill3 = options.Skill3,
diff --git a/src/cli/Options/TaskUriOptions.cs b/src/cli/Options/TaskUriOptions.cs
index b3f8838..7380ae7 100644
--- a/src/cli/Options/TaskUriOptions.cs
+++ b/src/cli/Options/TaskUriOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TimeMarkerOptions.cs b/src/cli/Options/TimeMarkerOptions.cs
index f1c95fc..e900e03 100644
--- a/src/cli/Options/TimeMarkerOptions.cs
+++ b/src/cli/Options/TimeMarkerOptions.cs
@@ -1,5 +1,5 @@
using CommandLine;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/TransientMessageOptions.cs b/src/cli/Options/TransientMessageOptions.cs
index 76f7956..8f301c3 100644
--- a/src/cli/Options/TransientMessageOptions.cs
+++ b/src/cli/Options/TransientMessageOptions.cs
@@ -1,5 +1,4 @@
using CommandLine;
-using Dime.Scheduler.Sdk;
namespace Dime.Scheduler.CLI.Options
{
diff --git a/src/cli/Options/UserOptions.cs b/src/cli/Options/UserOptions.cs
index eada6da..37d8566 100644
--- a/src/cli/Options/UserOptions.cs
+++ b/src/cli/Options/UserOptions.cs
@@ -1,5 +1,4 @@
using CommandLine;
-using Dime.Scheduler.Sdk;
namespace Dime.Scheduler.CLI.Options
{
@@ -9,9 +8,6 @@ public class UserOptions : BaseOptions
[Option(Required = true, HelpText = "The user's e-mail address.")]
public string Email { get; set; }
- [Option(Required = true, HelpText = "The user's password.")]
- public string Key { get; set; }
-
[Option(HelpText = "The user type.", Default = LoginType.Forms)]
public LoginType Type { get; set; } = LoginType.Forms;
@@ -20,5 +16,8 @@ public class UserOptions : BaseOptions
[Option(HelpText = "The user's time zone.")]
public string TimeZone { get; set; }
+
+ [Option(Required = true, HelpText = "The user's password.")]
+ public string Password { get; set; }
}
}
\ No newline at end of file
diff --git a/src/cli/Properties/launchSettings.json b/src/cli/Properties/launchSettings.json
index e9d1441..cdf0ffd 100644
--- a/src/cli/Properties/launchSettings.json
+++ b/src/cli/Properties/launchSettings.json
@@ -2,7 +2,7 @@
"profiles": {
"Dime.Scheduler.CLI": {
"commandName": "Project",
- "commandLineArgs": "pin -d -h 000000 -name Test -u google.com -c test -p no"
+ "commandLineArgs": "pin add --env Dev -k DS-6BTLFKPD-M3ROU9EK-0AWOMKSG-ZKK6IS -h #6e64b5 -n Pin"
}
}
}
\ No newline at end of file
diff --git a/src/cli/README.md b/src/cli/README.md
index 18ea6a9..b2e6686 100644
--- a/src/cli/README.md
+++ b/src/cli/README.md
@@ -1,11 +1,11 @@
# Dime.Scheduler CLI
-Connect with Dime.Scheduler through the CLI.
+Connect with Dime.Scheduler through the CLI. Version 2.x.x and up targets the cloud version of Dime.Scheduler. v1.x.x will be used for on-premise instances
## Installation
```cmd
-dotnet tool install Dime.Scheduler.CLI --global --version 1.0.0
+dotnet tool install Dime.Scheduler.CLI --global --version 2.x.x
```
## Usage
@@ -13,13 +13,7 @@ dotnet tool install Dime.Scheduler.CLI --global --version 1.0.0
The following example adds or updates a category in Dime.Scheduler:
```cmd
-dimescheduler category
--a
--u https://mydimescheduler.io
--c myadministrator@mydimescheduler.com
--p mystrongpassword
--n Service order status
--h #32a852
+dimescheduler category add -k "MYAPIKEY" -n 'Service order 123' -h #32a852
```
The entry point of the global tool is the `dimescheduler` command. See the repo's wiki for a list of all commands and their parameters.
diff --git a/src/cli/Utils/EnumExtension.cs b/src/cli/Utils/EnumExtension.cs
new file mode 100644
index 0000000..1a7682d
--- /dev/null
+++ b/src/cli/Utils/EnumExtension.cs
@@ -0,0 +1,49 @@
+using System;
+using System.ComponentModel;
+
+namespace Dime.Scheduler.CLI.Options
+{
+ internal static class EnumExtension
+ {
+ internal static string GetDescription(this T enumValue) where T : struct, IConvertible
+ {
+ if (!typeof(T).IsEnum)
+ return null;
+
+ var description = enumValue.ToString();
+ var fieldInfo = enumValue.GetType().GetField(enumValue.ToString());
+
+ if (fieldInfo != null)
+ {
+ var attrs = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), true);
+ if (attrs != null && attrs.Length > 0)
+ {
+ description = ((DescriptionAttribute)attrs[0]).Description;
+ }
+ }
+
+ return description;
+ }
+
+ internal static T GetValueFromDescription(this string description) where T : Enum
+ {
+ foreach (var field in typeof(T).GetFields())
+ {
+ if (Attribute.GetCustomAttribute(field,
+ typeof(DescriptionAttribute)) is DescriptionAttribute attribute)
+ {
+ if (attribute.Description == description)
+ return (T)field.GetValue(null);
+ }
+ else
+ {
+ if (field.Name == description)
+ return (T)field.GetValue(null);
+ }
+ }
+
+ throw new ArgumentException("Not found.", nameof(description));
+ // Or return default(T);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/cli/Utils/OperationHelper.cs b/src/cli/Utils/OperationHelper.cs
index ad59118..d301ad9 100644
--- a/src/cli/Utils/OperationHelper.cs
+++ b/src/cli/Utils/OperationHelper.cs
@@ -5,6 +5,9 @@ namespace Dime.Scheduler.CLI.Utils
internal static class OperationHelper
{
internal static string GetOperationType(this BaseOptions opts)
- => opts.Append ? "Appending" : "Deleting";
+ {
+ CrudAction action = opts.Action.GetValueFromDescription();
+ return action != CrudAction.Delete ? "Appending" : "Deleting";
+ }
}
}
\ No newline at end of file
diff --git a/src/tests/ActionUriTests.cs b/src/tests/ActionUriTests.cs
index 51abe7c..bb2ae0b 100644
--- a/src/tests/ActionUriTests.cs
+++ b/src/tests/ActionUriTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,17 +11,12 @@ public void Mapping_ActionUri_TestProperties()
{
ActionUriOptions options = new()
{
- Append = true,
Default = true,
- Delete = true,
Description = "Hello world",
Link = "Hello world",
- Password = "Hello world",
SourceApp = "Hello world",
SourceType = "Hello world",
- Uri = "Hello world",
- UriType = Sdk.UriType.Appointment,
- User = ""
+ UriType = UriType.Appointment
};
options.AssertEqualProperties((ActionUri)options);
diff --git a/src/tests/AppointmentCategoryTests.cs b/src/tests/AppointmentCategoryTests.cs
index 3621e4b..62761d5 100644
--- a/src/tests/AppointmentCategoryTests.cs
+++ b/src/tests/AppointmentCategoryTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,16 +11,12 @@ public void Mapping_AppointmentCategory_TestProperties()
{
AppointmentCategoryOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
SourceType = "Hello world",
SourceApp = "Hello world",
- Password = "Hello world",
+ Key = "Hello world",
AppointmentGuid = System.Guid.NewGuid(),
AppointmentId = 1,
Category = "Hello world",
- Delete = true,
SentFromBackOffice = true
};
diff --git a/src/tests/AppointmentContainerTests.cs b/src/tests/AppointmentContainerTests.cs
index 9f3413f..a8c4972 100644
--- a/src/tests/AppointmentContainerTests.cs
+++ b/src/tests/AppointmentContainerTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,12 +11,8 @@ public void Mapping_AppointmentContainer_TestProperties()
{
AppointmentContainerOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
- Password = "Hello world",
+ Key = "Hello world",
Container = "Hello world",
- Delete = true,
Appointment = "15"
};
diff --git a/src/tests/AppointmentContentTests.cs b/src/tests/AppointmentContentTests.cs
index 86aa524..b7326be 100644
--- a/src/tests/AppointmentContentTests.cs
+++ b/src/tests/AppointmentContentTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
diff --git a/src/tests/AppointmentImportanceTests.cs b/src/tests/AppointmentImportanceTests.cs
index 82f9406..c5857e4 100644
--- a/src/tests/AppointmentImportanceTests.cs
+++ b/src/tests/AppointmentImportanceTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,16 +11,12 @@ public void Mapping_AppointmentImportance_TestProperties()
{
AppointmentImportanceOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
SourceType = "Hello world",
SourceApp = "Hello world",
- Password = "Hello world",
+ Key = "X-123",
AppointmentGuid = System.Guid.NewGuid(),
AppointmentId = 1,
Importance = Importance.High,
- Delete = true,
SentFromBackOffice = true
};
diff --git a/src/tests/AppointmentLockedTests.cs b/src/tests/AppointmentLockedTests.cs
index 92cf262..8d6e980 100644
--- a/src/tests/AppointmentLockedTests.cs
+++ b/src/tests/AppointmentLockedTests.cs
@@ -8,7 +8,7 @@ public class AppointmentLockedTests
public void Mapping_AppointmentLocked_TestProperties()
{
Options.AppointmentLockedOptions options = new();
- options.AssertEqualProperties((Sdk.Import.AppointmentLocked)options);
+ options.AssertEqualProperties((Entities.AppointmentLocked)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/AppointmentPlanningQuantityTests.cs b/src/tests/AppointmentPlanningQuantityTests.cs
index 56189c6..3bc4fd9 100644
--- a/src/tests/AppointmentPlanningQuantityTests.cs
+++ b/src/tests/AppointmentPlanningQuantityTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,16 +11,12 @@ public void Mapping_AppointmentPlanningQuantity_TestProperties()
{
AppointmentPlanningQuantityOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
SourceType = "Hello world",
SourceApp = "Hello world",
- Password = "Hello world",
+ Key = "Hello world",
AppointmentGuid = System.Guid.NewGuid(),
AppointmentId = 1,
Quantity = 25,
- Delete = true,
SentFromBackOffice = true
};
diff --git a/src/tests/AppointmentTests.cs b/src/tests/AppointmentTests.cs
index f5cc9b7..f062ba4 100644
--- a/src/tests/AppointmentTests.cs
+++ b/src/tests/AppointmentTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
diff --git a/src/tests/AppointmentTimeMarkerTests.cs b/src/tests/AppointmentTimeMarkerTests.cs
index 2e4bf7a..8dd7824 100644
--- a/src/tests/AppointmentTimeMarkerTests.cs
+++ b/src/tests/AppointmentTimeMarkerTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,16 +11,12 @@ public void Mapping_AppointmentTimeMarker_TestProperties()
{
AppointmentTimeMarkerOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
SourceType = "Hello world",
SourceApp = "Hello world",
- Password = "Hello world",
+ Key = "Hello world",
AppointmentGuid = System.Guid.NewGuid(),
AppointmentId = 1,
TimeMarker = "Hello world",
- Delete = true,
SentFromBackOffice = true
};
diff --git a/src/tests/AppointmentUriTests.cs b/src/tests/AppointmentUriTests.cs
index dd9de47..c0898e9 100644
--- a/src/tests/AppointmentUriTests.cs
+++ b/src/tests/AppointmentUriTests.cs
@@ -8,7 +8,7 @@ public class AppointmentUriTests
public void Mapping_AppointmentUri_TestProperties()
{
Options.AppointmentUriOptions options = new();
- options.AssertEqualProperties((Sdk.Import.AppointmentUri)options);
+ options.AssertEqualProperties((Entities.AppointmentUri)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/AssignmentTests.cs b/src/tests/AssignmentTests.cs
index 87c4f50..1a41389 100644
--- a/src/tests/AssignmentTests.cs
+++ b/src/tests/AssignmentTests.cs
@@ -8,7 +8,7 @@ public class AssignmentTests
public void Mapping_Assignment_TestProperties()
{
Options.AssignmentOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Assignment)options);
+ options.AssertEqualProperties((Entities.Assignment)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/CaptionTests.cs b/src/tests/CaptionTests.cs
index 83ecec3..15aa2ec 100644
--- a/src/tests/CaptionTests.cs
+++ b/src/tests/CaptionTests.cs
@@ -8,7 +8,7 @@ public class CaptionTests
public void Mapping_Caption_TestProperties()
{
Options.CaptionOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Caption)options);
+ options.AssertEqualProperties((Entities.Caption)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/CategoryTests.cs b/src/tests/CategoryTests.cs
index 6f8fde7..accbaa8 100644
--- a/src/tests/CategoryTests.cs
+++ b/src/tests/CategoryTests.cs
@@ -9,16 +9,12 @@ public void Mapping_Category_TestProperties()
{
Options.CategoryOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
- Password = "Hello world",
- Delete = true,
+ Key = "Hello world",
Color = "GREEN",
Name = "CATEGORY"
};
- options.AssertEqualProperties((Sdk.Import.Category)options);
+ options.AssertEqualProperties((Entities.Category)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ContainerTests.cs b/src/tests/ContainerTests.cs
index 537ba22..d93dffc 100644
--- a/src/tests/ContainerTests.cs
+++ b/src/tests/ContainerTests.cs
@@ -8,7 +8,7 @@ public class ContainerTests
public void Mapping_Container_TestProperties()
{
Options.ContainerOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Container)options);
+ options.AssertEqualProperties((Entities.Container)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/Dime.Scheduler.CLI.Tests.csproj b/src/tests/Dime.Scheduler.CLI.Tests.csproj
index 6b42ef7..5b6dca0 100644
--- a/src/tests/Dime.Scheduler.CLI.Tests.csproj
+++ b/src/tests/Dime.Scheduler.CLI.Tests.csproj
@@ -1,20 +1,20 @@
- net7.0
- enable
+ net8.0
+ enable
false
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/src/tests/FilterGroupTests.cs b/src/tests/FilterGroupTests.cs
index 3048ea2..8bdd398 100644
--- a/src/tests/FilterGroupTests.cs
+++ b/src/tests/FilterGroupTests.cs
@@ -8,7 +8,7 @@ public class FilterGroupTests
public void Mapping_FilterGroup_TestProperties()
{
Options.FilterGroupOptions options = new();
- options.AssertEqualProperties((Sdk.Import.FilterGroup)options);
+ options.AssertEqualProperties((Entities.FilterGroup)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/FilterValueTests.cs b/src/tests/FilterValueTests.cs
index bc89119..25d453d 100644
--- a/src/tests/FilterValueTests.cs
+++ b/src/tests/FilterValueTests.cs
@@ -8,7 +8,7 @@ public class FilterValueTests
public void Mapping_FilterValue_TestProperties()
{
Options.FilterValueOptions options = new();
- options.AssertEqualProperties((Sdk.Import.FilterValue)options);
+ options.AssertEqualProperties((Entities.FilterValue)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/JobTests.cs b/src/tests/JobTests.cs
index 74320c8..a1affd8 100644
--- a/src/tests/JobTests.cs
+++ b/src/tests/JobTests.cs
@@ -1,6 +1,6 @@
using System;
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -13,7 +13,6 @@ public void Mapping_Job_TestProperties()
JobOptions options = new()
{
AllowDependencies = true,
- Append = true,
AvailableInGantt = true,
BillAddress = "ADDRESS",
BillAddressGeoLat = 51.055346M,
@@ -42,7 +41,6 @@ public void Mapping_Job_TestProperties()
CustomerNo = "TEST",
CustomerPhone = "TEST",
CustomerReference = "TEST",
- Delete = true,
Description = "TEST",
EnableManualSelection = true,
EndDate = new DateTime(2021, 01, 10, 10, 30, 0),
@@ -81,13 +79,12 @@ public void Mapping_Job_TestProperties()
FreeText7 = "FREE TEXT",
FreeText8 = "FREE TEXT",
FreeText9 = "FREE TEXT",
- Importance = Sdk.Import.Importance.High,
+ Importance = Importance.High,
JobNo = "TEST",
Language = "TEST",
Name = "TEST",
Note = "TEST",
OverRuleGanttPlanning = true,
- Password = "TEST",
Pin = "TEST",
Responsible = "TEST",
SentFromBackOffice = true,
@@ -127,8 +124,7 @@ public void Mapping_Job_TestProperties()
StartDate = new DateTime(2021, 1, 10, 10, 5, 0),
TimeMarker = "TEST",
Type = "TEST",
- Uri = "TEST",
- User = "TEST"
+ Key = "X-123"
};
options.AssertEqualProperties((Job)options);
diff --git a/src/tests/NotificationTests.cs b/src/tests/NotificationTests.cs
index 0a0eb0a..4af6a44 100644
--- a/src/tests/NotificationTests.cs
+++ b/src/tests/NotificationTests.cs
@@ -8,7 +8,7 @@ public class NotificationTests
public void Mapping_Notification_TestProperties()
{
Options.NotificationOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Notification)options);
+ options.AssertEqualProperties((Entities.Notification)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/PinTests.cs b/src/tests/PinTests.cs
index 6b245b9..071f16e 100644
--- a/src/tests/PinTests.cs
+++ b/src/tests/PinTests.cs
@@ -8,7 +8,7 @@ public class PinTests
public void Mapping_Pin_TestProperties()
{
Options.PinOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Pin)options);
+ options.AssertEqualProperties((Entities.Pin)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ResourceCalendarTests.cs b/src/tests/ResourceCalendarTests.cs
index 503892c..4eee098 100644
--- a/src/tests/ResourceCalendarTests.cs
+++ b/src/tests/ResourceCalendarTests.cs
@@ -8,7 +8,7 @@ public class ResourceCalendarTests
public void Mapping_ResourceCalendar_TestProperties()
{
Options.ResourceCalendarOptions options = new();
- options.AssertEqualProperties((Sdk.Import.ResourceCalendar)options);
+ options.AssertEqualProperties((Entities.ResourceCalendar)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ResourceCapacityTests.cs b/src/tests/ResourceCapacityTests.cs
index 09c79d2..7d0ee1a 100644
--- a/src/tests/ResourceCapacityTests.cs
+++ b/src/tests/ResourceCapacityTests.cs
@@ -8,7 +8,7 @@ public class ResourceCapacityTests
public void Mapping_ResourceCapacity_TestProperties()
{
Options.ResourceCapacityOptions options = new();
- options.AssertEqualProperties((Sdk.Import.ResourceCapacity)options);
+ options.AssertEqualProperties((Entities.ResourceCapacity)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ResourceFilterValueTests.cs b/src/tests/ResourceFilterValueTests.cs
index e9e0fef..96344e7 100644
--- a/src/tests/ResourceFilterValueTests.cs
+++ b/src/tests/ResourceFilterValueTests.cs
@@ -8,7 +8,7 @@ public class ResourceFilterValueTests
public void Mapping_ResourceFilterValue_TestProperties()
{
Options.ResourceFilterValueOptions options = new();
- options.AssertEqualProperties((Sdk.Import.ResourceFilterValue)options);
+ options.AssertEqualProperties((Entities.ResourceFilterValue)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ResourceLiveLocationTests.cs b/src/tests/ResourceLiveLocationTests.cs
index a23ff8f..09651cf 100644
--- a/src/tests/ResourceLiveLocationTests.cs
+++ b/src/tests/ResourceLiveLocationTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,11 +11,7 @@ public void Mapping_ResourceLiveLocation_TestProperties()
{
ResourceLiveLocationOptions options = new()
{
- Append = true,
- User = "Hello world",
- Uri = "Hello world",
- Password = "Hello world",
- Delete = true,
+ Key = "X-123",
Latitude = 35.25M,
Longitude = 15.15M,
ResourceNo = "RESOURCENO"
diff --git a/src/tests/ResourceTests.cs b/src/tests/ResourceTests.cs
index d798889..b3f77f4 100644
--- a/src/tests/ResourceTests.cs
+++ b/src/tests/ResourceTests.cs
@@ -8,7 +8,7 @@ public class ResourceTests
public void Mapping_Resource_TestProperties()
{
Options.ResourceOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Resource)options);
+ options.AssertEqualProperties((Entities.Resource)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/ResourceUriTests.cs b/src/tests/ResourceUriTests.cs
index 571abe6..5ad7c16 100644
--- a/src/tests/ResourceUriTests.cs
+++ b/src/tests/ResourceUriTests.cs
@@ -8,7 +8,7 @@ public class ResourceUriTests
public void Mapping_ResourceUri_TestProperties()
{
Options.ResourceUriOptions options = new();
- options.AssertEqualProperties((Sdk.Import.ResourceUri)options);
+ options.AssertEqualProperties((Entities.ResourceUri)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/TaskContainerTests.cs b/src/tests/TaskContainerTests.cs
index 74e2bdc..6d29ff3 100644
--- a/src/tests/TaskContainerTests.cs
+++ b/src/tests/TaskContainerTests.cs
@@ -1,5 +1,5 @@
using Dime.Scheduler.CLI.Options;
-using Dime.Scheduler.Sdk.Import;
+using Dime.Scheduler.Entities;
using Xunit;
namespace Dime.Scheduler.CLI.Tests
@@ -11,13 +11,9 @@ public void Mapping_TaskContainer_TestProperties()
{
TaskContainerOptions options = new()
{
- Append = true,
- Delete = true,
- Password = "Hello world",
+ Key = "Hello world",
SourceApp = "Hello world",
SourceType = "Hello world",
- Uri = "Hello world",
- User = "Hello world",
TaskNo = "Hello world",
Name = "Hello world",
JobNo = "Hello world",
diff --git a/src/tests/TaskFilterValueTests.cs b/src/tests/TaskFilterValueTests.cs
index 122e839..645f49f 100644
--- a/src/tests/TaskFilterValueTests.cs
+++ b/src/tests/TaskFilterValueTests.cs
@@ -8,7 +8,7 @@ public class TaskFilterValueTests
public void Mapping_TaskFilterValue_TestProperties()
{
Options.TaskFilterValueOptions options = new();
- options.AssertEqualProperties((Sdk.Import.TaskFilterValue)options);
+ options.AssertEqualProperties((Entities.TaskFilterValue)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/TaskLockedTests.cs b/src/tests/TaskLockedTests.cs
index 7bcddae..457eb10 100644
--- a/src/tests/TaskLockedTests.cs
+++ b/src/tests/TaskLockedTests.cs
@@ -8,7 +8,7 @@ public class TaskLockedTests
public void Mapping_TaskLocked_TestProperties()
{
Options.TaskLockedOptions options = new();
- options.AssertEqualProperties((Sdk.Import.TaskLocked)options);
+ options.AssertEqualProperties((Entities.TaskLocked)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/TaskTests.cs b/src/tests/TaskTests.cs
index 4480fcf..615f6bd 100644
--- a/src/tests/TaskTests.cs
+++ b/src/tests/TaskTests.cs
@@ -8,7 +8,7 @@ public class TaskTests
public void Mapping_Task_TestProperties()
{
Options.TaskOptions options = new();
- options.AssertEqualProperties((Sdk.Import.Task)options);
+ options.AssertEqualProperties((Entities.Task)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/TaskUriTests.cs b/src/tests/TaskUriTests.cs
index c5f6c1a..b8d9380 100644
--- a/src/tests/TaskUriTests.cs
+++ b/src/tests/TaskUriTests.cs
@@ -8,7 +8,7 @@ public class TaskUriTests
public void Mapping_TaskUri_TestProperties()
{
Options.TaskUriOptions options = new();
- options.AssertEqualProperties((Sdk.Import.TaskUri)options);
+ options.AssertEqualProperties((Entities.TaskUri)options);
}
}
}
\ No newline at end of file
diff --git a/src/tests/TimeMarkerTests.cs b/src/tests/TimeMarkerTests.cs
index 8ab1348..4d2d316 100644
--- a/src/tests/TimeMarkerTests.cs
+++ b/src/tests/TimeMarkerTests.cs
@@ -8,7 +8,7 @@ public class TimeMarkerTests
public void Mapping_TimeMarker_TestProperties()
{
Options.TimeMarkerOptions options = new();
- options.AssertEqualProperties((Sdk.Import.TimeMarker)options);
+ options.AssertEqualProperties((Entities.TimeMarker)options);
}
}
}
\ No newline at end of file