pepipost_gem 2.5.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +6 -13
- data/README.md +123 -77
- data/lib/pepipost.rb +74 -0
- data/lib/{pepipost_gem → pepipost}/api_helper.rb +5 -3
- data/lib/pepipost/configuration.rb +24 -0
- data/lib/{pepipost_gem → pepipost}/controllers/base_controller.rb +10 -5
- data/lib/pepipost/controllers/domain_controller.rb +68 -0
- data/lib/pepipost/controllers/domain_delete_controller.rb +67 -0
- data/lib/pepipost/controllers/events_controller.rb +104 -0
- data/lib/pepipost/controllers/mail_send_controller.rb +54 -0
- data/lib/pepipost/controllers/setrecurringcreditddetails_controller.rb +68 -0
- data/lib/pepipost/controllers/stats_controller.rb +82 -0
- data/lib/pepipost/controllers/subaccounts_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_create_subaccount_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_delete_controller.rb +67 -0
- data/lib/pepipost/controllers/subaccounts_get_sub_accounts_controller.rb +71 -0
- data/lib/pepipost/controllers/subaccounts_setsubaccountcredit_controller.rb +68 -0
- data/lib/pepipost/controllers/subaccounts_update_subaccount_controller.rb +67 -0
- data/lib/pepipost/controllers/suppression_controller.rb +121 -0
- data/lib/{pepipost_gem → pepipost}/exceptions/api_exception.rb +5 -3
- data/lib/pepipost/http/auth/custom_header_auth.rb +16 -0
- data/lib/{pepipost_gem → pepipost}/http/faraday_client.rb +17 -8
- data/lib/{pepipost_gem → pepipost}/http/http_call_back.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_client.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_context.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_method_enum.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_request.rb +5 -3
- data/lib/{pepipost_gem → pepipost}/http/http_response.rb +5 -3
- data/lib/pepipost/models/action_enum.rb +18 -0
- data/lib/pepipost/models/add_email_or_domain_to_suppression_list.rb +48 -0
- data/lib/pepipost/models/aggregated_by_enum.rb +20 -0
- data/lib/pepipost/models/attachments.rb +44 -0
- data/lib/{pepipost_gem → pepipost}/models/base_model.rb +5 -3
- data/lib/pepipost/models/content.rb +44 -0
- data/lib/pepipost/models/create_subaccount.rb +76 -0
- data/lib/pepipost/models/delete_domain.rb +35 -0
- data/lib/pepipost/models/delete_subacoount.rb +35 -0
- data/lib/pepipost/models/domain_struct.rb +45 -0
- data/lib/pepipost/models/email_struct.rb +44 -0
- data/lib/pepipost/models/enable_or_disable_subacoount.rb +44 -0
- data/lib/pepipost/models/events_enum.rb +44 -0
- data/lib/pepipost/models/from.rb +44 -0
- data/lib/pepipost/models/personalizations.rb +135 -0
- data/lib/pepipost/models/remove_email_or_domain_to_suppression_list.rb +48 -0
- data/lib/pepipost/models/send.rb +164 -0
- data/lib/pepipost/models/settings.rb +71 -0
- data/lib/pepipost/models/sort_enum.rb +17 -0
- data/lib/pepipost/models/timeperiod_enum.rb +20 -0
- data/lib/pepipost/models/type_enum.rb +17 -0
- data/lib/pepipost/models/update_credis_of_subaccount.rb +54 -0
- data/lib/pepipost/models/update_recurring_credis_of_subaccount.rb +80 -0
- data/lib/pepipost/models/update_subaccount.rb +72 -0
- data/lib/pepipost/pepipost_client.rb +99 -0
- metadata +98 -54
- data/lib/pepipost_gem.rb +0 -40
- data/lib/pepipost_gem/configuration.rb +0 -17
- data/lib/pepipost_gem/controllers/email_controller.rb +0 -59
- data/lib/pepipost_gem/models/attachments.rb +0 -42
- data/lib/pepipost_gem/models/attribute.rb +0 -42
- data/lib/pepipost_gem/models/email_body.rb +0 -119
- data/lib/pepipost_gem/models/email_body_attachments.rb +0 -42
- data/lib/pepipost_gem/models/from.rb +0 -42
- data/lib/pepipost_gem/models/personalizations.rb +0 -85
- data/lib/pepipost_gem/models/send_email_error.rb +0 -42
- data/lib/pepipost_gem/models/send_email_response.rb +0 -52
- data/lib/pepipost_gem/models/settings.rb +0 -69
- data/lib/pepipost_gem/pepipost_gem_client.rb +0 -19
@@ -0,0 +1,68 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsController
|
8
|
+
class SubaccountsController < BaseController
|
9
|
+
@instance = SubaccountsController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Lets you enable or disable a subaccount
|
20
|
+
# @param [EnableOrDisableSubacoount] body Required parameter: enable or
|
21
|
+
# disable subaccount
|
22
|
+
# @return Object response from the API call
|
23
|
+
def update_subaccounts_patch(body)
|
24
|
+
# Prepare query url.
|
25
|
+
_path_url = '/subaccounts'
|
26
|
+
_query_builder = Configuration.base_uri.dup
|
27
|
+
_query_builder << _path_url
|
28
|
+
_query_url = APIHelper.clean_url _query_builder
|
29
|
+
# Prepare headers.
|
30
|
+
_headers = {
|
31
|
+
'content-type' => 'application/json; charset=utf-8'
|
32
|
+
}
|
33
|
+
# Prepare and execute HttpRequest.
|
34
|
+
_request = @http_client.patch(
|
35
|
+
_query_url,
|
36
|
+
headers: _headers,
|
37
|
+
parameters: body.to_json
|
38
|
+
)
|
39
|
+
CustomHeaderAuth.apply(_request)
|
40
|
+
_context = execute_request(_request)
|
41
|
+
# Validate response against endpoint and global error codes.
|
42
|
+
if _context.response.status_code == 400
|
43
|
+
raise APIException.new(
|
44
|
+
'API Response',
|
45
|
+
_context
|
46
|
+
)
|
47
|
+
elsif _context.response.status_code == 401
|
48
|
+
raise APIException.new(
|
49
|
+
'API Response',
|
50
|
+
_context
|
51
|
+
)
|
52
|
+
elsif _context.response.status_code == 403
|
53
|
+
raise APIException.new(
|
54
|
+
'API Response',
|
55
|
+
_context
|
56
|
+
)
|
57
|
+
elsif _context.response.status_code == 405
|
58
|
+
raise APIException.new(
|
59
|
+
'Invalid input',
|
60
|
+
_context
|
61
|
+
)
|
62
|
+
end
|
63
|
+
validate_response(_context)
|
64
|
+
# Return appropriate response type.
|
65
|
+
_context.response.raw_body
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsCreateSubaccountController
|
8
|
+
class SubaccountsCreateSubaccountController < BaseController
|
9
|
+
@instance = SubaccountsCreateSubaccountController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Subaccount is the same as any regular Pepipost account however the credits
|
20
|
+
# are managed by the master account.
|
21
|
+
# @param [CreateSubaccount] body Required parameter: create sub account
|
22
|
+
# @return Object response from the API call
|
23
|
+
def create_subaccounts_create_subaccount_post(body)
|
24
|
+
# Prepare query url.
|
25
|
+
_path_url = '/subaccounts/createSubaccount'
|
26
|
+
_query_builder = Configuration.base_uri.dup
|
27
|
+
_query_builder << _path_url
|
28
|
+
_query_url = APIHelper.clean_url _query_builder
|
29
|
+
# Prepare headers.
|
30
|
+
_headers = {
|
31
|
+
'content-type' => 'application/json; charset=utf-8'
|
32
|
+
}
|
33
|
+
# Prepare and execute HttpRequest.
|
34
|
+
_request = @http_client.post(
|
35
|
+
_query_url,
|
36
|
+
headers: _headers,
|
37
|
+
parameters: body.to_json
|
38
|
+
)
|
39
|
+
CustomHeaderAuth.apply(_request)
|
40
|
+
_context = execute_request(_request)
|
41
|
+
# Validate response against endpoint and global error codes.
|
42
|
+
if _context.response.status_code == 400
|
43
|
+
raise APIException.new(
|
44
|
+
'API Response',
|
45
|
+
_context
|
46
|
+
)
|
47
|
+
elsif _context.response.status_code == 401
|
48
|
+
raise APIException.new(
|
49
|
+
'API Response',
|
50
|
+
_context
|
51
|
+
)
|
52
|
+
elsif _context.response.status_code == 403
|
53
|
+
raise APIException.new(
|
54
|
+
'API Response',
|
55
|
+
_context
|
56
|
+
)
|
57
|
+
elsif _context.response.status_code == 405
|
58
|
+
raise APIException.new(
|
59
|
+
'Invalid input',
|
60
|
+
_context
|
61
|
+
)
|
62
|
+
end
|
63
|
+
validate_response(_context)
|
64
|
+
# Return appropriate response type.
|
65
|
+
_context.response.raw_body
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsDeleteController
|
8
|
+
class SubaccountsDeleteController < BaseController
|
9
|
+
@instance = SubaccountsDeleteController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Lets you delete a subaccount
|
20
|
+
# @param [DeleteSubacoount] body Required parameter: delete subaccount
|
21
|
+
# @return Object response from the API call
|
22
|
+
def delete_subaccounts_delete_delete(body)
|
23
|
+
# Prepare query url.
|
24
|
+
_path_url = '/subaccounts/delete'
|
25
|
+
_query_builder = Configuration.base_uri.dup
|
26
|
+
_query_builder << _path_url
|
27
|
+
_query_url = APIHelper.clean_url _query_builder
|
28
|
+
# Prepare headers.
|
29
|
+
_headers = {
|
30
|
+
'content-type' => 'application/json; charset=utf-8'
|
31
|
+
}
|
32
|
+
# Prepare and execute HttpRequest.
|
33
|
+
_request = @http_client.delete(
|
34
|
+
_query_url,
|
35
|
+
headers: _headers,
|
36
|
+
parameters: body.to_json
|
37
|
+
)
|
38
|
+
CustomHeaderAuth.apply(_request)
|
39
|
+
_context = execute_request(_request)
|
40
|
+
# Validate response against endpoint and global error codes.
|
41
|
+
if _context.response.status_code == 400
|
42
|
+
raise APIException.new(
|
43
|
+
'API Response',
|
44
|
+
_context
|
45
|
+
)
|
46
|
+
elsif _context.response.status_code == 401
|
47
|
+
raise APIException.new(
|
48
|
+
'API Response',
|
49
|
+
_context
|
50
|
+
)
|
51
|
+
elsif _context.response.status_code == 403
|
52
|
+
raise APIException.new(
|
53
|
+
'API Response',
|
54
|
+
_context
|
55
|
+
)
|
56
|
+
elsif _context.response.status_code == 405
|
57
|
+
raise APIException.new(
|
58
|
+
'Invalid input',
|
59
|
+
_context
|
60
|
+
)
|
61
|
+
end
|
62
|
+
validate_response(_context)
|
63
|
+
# Return appropriate response type.
|
64
|
+
_context.response.raw_body
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsGetSubAccountsController
|
8
|
+
class SubaccountsGetSubAccountsController < BaseController
|
9
|
+
@instance = SubaccountsGetSubAccountsController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Lets you fetch all the subaccounts created by you
|
20
|
+
# @param [String] limit Required parameter: Example:
|
21
|
+
# @param [String] offset Required parameter: Example:
|
22
|
+
# @return Object response from the API call
|
23
|
+
def get_subaccounts_get_sub_accounts_get(limit,
|
24
|
+
offset)
|
25
|
+
# Prepare query url.
|
26
|
+
_path_url = '/subaccounts/getSubAccounts'
|
27
|
+
_query_builder = Configuration.base_uri.dup
|
28
|
+
_query_builder << _path_url
|
29
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
30
|
+
_query_builder,
|
31
|
+
{
|
32
|
+
'limit' => limit,
|
33
|
+
'offset' => offset
|
34
|
+
},
|
35
|
+
array_serialization: Configuration.array_serialization
|
36
|
+
)
|
37
|
+
_query_url = APIHelper.clean_url _query_builder
|
38
|
+
# Prepare and execute HttpRequest.
|
39
|
+
_request = @http_client.get(
|
40
|
+
_query_url
|
41
|
+
)
|
42
|
+
CustomHeaderAuth.apply(_request)
|
43
|
+
_context = execute_request(_request)
|
44
|
+
# Validate response against endpoint and global error codes.
|
45
|
+
if _context.response.status_code == 400
|
46
|
+
raise APIException.new(
|
47
|
+
'API Response',
|
48
|
+
_context
|
49
|
+
)
|
50
|
+
elsif _context.response.status_code == 401
|
51
|
+
raise APIException.new(
|
52
|
+
'API Response',
|
53
|
+
_context
|
54
|
+
)
|
55
|
+
elsif _context.response.status_code == 403
|
56
|
+
raise APIException.new(
|
57
|
+
'API Response',
|
58
|
+
_context
|
59
|
+
)
|
60
|
+
elsif _context.response.status_code == 405
|
61
|
+
raise APIException.new(
|
62
|
+
'Invalid input',
|
63
|
+
_context
|
64
|
+
)
|
65
|
+
end
|
66
|
+
validate_response(_context)
|
67
|
+
# Return appropriate response type.
|
68
|
+
_context.response.raw_body
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsSetsubaccountcreditController
|
8
|
+
class SubaccountsSetsubaccountcreditController < BaseController
|
9
|
+
@instance = SubaccountsSetsubaccountcreditController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Lets you add(or remove) credits to a subaccount
|
20
|
+
# @param [UpdateCredisOfSubaccount] body Required parameter: Update credit
|
21
|
+
# account
|
22
|
+
# @return Object response from the API call
|
23
|
+
def create_subaccounts_setsubaccountcredit_post(body)
|
24
|
+
# Prepare query url.
|
25
|
+
_path_url = '/subaccounts/setsubaccountcredit'
|
26
|
+
_query_builder = Configuration.base_uri.dup
|
27
|
+
_query_builder << _path_url
|
28
|
+
_query_url = APIHelper.clean_url _query_builder
|
29
|
+
# Prepare headers.
|
30
|
+
_headers = {
|
31
|
+
'content-type' => 'application/json; charset=utf-8'
|
32
|
+
}
|
33
|
+
# Prepare and execute HttpRequest.
|
34
|
+
_request = @http_client.post(
|
35
|
+
_query_url,
|
36
|
+
headers: _headers,
|
37
|
+
parameters: body.to_json
|
38
|
+
)
|
39
|
+
CustomHeaderAuth.apply(_request)
|
40
|
+
_context = execute_request(_request)
|
41
|
+
# Validate response against endpoint and global error codes.
|
42
|
+
if _context.response.status_code == 400
|
43
|
+
raise APIException.new(
|
44
|
+
'API Response',
|
45
|
+
_context
|
46
|
+
)
|
47
|
+
elsif _context.response.status_code == 401
|
48
|
+
raise APIException.new(
|
49
|
+
'API Response',
|
50
|
+
_context
|
51
|
+
)
|
52
|
+
elsif _context.response.status_code == 403
|
53
|
+
raise APIException.new(
|
54
|
+
'API Response',
|
55
|
+
_context
|
56
|
+
)
|
57
|
+
elsif _context.response.status_code == 405
|
58
|
+
raise APIException.new(
|
59
|
+
'Invalid input',
|
60
|
+
_context
|
61
|
+
)
|
62
|
+
end
|
63
|
+
validate_response(_context)
|
64
|
+
# Return appropriate response type.
|
65
|
+
_context.response.raw_body
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SubaccountsUpdateSubaccountController
|
8
|
+
class SubaccountsUpdateSubaccountController < BaseController
|
9
|
+
@instance = SubaccountsUpdateSubaccountController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# lets you update credentials and credit type of a subaccount.
|
20
|
+
# @param [UpdateSubaccount] body Required parameter: Update sub account
|
21
|
+
# @return Object response from the API call
|
22
|
+
def create_subaccounts_update_subaccount_post(body)
|
23
|
+
# Prepare query url.
|
24
|
+
_path_url = '/subaccounts/updateSubaccount'
|
25
|
+
_query_builder = Configuration.base_uri.dup
|
26
|
+
_query_builder << _path_url
|
27
|
+
_query_url = APIHelper.clean_url _query_builder
|
28
|
+
# Prepare headers.
|
29
|
+
_headers = {
|
30
|
+
'content-type' => 'application/json; charset=utf-8'
|
31
|
+
}
|
32
|
+
# Prepare and execute HttpRequest.
|
33
|
+
_request = @http_client.post(
|
34
|
+
_query_url,
|
35
|
+
headers: _headers,
|
36
|
+
parameters: body.to_json
|
37
|
+
)
|
38
|
+
CustomHeaderAuth.apply(_request)
|
39
|
+
_context = execute_request(_request)
|
40
|
+
# Validate response against endpoint and global error codes.
|
41
|
+
if _context.response.status_code == 400
|
42
|
+
raise APIException.new(
|
43
|
+
'API Response',
|
44
|
+
_context
|
45
|
+
)
|
46
|
+
elsif _context.response.status_code == 401
|
47
|
+
raise APIException.new(
|
48
|
+
'API Response',
|
49
|
+
_context
|
50
|
+
)
|
51
|
+
elsif _context.response.status_code == 403
|
52
|
+
raise APIException.new(
|
53
|
+
'API Response',
|
54
|
+
_context
|
55
|
+
)
|
56
|
+
elsif _context.response.status_code == 405
|
57
|
+
raise APIException.new(
|
58
|
+
'Invalid input',
|
59
|
+
_context
|
60
|
+
)
|
61
|
+
end
|
62
|
+
validate_response(_context)
|
63
|
+
# Return appropriate response type.
|
64
|
+
_context.response.raw_body
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# SuppressionController
|
8
|
+
class SuppressionController < BaseController
|
9
|
+
@instance = SuppressionController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# This API allows you to suppress an email address and block any future
|
20
|
+
# email delivery attempts on this email address.
|
21
|
+
# @param [AddEmailOrDomainToSuppressionList] body Required parameter: add
|
22
|
+
# email or domain to suppression list
|
23
|
+
# @return Object response from the API call
|
24
|
+
def add_domain_or_email_to_suppression_list(body)
|
25
|
+
# Prepare query url.
|
26
|
+
_path_url = '/suppression'
|
27
|
+
_query_builder = Configuration.base_uri.dup
|
28
|
+
_query_builder << _path_url
|
29
|
+
_query_url = APIHelper.clean_url _query_builder
|
30
|
+
# Prepare headers.
|
31
|
+
_headers = {
|
32
|
+
'content-type' => 'application/json; charset=utf-8'
|
33
|
+
}
|
34
|
+
# Prepare and execute HttpRequest.
|
35
|
+
_request = @http_client.post(
|
36
|
+
_query_url,
|
37
|
+
headers: _headers,
|
38
|
+
parameters: body.to_json
|
39
|
+
)
|
40
|
+
CustomHeaderAuth.apply(_request)
|
41
|
+
_context = execute_request(_request)
|
42
|
+
# Validate response against endpoint and global error codes.
|
43
|
+
if _context.response.status_code == 400
|
44
|
+
raise APIException.new(
|
45
|
+
'API Response',
|
46
|
+
_context
|
47
|
+
)
|
48
|
+
elsif _context.response.status_code == 401
|
49
|
+
raise APIException.new(
|
50
|
+
'API Response',
|
51
|
+
_context
|
52
|
+
)
|
53
|
+
elsif _context.response.status_code == 403
|
54
|
+
raise APIException.new(
|
55
|
+
'API Response',
|
56
|
+
_context
|
57
|
+
)
|
58
|
+
elsif _context.response.status_code == 405
|
59
|
+
raise APIException.new(
|
60
|
+
'Invalid input',
|
61
|
+
_context
|
62
|
+
)
|
63
|
+
end
|
64
|
+
validate_response(_context)
|
65
|
+
# Return appropriate response type.
|
66
|
+
_context.response.raw_body
|
67
|
+
end
|
68
|
+
|
69
|
+
# Use this API to remove an email address or a recipient domain from the
|
70
|
+
# suppression list. You can remove multiple email addresses and recipient
|
71
|
+
# domains together by passing them as values & separating them using commas
|
72
|
+
# as shown below.
|
73
|
+
# @param [RemoveEmailOrDomainToSuppressionList] body Required parameter:
|
74
|
+
# remove email or domain to suppression list
|
75
|
+
# @return Object response from the API call
|
76
|
+
def remove_domain_or_email_to_suppression_list(body)
|
77
|
+
# Prepare query url.
|
78
|
+
_path_url = '/suppression'
|
79
|
+
_query_builder = Configuration.base_uri.dup
|
80
|
+
_query_builder << _path_url
|
81
|
+
_query_url = APIHelper.clean_url _query_builder
|
82
|
+
# Prepare headers.
|
83
|
+
_headers = {
|
84
|
+
'content-type' => 'application/json; charset=utf-8'
|
85
|
+
}
|
86
|
+
# Prepare and execute HttpRequest.
|
87
|
+
_request = @http_client.delete(
|
88
|
+
_query_url,
|
89
|
+
headers: _headers,
|
90
|
+
parameters: body.to_json
|
91
|
+
)
|
92
|
+
CustomHeaderAuth.apply(_request)
|
93
|
+
_context = execute_request(_request)
|
94
|
+
# Validate response against endpoint and global error codes.
|
95
|
+
if _context.response.status_code == 400
|
96
|
+
raise APIException.new(
|
97
|
+
'API Response',
|
98
|
+
_context
|
99
|
+
)
|
100
|
+
elsif _context.response.status_code == 401
|
101
|
+
raise APIException.new(
|
102
|
+
'API Response',
|
103
|
+
_context
|
104
|
+
)
|
105
|
+
elsif _context.response.status_code == 403
|
106
|
+
raise APIException.new(
|
107
|
+
'API Response',
|
108
|
+
_context
|
109
|
+
)
|
110
|
+
elsif _context.response.status_code == 405
|
111
|
+
raise APIException.new(
|
112
|
+
'Invalid input',
|
113
|
+
_context
|
114
|
+
)
|
115
|
+
end
|
116
|
+
validate_response(_context)
|
117
|
+
# Return appropriate response type.
|
118
|
+
_context.response.raw_body
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|