namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems;
///
/// Defines a callable HTTP method on an external system definition.
///
public class ExternalSystemMethod
{
/// Primary key.
public int Id { get; set; }
/// Foreign key referencing the owning ExternalSystemDefinition.
public int ExternalSystemDefinitionId { get; set; }
/// Name of the method as referenced in scripts.
public string Name { get; set; }
/// HTTP method (GET, POST, PUT, DELETE, etc.).
public string HttpMethod { get; set; }
/// URL path relative to the external system's base URL.
public string Path { get; set; }
/// JSON-serialized parameter definitions for this method, or null if there are none.
public string? ParameterDefinitions { get; set; }
/// JSON-serialized return type definition for this method, or null if void.
public string? ReturnDefinition { get; set; }
/// Initializes a new instance of with the required fields.
/// The method name.
/// The HTTP method verb.
/// The URL path.
public ExternalSystemMethod(string name, string httpMethod, string path)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
HttpMethod = httpMethod ?? throw new ArgumentNullException(nameof(httpMethod));
Path = path ?? throw new ArgumentNullException(nameof(path));
}
}