lib/google_directory/user_commands.rb
def user_create( attributes: )
      # http://blog.liveedu.tv/ruby-generate-random-string/
      password = SecureRandom.base64
      defaults  = { suspended: true, password: password, change_password_at_next_login: true }
      user_attr = defaults.merge( attributes )
      # create a google user object
      user_object = Google::Apis::AdminDirectoryV1::User.new user_attr
      # create user in directory services
      response = service.insert_user( user_object )
      {response: response, attributes: attributes[:primary_email], command: :user_create}
    end
def user_create( attributes: )
      # http://blog.liveedu.tv/ruby-generate-random-string/
      password = SecureRandom.base64
      defaults  = { suspended: true, password: password, change_password_at_next_login: true }
      user_attr = defaults.merge( attributes )
      # create a google user object
      user_object = Google::Apis::AdminDirectoryV1::User.new user_attr
      # create user in directory services
      response = service.insert_user( user_object )
      {response: response, attributes: attributes[:primary_email], command: :user_create}
    end
@note creates a new Google Directory User

 @param attributes [Hash] this attribute MUST include: { primary_email: "username@domain.com", name: {given_name: "First Names", family_name: "LAST NAMES" } }
 @return [Hash] formatted as {success: {command: :user_create, attributes: {primary_email: "user@domain"}, response: GoogleUserObject } }