Class: Courier::Resources::Tenants::Preferences::Items
- Inherits:
-
Object
- Object
- Courier::Resources::Tenants::Preferences::Items
- Defined in:
- lib/courier/resources/tenants/preferences/items.rb,
sig/courier/resources/tenants/preferences/items.rbs
Overview
Manage tenants — the organizations, teams, or accounts your users belong to — along with their users and default preferences.
Instance Method Summary collapse
-
#delete(topic_id, tenant_id:, request_options: {}) ⇒ nil
Removes a tenant's default preference for one subscription topic, addressed by tenant id and topic id.
-
#initialize(client:) ⇒ Items
constructor
private
A new instance of Items.
-
#update(topic_id, tenant_id:, status:, custom_routing: nil, has_custom_routing: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Tenants::Preferences::ItemUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Items
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Items.
79 80 81 |
# File 'lib/courier/resources/tenants/preferences/items.rb', line 79 def initialize(client:) @client = client end |
Instance Method Details
#delete(topic_id, tenant_id:, request_options: {}) ⇒ nil
Removes a tenant's default preference for one subscription topic, addressed by tenant id and topic id.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/courier/resources/tenants/preferences/items.rb', line 62 def delete(topic_id, params) parsed, = Courier::Tenants::Preferences::ItemDeleteParams.dump_request(params) tenant_id = parsed.delete(:tenant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["tenants/%1$s/default_preferences/items/%2$s", tenant_id, topic_id], model: NilClass, options: ) end |
#update(topic_id, tenant_id:, status:, custom_routing: nil, has_custom_routing: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Tenants::Preferences::ItemUpdateParams for more details.
Sets a tenant's default opt-in status for one subscription topic, which applies to every member unless a user sets their own override.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/courier/resources/tenants/preferences/items.rb', line 33 def update(topic_id, params) parsed, = Courier::Tenants::Preferences::ItemUpdateParams.dump_request(params) tenant_id = parsed.delete(:tenant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["tenants/%1$s/default_preferences/items/%2$s", tenant_id, topic_id], body: parsed, model: NilClass, options: ) end |