mandrill-api 1.0.44 → 1.0.45
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mandrill.rb +10 -1
- data/lib/mandrill/api.rb +212 -0
- data/lib/mandrill/errors.rb +12 -0
- metadata +4 -4
data/lib/mandrill.rb
CHANGED
@@ -66,7 +66,13 @@ module Mandrill
|
|
66
66
|
'Invalid_Template' => InvalidTemplateError,
|
67
67
|
'Unknown_Webhook' => UnknownWebhookError,
|
68
68
|
'Unknown_InboundDomain' => UnknownInboundDomainError,
|
69
|
-
'Unknown_Export' => UnknownExportError
|
69
|
+
'Unknown_Export' => UnknownExportError,
|
70
|
+
'IP_ProvisionLimit' => IPProvisionLimitError,
|
71
|
+
'Unknown_Pool' => UnknownPoolError,
|
72
|
+
'Unknown_IP' => UnknownIPError,
|
73
|
+
'Invalid_EmptyDefaultPool' => InvalidEmptyDefaultPoolError,
|
74
|
+
'Invalid_DeleteDefaultPool' => InvalidDeleteDefaultPoolError,
|
75
|
+
'Invalid_DeleteNonEmptyPool' => InvalidDeleteNonEmptyPoolError
|
70
76
|
}
|
71
77
|
|
72
78
|
begin
|
@@ -108,6 +114,9 @@ module Mandrill
|
|
108
114
|
def whitelists()
|
109
115
|
Whitelists.new self
|
110
116
|
end
|
117
|
+
def ips()
|
118
|
+
Ips.new self
|
119
|
+
end
|
111
120
|
def internal()
|
112
121
|
Internal.new self
|
113
122
|
end
|
data/lib/mandrill/api.rb
CHANGED
@@ -1064,6 +1064,218 @@ module Mandrill
|
|
1064
1064
|
return @master.call 'whitelists/delete', _params
|
1065
1065
|
end
|
1066
1066
|
|
1067
|
+
end
|
1068
|
+
class Ips
|
1069
|
+
attr_accessor :master
|
1070
|
+
|
1071
|
+
def initialize(master)
|
1072
|
+
@master = master
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
# Lists your dedicated IPs.
|
1076
|
+
# @return [Array] an array of structs for each dedicated IP
|
1077
|
+
# - [Hash] return[] information about a single dedicated IP
|
1078
|
+
# - [String] ip the ip address
|
1079
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1080
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1081
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1082
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1083
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1084
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1085
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1086
|
+
# - [Hash] warmup information about the ip's warmup status
|
1087
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1088
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1089
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1090
|
+
def list()
|
1091
|
+
_params = {}
|
1092
|
+
return @master.call 'ips/list', _params
|
1093
|
+
end
|
1094
|
+
|
1095
|
+
# Retrieves information about a single dedicated ip.
|
1096
|
+
# @param [String] ip a dedicated IP address
|
1097
|
+
# @return [Hash] Information about the dedicated ip
|
1098
|
+
# - [String] ip the ip address
|
1099
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1100
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1101
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1102
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1103
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1104
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1105
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1106
|
+
# - [Hash] warmup information about the ip's warmup status
|
1107
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1108
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1109
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1110
|
+
def info(ip)
|
1111
|
+
_params = {:ip => ip}
|
1112
|
+
return @master.call 'ips/info', _params
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
# Requests an additional dedicated IP for your account. Accounts may have one outstanding request at any time, and provisioning requests are processed within 24 hours.
|
1116
|
+
# @param [Boolean] warmup whether to enable warmup mode for the ip
|
1117
|
+
# @param [String] pool the id of the pool to add the dedicated ip to, or null to use your account's default pool
|
1118
|
+
# @return [Hash] a description of the provisioning request that was created
|
1119
|
+
# - [String] requested_at the date and time that the request was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
1120
|
+
def provision(warmup=false, pool=nil)
|
1121
|
+
_params = {:warmup => warmup, :pool => pool}
|
1122
|
+
return @master.call 'ips/provision', _params
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
# Begins the warmup process for a dedicated IP. During the warmup process, Mandrill will gradually increase the percentage of your mail that is sent over the warming-up IP, over a period of roughly 30 days. The rest of your mail will be sent over shared IPs or other dedicated IPs in the same pool.
|
1126
|
+
# @param [String] ip a dedicated ip address
|
1127
|
+
# @return [Hash] Information about the dedicated IP
|
1128
|
+
# - [String] ip the ip address
|
1129
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1130
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1131
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1132
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1133
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1134
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1135
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1136
|
+
# - [Hash] warmup information about the ip's warmup status
|
1137
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1138
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1139
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1140
|
+
def start_warmup(ip)
|
1141
|
+
_params = {:ip => ip}
|
1142
|
+
return @master.call 'ips/start-warmup', _params
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
# Cancels the warmup process for a dedicated IP.
|
1146
|
+
# @param [String] ip a dedicated ip address
|
1147
|
+
# @return [Hash] Information about the dedicated IP
|
1148
|
+
# - [String] ip the ip address
|
1149
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1150
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1151
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1152
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1153
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1154
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1155
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1156
|
+
# - [Hash] warmup information about the ip's warmup status
|
1157
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1158
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1159
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1160
|
+
def cancel_warmup(ip)
|
1161
|
+
_params = {:ip => ip}
|
1162
|
+
return @master.call 'ips/cancel-warmup', _params
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
# Moves a dedicated IP to a different pool.
|
1166
|
+
# @param [String] ip a dedicated ip address
|
1167
|
+
# @param [String] pool the name of the new pool to add the dedicated ip to
|
1168
|
+
# @param [Boolean] create_pool whether to create the pool if it does not exist; if false and the pool does not exist, an Unknown_Pool will be thrown.
|
1169
|
+
# @return [Hash] Information about the updated state of the dedicated IP
|
1170
|
+
# - [String] ip the ip address
|
1171
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1172
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1173
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1174
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1175
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1176
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1177
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1178
|
+
# - [Hash] warmup information about the ip's warmup status
|
1179
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1180
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1181
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1182
|
+
def set_pool(ip, pool, create_pool=false)
|
1183
|
+
_params = {:ip => ip, :pool => pool, :create_pool => create_pool}
|
1184
|
+
return @master.call 'ips/set-pool', _params
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
# Deletes a dedicated IP. This is permanent and cannot be undone.
|
1188
|
+
# @param [String] ip the dedicated ip to remove from your account
|
1189
|
+
# @return [Hash] a description of the ip that was removed from your account.
|
1190
|
+
# - [String] ip the ip address
|
1191
|
+
# - [String] deleted a boolean indicating whether the ip was successfully deleted
|
1192
|
+
def delete(ip)
|
1193
|
+
_params = {:ip => ip}
|
1194
|
+
return @master.call 'ips/delete', _params
|
1195
|
+
end
|
1196
|
+
|
1197
|
+
# Lists your dedicated IP pools.
|
1198
|
+
# @return [Array] the dedicated IP pools for your account, up to a maximum of 1,000
|
1199
|
+
# - [Hash] return[] information about each dedicated IP pool
|
1200
|
+
# - [String] name this pool's name
|
1201
|
+
# - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
1202
|
+
# - [Array] ips the dedicated IPs in this pool
|
1203
|
+
# - [Hash] ips[] information about each dedicated IP
|
1204
|
+
# - [String] ip the ip address
|
1205
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1206
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1207
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1208
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1209
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1210
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1211
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1212
|
+
# - [Hash] warmup information about the ip's warmup status
|
1213
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1214
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1215
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1216
|
+
def list_pools()
|
1217
|
+
_params = {}
|
1218
|
+
return @master.call 'ips/list-pools', _params
|
1219
|
+
end
|
1220
|
+
|
1221
|
+
# Describes a single dedicated IP pool.
|
1222
|
+
# @param [String] pool a pool name
|
1223
|
+
# @return [Hash] Information about the dedicated ip pool
|
1224
|
+
# - [String] name this pool's name
|
1225
|
+
# - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
1226
|
+
# - [Array] ips the dedicated IPs in this pool
|
1227
|
+
# - [Hash] ips[] information about each dedicated IP
|
1228
|
+
# - [String] ip the ip address
|
1229
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1230
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1231
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1232
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1233
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1234
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1235
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1236
|
+
# - [Hash] warmup information about the ip's warmup status
|
1237
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1238
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1239
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1240
|
+
def pool_info(pool)
|
1241
|
+
_params = {:pool => pool}
|
1242
|
+
return @master.call 'ips/pool-info', _params
|
1243
|
+
end
|
1244
|
+
|
1245
|
+
# Creates a pool and returns it. If a pool already exists with this name, no action will be performed.
|
1246
|
+
# @param [String] pool the name of a pool to create
|
1247
|
+
# @return [Hash] Information about the dedicated ip pool
|
1248
|
+
# - [String] name this pool's name
|
1249
|
+
# - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
1250
|
+
# - [Array] ips the dedicated IPs in this pool
|
1251
|
+
# - [Hash] ips[] information about each dedicated IP
|
1252
|
+
# - [String] ip the ip address
|
1253
|
+
# - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1254
|
+
# - [String] pool the name of the pool that this dedicated IP belongs to
|
1255
|
+
# - [String] domain the domain name (reverse dns) of this dedicated IP
|
1256
|
+
# - [Hash] custom_dns information about the ip's custom dns, if it has been configured
|
1257
|
+
# - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
|
1258
|
+
# - [Boolean] valid whether the ip's custom dns is currently valid
|
1259
|
+
# - [String] error if the ip's custom dns is invalid, this will include details about the error
|
1260
|
+
# - [Hash] warmup information about the ip's warmup status
|
1261
|
+
# - [Boolean] warming_up whether the ip is currently in warmup mode
|
1262
|
+
# - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1263
|
+
# - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
1264
|
+
def create_pool(pool)
|
1265
|
+
_params = {:pool => pool}
|
1266
|
+
return @master.call 'ips/create-pool', _params
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
# Deletes a pool. A pool must be empty before you can delete it, and you cannot delete your default pool.
|
1270
|
+
# @param [String] pool the name of the pool to delete
|
1271
|
+
# @return [Hash] information about the status of the pool that was deleted
|
1272
|
+
# - [String] pool the name of the pool
|
1273
|
+
# - [Boolean] deleted whether the pool was deleted
|
1274
|
+
def delete_pool(pool)
|
1275
|
+
_params = {:pool => pool}
|
1276
|
+
return @master.call 'ips/delete-pool', _params
|
1277
|
+
end
|
1278
|
+
|
1067
1279
|
end
|
1068
1280
|
class Internal
|
1069
1281
|
attr_accessor :master
|
data/lib/mandrill/errors.rb
CHANGED
@@ -31,5 +31,17 @@ module Mandrill
|
|
31
31
|
end
|
32
32
|
class UnknownExportError < Error
|
33
33
|
end
|
34
|
+
class IPProvisionLimitError < Error
|
35
|
+
end
|
36
|
+
class UnknownPoolError < Error
|
37
|
+
end
|
38
|
+
class UnknownIPError < Error
|
39
|
+
end
|
40
|
+
class InvalidEmptyDefaultPoolError < Error
|
41
|
+
end
|
42
|
+
class InvalidDeleteDefaultPoolError < Error
|
43
|
+
end
|
44
|
+
class InvalidDeleteNonEmptyPoolError < Error
|
45
|
+
end
|
34
46
|
end
|
35
47
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mandrill-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 77
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 45
|
10
|
+
version: 1.0.45
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mandrill Devs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-09-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|