Class: CircleSo::Resources::AccessGroups

Inherits:
Base
  • Object
show all
Defined in:
lib/circle_so/resources/access_groups.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CircleSo::Resources::Base

Instance Method Details

#add_member(access_group_id, email:, **attrs) ⇒ Object



17
# File 'lib/circle_so/resources/access_groups.rb', line 17

def add_member(access_group_id, email:, **attrs) = client.post("/access_groups/#{access_group_id}/community_members", {email: email, **attrs})

#archive(id) ⇒ Object

DELETE archives the access group (Circle keeps the record).



10
# File 'lib/circle_so/resources/access_groups.rb', line 10

def archive(id) = client.delete("/access_groups/#{id}")

#create(**attrs) ⇒ Object



7
# File 'lib/circle_so/resources/access_groups.rb', line 7

def create(**attrs) = client.post("/access_groups", attrs)

#list(**params) ⇒ Object



6
# File 'lib/circle_so/resources/access_groups.rb', line 6

def list(**params) = client.get("/access_groups", params)

#member(access_group_id, email:) ⇒ Object



16
# File 'lib/circle_so/resources/access_groups.rb', line 16

def member(access_group_id, email:) = client.get("/access_groups/#{access_group_id}/community_member", {email: email})

#members(access_group_id, **params) ⇒ Object

Membership: the group id goes in the URL, the member is identified by email (not member id) in the body/query.



15
# File 'lib/circle_so/resources/access_groups.rb', line 15

def members(access_group_id, **params) = client.get("/access_groups/#{access_group_id}/community_members", params)

#remove_member(access_group_id, email:) ⇒ Object



18
# File 'lib/circle_so/resources/access_groups.rb', line 18

def remove_member(access_group_id, email:) = client.delete("/access_groups/#{access_group_id}/community_members", {email: email})

#unarchive(id) ⇒ Object



11
# File 'lib/circle_so/resources/access_groups.rb', line 11

def unarchive(id) = client.patch("/access_groups/#{id}/unarchive")

#update(id, **attrs) ⇒ Object



8
9
# File 'lib/circle_so/resources/access_groups.rb', line 8

def update(id, **attrs) = client.put("/access_groups/#{id}", attrs)
# DELETE archives the access group (Circle keeps the record).