Skip to content

Commit

Permalink
fix: UniqueId is now lowercase
Browse files Browse the repository at this point in the history
Signed-off-by: JobaDiniz <[email protected]>
  • Loading branch information
JobaDiniz committed Aug 11, 2023
1 parent 2feb770 commit 228fa81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Joba.IBM.RPA.Cli/Client/RpaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public async Task<string> GetContentAsync(Guid scriptVersionId, CancellationToke
return await client.GetStringAsync(url, cancellation);
}
}

class AccountResource : IAccountResource
{
private readonly HttpClient client;
Expand Down
8 changes: 4 additions & 4 deletions src/Joba.IBM.RPA/UniqueId.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
namespace Joba.IBM.RPA
{
/// <summary>
/// Must only contain latin letters (a-z, A-Z), numbers (0-9), underscores ( _ ) and cannot start with a number.
/// Must only contain lowercase latin letters (a-z), numbers (0-9), underscores ( _ ) and cannot start with a number.
/// </summary>
public struct UniqueId
public readonly struct UniqueId
{
private readonly string uniqueId;

public UniqueId(string name)
{
Original = name;
//TODO: use regex to replace everything except the allowed values.
uniqueId = name.Replace(" ", "_").Replace("-", "_");
//TODO: use regex to replace everything except the allowed values: @"^[a-z_]([a-z0-9_]+)?$"
uniqueId = name.ToLower().Replace(" ", "_").Replace("-", "_");
}

public string Original { get; }
Expand Down

0 comments on commit 228fa81

Please sign in to comment.