class BusinessCentral::Object::Attachment

Constants

OBJECT
OBJECT_METHODS

Public Instance Methods

destroy(parent_id:, attachment_id:) click to toggle source
# File lib/business_central/object/attachment.rb, line 24
def destroy(parent_id:, attachment_id:)
  url = "#{build_url(child_path: OBJECT)}(#{parent_id},#{attachment_id})"
  Request.call(:delete, @client, url, etag: '')
end
update(parent_id:, attachment_id:, **params) click to toggle source
# File lib/business_central/object/attachment.rb, line 15
def update(parent_id:, attachment_id:, **params)
  url = "#{build_url(child_path: OBJECT)}(parentId=#{parent_id},id=#{attachment_id})/content"
  Request.call(:patch, @client, url, etag: '', params: {}) do |request|
    request['Content-Type'] = 'application/json'
    request['If-Match'] = 'application/json'
    request.body = Request.convert(params)
  end
end