Method: Bitly::API::Bitlink#update

Defined in:
lib/bitly/api/bitlink.rb

#update(archived: nil, tags: nil, created_at: nil, title: nil, deeplinks: nil, created_by: nil, long_url: nil, client_id: nil, custom_bitlinks: nil, link: nil, id: nil, references: nil) ⇒ Object

Update the Bitlink. [‘PATCH /v4/bitlink/bitlink`](dev.bitly.com/v4/#operation/updateBitlink)

The parameters listed below are from the documentation. Some only work if you have a Bitly Pro account.

Examples:

bitlink.update(title: "New title")

Parameters:

  • archived (Boolean) (defaults to: nil)
  • tags (Array<String>) (defaults to: nil)
  • created_at (String) (defaults to: nil)
  • title (String) (defaults to: nil)
  • deeplinks (Array<Bitly::API::Bitlink::Deeplink>) (defaults to: nil)
  • created_by (String) (defaults to: nil)
  • long_url (String) (defaults to: nil)
  • client_id (String) (defaults to: nil)
  • custom_bitlinks (Array<String>) (defaults to: nil)
  • link (String) (defaults to: nil)
  • id (String) (defaults to: nil)
  • references (Hash<String, String>) (defaults to: nil)


282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/bitly/api/bitlink.rb', line 282

def update(
  archived: nil,
  tags: nil,
  created_at: nil,
  title: nil,
  deeplinks: nil,
  created_by: nil,
  long_url: nil,
  client_id: nil,
  custom_bitlinks: nil,
  link: nil,
  id: nil,
  references: nil
)
  @response = @client.request(
    path: "/bitlinks/#{@id}",
    method: "PATCH",
    params: {
      "archived" => archived,
      "tags" => tags,
      "created_at" => created_at,
      "title" => title,
      "deeplinks" => deeplinks,
      "created_by" => created_by,
      "long_url" =>long_url ,
      "client_id" => client_id,
      "custom_bitlinks" => custom_bitlinks,
      "link" => link,
      "id" => id,
      "references" => references
    }
  )
  assign_attributes(@response.body)
  self
end