示例#1
0
        public static GetUserIdResult Execute(string apiKey, string authToken, string login)
        {
            var uri = uriBase + "&api_key=" + apiKey + "&auth_token=" + authToken + "&login="******"URI: " + uri);
            }

            return(GetFunctionCore.Execute <GetUserIdResult>(uri, DumpXml));
        }
示例#2
0
        public static InviteCollaboratorsResult Execute(string apiKey, string authToken,
                                                        Target target, long targetId,
                                                        long[] userIds, string[] emails, Role itemRole,
                                                        bool resendInvite, bool noEmail,
                                                        params string[] parameters)
        {
            var sb = new StringBuilder();

            sb.Append(uriBase);
            sb.Append("&api_key=").Append(apiKey);
            sb.Append("&auth_token=").Append(authToken);
            sb.Append("&target=").Append(target.ToParameterValue());
            sb.Append("&target_id=").Append(targetId);
            if (userIds == null || userIds.Length == 0)
            {
                // 空でも必須パラメータ扱いであるようなので明示指定します。
                sb.Append("&user_ids[]=");
            }
            else
            {
                foreach (var userId in userIds)
                {
                    sb.Append("&user_ids[]=").Append(userId);
                }
            }
            if (emails == null || emails.Length == 0)
            {
                // 空でも必須パラメータ扱いであるようなので明示指定します。
                sb.Append("&emails[]=");
            }
            else
            {
                foreach (var email in emails)
                {
                    sb.Append("&emails[]=").Append(email);
                }
            }
            sb.Append("&item_role_name=").Append(itemRole.ToParameterValue());
            sb.Append("&resend_invite=").Append(resendInvite);
            sb.Append("&no_email=").Append(noEmail);
            foreach (var p in parameters)
            {
                sb.Append("&params[]=").Append(p);
            }

            var uri = sb.ToString();

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <InviteCollaboratorsResult>(uri, DumpXml));
        }
示例#3
0
        public static GetFileInfoResult Execute(string apiKey, string authToken, long fileId)
        {
            var uri = uriBase + "&api_key=" + apiKey + "&auth_token=" + authToken + "&file_id=" + fileId;

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <GetFileInfoResult>(uri, DumpXml));
        }
示例#4
0
        public static GetAuthTokenResult Execute(string apiKey, string ticket)
        {
            var uri = uriBase + "&api_key=" + apiKey + "&ticket=" + ticket;

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <GetAuthTokenResult>(uri, DumpXml));
        }
示例#5
0
        public static GetTicketResult Execute(string apiKey)
        {
            var uri = uriBase + "&api_key=" + apiKey;

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <GetTicketResult>(uri, DumpXml));
        }
示例#6
0
        public static DeleteResult Execute(string apiKey, string authToken, Target target, long targetId)
        {
            var uri = uriBase + "&api_key=" + apiKey + "&auth_token=" + authToken +
                      "&target=" + target.ToParameterValue() + "&target_id=" + targetId;

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <DeleteResult>(uri, DumpXml));
        }
        public static CreateFolderResult Execute(string apiKey, string authToken, long parentId, string name, bool share)
        {
            var sb = new StringBuilder();

            sb.Append(uriBase);
            sb.Append("&api_key=").Append(apiKey);
            sb.Append("&auth_token=").Append(authToken);
            sb.Append("&parent_id=").Append(parentId);
            sb.Append("&name=").Append(Uri.EscapeUriString(name));
            sb.Append("&share=").Append(share ? "1" : "0");

            var uri = sb.ToString();

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <CreateFolderResult>(uri, DumpXml));
        }
        public static GetAccountTreeResult Execute(string apiKey, string authToken, long folderId, params string[] parameters)
        {
            var sb = new StringBuilder();

            sb.Append(uriBase);
            sb.Append("&api_key=").Append(apiKey);
            sb.Append("&auth_token=").Append(authToken);
            sb.Append("&folder_id=").Append(folderId);
            foreach (var p in parameters)
            {
                sb.Append("&params[]=").Append(p);
            }

            var uri = sb.ToString();

            if (DumpUri)
            {
                Console.WriteLine("URI: " + uri);
            }

            return(GetFunctionCore.Execute <GetAccountTreeResult>(uri, DumpXml));
        }