Sha256: 4f1ebed5219def8a19e9ab94d8117535cef248d5341ee6a695eb61a7b0a46a96

Contents?: true

Size: 968 Bytes

Versions: 11

Compression:

Stored size: 968 Bytes

Contents

# frozen_string_literal: true

require "resend/request"
require "resend/errors"

module Resend
  # Audiences api wrapper
  module Audiences
    class << self
      # https://resend.com/docs/api-reference/audiences/create-audience
      def create(params)
        path = "audiences"
        Resend::Request.new(path, params, "post").perform
      end

      # https://resend.com/docs/api-reference/audiences/get-audience
      def get(audience_id = "")
        path = "audiences/#{audience_id}"
        Resend::Request.new(path, {}, "get").perform
      end

      # https://resend.com/docs/api-reference/audiences/list-audiences
      def list
        path = "audiences"
        Resend::Request.new(path, {}, "get").perform
      end

      # https://resend.com/docs/api-reference/audiences/delete-audience
      def remove(audience_id = "")
        path = "audiences/#{audience_id}"
        Resend::Request.new(path, {}, "delete").perform
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
resend-0.17.2 lib/resend/audiences.rb
resend-0.17.1 lib/resend/audiences.rb
resend-0.17.0 lib/resend/audiences.rb
resend-0.16.0 lib/resend/audiences.rb
resend-0.15.0 lib/resend/audiences.rb
resend-0.14.0 lib/resend/audiences.rb
resend-0.13.0 lib/resend/audiences.rb
resend-0.12.0 lib/resend/audiences.rb
resend-0.11.0 lib/resend/audiences.rb
resend-0.10.0 lib/resend/audiences.rb
resend-0.9.0 lib/resend/audiences.rb