/// <summary>
        /// Create a user (hosted email account) using Google's Provisioning API.
        /// </summary>
        /// <param name="userName">The username for the account.  This username must be unique.</param>
        /// <param name="password">Password for the account.</param>
        /// <param name="firstName">The first name of the user.</param>
        /// <param name="lastName">The last name of the user.</param>
        /// <param name="quota">The quota (storage space) allowed for the user's email account, in megabytes.</param>
        public ProvisioningResponse CreateUser( 
            string userName, string password, string firstName, string lastName, int quota)
        {
            GoogleUser user =
                new GoogleUser( userName, password, firstName, lastName, quota );

            CreateUserAction action =
                new CreateUserAction( user );

            return controller.Execute( action );
        }
        /// <summary>
        /// Retrieves account information for a user.
        /// </summary>
        /// <param name="userName">The username to retrieve information for.</param>
        /// <param name="user">Out parameter populated with the retrieved information.</param>
        public ProvisioningResponse RetrieveUser( string userName, out GoogleUser user )
        {
            RetrieveUserAction action =
                new RetrieveUserAction( userName );

            ProvisioningResponse response =
                controller.Execute( action );

            user = action.GoogleUser;

            return response;
        }
        /// <summary>
        /// Update a user.  Note that the username cannot be updated.
        /// </summary>
        /// <param name="userName">The username for the account.</param>
        /// <param name="password">Password for the account.</param>
        /// <param name="firstName">The first name of the user.</param>
        /// <param name="lastName">The last name of the user.</param>
        public ProvisioningResponse UpdateUser( 
            string userName, string password, string firstName, string lastName)
        {
            GoogleUser user =
                new GoogleUser( userName, password, firstName, lastName );

            UpdateUserAction action =
                new UpdateUserAction( user );

            return controller.Execute( action );
        }
コード例 #4
0
 static void print(GoogleUser user)
 {
     Console.WriteLine("User first name: "+user.FirstName);
     Console.WriteLine("     last name: "+user.LastName);
 }
 /// <summary>
 /// Retrieves account information for a user using Google's Provisioning API.
 /// </summary>
 /// <param name="userName">The username to retrieve information for.</param>
 /// <param name="user">Out parameter populated with the retrieved information.</param>
 public ProvisioningResponse RetrieveUser( string userName, out GoogleUser user )
 {
     return provisioningManager.RetrieveUser( userName, out user );
 }