Beispiel #1
0
        /// <summary>
        /// The collection of pages in the section.  Read-only. Nullable.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "The collection of pages in the section.  Read-only. Nullable.";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var sectionGroupIdOption = new Option <string>("--section-group-id", description: "key: id of sectionGroup")
            {
            };

            sectionGroupIdOption.IsRequired = true;
            command.AddOption(sectionGroupIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var onenotePageIdOption = new Option <string>("--onenote-page-id", description: "key: id of onenotePage")
            {
            };

            onenotePageIdOption.IsRequired = true;
            command.AddOption(onenotePageIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId                = (string)parameters[0];
                var siteId                 = (string)parameters[1];
                var sectionGroupId         = (string)parameters[2];
                var onenoteSectionId       = (string)parameters[3];
                var onenotePageId          = (string)parameters[4];
                var select                 = (string[])parameters[5];
                var expand                 = (string[])parameters[6];
                var output                 = (FormatterType)parameters[7];
                var query                  = (string)parameters[8];
                var jsonNoIndent           = (bool)parameters[9];
                var outputFilter           = (IOutputFilter)parameters[10];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[11];
                var cancellationToken      = (CancellationToken)parameters[12];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                    q.QueryParameters.Expand = expand;
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("sectionGroup%2Did", sectionGroupId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                requestInfo.PathParameters.Add("onenotePage%2Did", onenotePageId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(groupIdOption, siteIdOption, sectionGroupIdOption, onenoteSectionIdOption, onenotePageIdOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Delete navigation property children for sites
        /// </summary>
        public Command BuildDeleteCommand()
        {
            var command = new Command("delete");

            command.Description = "Delete navigation property children for sites";
            // Create options for all the parameters
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var storeIdOption = new Option <string>("--store-id", description: "key: id of store")
            {
            };

            storeIdOption.IsRequired = true;
            command.AddOption(storeIdOption);
            var setIdOption = new Option <string>("--set-id", description: "key: id of set")
            {
            };

            setIdOption.IsRequired = true;
            command.AddOption(setIdOption);
            var setId1Option = new Option <string>("--set-id1", description: "key: id of set")
            {
            };

            setId1Option.IsRequired = true;
            command.AddOption(setId1Option);
            var termIdOption = new Option <string>("--term-id", description: "key: id of term")
            {
            };

            termIdOption.IsRequired = true;
            command.AddOption(termIdOption);
            var termId1Option = new Option <string>("--term-id1", description: "key: id of term")
            {
            };

            termId1Option.IsRequired = true;
            command.AddOption(termId1Option);
            var ifMatchOption = new Option <string>("--if-match", description: "ETag")
            {
            };

            ifMatchOption.IsRequired = false;
            command.AddOption(ifMatchOption);
            command.SetHandler(async(object[] parameters) => {
                var siteId            = (string)parameters[0];
                var storeId           = (string)parameters[1];
                var setId             = (string)parameters[2];
                var setId1            = (string)parameters[3];
                var termId            = (string)parameters[4];
                var termId1           = (string)parameters[5];
                var ifMatch           = (string)parameters[6];
                var cancellationToken = (CancellationToken)parameters[7];
                var requestInfo       = CreateDeleteRequestInformation(q => {
                });
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("store%2Did", storeId);
                requestInfo.PathParameters.Add("set%2Did", setId);
                requestInfo.PathParameters.Add("set%2Did1", setId1);
                requestInfo.PathParameters.Add("term%2Did", termId);
                requestInfo.PathParameters.Add("term%2Did1", termId1);
                requestInfo.Headers["If-Match"] = ifMatch;
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(siteIdOption, storeIdOption, setIdOption, setId1Option, termIdOption, termId1Option, ifMatchOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #3
0
        /// <summary>
        /// Invoke function preview
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "Invoke function preview";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var notebookIdOption = new Option <string>("--notebook-id", description: "key: id of notebook")
            {
            };

            notebookIdOption.IsRequired = true;
            command.AddOption(notebookIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var onenotePageIdOption = new Option <string>("--onenote-page-id", description: "key: id of onenotePage")
            {
            };

            onenotePageIdOption.IsRequired = true;
            command.AddOption(onenotePageIdOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId                = (string)parameters[0];
                var siteId                 = (string)parameters[1];
                var notebookId             = (string)parameters[2];
                var onenoteSectionId       = (string)parameters[3];
                var onenotePageId          = (string)parameters[4];
                var output                 = (FormatterType)parameters[5];
                var query                  = (string)parameters[6];
                var jsonNoIndent           = (bool)parameters[7];
                var outputFilter           = (IOutputFilter)parameters[8];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[9];
                var cancellationToken      = (CancellationToken)parameters[10];
                var requestInfo            = CreateGetRequestInformation(q => {
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("notebook%2Did", notebookId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                requestInfo.PathParameters.Add("onenotePage%2Did", onenotePageId);
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: default, cancellationToken: cancellationToken);
Beispiel #4
0
        /// <summary>
        /// Invoke action copyToSectionGroup
        /// </summary>
        public Command BuildPostCommand()
        {
            var command = new Command("post");

            command.Description = "Invoke action copyToSectionGroup";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var notebookIdOption = new Option <string>("--notebook-id", description: "key: id of notebook")
            {
            };

            notebookIdOption.IsRequired = true;
            command.AddOption(notebookIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId                = (string)parameters[0];
                var notebookId             = (string)parameters[1];
                var onenoteSectionId       = (string)parameters[2];
                var body                   = (string)parameters[3];
                var output                 = (FormatterType)parameters[4];
                var query                  = (string)parameters[5];
                var jsonNoIndent           = (bool)parameters[6];
                var outputFilter           = (IOutputFilter)parameters[7];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[8];
                var cancellationToken      = (CancellationToken)parameters[9];
                using var stream           = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode              = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model                  = parseNode.GetObjectValue <CopyToSectionGroupRequestBody>(CopyToSectionGroupRequestBody.CreateFromDiscriminatorValue);
                var requestInfo            = CreatePostRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("notebook%2Did", notebookId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: default, cancellationToken: cancellationToken);
        /// <summary>
        /// The registered device on which this Windows Hello for Business key resides. Supports $expand. When you get a user&apos;s Windows Hello for Business registration information, this property is returned only on a single GET and when you specify ?$expand. For example, GET /users/[email protected]/authentication/windowsHelloForBusinessMethods/_jpuR-TGZtk6aQCLF3BQjA2?$expand=device.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "The registered device on which this Windows Hello for Business key resides. Supports $expand. When you get a user's Windows Hello for Business registration information, this property is returned only on a single GET and when you specify ?$expand. For example, GET /users/[email protected]/authentication/windowsHelloForBusinessMethods/_jpuR-TGZtk6aQCLF3BQjA2?$expand=device.";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var windowsHelloForBusinessAuthenticationMethodIdOption = new Option <string>("--windows-hello-for-business-authentication-method-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")
            {
            };

            windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true;
            command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var userId = (string)parameters[0];
                var windowsHelloForBusinessAuthenticationMethodId = (string)parameters[1];
                var select                 = (string[])parameters[2];
                var expand                 = (string[])parameters[3];
                var output                 = (FormatterType)parameters[4];
                var query                  = (string)parameters[5];
                var jsonNoIndent           = (bool)parameters[6];
                var outputFilter           = (IOutputFilter)parameters[7];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[8];
                var cancellationToken      = (CancellationToken)parameters[9];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                    q.QueryParameters.Expand = expand;
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod%2Did", windowsHelloForBusinessAuthenticationMethodId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(userIdOption, windowsHelloForBusinessAuthenticationMethodIdOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #6
0
        /// <summary>
        /// The permissions of the users with whom the calendar is shared.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "The permissions of the users with whom the calendar is shared.";
            // Create options for all the parameters
            var calendarIdOption = new Option <string>("--calendar-id", description: "key: id of calendar")
            {
            };

            calendarIdOption.IsRequired = true;
            command.AddOption(calendarIdOption);
            var calendarPermissionIdOption = new Option <string>("--calendar-permission-id", description: "key: id of calendarPermission")
            {
            };

            calendarPermissionIdOption.IsRequired = true;
            command.AddOption(calendarPermissionIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var calendarId           = (string)parameters[0];
                var calendarPermissionId = (string)parameters[1];
                var select                 = (string[])parameters[2];
                var output                 = (FormatterType)parameters[3];
                var query                  = (string)parameters[4];
                var jsonNoIndent           = (bool)parameters[5];
                var outputFilter           = (IOutputFilter)parameters[6];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[7];
                var cancellationToken      = (CancellationToken)parameters[8];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                });
                requestInfo.PathParameters.Add("calendar%2Did", calendarId);
                requestInfo.PathParameters.Add("calendarPermission%2Did", calendarPermissionId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(calendarIdOption, calendarPermissionIdOption, selectOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable.";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var eventIdOption = new Option <string>("--event-id", description: "key: id of event")
            {
            };

            eventIdOption.IsRequired = true;
            command.AddOption(eventIdOption);
            var eventId1Option = new Option <string>("--event-id1", description: "key: id of event")
            {
            };

            eventId1Option.IsRequired = true;
            command.AddOption(eventId1Option);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId                = (string)parameters[0];
                var eventId                = (string)parameters[1];
                var eventId1               = (string)parameters[2];
                var select                 = (string[])parameters[3];
                var output                 = (FormatterType)parameters[4];
                var query                  = (string)parameters[5];
                var jsonNoIndent           = (bool)parameters[6];
                var outputFilter           = (IOutputFilter)parameters[7];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[8];
                var cancellationToken      = (CancellationToken)parameters[9];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("event%2Did", eventId);
                requestInfo.PathParameters.Add("event%2Did1", eventId1);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(groupIdOption, eventIdOption, eventId1Option, selectOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Invoke action onenotePatchContent
        /// </summary>
        public Command BuildPostCommand()
        {
            var command = new Command("post");

            command.Description = "Invoke action onenotePatchContent";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var notebookIdOption = new Option <string>("--notebook-id", description: "key: id of notebook")
            {
            };

            notebookIdOption.IsRequired = true;
            command.AddOption(notebookIdOption);
            var sectionGroupIdOption = new Option <string>("--section-group-id", description: "key: id of sectionGroup")
            {
            };

            sectionGroupIdOption.IsRequired = true;
            command.AddOption(sectionGroupIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var onenotePageIdOption = new Option <string>("--onenote-page-id", description: "key: id of onenotePage")
            {
            };

            onenotePageIdOption.IsRequired = true;
            command.AddOption(onenotePageIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var userId            = (string)parameters[0];
                var notebookId        = (string)parameters[1];
                var sectionGroupId    = (string)parameters[2];
                var onenoteSectionId  = (string)parameters[3];
                var onenotePageId     = (string)parameters[4];
                var body              = (string)parameters[5];
                var cancellationToken = (CancellationToken)parameters[6];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <OnenotePatchContentRequestBody>(OnenotePatchContentRequestBody.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePostRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("notebook%2Did", notebookId);
                requestInfo.PathParameters.Add("sectionGroup%2Did", sectionGroupId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                requestInfo.PathParameters.Add("onenotePage%2Did", onenotePageId);
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: default, cancellationToken: cancellationToken);
        /// <summary>
        /// Get the number of the resource
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "Get the number of the resource";
            // Create options for all the parameters
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var storeIdOption = new Option <string>("--store-id", description: "key: id of store")
            {
            };

            storeIdOption.IsRequired = true;
            command.AddOption(storeIdOption);
            var setIdOption = new Option <string>("--set-id", description: "key: id of set")
            {
            };

            setIdOption.IsRequired = true;
            command.AddOption(setIdOption);
            var termIdOption = new Option <string>("--term-id", description: "key: id of term")
            {
            };

            termIdOption.IsRequired = true;
            command.AddOption(termIdOption);
            var termId1Option = new Option <string>("--term-id1", description: "key: id of term")
            {
            };

            termId1Option.IsRequired = true;
            command.AddOption(termId1Option);
            command.SetHandler(async(object[] parameters) => {
                var siteId  = (string)parameters[0];
                var storeId = (string)parameters[1];
                var setId   = (string)parameters[2];
                var termId  = (string)parameters[3];
                var termId1 = (string)parameters[4];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[5];
                var cancellationToken      = (CancellationToken)parameters[6];
                var requestInfo            = CreateGetRequestInformation(q => {
                });
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("store%2Did", storeId);
                requestInfo.PathParameters.Add("set%2Did", setId);
                requestInfo.PathParameters.Add("term%2Did", termId);
                requestInfo.PathParameters.Add("term%2Did1", termId1);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response  = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT);
                await formatter.WriteOutputAsync(response, null, cancellationToken);
            }, new CollectionBinding(siteIdOption, storeIdOption, setIdOption, termIdOption, termId1Option, new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
 /// <summary>
 /// Delete navigation property extensions for users
 /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
 /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
 /// <param name="responseHandler">Response handler to use in place of the default response handling provided by the core service</param>
 /// </summary>
 public async Task DeleteAsync(Action <ExtensionItemRequestBuilderDeleteRequestConfiguration> requestConfiguration = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default)
 {
     var requestInfo = CreateDeleteRequestInformation(requestConfiguration);
     await RequestAdapter.SendNoContentAsync(requestInfo, responseHandler, default, cancellationToken);
Beispiel #11
0
        /// <summary>
        /// Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand.";
            // Create options for all the parameters
            var windowsHelloForBusinessAuthenticationMethodIdOption = new Option <string>("--windows-hello-for-business-authentication-method-id", description: "key: id of windowsHelloForBusinessAuthenticationMethod")
            {
            };

            windowsHelloForBusinessAuthenticationMethodIdOption.IsRequired = true;
            command.AddOption(windowsHelloForBusinessAuthenticationMethodIdOption);
            var directoryObjectIdOption = new Option <string>("--directory-object-id", description: "key: id of directoryObject")
            {
            };

            directoryObjectIdOption.IsRequired = true;
            command.AddOption(directoryObjectIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var windowsHelloForBusinessAuthenticationMethodId = (string)parameters[0];
                var directoryObjectId      = (string)parameters[1];
                var select                 = (string[])parameters[2];
                var expand                 = (string[])parameters[3];
                var output                 = (FormatterType)parameters[4];
                var query                  = (string)parameters[5];
                var jsonNoIndent           = (bool)parameters[6];
                var outputFilter           = (IOutputFilter)parameters[7];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[8];
                var cancellationToken      = (CancellationToken)parameters[9];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                    q.QueryParameters.Expand = expand;
                });
                requestInfo.PathParameters.Add("windowsHelloForBusinessAuthenticationMethod%2Did", windowsHelloForBusinessAuthenticationMethodId);
                requestInfo.PathParameters.Add("directoryObject%2Did", directoryObjectId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(windowsHelloForBusinessAuthenticationMethodIdOption, directoryObjectIdOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Get multiValueExtendedProperties from users
        /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
        /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
        /// <param name="responseHandler">Response handler to use in place of the default response handling provided by the core service</param>
        /// </summary>
        public async Task <MultiValueLegacyExtendedPropertyCollectionResponse> GetAsync(Action <MultiValueExtendedPropertiesRequestBuilderGetRequestConfiguration> requestConfiguration = default, IResponseHandler responseHandler = default, CancellationToken cancellationToken = default)
        {
            var requestInfo = CreateGetRequestInformation(requestConfiguration);

            return(await RequestAdapter.SendAsync <MultiValueLegacyExtendedPropertyCollectionResponse>(requestInfo, MultiValueLegacyExtendedPropertyCollectionResponse.CreateFromDiscriminatorValue, responseHandler, default, cancellationToken));
Beispiel #13
0
        /// <summary>
        /// Get entities from permissionGrants
        /// </summary>
        public Command BuildListCommand()
        {
            var command = new Command("list");

            command.Description = "Get entities from permissionGrants";
            // Create options for all the parameters
            var searchOption = new Option <string>("--search", description: "Search items by search phrases")
            {
            };

            searchOption.IsRequired = false;
            command.AddOption(searchOption);
            var filterOption = new Option <string>("--filter", description: "Filter items by property values")
            {
            };

            filterOption.IsRequired = false;
            command.AddOption(filterOption);
            var orderbyOption = new Option <string[]>("--orderby", description: "Order items by property values")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            orderbyOption.IsRequired = false;
            command.AddOption(orderbyOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var search                 = (string)parameters[0];
                var filter                 = (string)parameters[1];
                var orderby                = (string[])parameters[2];
                var select                 = (string[])parameters[3];
                var expand                 = (string[])parameters[4];
                var output                 = (FormatterType)parameters[5];
                var query                  = (string)parameters[6];
                var jsonNoIndent           = (bool)parameters[7];
                var outputFilter           = (IOutputFilter)parameters[8];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[9];
                var cancellationToken      = (CancellationToken)parameters[10];
                var requestInfo            = CreateGetRequestInformation(q => {
                    if (!String.IsNullOrEmpty(search))
                    {
                        q.QueryParameters.Search = search;
                    }
                    if (!String.IsNullOrEmpty(filter))
                    {
                        q.QueryParameters.Filter = filter;
                    }
                    q.QueryParameters.Orderby = orderby;
                    q.QueryParameters.Select  = select;
                    q.QueryParameters.Expand  = expand;
                });
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(searchOption, filterOption, orderbyOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #14
0
        /// <summary>
        /// Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "Collection of pages with the default content to display in a user flow for a specified language. This collection does not allow any kind of modification.";
            // Create options for all the parameters
            var b2xIdentityUserFlowIdOption = new Option <string>("--b2x-identity-user-flow-id", description: "key: id of b2xIdentityUserFlow")
            {
            };

            b2xIdentityUserFlowIdOption.IsRequired = true;
            command.AddOption(b2xIdentityUserFlowIdOption);
            var userFlowLanguageConfigurationIdOption = new Option <string>("--user-flow-language-configuration-id", description: "key: id of userFlowLanguageConfiguration")
            {
            };

            userFlowLanguageConfigurationIdOption.IsRequired = true;
            command.AddOption(userFlowLanguageConfigurationIdOption);
            var userFlowLanguagePageIdOption = new Option <string>("--user-flow-language-page-id", description: "key: id of userFlowLanguagePage")
            {
            };

            userFlowLanguagePageIdOption.IsRequired = true;
            command.AddOption(userFlowLanguagePageIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var b2xIdentityUserFlowId           = (string)parameters[0];
                var userFlowLanguageConfigurationId = (string)parameters[1];
                var userFlowLanguagePageId          = (string)parameters[2];
                var select                 = (string[])parameters[3];
                var expand                 = (string[])parameters[4];
                var output                 = (FormatterType)parameters[5];
                var query                  = (string)parameters[6];
                var jsonNoIndent           = (bool)parameters[7];
                var outputFilter           = (IOutputFilter)parameters[8];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[9];
                var cancellationToken      = (CancellationToken)parameters[10];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                    q.QueryParameters.Expand = expand;
                });
                requestInfo.PathParameters.Add("b2xIdentityUserFlow%2Did", b2xIdentityUserFlowId);
                requestInfo.PathParameters.Add("userFlowLanguageConfiguration%2Did", userFlowLanguageConfigurationId);
                requestInfo.PathParameters.Add("userFlowLanguagePage%2Did", userFlowLanguagePageId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(b2xIdentityUserFlowIdOption, userFlowLanguageConfigurationIdOption, userFlowLanguagePageIdOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #15
0
        /// <summary>
        /// Update the navigation property pages in groups
        /// </summary>
        public Command BuildPatchCommand()
        {
            var command = new Command("patch");

            command.Description = "Update the navigation property pages in groups";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var sectionGroupIdOption = new Option <string>("--section-group-id", description: "key: id of sectionGroup")
            {
            };

            sectionGroupIdOption.IsRequired = true;
            command.AddOption(sectionGroupIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var onenotePageIdOption = new Option <string>("--onenote-page-id", description: "key: id of onenotePage")
            {
            };

            onenotePageIdOption.IsRequired = true;
            command.AddOption(onenotePageIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId           = (string)parameters[0];
                var siteId            = (string)parameters[1];
                var sectionGroupId    = (string)parameters[2];
                var onenoteSectionId  = (string)parameters[3];
                var onenotePageId     = (string)parameters[4];
                var body              = (string)parameters[5];
                var cancellationToken = (CancellationToken)parameters[6];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <OnenotePage>(OnenotePage.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePatchRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("sectionGroup%2Did", sectionGroupId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                requestInfo.PathParameters.Add("onenotePage%2Did", onenotePageId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(groupIdOption, siteIdOption, sectionGroupIdOption, onenoteSectionIdOption, onenotePageIdOption, bodyOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
 /// <summary>
 /// The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable.
 /// </summary>
 public Command BuildListCommand() {
     var command = new Command("list");
     command.Description = "The occurrences of a recurring series, if the event is a series master. This property includes occurrences that are part of the recurrence pattern, and exceptions that have been modified, but does not include occurrences that have been cancelled from the series. Navigation property. Read-only. Nullable.";
     // Create options for all the parameters
     var userIdOption = new Option<string>("--user-id", description: "key: id of user") {
     };
     userIdOption.IsRequired = true;
     command.AddOption(userIdOption);
     var eventIdOption = new Option<string>("--event-id", description: "key: id of event") {
     };
     eventIdOption.IsRequired = true;
     command.AddOption(eventIdOption);
     var topOption = new Option<int?>("--top", description: "Show only the first n items") {
     };
     topOption.IsRequired = false;
     command.AddOption(topOption);
     var skipOption = new Option<int?>("--skip", description: "Skip the first n items") {
     };
     skipOption.IsRequired = false;
     command.AddOption(skipOption);
     var filterOption = new Option<string>("--filter", description: "Filter items by property values") {
     };
     filterOption.IsRequired = false;
     command.AddOption(filterOption);
     var countOption = new Option<bool?>("--count", description: "Include count of items") {
     };
     countOption.IsRequired = false;
     command.AddOption(countOption);
     var orderbyOption = new Option<string[]>("--orderby", description: "Order items by property values") {
         Arity = ArgumentArity.ZeroOrMore
     };
     orderbyOption.IsRequired = false;
     command.AddOption(orderbyOption);
     var selectOption = new Option<string[]>("--select", description: "Select properties to be returned") {
         Arity = ArgumentArity.ZeroOrMore
     };
     selectOption.IsRequired = false;
     command.AddOption(selectOption);
     var outputOption = new Option<FormatterType>("--output", () => FormatterType.JSON){
         IsRequired = true
     };
     command.AddOption(outputOption);
     var queryOption = new Option<string>("--query");
     command.AddOption(queryOption);
     var jsonNoIndentOption = new Option<bool>("--json-no-indent", r => {
         if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value)) {
             return value;
         }
         return true;
     }, description: "Disable indentation for the JSON output formatter.");
     command.AddOption(jsonNoIndentOption);
     command.SetHandler(async (object[] parameters) => {
         var userId = (string) parameters[0];
         var eventId = (string) parameters[1];
         var top = (int?) parameters[2];
         var skip = (int?) parameters[3];
         var filter = (string) parameters[4];
         var count = (bool?) parameters[5];
         var orderby = (string[]) parameters[6];
         var select = (string[]) parameters[7];
         var output = (FormatterType) parameters[8];
         var query = (string) parameters[9];
         var jsonNoIndent = (bool) parameters[10];
         var outputFilter = (IOutputFilter) parameters[11];
         var outputFormatterFactory = (IOutputFormatterFactory) parameters[12];
         var cancellationToken = (CancellationToken) parameters[13];
         var requestInfo = CreateGetRequestInformation(q => {
             q.QueryParameters.Top = top;
             q.QueryParameters.Skip = skip;
             if (!String.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter;
             q.QueryParameters.Count = count;
             q.QueryParameters.Orderby = orderby;
             q.QueryParameters.Select = select;
         });
         requestInfo.PathParameters.Add("user%2Did", userId);
         requestInfo.PathParameters.Add("event%2Did", eventId);
         var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
             {"4XX", ODataError.CreateFromDiscriminatorValue},
             {"5XX", ODataError.CreateFromDiscriminatorValue},
         };
         var response = await RequestAdapter.SendPrimitiveAsync<Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
         response = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
         var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
         var formatter = outputFormatterFactory.GetFormatter(output);
         await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
     }, new CollectionBinding(userIdOption, eventIdOption, topOption, skipOption, filterOption, new NullableBooleanBinding(countOption), orderbyOption, selectOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
     return command;
 }
Beispiel #17
0
        /// <summary>
        /// Delete navigation property pages for groups
        /// </summary>
        public Command BuildDeleteCommand()
        {
            var command = new Command("delete");

            command.Description = "Delete navigation property pages for groups";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var sectionGroupIdOption = new Option <string>("--section-group-id", description: "key: id of sectionGroup")
            {
            };

            sectionGroupIdOption.IsRequired = true;
            command.AddOption(sectionGroupIdOption);
            var onenoteSectionIdOption = new Option <string>("--onenote-section-id", description: "key: id of onenoteSection")
            {
            };

            onenoteSectionIdOption.IsRequired = true;
            command.AddOption(onenoteSectionIdOption);
            var onenotePageIdOption = new Option <string>("--onenote-page-id", description: "key: id of onenotePage")
            {
            };

            onenotePageIdOption.IsRequired = true;
            command.AddOption(onenotePageIdOption);
            var ifMatchOption = new Option <string>("--if-match", description: "ETag")
            {
            };

            ifMatchOption.IsRequired = false;
            command.AddOption(ifMatchOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId           = (string)parameters[0];
                var siteId            = (string)parameters[1];
                var sectionGroupId    = (string)parameters[2];
                var onenoteSectionId  = (string)parameters[3];
                var onenotePageId     = (string)parameters[4];
                var ifMatch           = (string)parameters[5];
                var cancellationToken = (CancellationToken)parameters[6];
                var requestInfo       = CreateDeleteRequestInformation(q => {
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("sectionGroup%2Did", sectionGroupId);
                requestInfo.PathParameters.Add("onenoteSection%2Did", onenoteSectionId);
                requestInfo.PathParameters.Add("onenotePage%2Did", onenotePageId);
                requestInfo.Headers["If-Match"] = ifMatch;
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(groupIdOption, siteIdOption, sectionGroupIdOption, onenoteSectionIdOption, onenotePageIdOption, ifMatchOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Update the navigation property progressTaskBoardFormat in groups
        /// </summary>
        public Command BuildPatchCommand()
        {
            var command = new Command("patch");

            command.Description = "Update the navigation property progressTaskBoardFormat in groups";
            // Create options for all the parameters
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var plannerPlanIdOption = new Option <string>("--planner-plan-id", description: "key: id of plannerPlan")
            {
            };

            plannerPlanIdOption.IsRequired = true;
            command.AddOption(plannerPlanIdOption);
            var plannerBucketIdOption = new Option <string>("--planner-bucket-id", description: "key: id of plannerBucket")
            {
            };

            plannerBucketIdOption.IsRequired = true;
            command.AddOption(plannerBucketIdOption);
            var plannerTaskIdOption = new Option <string>("--planner-task-id", description: "key: id of plannerTask")
            {
            };

            plannerTaskIdOption.IsRequired = true;
            command.AddOption(plannerTaskIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var groupId           = (string)parameters[0];
                var plannerPlanId     = (string)parameters[1];
                var plannerBucketId   = (string)parameters[2];
                var plannerTaskId     = (string)parameters[3];
                var body              = (string)parameters[4];
                var cancellationToken = (CancellationToken)parameters[5];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <PlannerProgressTaskBoardTaskFormat>(PlannerProgressTaskBoardTaskFormat.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePatchRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("plannerPlan%2Did", plannerPlanId);
                requestInfo.PathParameters.Add("plannerBucket%2Did", plannerBucketId);
                requestInfo.PathParameters.Add("plannerTask%2Did", plannerTaskId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(groupIdOption, plannerPlanIdOption, plannerBucketIdOption, plannerTaskIdOption, bodyOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #19
0
        /// <summary>
        /// Create new navigation property to subscriptions for users
        /// </summary>
        public Command BuildCreateCommand()
        {
            var command = new Command("create");

            command.Description = "Create new navigation property to subscriptions for users";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var driveIdOption = new Option <string>("--drive-id", description: "key: id of drive")
            {
            };

            driveIdOption.IsRequired = true;
            command.AddOption(driveIdOption);
            var driveItemIdOption = new Option <string>("--drive-item-id", description: "key: id of driveItem")
            {
            };

            driveItemIdOption.IsRequired = true;
            command.AddOption(driveItemIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var userId                 = (string)parameters[0];
                var driveId                = (string)parameters[1];
                var driveItemId            = (string)parameters[2];
                var body                   = (string)parameters[3];
                var output                 = (FormatterType)parameters[4];
                var query                  = (string)parameters[5];
                var jsonNoIndent           = (bool)parameters[6];
                var outputFilter           = (IOutputFilter)parameters[7];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[8];
                var cancellationToken      = (CancellationToken)parameters[9];
                using var stream           = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode              = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model                  = parseNode.GetObjectValue <Subscription>(Subscription.CreateFromDiscriminatorValue);
                var requestInfo            = CreatePostRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("drive%2Did", driveId);
                requestInfo.PathParameters.Add("driveItem%2Did", driveItemId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(userIdOption, driveIdOption, driveItemIdOption, bodyOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Update the navigation property members in users
        /// </summary>
        public Command BuildPatchCommand()
        {
            var command = new Command("patch");

            command.Description = "Update the navigation property members in users";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var teamIdOption = new Option <string>("--team-id", description: "key: id of team")
            {
            };

            teamIdOption.IsRequired = true;
            command.AddOption(teamIdOption);
            var channelIdOption = new Option <string>("--channel-id", description: "key: id of channel")
            {
            };

            channelIdOption.IsRequired = true;
            command.AddOption(channelIdOption);
            var conversationMemberIdOption = new Option <string>("--conversation-member-id", description: "key: id of conversationMember")
            {
            };

            conversationMemberIdOption.IsRequired = true;
            command.AddOption(conversationMemberIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var userId               = (string)parameters[0];
                var teamId               = (string)parameters[1];
                var channelId            = (string)parameters[2];
                var conversationMemberId = (string)parameters[3];
                var body = (string)parameters[4];
                var cancellationToken = (CancellationToken)parameters[5];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <ConversationMember>(ConversationMember.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePatchRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("team%2Did", teamId);
                requestInfo.PathParameters.Add("channel%2Did", channelId);
                requestInfo.PathParameters.Add("conversationMember%2Did", conversationMemberId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(userIdOption, teamIdOption, channelIdOption, conversationMemberIdOption, bodyOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
Beispiel #21
0
        /// <summary>
        /// Invoke action tentativelyAccept
        /// </summary>
        public Command BuildPostCommand()
        {
            var command = new Command("post");

            command.Description = "Invoke action tentativelyAccept";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var calendarGroupIdOption = new Option <string>("--calendar-group-id", description: "key: id of calendarGroup")
            {
            };

            calendarGroupIdOption.IsRequired = true;
            command.AddOption(calendarGroupIdOption);
            var calendarIdOption = new Option <string>("--calendar-id", description: "key: id of calendar")
            {
            };

            calendarIdOption.IsRequired = true;
            command.AddOption(calendarIdOption);
            var eventIdOption = new Option <string>("--event-id", description: "key: id of event")
            {
            };

            eventIdOption.IsRequired = true;
            command.AddOption(eventIdOption);
            var eventId1Option = new Option <string>("--event-id1", description: "key: id of event")
            {
            };

            eventId1Option.IsRequired = true;
            command.AddOption(eventId1Option);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var userId            = (string)parameters[0];
                var calendarGroupId   = (string)parameters[1];
                var calendarId        = (string)parameters[2];
                var eventId           = (string)parameters[3];
                var eventId1          = (string)parameters[4];
                var body              = (string)parameters[5];
                var cancellationToken = (CancellationToken)parameters[6];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <TentativelyAcceptRequestBody>(TentativelyAcceptRequestBody.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePostRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("calendarGroup%2Did", calendarGroupId);
                requestInfo.PathParameters.Add("calendar%2Did", calendarId);
                requestInfo.PathParameters.Add("event%2Did", eventId);
                requestInfo.PathParameters.Add("event%2Did1", eventId1);
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: default, cancellationToken: cancellationToken);
        /// <summary>
        /// A collection of membership records associated with the channel.
        /// </summary>
        public Command BuildGetCommand()
        {
            var command = new Command("get");

            command.Description = "A collection of membership records associated with the channel.";
            // Create options for all the parameters
            var userIdOption = new Option <string>("--user-id", description: "key: id of user")
            {
            };

            userIdOption.IsRequired = true;
            command.AddOption(userIdOption);
            var teamIdOption = new Option <string>("--team-id", description: "key: id of team")
            {
            };

            teamIdOption.IsRequired = true;
            command.AddOption(teamIdOption);
            var channelIdOption = new Option <string>("--channel-id", description: "key: id of channel")
            {
            };

            channelIdOption.IsRequired = true;
            command.AddOption(channelIdOption);
            var conversationMemberIdOption = new Option <string>("--conversation-member-id", description: "key: id of conversationMember")
            {
            };

            conversationMemberIdOption.IsRequired = true;
            command.AddOption(conversationMemberIdOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var userId               = (string)parameters[0];
                var teamId               = (string)parameters[1];
                var channelId            = (string)parameters[2];
                var conversationMemberId = (string)parameters[3];
                var select               = (string[])parameters[4];
                var expand               = (string[])parameters[5];
                var output               = (FormatterType)parameters[6];
                var query                  = (string)parameters[7];
                var jsonNoIndent           = (bool)parameters[8];
                var outputFilter           = (IOutputFilter)parameters[9];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[10];
                var cancellationToken      = (CancellationToken)parameters[11];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Select = select;
                    q.QueryParameters.Expand = expand;
                });
                requestInfo.PathParameters.Add("user%2Did", userId);
                requestInfo.PathParameters.Add("team%2Did", teamId);
                requestInfo.PathParameters.Add("channel%2Did", channelId);
                requestInfo.PathParameters.Add("conversationMember%2Did", conversationMemberId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(userIdOption, teamIdOption, channelIdOption, conversationMemberIdOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Indicates which terms have been pinned or reused directly under the set.
        /// </summary>
        public Command BuildListCommand()
        {
            var command = new Command("list");

            command.Description = "Indicates which terms have been pinned or reused directly under the set.";
            // Create options for all the parameters
            var siteIdOption = new Option <string>("--site-id", description: "key: id of site")
            {
            };

            siteIdOption.IsRequired = true;
            command.AddOption(siteIdOption);
            var groupIdOption = new Option <string>("--group-id", description: "key: id of group")
            {
            };

            groupIdOption.IsRequired = true;
            command.AddOption(groupIdOption);
            var setIdOption = new Option <string>("--set-id", description: "key: id of set")
            {
            };

            setIdOption.IsRequired = true;
            command.AddOption(setIdOption);
            var topOption = new Option <int?>("--top", description: "Show only the first n items")
            {
            };

            topOption.IsRequired = false;
            command.AddOption(topOption);
            var skipOption = new Option <int?>("--skip", description: "Skip the first n items")
            {
            };

            skipOption.IsRequired = false;
            command.AddOption(skipOption);
            var searchOption = new Option <string>("--search", description: "Search items by search phrases")
            {
            };

            searchOption.IsRequired = false;
            command.AddOption(searchOption);
            var filterOption = new Option <string>("--filter", description: "Filter items by property values")
            {
            };

            filterOption.IsRequired = false;
            command.AddOption(filterOption);
            var countOption = new Option <bool?>("--count", description: "Include count of items")
            {
            };

            countOption.IsRequired = false;
            command.AddOption(countOption);
            var orderbyOption = new Option <string[]>("--orderby", description: "Order items by property values")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            orderbyOption.IsRequired = false;
            command.AddOption(orderbyOption);
            var selectOption = new Option <string[]>("--select", description: "Select properties to be returned")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            selectOption.IsRequired = false;
            command.AddOption(selectOption);
            var expandOption = new Option <string[]>("--expand", description: "Expand related entities")
            {
                Arity = ArgumentArity.ZeroOrMore
            };

            expandOption.IsRequired = false;
            command.AddOption(expandOption);
            var outputOption = new Option <FormatterType>("--output", () => FormatterType.JSON)
            {
                IsRequired = true
            };

            command.AddOption(outputOption);
            var queryOption = new Option <string>("--query");

            command.AddOption(queryOption);
            var jsonNoIndentOption = new Option <bool>("--json-no-indent", r => {
                if (bool.TryParse(r.Tokens.Select(t => t.Value).LastOrDefault(), out var value))
                {
                    return(value);
                }
                return(true);
            }, description: "Disable indentation for the JSON output formatter.");

            command.AddOption(jsonNoIndentOption);
            command.SetHandler(async(object[] parameters) => {
                var siteId                 = (string)parameters[0];
                var groupId                = (string)parameters[1];
                var setId                  = (string)parameters[2];
                var top                    = (int?)parameters[3];
                var skip                   = (int?)parameters[4];
                var search                 = (string)parameters[5];
                var filter                 = (string)parameters[6];
                var count                  = (bool?)parameters[7];
                var orderby                = (string[])parameters[8];
                var select                 = (string[])parameters[9];
                var expand                 = (string[])parameters[10];
                var output                 = (FormatterType)parameters[11];
                var query                  = (string)parameters[12];
                var jsonNoIndent           = (bool)parameters[13];
                var outputFilter           = (IOutputFilter)parameters[14];
                var outputFormatterFactory = (IOutputFormatterFactory)parameters[15];
                var cancellationToken      = (CancellationToken)parameters[16];
                var requestInfo            = CreateGetRequestInformation(q => {
                    q.QueryParameters.Top  = top;
                    q.QueryParameters.Skip = skip;
                    if (!String.IsNullOrEmpty(search))
                    {
                        q.QueryParameters.Search = search;
                    }
                    if (!String.IsNullOrEmpty(filter))
                    {
                        q.QueryParameters.Filter = filter;
                    }
                    q.QueryParameters.Count   = count;
                    q.QueryParameters.Orderby = orderby;
                    q.QueryParameters.Select  = select;
                    q.QueryParameters.Expand  = expand;
                });
                requestInfo.PathParameters.Add("site%2Did", siteId);
                requestInfo.PathParameters.Add("group%2Did", groupId);
                requestInfo.PathParameters.Add("set%2Did", setId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                var response         = await RequestAdapter.SendPrimitiveAsync <Stream>(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                response             = await outputFilter?.FilterOutputAsync(response, query, cancellationToken) ?? response;
                var formatterOptions = output.GetOutputFormatterOptions(new FormatterOptionsModel(!jsonNoIndent));
                var formatter        = outputFormatterFactory.GetFormatter(output);
                await formatter.WriteOutputAsync(response, formatterOptions, cancellationToken);
            }, new CollectionBinding(siteIdOption, groupIdOption, setIdOption, topOption, skipOption, searchOption, filterOption, new NullableBooleanBinding(countOption), orderbyOption, selectOption, expandOption, outputOption, queryOption, jsonNoIndentOption, new TypeBinding(typeof(IOutputFilter)), new TypeBinding(typeof(IOutputFormatterFactory)), new TypeBinding(typeof(CancellationToken))));
            return(command);
        }
        /// <summary>
        /// Update the navigation property attachments in me
        /// </summary>
        public Command BuildPatchCommand()
        {
            var command = new Command("patch");

            command.Description = "Update the navigation property attachments in me";
            // Create options for all the parameters
            var calendarIdOption = new Option <string>("--calendar-id", description: "key: id of calendar")
            {
            };

            calendarIdOption.IsRequired = true;
            command.AddOption(calendarIdOption);
            var eventIdOption = new Option <string>("--event-id", description: "key: id of event")
            {
            };

            eventIdOption.IsRequired = true;
            command.AddOption(eventIdOption);
            var eventId1Option = new Option <string>("--event-id1", description: "key: id of event")
            {
            };

            eventId1Option.IsRequired = true;
            command.AddOption(eventId1Option);
            var attachmentIdOption = new Option <string>("--attachment-id", description: "key: id of attachment")
            {
            };

            attachmentIdOption.IsRequired = true;
            command.AddOption(attachmentIdOption);
            var bodyOption = new Option <string>("--body")
            {
            };

            bodyOption.IsRequired = true;
            command.AddOption(bodyOption);
            command.SetHandler(async(object[] parameters) => {
                var calendarId        = (string)parameters[0];
                var eventId           = (string)parameters[1];
                var eventId1          = (string)parameters[2];
                var attachmentId      = (string)parameters[3];
                var body              = (string)parameters[4];
                var cancellationToken = (CancellationToken)parameters[5];
                using var stream      = new MemoryStream(Encoding.UTF8.GetBytes(body));
                var parseNode         = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream);
                var model             = parseNode.GetObjectValue <Attachment>(Attachment.CreateFromDiscriminatorValue);
                var requestInfo       = CreatePatchRequestInformation(model, q => {
                });
                requestInfo.PathParameters.Add("calendar%2Did", calendarId);
                requestInfo.PathParameters.Add("event%2Did", eventId);
                requestInfo.PathParameters.Add("event%2Did1", eventId1);
                requestInfo.PathParameters.Add("attachment%2Did", attachmentId);
                var errorMapping = new Dictionary <string, ParsableFactory <IParsable> > {
                    { "4XX", ODataError.CreateFromDiscriminatorValue },
                    { "5XX", ODataError.CreateFromDiscriminatorValue },
                };
                await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken);
                Console.WriteLine("Success");
            }, new CollectionBinding(calendarIdOption, eventIdOption, eventId1Option, attachmentIdOption, bodyOption, new TypeBinding(typeof(CancellationToken))));
            return(command);
        }