Module: Zanshin::SDK::OrganizationFollowing

Included in:
Client
Defined in:
lib/zanshin/organization_following.rb

Overview

Zanshin SDK Organization Following

Instance Method Summary collapse

Instance Method Details

#accept_organization_following_request(organization_id, following_id) ⇒ Object

Accepts a request to follow another organization [#reference](api.zanshin.tenchisecurity.com/#operation/acceptOrganizationFollowingRequestByToken)

Parameters:

  • organization_id (UUID)

    of the organization who was invited to follow another

  • following_id (UUID)

    of the organization who is going to be followed

Returns:

  • an Object describing the newly established following relationship



76
77
78
79
80
81
# File 'lib/zanshin/organization_following.rb', line 76

def accept_organization_following_request(organization_id, following_id)
  @http.request(
    'POST',
    "/organizations/#{validate_uuid(organization_id)}/following/requests/#{validate_uuid(following_id)}/accept"
  )
end

#decline_organization_following_request(organization_id, following_id) ⇒ Object

Declines a request to follow another organization [#reference](api.zanshin.tenchisecurity.com/#operation/declineOrganizationFollowingRequestByToken)

Parameters:

  • organization_id (UUID)

    of the organization who was invited to follow another

  • following_id (UUID)

    of the organization who is going to be followed

Returns:

  • an Object describing the newly established following relationship



90
91
92
93
94
95
# File 'lib/zanshin/organization_following.rb', line 90

def decline_organization_following_request(organization_id, following_id)
  @http.request(
    'POST',
    "/organizations/#{validate_uuid(organization_id)}/following/requests/#{validate_uuid(following_id)}/decline"
  )
end

#get_organization_following_request(organization_id, following_id) ⇒ Object

Returns a request received by an organization to follow another [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationFollowingRequestByToken)

Parameters:

  • organization_id (UUID)

    of the organization

  • following_id (UUID)

    of the follower request

Returns:

  • an Object representing the organization following request



62
63
64
65
66
67
# File 'lib/zanshin/organization_following.rb', line 62

def get_organization_following_request(organization_id, following_id)
  @http.request(
    'GET',
    "/organizations/#{validate_uuid(organization_id)}/following/requests/#{validate_uuid(following_id)}"
  )
end

#iter_organization_following(organization_id) ⇒ Object

Organization Following Enumerator of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationFollowing)

Parameters:

  • organization_id (UUID)

    of the organization

Returns:

  • an Organization Following Enumerator object



17
18
19
20
21
22
23
# File 'lib/zanshin/organization_following.rb', line 17

def iter_organization_following(organization_id)
  Enumerator.new do |yielder|
    @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/following").each do |e|
      yielder.yield e
    end
  end
end

#iter_organization_following_requests(organization_id) ⇒ Object

Organization Following Requests Enumerator of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationFollowingRequests)

Parameters:

  • organization_id (UUID)

    of the organization

Returns:

  • an Organization Following Requests Enumerator object



47
48
49
50
51
52
53
# File 'lib/zanshin/organization_following.rb', line 47

def iter_organization_following_requests(organization_id)
  Enumerator.new do |yielder|
    @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/following/requests").each do |e|
      yielder.yield e
    end
  end
end

#stop_organization_following(organization_id, following_id) ⇒ Object

Organization Followers Enumerator of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/removeOrganizationFollowingById)

Parameters:

  • organization_id (UUID)

    of the organization

  • following_id (UUID)

    of the follower

Returns:

  • a Boolean with result



32
33
34
35
# File 'lib/zanshin/organization_following.rb', line 32

def stop_organization_following(organization_id, following_id)
  @http.request('DELETE',
                "/organizations/#{validate_uuid(organization_id)}/following/#{validate_uuid(following_id)}")
end