File tree Expand file tree Collapse file tree 3 files changed +74
-0
lines changed
Interfaces/General/Networks Expand file tree Collapse file tree 3 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1
1
using FluentAssertions ;
2
2
using Meraki . Api . Data ;
3
+ using Meraki . Api . Extensions ;
3
4
using System . Net ;
4
5
using Xunit . Abstractions ;
5
6
@@ -101,4 +102,14 @@ public async Task BasicCrud_Succeeds()
101
102
_ = exception . StatusCode . Should ( ) . Be ( HttpStatusCode . NotFound ) ;
102
103
103
104
}
105
+
106
+ [ Fact ]
107
+ public async Task GetNetworkClientsAll_Succeeds ( )
108
+ {
109
+ TestMerakiClient . Statistics . Reset ( ) ;
110
+ var networks = await TestMerakiClient . Organizations . Networks . GetOrganizationNetworksAllAsync ( TestOrganizationId ) ;
111
+ var network = networks [ 0 ] ;
112
+ var clients = await TestMerakiClient . Networks . Clients . GetNetworkClientsAllAsync ( network . Id , cancellationToken : default ) ;
113
+ _ = clients . Should ( ) . NotBeNull ( ) ;
114
+ }
104
115
}
Original file line number Diff line number Diff line change
1
+ namespace Meraki . Api . Extensions ;
2
+
3
+ public static class INetworkClientsExtensions
4
+ {
5
+ public static Task < List < Client > > GetNetworkClientsAllAsync (
6
+ this NetworksClientsSection networkClients ,
7
+ string networkId ,
8
+ string t0 = null ! ,
9
+ double ? timespan = null ,
10
+ string ? statuses = null ,
11
+ string ? ip = null ,
12
+ string ? ip6 = null ,
13
+ string ? ip6Local = null ,
14
+ string ? mac = null ,
15
+ string ? os = null ,
16
+ string ? pskGroup = null ,
17
+ string ? description = null ,
18
+ List < string > ? recentDeviceConnections = null ,
19
+ CancellationToken cancellationToken = default )
20
+ => MerakiClient . GetAllAsync (
21
+ ( startingAfter , endingBefore , cancellationToken )
22
+ => networkClients . Clients . GetNetworkClientsApiResponseAsync (
23
+ networkId ,
24
+ t0 ,
25
+ timespan ,
26
+ 1000 ,
27
+ startingAfter ,
28
+ endingBefore ,
29
+ statuses ,
30
+ ip ,
31
+ ip6 ,
32
+ ip6Local ,
33
+ mac ,
34
+ os ,
35
+ pskGroup ,
36
+ description ,
37
+ recentDeviceConnections ,
38
+ cancellationToken
39
+ ) ,
40
+ cancellationToken
41
+ ) ;
42
+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,27 @@ Task<List<Client>> GetNetworkClientsAsync(
42
42
[ AliasAs ( "recentDeviceConnections[]" ) ] List < string > ? recentDeviceConnections = null ,
43
43
CancellationToken cancellationToken = default ) ;
44
44
45
+ [ ApiOperationId ( "getNetworkClients" ) ]
46
+ [ Get ( "/networks/{networkId}/clients" ) ]
47
+ [ QueryUriFormat ( UriFormat . Unescaped ) ]
48
+ internal Task < ApiResponse < List < Client > > > GetNetworkClientsApiResponseAsync (
49
+ string networkId ,
50
+ string t0 = null ! ,
51
+ double ? timespan = null ,
52
+ int ? perPage = null ,
53
+ string ? startingAfter = null ,
54
+ string ? endingBefore = null ,
55
+ string ? statuses = null ,
56
+ string ? ip = null ,
57
+ string ? ip6 = null ,
58
+ string ? ip6Local = null ,
59
+ string ? mac = null ,
60
+ string ? os = null ,
61
+ string ? pskGroup = null ,
62
+ string ? description = null ,
63
+ [ AliasAs ( "recentDeviceConnections[]" ) ] List < string > ? recentDeviceConnections = null ,
64
+ CancellationToken cancellationToken = default ) ;
65
+
45
66
/// <summary>
46
67
/// Return the client associated with the given identifier. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses Track-by-IP.
47
68
/// </summary>
You can’t perform that action at this time.
0 commit comments