Class: GData::Apps::ProvisioningMessage

Inherits:
RequestMessage
  • Object
show all
Defined in:
lib/gdata/apps/provisioning.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeProvisioningMessage

Returns a new instance of ProvisioningMessage.



396
397
398
399
# File 'lib/gdata/apps/provisioning.rb', line 396

def initialize
  super
  self.elements["atom:entry"].add_element "atom:category", {"scheme" => "http://schemas.google.com/g/2005#kind"}
end

Instance Method Details

#about_login(user_name, passwd = nil, hash_function_name = nil, admin = nil, suspended = nil, change_passwd_at_next_login = nil) ⇒ Object

adds <apps:login> element in the message body. warning : if valued admin, suspended, or change_passwd_at_next_login must be the STRINGS “true” or “false”, not the boolean true or false when needed to construct the message, should always been used before other “about_” methods so that the category tag can be overwritten only values permitted for hash_function_function_name : “SHA-1” or nil



405
406
407
408
409
410
411
412
413
414
# File 'lib/gdata/apps/provisioning.rb', line 405

def (user_name, passwd=nil, hash_function_name=nil, admin=nil, suspended=nil, =nil)
  self.elements["atom:entry/atom:category"].add_attribute("term", "http://schemas.google.com/apps/2006#user")
  self.elements["atom:entry"].add_element "apps:login", {"userName" => user_name }
  self.elements["atom:entry/apps:login"].add_attribute("password", passwd) if not passwd.nil?
  self.elements["atom:entry/apps:login"].add_attribute("hashFunctionName", hash_function_name) if not hash_function_name.nil?
  self.elements["atom:entry/apps:login"].add_attribute("admin", admin) if not admin.nil?
  self.elements["atom:entry/apps:login"].add_attribute("suspended", suspended) if not suspended.nil?
  self.elements["atom:entry/apps:login"].add_attribute("changePasswordAtNextLogin", ) if not .nil?
  return self
end

#about_name(family_name, given_name) ⇒ Object

adds <apps:name> in the message body.



424
425
426
427
# File 'lib/gdata/apps/provisioning.rb', line 424

def about_name(family_name, given_name)
  self.elements["atom:entry"].add_element "apps:name", {"familyName" => family_name, "givenName" => given_name }
  return self
end

#about_nickname(name) ⇒ Object

adds <apps:nickname> in the message body.



430
431
432
433
434
# File 'lib/gdata/apps/provisioning.rb', line 430

def about_nickname(name)
  self.elements["atom:entry/atom:category"].add_attribute("term", "http://schemas.google.com/apps/2006#nickname")
  self.elements["atom:entry"].add_element "apps:nickname", {"name" => name}
  return self
end

#about_quota(limit) ⇒ Object

adds <apps:quota> in the message body. limit in MB: integer



418
419
420
421
# File 'lib/gdata/apps/provisioning.rb', line 418

def about_quota(limit)
  self.elements["atom:entry"].add_element "apps:quota", {"limit" => limit }
  return self
end