Class: GoogleAppsApi::UserEntity
- Defined in:
- lib/google_apps_api/provisioning.rb
Constant Summary
Constants inherited from Entity
Instance Attribute Summary collapse
-
#admin ⇒ Object
Returns the value of attribute admin.
-
#agreed_to_terms ⇒ Object
Returns the value of attribute agreed_to_terms.
-
#change_password_at_next_login ⇒ Object
Returns the value of attribute change_password_at_next_login.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#family_name ⇒ Object
Returns the value of attribute family_name.
-
#given_name ⇒ Object
Returns the value of attribute given_name.
-
#ip_whitelisted ⇒ Object
Returns the value of attribute ip_whitelisted.
-
#quota_limit ⇒ Object
Returns the value of attribute quota_limit.
-
#suspended ⇒ Object
Returns the value of attribute suspended.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Entity
Instance Method Summary collapse
- #entity_for_base_calendar ⇒ Object
- #get_base_calendar(c_api, *args) ⇒ Object
- #get_calendars(c_api, *args) ⇒ Object
-
#initialize(*args) ⇒ UserEntity
constructor
A new instance of UserEntity.
Methods inherited from Entity
#==, #full_id, #full_id_escaped, #id_escaped, #qualified_id, #qualified_id_escaped
Constructor Details
#initialize(*args) ⇒ UserEntity
Returns a new instance of UserEntity.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/google_apps_api/provisioning.rb', line 81 def initialize(*args) = args. if (_xml = [:xml]) xml = _xml.at_css("entry") || _xml @kind = "user" @id = xml.at_css("apps|login").attribute("userName").content @domain = xml.at_css("id").content.gsub(/^.+\/feeds\/([^\/]+)\/.+$/,"\\1") @family_name = xml.at_css("apps|name").attribute("familyName").content @given_name = xml.at_css("apps|name").attribute("givenName").content @suspended = xml.at_css("apps|login").attribute("suspended").content @ip_whitelisted = xml.at_css("apps|login").attribute("ipWhitelisted").content @admin = xml.at_css("apps|login").attribute("admin").content @change_password_at_next_login = xml.at_css("apps|login").attribute("changePasswordAtNextLogin").content @agreed_to_terms = xml.at_css("apps|login").attribute("agreedToTerms").content @quota_limit = xml.at_css("apps|quota").attribute("limit").content else if args.first.kind_of?(String) super(:user => args.first) else super(.merge(:kind => "user")) end end end |
Instance Attribute Details
#admin ⇒ Object
Returns the value of attribute admin.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def admin @admin end |
#agreed_to_terms ⇒ Object
Returns the value of attribute agreed_to_terms.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def agreed_to_terms @agreed_to_terms end |
#change_password_at_next_login ⇒ Object
Returns the value of attribute change_password_at_next_login.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def change_password_at_next_login @change_password_at_next_login end |
#domain ⇒ Object
Returns the value of attribute domain.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def domain @domain end |
#family_name ⇒ Object
Returns the value of attribute family_name.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def family_name @family_name end |
#given_name ⇒ Object
Returns the value of attribute given_name.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def given_name @given_name end |
#ip_whitelisted ⇒ Object
Returns the value of attribute ip_whitelisted.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def ip_whitelisted @ip_whitelisted end |
#quota_limit ⇒ Object
Returns the value of attribute quota_limit.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def quota_limit @quota_limit end |
#suspended ⇒ Object
Returns the value of attribute suspended.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def suspended @suspended end |
#username ⇒ Object
Returns the value of attribute username.
79 80 81 |
# File 'lib/google_apps_api/provisioning.rb', line 79 def username @username end |
Instance Method Details
#entity_for_base_calendar ⇒ Object
106 107 108 |
# File 'lib/google_apps_api/provisioning.rb', line 106 def entity_for_base_calendar CalendarEntity.new(self.full_id) end |
#get_base_calendar(c_api, *args) ⇒ Object
110 111 112 |
# File 'lib/google_apps_api/provisioning.rb', line 110 def get_base_calendar(c_api, *args) c_api.retrieve_calendar_for_user(self.entity_for_base_calendar, self, *args) end |
#get_calendars(c_api, *args) ⇒ Object
114 115 116 |
# File 'lib/google_apps_api/provisioning.rb', line 114 def get_calendars(c_api, *args) c_api.retrieve_calendars_for_user(self, *args) end |