Example #1
0
        private ReportingClient(string baseUrl, IRestConnection restConnection)
        {
            restConnection.Setup(baseUrl, null);

            Device  = new DeviceClient(baseUrl, restConnection);
            Network = new NetworkClient(baseUrl, restConnection);
        }
Example #2
0
 /// <summary>
 /// Logs in with the specified network. Note that you can be logged in with only one device or one network for any <see cref="ReportingClient"/> instance.
 /// </summary>
 /// <param name="networkId">Unique network identifier</param>
 /// <param name="networkKey">Api key of the network, or any of the encosing networks, or the enclosing service</param>
 public void SetNetwork(string networkId, string networkKey)
 {
     _restConnection.Setup(_baseUrl,
                           new Dictionary <string, string>
     {
         { "X-NetworkId", networkId },
         { "X-NetworkKey", networkKey }
     });
 }
Example #3
0
 private OccasionallyConnectionClient(string baseUrl, string deviceId, string apiKey, IRestConnection restConnection)
 {
     _restConnection = restConnection;
     _restConnection.Setup(baseUrl, new Dictionary <string, string>
     {
         { "X-DeviceId", deviceId },
         { "X-ApiKey", apiKey }
     });
 }
Example #4
0
 /// <summary>
 /// Logs in with the specified device. Note that you can be logged in with only one device or one network for any <see cref="ReportingClient"/> instance.
 /// </summary>
 /// <param name="deviceId">Unique device identifier</param>
 /// <param name="deviceKey">Api key of the device, or any of the encosing networks, or the enclosing service</param>
 public void SetDevice(string deviceId, string deviceKey)
 {
     _restConnection.Setup(_baseUrl,
                           new Dictionary <string, string>
     {
         { "X-DeviceId", deviceId },
         { "X-DeviceKey", deviceKey }
     });
 }
Example #5
0
        private ManagementClient(string baseUrl, IRestConnection restConnection)
        {
            restConnection.Setup(baseUrl, null);

            User    = new UserManagementClient(baseUrl, restConnection);
            Company = new CompanyManagementClient(restConnection);
            Service = new ServiceManagementClient(restConnection);
            Network = new NetworkManagementClient(restConnection);
            Device  = new DeviceManagementClient(restConnection);
            TelemetryDataSinksMetadata = new TelemetryDataSinksMetadataClient(restConnection);
        }