Sha256: e36c9c5932d39187020dfcab5ad89faf55a359a904b444e62dd97a3a2b13bc23

Contents?: true

Size: 744 Bytes

Versions: 10

Compression:

Stored size: 744 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require_relative "data_response"

module WhatsappSdk
  module Api
    module Responses
      class SuccessResponse < DataResponse
        sig { params(response: T::Hash[T.untyped, T.untyped]).void }
        def initialize(response:)
          @success = T.let(response["success"], T::Boolean)
          super(response)
        end

        sig { override.params(response: T::Hash[T.untyped, T.untyped]).returns(T.nilable(SuccessResponse)) }
        def self.build_from_response(response:)
          return unless response["success"]

          new(response: response)
        end

        sig { returns(T::Boolean) }
        def success?
          @success
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
whatsapp_sdk-0.12.1 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.12.0 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.11.0 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.10.0 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.9.2 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.9.1 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.9.0 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.8.0 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.7.3 lib/whatsapp_sdk/api/responses/success_response.rb
whatsapp_sdk-0.7.2 lib/whatsapp_sdk/api/responses/success_response.rb