예제 #1
0
        internal static async Task DeleteAsync(
            IContractApiHttp contractApiHttp,
            DeviceRegistrationState deviceRegistrationState,
            CancellationToken cancellationToken)
        {
            /* SRS_REGISTRATION_STATUS_MANAGER_28_004: [The DeleteAsync shall throw ArgumentException if the provided deviceRegistrationState is null.] */
            if (deviceRegistrationState == null)
            {
                throw new ArgumentNullException(nameof(deviceRegistrationState));
            }

            /* SRS_REGISTRATION_STATUS_MANAGER_28_005: [The DeleteAsync shall sent the Delete HTTP request to remove the deviceRegistrationState.] */
            await contractApiHttp.RequestAsync(
                HttpMethod.Delete,
                GetDeviceRegistrationStatusUri(deviceRegistrationState.RegistrationId),
                null,
                null,
                deviceRegistrationState.ETag,
                cancellationToken).ConfigureAwait(false);
        }
        internal static async Task DeleteAsync(
            IContractApiHttp contractApiHttp,
            DeviceRegistrationState deviceRegistrationState,
            CancellationToken cancellationToken)
        {
            if (deviceRegistrationState == null)
            {
                throw new ArgumentNullException(nameof(deviceRegistrationState));
            }

            await contractApiHttp
            .RequestAsync(
                HttpMethod.Delete,
                GetDeviceRegistrationStatusUri(deviceRegistrationState.RegistrationId),
                null,
                null,
                deviceRegistrationState.ETag,
                cancellationToken)
            .ConfigureAwait(false);
        }