Class: CloudflareClient::Organization

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

Direct Known Subclasses

AccessRule, Invite, Member, Railgun, Role

Defined Under Namespace

Classes: AccessRule, Invite, Member, Railgun, Role

Constant Summary

Constants inherited from CloudflareClient

API_BASE, POSSIBLE_API_SETTINGS, VALID_BUNDLE_METHODS, VALID_DIRECTIONS, VALID_MATCHES, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Organization

Organization based operations



8
9
10
11
12
# File 'lib/cloudflare_client/organization.rb', line 8

def initialize(args)
  @org_id = args.delete(:org_id)
  id_check(:org_id, org_id)
  super(**args)
end

Instance Attribute Details

#org_idObject (readonly)

Returns the value of attribute org_id.



4
5
6
# File 'lib/cloudflare_client/organization.rb', line 4

def org_id
  @org_id
end

Instance Method Details

#showObject

get an org’s details



16
17
18
# File 'lib/cloudflare_client/organization.rb', line 16

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

#update(name: nil) ⇒ Object

update a given org (only supports name)



22
23
24
25
# File 'lib/cloudflare_client/organization.rb', line 22

def update(name: nil)
  data = name.nil? ? {} : {name: name}
  cf_patch(path: "/organizations/#{org_id}", data: data)
end