Sha256: cd04321b2abe0a09e4f09ed0f5cb6dfa82f7d17f51e83a01d7b6b2668ae782f9
Contents?: true
Size: 1.09 KB
Versions: 11
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true module Mailersend # SMS Recipient endpoint from MailerSend API. class SMSRecipient attr_accessor :client, :status, :sms_number_id, :sms_recipient_id, :page, :limit def initialize(client = Mailersend::Client.new) @client = client @status = status @sms_number_id = sms_number_id @sms_recipient_id = sms_recipient_id @page = page @limit = limit end def list(page: nil, limit: nil) hash = { 'page' => page, 'limit' => limit } client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-recipients', query: URI.encode_www_form(hash))) end def get(sms_recipient_id:) client.http.get("#{API_URL}/sms-recipients/#{sms_recipient_id}") end def update(sms_recipient_id:, status: nil) hash = { 'status' => status } client.http.put("#{API_URL}/sms-recipients/#{sms_recipient_id}", json: hash.compact) end end end
Version data entries
11 entries across 11 versions & 1 rubygems