Class: Whatsapp::SubscribedApp::Response::Unsubscription

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/whatsapp/subscribed_app/response/unsubscription.rb

Overview

The response to unsubscribing this app from a WABA's webhook notifications: {success}. Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-account/subscribed-apps-api

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success: false) ⇒ Unsubscription

Returns a new instance of Unsubscription.

Parameters:

  • success (Boolean) (defaults to: false)


15
16
17
# File 'lib/ruby/whatsapp/subscribed_app/response/unsubscription.rb', line 15

def initialize(success: false)
  @success = success
end

Instance Attribute Details

#successBoolean

Returns Whether the app was unsubscribed.

Returns:

  • (Boolean)

    Whether the app was unsubscribed.



12
13
14
# File 'lib/ruby/whatsapp/subscribed_app/response/unsubscription.rb', line 12

def success
  @success
end

Class Method Details

.deserialize(response) ⇒ Unsubscription

Parameters:

  • response (Hash, nil)

    The parsed response body.

Returns:



22
23
24
25
26
# File 'lib/ruby/whatsapp/subscribed_app/response/unsubscription.rb', line 22

def deserialize(response)
  response ||= {}

  new(success: response["success"] == true)
end