class NotionRb::Api::Destroy

Public Class Methods

new(params) click to toggle source
Calls superclass method NotionRb::Api::Base::new
# File lib/notion_rb/api/destroy.rb, line 6
def initialize(params)
  super

  @parent_id = params[:parent_id]
end

Private Instance Methods

params() click to toggle source
# File lib/notion_rb/api/destroy.rb, line 18
def params
  {
    requestId: SecureRandom.uuid,
    transactions: [{
      id: SecureRandom.uuid,
      operations: [{
        id: @notion_id,
        table: 'block',
        path: [],
        command: 'update',
        args: { alive: false }
      }, {
        id: @parent_id,
        table: 'block',
        path: ['content'],
        command: 'listRemove',
        args: { id: @notion_id }
      }]
    }]
  }
end
url() click to toggle source
# File lib/notion_rb/api/destroy.rb, line 14
def url
  'submitTransaction'
end