Class: Dodopayments::Resources::Blocklist::Customers::Notes

Inherits:
Object
  • Object
show all
Defined in:
lib/dodopayments/resources/blocklist/customers/notes.rb,
sig/dodopayments/resources/blocklist/customers/notes.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Notes

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 Notes.

Parameters:



61
62
63
# File 'lib/dodopayments/resources/blocklist/customers/notes.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#create(entry_id, note:, request_options: {}) ⇒ Dodopayments::Models::Blocklist::Customers::BlockedCustomerNote

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/dodopayments/resources/blocklist/customers/notes.rb', line 19

def create(entry_id, params)
  parsed, options = Dodopayments::Blocklist::Customers::NoteCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["blocklist/customers/%1$s/notes", entry_id],
    body: parsed,
    model: Dodopayments::Blocklist::Customers::BlockedCustomerNote,
    options: options
  )
end

#update(note_id, entry_id:, note:, request_options: {}) ⇒ Dodopayments::Models::Blocklist::Customers::BlockedCustomerNote

Parameters:

  • note_id (String)

    Path param: Note id

  • entry_id (String)

    Path param: Blocklist entry id

  • note (String)

    Body param

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

Returns:

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/dodopayments/resources/blocklist/customers/notes.rb', line 43

def update(note_id, params)
  parsed, options = Dodopayments::Blocklist::Customers::NoteUpdateParams.dump_request(params)
  entry_id =
    parsed.delete(:entry_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["blocklist/customers/%1$s/notes/%2$s", entry_id, note_id],
    body: parsed,
    model: Dodopayments::Blocklist::Customers::BlockedCustomerNote,
    options: options
  )
end