You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Repeated enum query parameters end up with two properties: a single
76
100
// one, and a Repeatable<T> (where the T is always non-nullable, whether or not the parameter
77
101
// is optional). If both properties are set, we fail. Note that this delegate is called
@@ -81,22 +105,22 @@ public static IDictionary<string, object> CreateParameterDictionary(object reque
81
105
if(existingValueisnull&&valueisobject)
82
106
{
83
107
// Overwrite null value with non-null value
84
-
dict[name]=value;
108
+
dict[name]=newParameterValue(type,value);
85
109
}
86
110
elseif(valueisnull)
87
111
{
88
112
// Ignore new null value
89
113
}
90
114
else
91
115
{
92
-
// Throw if we see a second null value
116
+
// Throw if we see a second non-null value
93
117
thrownewInvalidOperationException(
94
118
$"The query parameter '{name}' is set by multiple properties. For repeated enum query parameters, ensure that only one property is set to a non-null value.");
95
119
}
96
120
}
97
121
else
98
122
{
99
-
dict.Add(name,value);
123
+
dict.Add(name,newParameterValue(type,value));
100
124
}
101
125
});
102
126
returndict;
@@ -108,8 +132,8 @@ public static IDictionary<string, object> CreateParameterDictionary(object reque
/// Expands a dictionary of typed parameters into a sequence of <see cref="TypedParameter"/> instances.
175
+
/// </summary>
176
+
/// <remarks>
177
+
/// If a parameter value implements <see cref="System.Collections.IEnumerable"/> (and is not a <see cref="string"/>), it is expanded into
178
+
/// multiple <see cref="TypedParameter"/> instances with the same name and <see cref="RequestParameterType"/>.
179
+
/// This supports repeatable parameters represented as <see cref="Google.Apis.Util.Repeatable{T}"/> (which is <see cref="System.Collections.IEnumerable"/>) and other
180
+
/// enumerable values.
181
+
/// </remarks>
182
+
/// <param name="dictionary">
183
+
/// A dictionary where the key is the parameter name and the value is a <see cref="ParameterValue"/> containing both
184
+
/// the parameter type and raw value.
185
+
/// </param>
186
+
/// <returns>
187
+
/// An enumerable of <see cref="TypedParameter"/> instances, with enumerable values expanded into repeated parameters.
0 commit comments