-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
ClientIdOrName
parameter to allow editing/deleting clients by…
… ID or name.
- Loading branch information
1 parent
36ee5d9
commit 6314a7a
Showing
8 changed files
with
103 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using FluentResults; | ||
using HQ.Abstractions.Clients; | ||
using HQ.SDK; | ||
using Spectre.Console; | ||
using Spectre.Console.Cli; | ||
using Spectre.Console.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json; | ||
using System.Threading.Tasks; | ||
|
||
namespace HQ.CLI.Commands.Clients | ||
{ | ||
internal class CreateClientSettings : HQCommandSettings | ||
{ | ||
} | ||
|
||
internal class CreateClientCommand : AsyncCommand<CreateClientSettings> | ||
{ | ||
private readonly HQServiceV1 _hqService; | ||
|
||
public CreateClientCommand(HQServiceV1 hqService) | ||
{ | ||
_hqService = hqService; | ||
} | ||
|
||
public override async Task<int> ExecuteAsync(CommandContext context, CreateClientSettings settings) | ||
{ | ||
var model = new CreateClientV1.Request(); | ||
|
||
var Createor = new YAMLEditor<CreateClientV1.Request>(model, async (value) => | ||
{ | ||
return await _hqService.CreateClientV1(value); | ||
}); | ||
|
||
var rc = await Createor.Launch(); | ||
return rc; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters