- /// The pascal cased method name as loaded by
- /// Uses mapping of request implementations in the OSC code base
- ///
- public string MethodName { get; }
-
- public string ApiName { get; }
-
- public string RequestName => $"{ApiName}Request";
-
- public string ResponseName
- {
- get
- {
- if (Namespace == "Cat") return $"CatResponse<{ApiName}Record>";
- else if (ApiName.EndsWith("Exists")) return $"ExistsResponse";
-
- var generatedName = $"{ApiName}Response";
- var name = CodeConfiguration.ResponseLookup.TryGetValue(generatedName, out var lookup) ? lookup.Item1 : generatedName;
- return name;
- }
- }
- public string RequestInterfaceName => $"I{RequestName}";
- public string ParametersName => $"{RequestName}Parameters";
- public string DescriptorName => $"{ApiName}Descriptor";
-
- public const string ApiNamespace = "Specification";
- public const string ApiNamespaceSuffix = "Api";
- public const string RootNamespace = "NoNamespace";
- public const string LowLevelClientNamespacePrefix = "LowLevel";
- public const string HighLevelClientNamespacePrefix = "";
- public const string ClientNamespaceSuffix = "Namespace";
- private static string CreateCSharpNamespace(string endpointNamespace)
- {
- switch (endpointNamespace)
- {
- case null:
- case "": return RootNamespace;
- default: return endpointNamespace.ToPascalCase();
- }
- }
-
- public string PerPathMethodName(string path)
- {
- Func