Class: Posthubify::ProfilesResource
- Inherits:
-
Object
- Object
- Posthubify::ProfilesResource
- Defined in:
- lib/posthubify/resources/accounts.rb
Overview
Profiles (Node sdk .profiles) — workspace/brand separation.
Instance Method Summary collapse
-
#create(input) ⇒ Object
Create a profile (input: { name }).
-
#delete(id) ⇒ Object
Delete a profile.
-
#get(id) ⇒ Object
Get a single profile.
-
#initialize(http) ⇒ ProfilesResource
constructor
A new instance of ProfilesResource.
-
#list ⇒ Object
List all profiles.
-
#update(id, input) ⇒ Object
Update a profile (input: name/description/color/isDefault).
Constructor Details
#initialize(http) ⇒ ProfilesResource
Returns a new instance of ProfilesResource.
6 7 8 |
# File 'lib/posthubify/resources/accounts.rb', line 6 def initialize(http) @http = http end |
Instance Method Details
#create(input) ⇒ Object
Create a profile (input: { name }).
21 22 23 |
# File 'lib/posthubify/resources/accounts.rb', line 21 def create(input) @http.data('POST', '/profiles', body: input) end |
#delete(id) ⇒ Object
Delete a profile.
31 32 33 |
# File 'lib/posthubify/resources/accounts.rb', line 31 def delete(id) @http.data('DELETE', "/profiles/#{id}") end |
#get(id) ⇒ Object
Get a single profile.
16 17 18 |
# File 'lib/posthubify/resources/accounts.rb', line 16 def get(id) @http.data('GET', "/profiles/#{id}") end |
#list ⇒ Object
List all profiles.
11 12 13 |
# File 'lib/posthubify/resources/accounts.rb', line 11 def list @http.data('GET', '/profiles') end |
#update(id, input) ⇒ Object
Update a profile (input: name/description/color/isDefault).
26 27 28 |
# File 'lib/posthubify/resources/accounts.rb', line 26 def update(id, input) @http.data('PATCH', "/profiles/#{id}", body: input) end |