// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
namespace Microsoft.Graph
{
using System.Collections.Generic;
using System.Net.Http;
///
/// A single batch request step.
///
public class BatchRequestStep
{
///
/// A unique batch request id property.
///
public string RequestId { get; private set; }
///
/// A http request message for an individual batch request operation.
///
public HttpRequestMessage Request { get; private set; }
///
/// An OPTIONAL array of batch request ids specifying the order of execution for individual batch requests.
///
public List DependsOn { get; set; }
///
/// Constructs a new .
///
/// A unique batch request id.
/// A http request message for an individual batch request operation.
/// An OPTIONAL array of batch request ids specifying the order of execution for individual batch requests.
public BatchRequestStep(string requestId, HttpRequestMessage httpRequestMessage, List dependsOn = null)
{
RequestId = (!string.IsNullOrEmpty(requestId)) ? requestId : throw new ClientException(
new Error
{
Code = ErrorConstants.Codes.InvalidArgument,
Message = string.Format(ErrorConstants.Messages.NullParameter, nameof(requestId))
});
Request = httpRequestMessage ?? throw new ClientException(new Error
{
Code = ErrorConstants.Codes.InvalidArgument,
Message = string.Format(ErrorConstants.Messages.NullParameter, nameof(httpRequestMessage))
});
DependsOn = dependsOn;
}
}
}