Class: GoogleAppsApi::UserEntity

Inherits:
Entity
  • Object
show all
Defined in:
lib/google_apps_api/provisioning.rb

Constant Summary

Constant Summary

Constants inherited from Entity

Entity::VALID_ENTITY_TYPES

Instance Attribute Summary (collapse)

Attributes inherited from Entity

#id, #kind

Instance Method Summary (collapse)

Methods inherited from Entity

#==, #full_id, #full_id_escaped, #id_escaped, #qualified_id, #qualified_id_escaped

Constructor Details

- (UserEntity) initialize(*args)

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)
  options = args.extract_options!
  if (_xml = options[: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(options.merge(:kind => "user"))
    end
  end
end

Instance Attribute Details

- (Object) admin

Returns the value of attribute admin



79
80
81
# File 'lib/google_apps_api/provisioning.rb', line 79

def admin
  @admin
end

- (Object) agreed_to_terms

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

- (Object) change_password_at_next_login

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
end

- (Object) domain

Returns the value of attribute domain



79
80
81
# File 'lib/google_apps_api/provisioning.rb', line 79

def domain
  @domain
end

- (Object) family_name

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

- (Object) given_name

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

- (Object) ip_whitelisted

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

- (Object) quota_limit

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

- (Object) suspended

Returns the value of attribute suspended



79
80
81
# File 'lib/google_apps_api/provisioning.rb', line 79

def suspended
  @suspended
end

- (Object) username

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

- (Object) entity_for_base_calendar



106
107
108
# File 'lib/google_apps_api/provisioning.rb', line 106

def entity_for_base_calendar
  CalendarEntity.new(self.full_id)
end

- (Object) get_base_calendar(c_api, *args)



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

- (Object) get_calendars(c_api, *args)



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