Skip to content

Commit 15138f0

Browse files
authored
Implement IUrlParameter on Time (#3222)
* Implement IUrlParameter on Time This commit implements IUrlParameter on Time so that the conversion to a string value happens when building the url. Add condition to ElasticsearchUrlFormatter to convert TimeSpan to Time unit string value when building the url. Remove special case handling for Time and TimeSpan and re-run API generation Fixes #3220 * Remove superfluous code
1 parent 28ac57d commit 15138f0

File tree

6 files changed

+255
-241
lines changed

6 files changed

+255
-241
lines changed

src/CodeGeneration/ApiGenerator/Domain/ApiQueryParameters.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,9 @@ public string TypeHighLevel
4848
public string ClsArgumentName => this.ClsName.ToCamelCase();
4949
public string DescriptorArgumentType =>
5050
this.Type == "list" && this.TypeHighLevel.EndsWith("[]") ? "params " + this.TypeHighLevel : TypeHighLevel;
51-
public string SetterHighLevel
52-
{
53-
get
54-
{
55-
var setter = "value";
56-
if (this.TypeHighLevel == "Time") setter += ".ToString()";
57-
return setter;
58-
}
59-
}
60-
public string SetterLowLevel
61-
{
62-
get
63-
{
64-
var setter = "value";
65-
if (this.TypeLowLevel == "TimeSpan") setter += ".ToTimeUnit()";
66-
return setter;
67-
}
68-
}
51+
public string SetterHighLevel => "value";
52+
53+
public string SetterLowLevel => "value";
6954

7055
public bool IsFieldsParam => this.TypeHighLevel == "Fields";
7156
public bool IsFieldParam => this.TypeHighLevel == "Field";

0 commit comments

Comments
 (0)