private static async Task <(CGetExtendedUpdateInfoResponse.GetExtendedUpdateInfoResponse, string)> GetExtendedUpdateInfo(
            CSOAPCommon.Cookie cookie,
            string token,
            string[] revisionId,
            CTAC ctac)
        {
            CSOAPCommon.Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo", token, false);

            envelope.Body.GetExtendedUpdateInfo = new CGetExtendedUpdateInfoRequest.GetExtendedUpdateInfo()
            {
                Cookie      = cookie,
                RevisionIDs = new CGetExtendedUpdateInfoRequest.RevisionIDs()
                {
                    Int = revisionId
                },
                InfoTypes = new CSOAPCommon.InfoTypes()
                {
                    XmlUpdateFragmentType = new string[]
                    {
                        "FileUrl",
                        "FileDecryption",
                        "Extended",
                        "LocalizedProperties",
                        "Eula",
                        "Published",
                        "Core",
                        "VerificationRule"
                    }
                },
                Locales = new CSOAPCommon.Locales()
                {
                    String = new string[] { "en-US", "en" }
                },
                DeviceAttributes = ctac.DeviceAttributes
            };

            string message = SerializeSOAPEnvelope(envelope);

            string response = await PostToWindowsUpdateAsync("GetCookie", message, false);

            CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response);

            return(renvelope.Body.GetExtendedUpdateInfoResponse, response);
        }
        private static async Task <(CSyncUpdatesResponse.SyncUpdatesResponse, string)> SyncUpdates(
            CSOAPCommon.Cookie cookie,
            string token,
            IEnumerable <string> InstalledNonLeafUpdateIDs,
            IEnumerable <string> OtherCachedUpdateIDs,
            string[] CategoryIdentifiers,
            CTAC ctac
            )
        {
            string[] _InstalledNonLeafUpdateIDs = Constants.InstalledNonLeafUpdateIDs.Select(x => x.ToString()).ToArray();

            if (InstalledNonLeafUpdateIDs != null)
            {
                var tmplist = _InstalledNonLeafUpdateIDs.ToList();
                tmplist.AddRange(InstalledNonLeafUpdateIDs);
                _InstalledNonLeafUpdateIDs = tmplist.ToArray();
            }

            CSOAPCommon.Envelope envelope = GetEnveloppe("SyncUpdates", token, false);

            envelope.Body.SyncUpdates = new CSyncUpdatesRequest.SyncUpdates()
            {
                Cookie     = cookie,
                Parameters = new CSyncUpdatesRequest.Parameters()
                {
                    ExpressQuery = "false",
                    InstalledNonLeafUpdateIDs = new CSyncUpdatesRequest.InstalledNonLeafUpdateIDs()
                    {
                        Int = _InstalledNonLeafUpdateIDs
                    },
                    OtherCachedUpdateIDs = new CSyncUpdatesRequest.OtherCachedUpdateIDs()
                    {
                        Int = OtherCachedUpdateIDs != null?OtherCachedUpdateIDs.ToArray() : new string[0]
                    },
                    SkipSoftwareSync = "false",
                    NeedTwoGroupOutOfScopeUpdates = "true",
                    FilterAppCategoryIds          = CategoryIdentifiers != null && CategoryIdentifiers.Length != 0 ? new CSyncUpdatesRequest.FilterAppCategoryIds()
                    {
                        CategoryIdentifier = new CSyncUpdatesRequest.CategoryIdentifier()
                        {
                            Id = CategoryIdentifiers != null ? CategoryIdentifiers : new string[0]
                        }
                    } : null,
                    AlsoPerformRegularSync       = "false",
                    ComputerSpec                 = "",
                    ExtendedUpdateInfoParameters = new CSyncUpdatesRequest.ExtendedUpdateInfoParameters()
                    {
                        XmlUpdateFragmentTypes = new CSyncUpdatesRequest.XmlUpdateFragmentTypes()
                        {
                            XmlUpdateFragmentType = new string[]
                            {
                                "Extended",
                                "LocalizedProperties",
                                "Eula",
                                "Published",
                                "Core"
                            }
                        },
                        Locales = new CSOAPCommon.Locales()
                        {
                            String = new string[] { "en-US", "en" }
                        }
                    },
                    ClientPreferredLanguages = "",
                    ProductsParameters       = new CSyncUpdatesRequest.ProductsParameters()
                    {
                        SyncCurrentVersionOnly = ctac.SyncCurrentVersionOnly ? "true" : "false",
                        DeviceAttributes       = ctac.DeviceAttributes,
                        CallerAttributes       = ctac.CallerAttributes,
                        Products = ctac.Products
                    }
                }
            };

            string message = SerializeSOAPEnvelope(envelope);

            string response = await PostToWindowsUpdateAsync("SyncUpdates", message, false);

            CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response);

            return(renvelope.Body.SyncUpdatesResponse, response);
        }