Sha256: 8333e3c29e1a028468ba71c92016e2dba409b64c142838d251d1aa839686070b

Contents?: true

Size: 503 Bytes

Versions: 5

Compression:

Stored size: 503 Bytes

Contents

module RDStation
  class Events
    include HTTParty
    include ::RDStation::RetryableRequest

    EVENTS_ENDPOINT = 'https://api.rd.services/platform/events'.freeze

    def initialize(authorization:)
      @authorization = authorization
    end

    def create(payload)
      retryable_request(@authorization) do |authorization|
        response = self.class.post(EVENTS_ENDPOINT, headers: authorization.headers, body: payload.to_json)
        ApiResponse.build(response)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.5.1 lib/rdstation/events.rb
rdstation-ruby-client-2.5.0 lib/rdstation/events.rb
rdstation-ruby-client-2.4.0 lib/rdstation/events.rb
rdstation-ruby-client-2.3.1 lib/rdstation/events.rb
rdstation-ruby-client-2.3.0 lib/rdstation/events.rb