Sha256: 2bd7f5eac6583f988087be1f46b579757f2ecb6011a3559a475712107b8c5282

Contents?: true

Size: 871 Bytes

Versions: 1

Compression:

Stored size: 871 Bytes

Contents

# -*- encoding: utf-8 -*-

module SendGrid4r
  module REST
    #
    # SendGrid Web API v3 Webhooks
    #
    module Webhooks
      #
      # SendGrid Web API v3 Webhooks ParseApi
      #
      module ParseApi
        include SendGrid4r::REST::Request

        ParseSettings = Struct.new(:url, :hostname, :spam_check_outgoing)

        def self.url
          "#{BASE_URL}/webhooks/parse/settings"
        end

        def self.create_parse_settings(resp)
          return resp if resp.nil?
          ParseSettings.new(
            resp['url'],
            resp['hostname'],
            resp['spam_check_outgoing']
          )
        end

        def get_parse_settings(&block)
          resp = get(@auth, SendGrid4r::REST::Webhooks::ParseApi.url, &block)
          SendGrid4r::REST::Webhooks::ParseApi.create_parse_settings(resp)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sendgrid4r-1.5.1 lib/sendgrid4r/rest/webhooks/parse_api.rb