Module: UU::OS::Friend

Extended by:
Friend
Included in:
Friend
Defined in:
uu_os_client-0.10.6/lib/uu/os/friend.rb,
uu_os_client-0.10.6/lib/uu/os/friend/friend_create.rb,
uu_os_client-0.10.6/lib/uu/os/friend/friend_attributes.rb,
uu_os_client-0.10.6/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)

Instance Method Details

- (Object) activate_access(friend_uri)

This command activates a friend. The friend will be again with access to the territory where is located.

Parameters:

  • friend_uri (String, UU::OS::UESURI)

    UESURI of a friend that the access will be reactivated



73
74
75
76
77
78
# File 'uu_os_client-0.10.6/lib/uu/os/friend.rb', line 73

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.

Parameters:

  • personal_territory_uri (String, UU::OS::UESURI)

    UESURI of the personal territory where a new friend will be created

  • DTO (FriendCreate)

    containing attributes of the new friend

Returns:



59
60
61
62
63
64
65
66
67
# File 'uu_os_client-0.10.6/lib/uu/os/friend.rb', line 59

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)

This command deactivates a friend. The friend will be without access to the territory where is located.

Parameters:

  • friend_uri (String, UU::OS::UESURI)

    UESURI of a friend that the access will be canceled



84
85
86
87
88
89
# File 'uu_os_client-0.10.6/lib/uu/os/friend.rb', line 84

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)

This command returns attributes representing the friend specified by the friend_uri parameter. The command does not change the state of the friend in the system.

Parameters:

  • friend_uri (String, UU::OS::UESURI)

    UESURI of the friend whose attributes are returned

Returns:



26
27
28
29
30
31
32
# File 'uu_os_client-0.10.6/lib/uu/os/friend.rb', line 26

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.

Parameters:

  • friend_uri (String, UU::OS::UESURI)

    UESURI of the friend whose attributes are to be changed

  • criteria (FriendSetAttributes) (defaults to: nil)

    DTO containing new attributes of the friend

Returns:



41
42
43
44
45
46
47
48
49
# File 'uu_os_client-0.10.6/lib/uu/os/friend.rb', line 41

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