Esempio n. 1
0
        /// <summary>
        /// Updates an basic auth entry.
        /// </summary>
        /// <param name="requestObject">The updated basic auth informations.</param>
        /// <returns>True if successfull.</returns>
        public async Task <bool> UpdateBasicAuth(BasicAuthObject requestObject)
        {
            var param    = new[] { JsonConvert.SerializeObject(requestObject) };
            var response = await CallAction <bool>("updateBasicAuth", param);

            return(response);
        }
        /// <summary>
        /// Updates an basic auth entry.
        /// </summary>
        /// <param name="requestObject">The updated basic auth informations.</param>
        /// <returns>True if successfull.</returns>
        public bool UpdateBasicAuth(BasicAuthObject requestObject)
        {
            var param    = new[] { JsonConvert.SerializeObject(requestObject) };
            var response = ApiHandler.CallAction <DefaultReturnObject>(Device, "/accountsV2/updateBasicAuth",
                                                                       param, JDownloaderHandler.LoginObject, true);

            return(response != null);
        }
        /// <summary>
        /// Adds an basic authorization to the client.
        /// </summary>
        /// <param name="requestObject">Contains the needed properties for the request e.g. the username and password.</param>
        /// <returns>True if successfull.</returns>
        public bool AddBasicAuth(BasicAuthObject requestObject)
        {
            var param = new[]
            { requestObject.Type.ToString(), requestObject.Hostmask, requestObject.Username, requestObject.Password };
            var response = ApiHandler.CallAction <DefaultReturnObject>(Device, "/accountsV2/addBasicAuth",
                                                                       param, JDownloaderHandler.LoginObject, true);

            return(response != null);
        }