Class: CloudflareClient::Organization::Member

Inherits:
CloudflareClient::Organization show all
Defined in:
lib/cloudflare_client/organization/member.rb

Constant Summary

Constants inherited from CloudflareClient

API_BASE, POSSIBLE_API_SETTINGS, VALID_BUNDLE_METHODS, VALID_DIRECTIONS, VALID_MATCHES, VERSION

Instance Attribute Summary

Attributes inherited from CloudflareClient::Organization

#org_id

Instance Method Summary collapse

Methods inherited from CloudflareClient::Organization

#initialize

Methods inherited from CloudflareClient

#initialize

Constructor Details

This class inherits a constructor from CloudflareClient::Organization

Instance Method Details

#delete(id:) ⇒ Object

remove org member



32
33
34
35
36
# File 'lib/cloudflare_client/organization/member.rb', line 32

def delete(id:)
  id_check(:id, id)

  cf_delete(path: "/organizations/#{org_id}/members/#{id}")
end

#listObject

list org members



7
8
9
# File 'lib/cloudflare_client/organization/member.rb', line 7

def list
  cf_get(path: "/organizations/#{org_id}/members")
end

#show(id:) ⇒ Object

org member details



13
14
15
16
17
# File 'lib/cloudflare_client/organization/member.rb', line 13

def show(id:)
  id_check(:id, id)

  cf_get(path: "/organizations/#{org_id}/members/#{id}")
end

#update(id:, roles:) ⇒ Object

update org member roles



21
22
23
24
25
26
27
28
# File 'lib/cloudflare_client/organization/member.rb', line 21

def update(id:, roles:)
  id_check(:id, id)
  non_empty_array_check(:roles, roles)

  data = {roles: roles}

  cf_patch(path: "/organizations/#{org_id}/members/#{id}", data: data)
end