Module: UU::OS::Friend
- Extended by:
- Friend
- Included in:
- Friend
- Defined in:
- uu_os-0.29.16/lib/uu/os/friend.rb,
uu_os-0.29.16/lib/uu/os/friend/friend_create.rb,
uu_os-0.29.16/lib/uu/os/friend/friend_attributes.rb,
uu_os-0.29.16/lib/uu/os/friend/friend_set_attributes.rb
Overview
Friend service
Defined Under Namespace
Classes: FriendAttributes, FriendCreate, FriendSetAttributes
Constant Summary
- PATH =
Service path for the REST API
'ues/myterritory/person/UESFriend'
Instance Method Summary (collapse)
-
- (Object) activate_access(friend_uri)
Activates a friend.
-
- (UU::OS::UESURI) create(personal_territory_uri, criteria = nil)
Creates a new friend.
-
- (Object) deactivate_access(friend_uri)
Deactivates a friend.
-
- (FriendAttributes) get_attributes(friend_uri)
Returns attributes representing the friend specified by the
friend_uri
parameter. -
- (UU::OS::UESURI) set_attributes(friend_uri, criteria = nil)
Command for setting attributes of a friend.
Instance Method Details
- (Object) activate_access(friend_uri)
Activates a friend. The friend will be again with access to the territory where is located.
122 123 124 125 126 127 |
# File 'uu_os-0.29.16/lib/uu/os/friend.rb', line 122 def activate_access(friend_uri) svc = UU::OS::REST::RemoteClient.new(Friend) UU::OS::QoS::QoSHandler.auto_retry do svc.post('activateAccess', friend_uri) end end |
- (UU::OS::UESURI) create(personal_territory_uri, criteria = nil)
Creates a new friend. The command creates a new friend in a specified personal territory. At the very least meta artifact must be specified in FriendCreate DTO.
105 106 107 108 109 110 111 112 113 |
# File 'uu_os-0.29.16/lib/uu/os/friend.rb', line 105 def create(personal_territory_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Friend) payload = UU::OS::Friend::FriendCreate.new(criteria).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', personal_territory_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) deactivate_access(friend_uri)
Deactivates a friend. The friend will be without access to the territory where is located.
136 137 138 139 140 141 |
# File 'uu_os-0.29.16/lib/uu/os/friend.rb', line 136 def deactivate_access(friend_uri) svc = UU::OS::REST::RemoteClient.new(Friend) UU::OS::QoS::QoSHandler.auto_retry do svc.post('deactivateAccess', friend_uri) end end |
- (FriendAttributes) get_attributes(friend_uri)
Returns attributes representing the friend specified by the
friend_uri
parameter. The command does not change the state of
the friend in the system.
29 30 31 32 33 34 35 |
# File 'uu_os-0.29.16/lib/uu/os/friend.rb', line 29 def get_attributes(friend_uri) svc = UU::OS::REST::RemoteClient.new(Friend) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', friend_uri) return Friend::FriendAttributes.new(res) end end |
- (UU::OS::UESURI) set_attributes(friend_uri, criteria = nil)
Command for setting attributes of a friend. The command can't modify references to objects like location, competent role and so on.
58 59 60 61 62 63 64 65 66 |
# File 'uu_os-0.29.16/lib/uu/os/friend.rb', line 58 def set_attributes(friend_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Friend) payload = UU::OS::Friend::FriendSetAttributes.new(criteria).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', friend_uri, payload) return UU::OS::UESURI.new(res) end end |