// ------------------------------------------------------------------------------
//  Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

// **NOTE** This file was generated by a tool and any changes will be overwritten.


namespace Microsoft.Graph
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    /// <summary>
    /// The type WorkbookFunctionsSydRequestBuilder.
    /// </summary>
    public partial class WorkbookFunctionsSydRequestBuilder : BaseActionMethodRequestBuilder<IWorkbookFunctionsSydRequest>, IWorkbookFunctionsSydRequestBuilder
    {
        /// <summary>
        /// Constructs a new <see cref="WorkbookFunctionsSydRequestBuilder"/>.
        /// </summary>
        /// <param name="requestUrl">The URL for the request.</param>
        /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
        /// <param name="cost">A cost parameter for the OData method call.</param>
        /// <param name="salvage">A salvage parameter for the OData method call.</param>
        /// <param name="life">A life parameter for the OData method call.</param>
        /// <param name="per">A per parameter for the OData method call.</param>
        public WorkbookFunctionsSydRequestBuilder(
            string requestUrl,
            IBaseClient client,
            Newtonsoft.Json.Linq.JToken cost,
            Newtonsoft.Json.Linq.JToken salvage,
            Newtonsoft.Json.Linq.JToken life,
            Newtonsoft.Json.Linq.JToken per)
            : base(requestUrl, client)
        {
            this.SetParameter("cost", cost, true);
            this.SetParameter("salvage", salvage, true);
            this.SetParameter("life", life, true);
            this.SetParameter("per", per, true);
        }

        /// <summary>
        /// A method used by the base class to construct a request class instance.
        /// </summary>
        /// <param name="functionUrl">The request URL to </param>
        /// <param name="options">The query and header options for the request.</param>
        /// <returns>An instance of a specific request class.</returns>
        protected override IWorkbookFunctionsSydRequest CreateRequest(string functionUrl, IEnumerable<Option> options)
        {
            var request = new WorkbookFunctionsSydRequest(functionUrl, this.Client, options);

            if (this.HasParameter("cost"))
            {
                request.RequestBody.Cost = this.GetParameter<Newtonsoft.Json.Linq.JToken>("cost");
            }

            if (this.HasParameter("salvage"))
            {
                request.RequestBody.Salvage = this.GetParameter<Newtonsoft.Json.Linq.JToken>("salvage");
            }

            if (this.HasParameter("life"))
            {
                request.RequestBody.Life = this.GetParameter<Newtonsoft.Json.Linq.JToken>("life");
            }

            if (this.HasParameter("per"))
            {
                request.RequestBody.Per = this.GetParameter<Newtonsoft.Json.Linq.JToken>("per");
            }

            return request;
        }
    }
}
