[#19] Client: Use specific classes for search
Signed-off-by: Pavel Gross <p.gross@yando.com>
This commit is contained in:
parent
3206abc33e
commit
35fe791406
27 changed files with 320 additions and 123 deletions
28
src/FrostFS.SDK.ModelsV2/Client/ClientSettings.cs
Normal file
28
src/FrostFS.SDK.ModelsV2/Client/ClientSettings.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace FrostFS.SDK.ModelsV2;
|
||||
|
||||
public class ClientSettings
|
||||
{
|
||||
private static readonly string errorTemplate = "{0} is required parameter";
|
||||
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
public string Host { get; set; } = string.Empty;
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
StringBuilder? error = null;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Key))
|
||||
(error ??= new StringBuilder()).AppendLine(string.Format(errorTemplate, nameof(Key)));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Host))
|
||||
(error ??= new StringBuilder()).AppendLine(string.Format(errorTemplate, nameof(Host)));
|
||||
|
||||
if (error != null)
|
||||
throw new ArgumentException(error.ToString());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue