Module: Zanshin::SDK::OrganizationFollowers

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

Overview

Zanshin SDK Organization Followers

Instance Method Summary collapse

Instance Method Details

#create_organization_follower_request(organization_id, token) ⇒ Object

Create organization follower request [#reference](api.zanshin.tenchisecurity.com/#operation/createOrganizationFollowRequests)

Parameters:

  • organization_id (UUID)

    of the organization

  • token (UUID)

    of the follower request

Returns:

  • an Organization Followers Requests Enumerator object



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

def create_organization_follower_request(organization_id, token)
  body = {
    'token' => validate_uuid(token)
  }
  @http.request('POST', "/organizations/#{validate_uuid(organization_id)}/followers/requests", body)
end

#delete_organization_follower_request(organization_id, token) ⇒ Object

Parameters:

  • organization_id (UUID)

    of the organization

  • token (UUID)

    of the follower request

Returns:

  • a Boolean with result



88
89
90
91
# File 'lib/zanshin/organization_followers.rb', line 88

def delete_organization_follower_request(organization_id, token)
  @http.request('DELETE',
                "/organizations/#{validate_uuid(organization_id)}/followers/requests/#{validate_uuid(token)}")
end

#get_organization_follower_request(organization_id, token) ⇒ Object

Parameters:

  • organization_id (UUID)

    of the organization

  • token (UUID)

    of the follower request

Returns:

  • an Object representing the organization follower



76
77
78
79
# File 'lib/zanshin/organization_followers.rb', line 76

def get_organization_follower_request(organization_id, token)
  @http.request('GET',
                "/organizations/#{validate_uuid(organization_id)}/followers/requests/#{validate_uuid(token)}")
end

#iter_organization_follower_requests(organization_id) ⇒ Object

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

Parameters:

  • organization_id (UUID)

    of the organization

Returns:

  • an Organization Followers Requests Enumerator object



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

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

#iter_organization_followers(organization_id) ⇒ Object

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

Parameters:

  • organization_id (UUID)

    of the organization

Returns:

  • an Organization Followers Enumerator object



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

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

#stop_organization_follower(organization_id, follower_id) ⇒ Object

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

Parameters:

  • organization_id (UUID)

    of the organization

  • follower_id (UUID)

    of the follower

Returns:

  • a Boolean with result



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

def stop_organization_follower(organization_id, follower_id)
  @http.request('DELETE',
                "/organizations/#{validate_uuid(organization_id)}/followers/#{validate_uuid(follower_id)}")
end