Class: Dyte::OrganizationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/dyte/resources/organizations.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Dyte::Resource

Instance Method Details

#create(**attributes) ⇒ Object



3
4
5
# File 'lib/dyte/resources/organizations.rb', line 3

def create(**attributes)
  Organization.new post_request("orgs", body: attributes).body.dig("data")
end

#fetch(organization_id:) ⇒ Object



7
8
9
# File 'lib/dyte/resources/organizations.rb', line 7

def fetch(organization_id:)
  Organization.new get_request("orgs/#{organization_id}").body.dig("data")
end

#update(organization_id:, **attributes) ⇒ Object



11
12
13
# File 'lib/dyte/resources/organizations.rb', line 11

def update(organization_id:, **attributes)
  Organization.new patch_request("orgs/#{organization_id}", body: attributes).body.dig("data")
end