예제 #1
0
        private static void AddNewUser()
        {
            var newUser = new Apigee.Net.Models.ApigeeUser();

            Console.WriteLine("Creating a New User: Infomation");
            Console.WriteLine("User Name");
            newUser.Username = Console.ReadLine();
            Console.WriteLine("Full Name");
            newUser.Name = Console.ReadLine();
            Console.WriteLine("Email");
            newUser.Email = Console.ReadLine();
            Console.WriteLine("Password");
            newUser.Password = Console.ReadLine();

            Console.WriteLine("Creating Account...");

            //API call
            var res = aClient.CreateAppUser(newUser);

            if (res.success)
            {
                Console.WriteLine("Success! Account Created..");
            }
            else
            {
                Console.WriteLine("Error! Creation failed.");
                Console.WriteLine("Reason: " + res.Error.Message);
            }
        }
예제 #2
0
 private void HttpWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     string response = "";
     apigeeServer = new ApigeeClient(apigeeUrl, new ApigeeWP7Implementation());
     switch((HttpTools.RequestTypes)e.Argument)
     {
         
         case HttpTools.RequestTypes.Get:
             response = "Getting OrgEvents: " + Environment.NewLine;
             response += apigeeServer.GetUsers().RawResponse;  // wp7Impl.PerformGet(apigeeUrl + "/users");
             break;
         case HttpTools.RequestTypes.Post:
             var user = new ApigeeUser() { Username = "******" + DateTime.Now.Millisecond, Name = "WP7_TestApp User", Email =  "test"+DateTime.Now.Millisecond+"@zaxyinc.com", Password = "******" };
             response = "Creating account for user: "******"(" + user.Email + ")" + Environment.NewLine;
             response += apigeeServer.CreateAppUser(user).RawResponse; //wp7Impl.PerformJsonRequest<string>(apigeeUrl + "/users", HttpTools.RequestTypes.Post, user);
             break;
     }
     e.Result = new KeyValuePair<HttpTools.RequestTypes,string>((HttpTools.RequestTypes)e.Argument,response);
 }
예제 #3
0
        private static void AddNewUser()
        {
            var newUser = new Apigee.Net.Models.ApigeeUser();
            Console.WriteLine("Creating a New User: Infomation");
            Console.WriteLine("User Name");
            newUser.Username = Console.ReadLine();
            Console.WriteLine("Full Name");
            newUser.Name = Console.ReadLine();
            Console.WriteLine("Email");
            newUser.Email = Console.ReadLine();
            Console.WriteLine("Password");
            newUser.Password = Console.ReadLine();

            Console.WriteLine("Creating Account...");

            //API call
            var res = aClient.CreateAppUser(newUser);
            if (res.success)
                Console.WriteLine("Success! Account Created..");
            else
            {
                Console.WriteLine("Error! Creation failed.");
                Console.WriteLine("Reason: " + res.Error.Message);
            }            
        }