Class: OnSIP::Organization
- Inherits:
-
Object
- Object
- OnSIP::Organization
- Extended by:
- ClassMethods
- Includes:
- Model
- Defined in:
- lib/onsip/models/organization.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary
Constants included from Model::ClassMethods
Model::ClassMethods::DEFAULT_OPTIONS
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#add_user(attrs = {}) ⇒ User
Adds a User to the Organization.
- #id ⇒ Object
- #migrate_domain(new_domain) ⇒ Object
Methods included from ClassMethods
add, browse, edit_authenticated, edit_contact, process_browse_organization_response, process_migrate_domain_response, process_read_organization_response, read
Methods included from Model
Methods included from Model::ClassMethods
Instance Method Details
#add_user(attrs = {}) ⇒ User
Adds a User to the Organization
reference at developer.onsip.com/admin-api/Users/#user-add
attrs = => ‘docs’,
'Domain' => 'example.onsip.com',
'Name' => 'Docs',
'Email' => '[email protected]',
'AuthUsername' => 'example',
'Password' => 'mysuperpassword',
'PasswordConfirm' => 'mysuperpassword'
organziation.add_user(attrs)
24 25 26 |
# File 'lib/onsip/models/organization.rb', line 24 def add_user(attrs = {}) User.add self, attrs end |
#id ⇒ Object
5 6 7 |
# File 'lib/onsip/models/organization.rb', line 5 def id @attributes.OrganizationId end |
#migrate_domain(new_domain) ⇒ Object
28 29 30 |
# File 'lib/onsip/models/organization.rb', line 28 def migrate_domain(new_domain) self.class.migrate_domain(self.id, self.attributes.Domain, new_domain) end |