class Postmark::AccountApiClient

Public Class Methods

new(api_token, options = {}) click to toggle source
Calls superclass method
# File lib/postmark/account_api_client.rb, line 5
def initialize(api_token, options = {})
  options[:auth_header_name] = 'X-Postmark-Account-Token'
  super
end

Public Instance Methods

create_domain(attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 80
def create_domain(attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))

  format_response http_client.post('domains', data)
end
create_sender(attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 30
def create_sender(attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))

  format_response http_client.post('senders', data)
end
Also aliased as: create_signature
create_server(attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 128
def create_server(attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))
  format_response http_client.post('servers', data)
end
create_signature(attributes = {})
Alias for: create_sender
delete_domain(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 108
def delete_domain(id)
  format_response http_client.delete("domains/#{id.to_i}")
end
delete_sender(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 59
def delete_sender(id)
  format_response http_client.delete("senders/#{id.to_i}")
end
Also aliased as: delete_signature
delete_server(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 138
def delete_server(id)
  format_response http_client.delete("servers/#{id.to_i}")
end
delete_signature(id)
Alias for: delete_sender
domains(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 64
def domains(options = {})
  find_each('domains', 'Domains', options)
end
get_domain(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 76
def get_domain(id)
  format_response http_client.get("domains/#{id.to_i}")
end
get_domains(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 68
def get_domains(options = {})
  load_batch('domains', 'Domains', options).last
end
get_domains_count(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 72
def get_domains_count(options = {})
  get_resource_count('domains', options)
end
get_sender(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 25
def get_sender(id)
  format_response http_client.get("senders/#{id.to_i}")
end
Also aliased as: get_signature
get_senders(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 15
def get_senders(options = {})
  load_batch('senders', 'SenderSignatures', options).last
end
Also aliased as: get_signatures
get_senders_count(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 20
def get_senders_count(options = {})
  get_resource_count('senders', options)
end
Also aliased as: get_signatures_count
get_server(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 124
def get_server(id)
  format_response http_client.get("servers/#{id.to_i}")
end
get_servers(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 116
def get_servers(options = {})
  load_batch('servers', 'Servers', options).last
end
get_servers_count(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 120
def get_servers_count(options = {})
  get_resource_count('servers', options)
end
get_signature(id)
Alias for: get_sender
get_signatures(options = {})
Alias for: get_senders
get_signatures_count(options = {})
Alias for: get_senders_count
push_templates(attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 142
def push_templates(attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))
  _, batch = format_batch_response(http_client.put('templates/push', data), "Templates")
  batch
end
request_new_sender_dkim(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 54
def request_new_sender_dkim(id)
  format_response http_client.post("senders/#{id.to_i}/requestnewdkim")
end
Also aliased as: request_new_signature_dkim
request_new_signature_dkim(id)
resend_sender_confirmation(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 44
def resend_sender_confirmation(id)
  format_response http_client.post("senders/#{id.to_i}/resend")
end
resend_signature_confirmation(id)
rotate_domain_dkim(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 104
def rotate_domain_dkim(id)
  format_response http_client.post("domains/#{id.to_i}/rotatedkim")
end
senders(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 10
def senders(options = {})
  find_each('senders', 'SenderSignatures', options)
end
Also aliased as: signatures
servers(options = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 112
def servers(options = {})
  find_each('servers', 'Servers', options)
end
signatures(options = {})
Alias for: senders
update_domain(id, attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 86
def update_domain(id, attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))

  format_response http_client.put("domains/#{id.to_i}", data)
end
update_sender(id, attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 37
def update_sender(id, attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))

  format_response http_client.put("senders/#{id.to_i}", data)
end
Also aliased as: update_signature
update_server(id, attributes = {}) click to toggle source
# File lib/postmark/account_api_client.rb, line 133
def update_server(id, attributes = {})
  data = serialize(HashHelper.to_postmark(attributes))
  format_response http_client.put("servers/#{id.to_i}", data)
end
update_signature(id, attributes = {})
Alias for: update_sender
verified_domain_spf?(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 100
def verified_domain_spf?(id)
  !!http_client.post("domains/#{id.to_i}/verifyspf")['SPFVerified']
end
verified_sender_spf?(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 49
def verified_sender_spf?(id)
  !!http_client.post("senders/#{id.to_i}/verifyspf")['SPFVerified']
end
Also aliased as: verified_signature_spf?
verified_signature_spf?(id)
verify_domain_dkim(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 92
def verify_domain_dkim(id)
  format_response http_client.put("domains/#{id.to_i}/verifydkim")
end
verify_domain_return_path(id) click to toggle source
# File lib/postmark/account_api_client.rb, line 96
def verify_domain_return_path(id)
  format_response http_client.put("domains/#{id.to_i}/verifyreturnpath")
end