Class: Trycourier::Resources::Tenants::Preferences::Items

Inherits:
Object
  • Object
show all
Defined in:
lib/trycourier/resources/tenants/preferences/items.rb

Instance Method Summary collapse

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.

Parameters:



75
76
77
# File 'lib/trycourier/resources/tenants/preferences/items.rb', line 75

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(topic_id, tenant_id: , request_options: {}) ⇒ nil

Remove Default Preferences For Topic

Parameters:

  • topic_id (String)

    Id fo the susbcription topic you want to have a default preference for.

  • tenant_id (String)

    Id of the tenant to update the default preferences for.

  • request_options (Trycourier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/trycourier/resources/tenants/preferences/items.rb', line 58

def delete(topic_id, params)
  parsed, options = Trycourier::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: 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.

Create or Replace Default Preferences For Topic

Parameters:

  • topic_id (String)

    Path param: Id fo the susbcription topic you want to have a default preference f

  • tenant_id (String)

    Path param: Id of the tenant to update the default preferences for.

  • status (Symbol, Trycourier::Models::SubscriptionTopicNew::Status)

    Body param:

  • custom_routing (Array<Symbol, Trycourier::Models::ChannelClassification>, nil)

    Body param: The default channels to send to this tenant when has_custom_routing

  • has_custom_routing (Boolean, nil)

    Body param: Override channel routing with custom preferences. This will override

  • request_options (Trycourier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/trycourier/resources/tenants/preferences/items.rb', line 30

def update(topic_id, params)
  parsed, options = Trycourier::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: options
  )
end