-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced deliverability reporting request/models
- Loading branch information
1 parent
318f18b
commit 4fd88dd
Showing
10 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from .result_enum import ResultEnum | ||
|
||
class BlockListResult(object): | ||
"""BlockListResult. | ||
:param id: | ||
:type id: string | ||
:param name: | ||
:type name: string | ||
:param result: | ||
:type result: ~mailosaur.models.ResultEnum | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.id = data.get('id', None) | ||
self.name = data.get('name', None) | ||
self.result = ResultEnum(data.get('result', None)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
class Content(object): | ||
"""Content. | ||
:param embed: | ||
:type embed: boolean | ||
:param iframe: | ||
:type iframe: boolean | ||
:param object: | ||
:type object: boolean | ||
:param script: | ||
:type script: boolean | ||
:param short_urls: | ||
:type short_urls: boolean | ||
:param text_size: | ||
:type text_size: int | ||
:param total_size: | ||
:type total_size: int | ||
:param missing_alt: | ||
:type missing_alt: boolean | ||
:param missing_list_unsubscribe: | ||
:type missing_list_unsubscribe: boolean | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.embed = data.get('embed', None) | ||
self.iframe = data.get('iframe', None) | ||
self.object = data.get('object', None) | ||
self.script = data.get('script', None) | ||
self.short_urls = data.get('shortUrls', None) | ||
self.text_size = data.get('textSize', None) | ||
self.total_size = data.get('totalSize', None) | ||
self.missing_alt = data.get('missingAlt', None) | ||
self.missing_list_unsubscribe = data.get('missingListUnsubscribe', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from .email_authentication_result import EmailAuthenticationResult | ||
from .block_list_result import BlockListResult | ||
from .content import Content | ||
from .dns_records import DnsRecords | ||
from .spam_assassin_result import SpamAssassinResult | ||
|
||
class DeliverabilityReport(object): | ||
"""DeliverabilityReport. | ||
:param spf: | ||
:type spf: ~mailosaur.models.EmailAuthenticationResult | ||
:param dkim: | ||
:type dkim: list[~mailosaur.models.EmailAuthenticationResult] | ||
:param dmarc: | ||
:type dmarc: ~mailosaur.models.EmailAuthenticationResult | ||
:param block_list: | ||
:type block_lists: list[~mailosaur.models.BlockListResult] | ||
:param content: | ||
:type content: ~mailosaur.models.Content | ||
:param dns_records: | ||
:type dns_records: ~mailosaur.models.DnsRecords | ||
:param spam_assassin: | ||
:type spam_assassin: ~mailosaur.models.SpamAssassinResult | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.spf = EmailAuthenticationResult(data.get('spf', None)) | ||
self.dkim = [EmailAuthenticationResult(i) for i in data.get('dkim', None)] | ||
self.dmarc = EmailAuthenticationResult(data.get('dmarc', None)) | ||
self.block_lists = [BlockListResult(i) for i in data.get('blockLists', None)] | ||
self.content = Content(data.get('content', None)) | ||
self.dns_records = DnsRecords(data.get('dnsRecords', None)) | ||
self.spam_assassin = SpamAssassinResult(data.get('spamAssassin', None)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from .spam_assassin_rule import SpamAssassinRule | ||
|
||
class DnsRecords(object): | ||
"""DnsRecords. | ||
:param a: | ||
:type a: list[string] | ||
:param mx: | ||
:type mx: list[string] | ||
:param ptr: | ||
:type ptr: list[string] | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.a = [a for a in data.get('a', None)] | ||
self.mx = [mx for mx in data.get('mx', None)] | ||
self.ptr = [ptr for ptr in data.get('ptr', None)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from .spam_filter_results import SpamFilterResults | ||
from .result_enum import ResultEnum | ||
|
||
class EmailAuthenticationResult(object): | ||
"""EmailAuthenticationResult. | ||
:param result: | ||
:type result: ~mailosaur.models.ResultEnum | ||
:param description: | ||
:type description: string | ||
:param raw_value: | ||
:type raw_value: string | ||
:param tags: | ||
:type tags: dict | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.result = ResultEnum(data.get('result', None)) | ||
self.description = data.get('description', None) | ||
self.raw_value = data.get('rawValue', None) | ||
self.tags = data.get('tags', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from enum import Enum | ||
|
||
class ResultEnum(Enum): | ||
Pass = "Pass" | ||
Warning = "Warning" | ||
Fail = "Fail" | ||
Timeout = "Timeout" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from .spam_assassin_rule import SpamAssassinRule | ||
from .result_enum import ResultEnum | ||
|
||
class SpamAssassinResult(object): | ||
"""SpamAssassinResult. | ||
:param score: | ||
:type score: float | ||
:param result: | ||
:type result: ~mailosaur.models.ResultEnum | ||
:param rules: | ||
:type rules: list[~mailosaur.models.SpamAssassinRule] | ||
""" | ||
|
||
def __init__(self, data=None): | ||
if data is None: | ||
data = {} | ||
|
||
self.score = data.get('score', 0.0) | ||
self.result = ResultEnum(data.get('result', None)) | ||
self.rules = [SpamAssassinRule(i) for i in data.get('rules', None)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters