@@ -135,30 +135,41 @@ public async Task<IEnumerable<Activity>> GetActivities(IEnumerable<string> ids =
135135 throw StreamException . FromResponse ( response ) ;
136136 }
137137
138- public async Task < IEnumerable < EnrichedActivity > > GetEnrichedFlatActivities ( IEnumerable < string > ids = null , ReactionOption reactions = null , IEnumerable < ForeignIDTime > foreignIDTimes = null )
138+ public async Task < IEnumerable < EnrichedActivity > > GetEnrichedActivities ( IEnumerable < string > ids , GetOptions options = null )
139139 {
140- if ( ids == null && foreignIDTimes == null )
141- throw new ArgumentException ( "one of the parameters ids or foreignIdTimes must be provided and not null" , "ids, foreignIDTimes" ) ;
142- if ( ids != null && foreignIDTimes != null )
143- throw new ArgumentException ( "at most one of the parameters ids or foreignIdTimes must be provided" , "ids, foreignIDTimes" ) ;
140+ if ( ids == null || ids . Count ( ) == 0 )
141+ throw new ArgumentException ( "Activity ids must be provided." , nameof ( ids ) ) ;
142+
143+ return await GetEnrichedActivities ( ids , null , options ) ;
144+ }
145+
146+
147+ public async Task < IEnumerable < EnrichedActivity > > GetEnrichedActivities ( IEnumerable < ForeignIDTime > foreignIDTimes , GetOptions options = null )
148+ {
149+ if ( foreignIDTimes == null || foreignIDTimes . Count ( ) == 0 )
150+ throw new ArgumentException ( "ForeignIDTimes must be provided." , nameof ( foreignIDTimes ) ) ;
144151
152+ return await GetEnrichedActivities ( null , foreignIDTimes , options ) ;
153+ }
154+
155+
156+ private async Task < IEnumerable < EnrichedActivity > > GetEnrichedActivities ( IEnumerable < string > ids = null , IEnumerable < ForeignIDTime > foreignIDTimes = null , GetOptions options = null )
157+ {
145158 var request = _client . BuildAppRequest ( "enrich/activities/" , HttpMethod . GET ) ;
146- if ( ids != null )
159+
160+ if ( ids != null && ids . Any ( ) )
147161 {
148162 request . AddQueryParameter ( "ids" , string . Join ( "," , ids ) ) ;
149163 }
150164
151- if ( foreignIDTimes != null )
165+ if ( foreignIDTimes != null && foreignIDTimes . Any ( ) )
152166 {
153167 request . AddQueryParameter ( "foreign_ids" , string . Join ( "," , foreignIDTimes . Select ( f => f . ForeignID ) ) ) ;
154168 request . AddQueryParameter ( "timestamps" , string . Join ( "," , foreignIDTimes . Select ( f =>
155169 f . Time . ToString ( "s" , System . Globalization . CultureInfo . InvariantCulture ) ) ) ) ;
156170 }
157171
158- if ( reactions != null )
159- {
160- reactions . Apply ( request ) ;
161- }
172+ options ? . Apply ( request ) ;
162173
163174 var response = await _client . MakeRequest ( request ) ;
164175
0 commit comments