Skip to content
6 changes: 3 additions & 3 deletions examples/csharp/src/Twilio/Rest/Api/V2010/AccountOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ public override List<KeyValuePair<string, string>> GetParams()
}
if (DateTest != null)
{
p.Add(new KeyValuePair<string, string>("DateTest", DateTest.Value.ToString("yyyy-MM-dd")));
p.Add(new KeyValuePair<string, string>("Date.Test", DateTest.Value.ToString("yyyy-MM-dd")));
}
if (DateCreatedBefore != null)
{
p.Add(new KeyValuePair<string, string>("DateCreatedBefore", Serializers.DateTimeIso8601(DateCreatedBefore)));
p.Add(new KeyValuePair<string, string>("DateCreated<", Serializers.DateTimeIso8601(DateCreatedBefore)));
}
if (DateCreatedAfter != null)
{
p.Add(new KeyValuePair<string, string>("DateCreatedAfter", Serializers.DateTimeIso8601(DateCreatedAfter)));
p.Add(new KeyValuePair<string, string>("DateCreated>", Serializers.DateTimeIso8601(DateCreatedAfter)));
}
if (PageSize != null)
{
Expand Down
12 changes: 6 additions & 6 deletions examples/csharp/unit-test/Rest/TwilioRestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ public void TestShouldSupportNestedPropertiesResponse()
var list = new List<KeyValuePair<string, string>>();
list.Add(new KeyValuePair<string, string>("DateCreated<",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateCreated>",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateTest", formattedDate));
list.Add(new KeyValuePair<string, string>("DateCreatedBefore",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateCreatedAfter",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("Date.Test", formattedDate));
list.Add(new KeyValuePair<string, string>("DateCreated<",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateCreated>",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("PageSize", "4"));

var request1 = new Request(
Expand Down Expand Up @@ -367,7 +367,7 @@ public void TestShouldSupportArrayOfObjectResponse()
string formattedDateTime = Serializers.DateTimeIso8601(currentDateTime);
var list = new List<KeyValuePair<string, string>>();
list.Add(new KeyValuePair<string, string>("DateCreated",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateTest", formattedDate));
list.Add(new KeyValuePair<string, string>("Date.Test", formattedDate));
list.Add(new KeyValuePair<string, string>("PageSize", "4"));

var request1 = new Request(
Expand Down Expand Up @@ -417,7 +417,7 @@ public void TestShouldSupportDeserializationTypes()
string formattedDateTime = Serializers.DateTimeIso8601(currentDateTime);
var list = new List<KeyValuePair<string, string>>();
list.Add(new KeyValuePair<string, string>("DateCreated",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateTest", formattedDate));
list.Add(new KeyValuePair<string, string>("Date.Test", formattedDate));
list.Add(new KeyValuePair<string, string>("PageSize", "4"));

var request1 = new Request(
Expand Down Expand Up @@ -615,7 +615,7 @@ public async System.Threading.Tasks.Task TestShouldMakeValidAPICallAccountReadAs
string formattedDateTime = Serializers.DateTimeIso8601(currentDateTime);
var list = new List<KeyValuePair<string, string>>();
list.Add(new KeyValuePair<string, string>("DateCreated",formattedDateTime ));
list.Add(new KeyValuePair<string, string>("DateTest", formattedDate));
list.Add(new KeyValuePair<string, string>("Date.Test", formattedDate));
list.Add(new KeyValuePair<string, string>("PageSize", "4"));

var request1 = new Request(
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/twilio-csharp/options/GetParams.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
{{#isArray}}
if ({{paramName}} != null)
{
p.AddRange({{paramName}}.Select({{paramName}} => new KeyValuePair<string, string>("{{paramName}}", {{{vendorExtensions.x-param-to-string}}})));
p.AddRange({{paramName}}.Select({{paramName}} => new KeyValuePair<string, string>("{{{baseName}}}", {{{vendorExtensions.x-param-to-string}}})));
}
{{/isArray}}
{{^isArray}}
{{^isMap}}
if ({{paramName}} != null)
{
p.Add(new KeyValuePair<string, string>("{{paramName}}", {{{vendorExtensions.x-param-to-string}}}));
p.Add(new KeyValuePair<string, string>("{{{baseName}}}", {{{vendorExtensions.x-param-to-string}}}));
Copy link
Contributor

@sbansla sbansla Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change needs to be done in case of map and array as well and Test by generating code.

}
{{/isMap}}
{{/isArray}}
{{#isMap}}
if ({{paramName}} != null)
{
p.AddRange(PrefixedCollapsibleMap.Serialize({{paramName}}, "{{{vendorExtensions.x-map-value}}}"));
p.AddRange(PrefixedCollapsibleMap.Serialize({{{baseName}}}, "{{{vendorExtensions.x-map-value}}}"));
}
{{/isMap}}
{{#vendorExtensions.x-before-or-after}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
{{#isArray}}
if ({{paramName}} != null)
{
p.AddRange({{paramName}}.Select({{paramName}} => new KeyValuePair<string, string>("{{baseName}}", {{{vendorExtensions.x-param-to-string}}})));
p.AddRange({{paramName}}.Select({{paramName}} => new KeyValuePair<string, string>("{{{baseName}}}", {{{vendorExtensions.x-param-to-string}}})));
}
{{/isArray}}
{{^isArray}}
if ({{paramName}} != null)
{
p.Add(new KeyValuePair<string, string>("{{baseName}}", {{{vendorExtensions.x-param-to-string}}}));
p.Add(new KeyValuePair<string, string>("{{{baseName}}}", {{{vendorExtensions.x-param-to-string}}}));
}
{{/isArray}}
{{/vendorExtensions.x-header-params}}
Expand Down