Sha256: eb43398def8c7a002aadf3ec2d2737507959e2bdfc849a7397f75c4478c1cfd8

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

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

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

      # https://resend.com/docs/api-reference/domains/update-domain
      def update(params)
        path = "domains/#{params[:id]}"
        Resend::Request.new(path, params, "patch").perform
      end

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

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

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

      # https://resend.com/docs/api-reference/domains/verify-domain
      def verify(domain_id = "")
        path = "domains/#{domain_id}/verify"
        Resend::Request.new(path, {}, "post").perform
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
resend-0.18.0 lib/resend/domains.rb
resend-0.17.2 lib/resend/domains.rb
resend-0.17.1 lib/resend/domains.rb
resend-0.17.0 lib/resend/domains.rb
resend-0.16.0 lib/resend/domains.rb
resend-0.15.0 lib/resend/domains.rb
resend-0.14.0 lib/resend/domains.rb
resend-0.13.0 lib/resend/domains.rb
resend-0.12.0 lib/resend/domains.rb
resend-0.11.0 lib/resend/domains.rb