mandrill-rb 1.0.52 → 1.0.53

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f71903132eb724ad3ee5ae75131ddec8d0c7812
4
- data.tar.gz: 96ea4aacffd158e1e6152dba83666478a750a855
3
+ metadata.gz: 366b3f229c2a6e140a7ac244bbbf07fb133f3daf
4
+ data.tar.gz: edb22329aab201bc11296f72f51655853519478d
5
5
  SHA512:
6
- metadata.gz: c720ebcd2efd63bc4c323b05e200929e26f9071b0752a41151d2a394f793651b7daa6c00547e2e0bb9d014891ad6a77a7b7aeeecdb0aab24b4dc116f3b7938eb
7
- data.tar.gz: 2d26ae706e5b6d5338679c308fd2e36311dff624e16a4bc4db2bd4cc2ff172a39fa90099c8a3d18af82e33489cf437d5ac5f8f176a03008bcd36558e63ecbeb4
6
+ metadata.gz: af689525730815dfe6eb8d6628c23e53912fa994d3ffaf014dacb09690f8e6f8bca488a3c7a048083c2367ea5ed58f681bf6f6a7448a79ee6fada7f455a14607
7
+ data.tar.gz: 184850ffd007ff9bf7cad0541790c923bc38cfe07c46339109863cdff5ecb3a55002ae0ef5b43efb38dd27e046fe3d1fd92aef19caba42542ffa6ca64df525bc
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2013 The Rocket Science Group, LLC.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,30 @@
1
+ # Mandrill-rb
2
+
3
+ Stealing this from https://bitbucket.org/mailchimp/mandrill-api-ruby/ as of version 1.0.52, for multiple reasons.
4
+
5
+ 1) its on bitbucket
6
+ 2) it was broken in my application due mainly to some oddities caused by wonky file/class declaration (or lack thereof in the gem), i.e. specifically:
7
+
8
+ ``` ruby
9
+ module API
10
+ class WhateverController
11
+
12
+ end
13
+ end
14
+ ```
15
+
16
+ Was making ::Mandrill::API or Mandrill::API or whatever, point to the API module, then break. Short version, didnt have ton of time to dig into it, but when I cloned source of mandrill gem off bitbucket I wasn't suprised it was breaking.
17
+
18
+ So I broke everything into separate files, added some scope resolution operators for safety and speed, and thats the extent of it so far.
19
+
20
+ I may end up refactoring to make it more resourceful, which is why I elected to release it under a separate gem name, that and the majority of devs will appreciate it being on github, and being able to dig through the source on GH, and it works for now.
21
+
22
+ ```ruby
23
+ require 'mandrill'
24
+ ```
25
+
26
+ or using bundler:
27
+
28
+ ```ruby
29
+ gem 'mandrill-rb'
30
+ ```
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,62 @@
1
+ module Mandrill
2
+ class Error < Exception
3
+ end
4
+ class ValidationError < Error
5
+ end
6
+ class InvalidKeyError < Error
7
+ end
8
+ class PaymentRequiredError < Error
9
+ end
10
+ class UnknownSubaccountError < Error
11
+ end
12
+ class UnknownTemplateError < Error
13
+ end
14
+ class ServiceUnavailableError < Error
15
+ end
16
+ class UnknownMessageError < Error
17
+ end
18
+ class InvalidTagNameError < Error
19
+ end
20
+ class InvalidRejectError < Error
21
+ end
22
+ class UnknownSenderError < Error
23
+ end
24
+ class UnknownUrlError < Error
25
+ end
26
+ class UnknownTrackingDomainError < Error
27
+ end
28
+ class InvalidTemplateError < Error
29
+ end
30
+ class UnknownWebhookError < Error
31
+ end
32
+ class UnknownInboundDomainError < Error
33
+ end
34
+ class UnknownInboundRouteError < Error
35
+ end
36
+ class UnknownExportError < Error
37
+ end
38
+ class IPProvisionLimitError < Error
39
+ end
40
+ class UnknownPoolError < Error
41
+ end
42
+ class NoSendingHistoryError < Error
43
+ end
44
+ class PoorReputationError < Error
45
+ end
46
+ class UnknownIPError < Error
47
+ end
48
+ class InvalidEmptyDefaultPoolError < Error
49
+ end
50
+ class InvalidDeleteDefaultPoolError < Error
51
+ end
52
+ class InvalidDeleteNonEmptyPoolError < Error
53
+ end
54
+ class InvalidCustomDNSError < Error
55
+ end
56
+ class InvalidCustomDNSPendingError < Error
57
+ end
58
+ class MetadataFieldLimitError < Error
59
+ end
60
+ class UnknownMetadataFieldError < Error
61
+ end
62
+ end
@@ -0,0 +1,89 @@
1
+ module Mandrill
2
+ class Exports
3
+ attr_accessor :master
4
+
5
+ def initialize(master)
6
+ @master = master
7
+ end
8
+
9
+ # Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type.
10
+ # @param [String] id an export job identifier
11
+ # @return [Hash] the information about the export
12
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
13
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
14
+ # - [String] type the type of the export job - activity, reject, or whitelist
15
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
16
+ # - [String] state the export job's state - waiting, working, complete, error, or expired.
17
+ # - [String] result_url the url for the export job's results, if the job is completed.
18
+ def info(id)
19
+ _params = {:id => id}
20
+ return @master.call 'exports/info', _params
21
+ end
22
+
23
+ # Returns a list of your exports.
24
+ # @return [Array] the account's exports
25
+ # - [Hash] return[] the individual export info
26
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
27
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
28
+ # - [String] type the type of the export job - activity, reject, or whitelist
29
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
30
+ # - [String] state the export job's state - waiting, working, complete, error, or expired.
31
+ # - [String] result_url the url for the export job's results, if the job is completed.
32
+ def list()
33
+ _params = {}
34
+ return @master.call 'exports/list', _params
35
+ end
36
+
37
+ # Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at.
38
+ # @param [String] notify_email an optional email address to notify when the export job has finished.
39
+ # @return [Hash] information about the rejects export job that was started
40
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
41
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
42
+ # - [String] type the type of the export job
43
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
44
+ # - [String] state the export job's state
45
+ # - [String] result_url the url for the export job's results, if the job is complete
46
+ def rejects(notify_email=nil)
47
+ _params = {:notify_email => notify_email}
48
+ return @master.call 'exports/rejects', _params
49
+ end
50
+
51
+ # Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive containing a single file named whitelist.csv that includes the following fields: email, detail, created_at.
52
+ # @param [String] notify_email an optional email address to notify when the export job has finished.
53
+ # @return [Hash] information about the whitelist export job that was started
54
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
55
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
56
+ # - [String] type the type of the export job
57
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
58
+ # - [String] state the export job's state
59
+ # - [String] result_url the url for the export job's results, if the job is complete
60
+ def whitelist(notify_email=nil)
61
+ _params = {:notify_email => notify_email}
62
+ return @master.call 'exports/whitelist', _params
63
+ end
64
+
65
+ # Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.
66
+ # @param [String] notify_email an optional email address to notify when the export job has finished
67
+ # @param [String] date_from start date as a UTC string in YYYY-MM-DD HH:MM:SS format
68
+ # @param [String] date_to end date as a UTC string in YYYY-MM-DD HH:MM:SS format
69
+ # @param [Array] tags an array of tag names to narrow the export to; will match messages that contain ANY of the tags
70
+ # - [String] tags[] a tag name
71
+ # @param [Array] senders an array of senders to narrow the export to
72
+ # - [String] senders[] a sender address
73
+ # @param [Array] states an array of states to narrow the export to; messages with ANY of the states will be included
74
+ # - [String] states[] a message state
75
+ # @param [Array] api_keys an array of api keys to narrow the export to; messsagse sent with ANY of the keys will be included
76
+ # - [String] api_keys[] an API key associated with your account
77
+ # @return [Hash] information about the activity export job that was started
78
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
79
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
80
+ # - [String] type the type of the export job
81
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
82
+ # - [String] state the export job's state
83
+ # - [String] result_url the url for the export job's results, if the job is complete
84
+ def activity(notify_email=nil, date_from=nil, date_to=nil, tags=nil, senders=nil, states=nil, api_keys=nil)
85
+ _params = {:notify_email => notify_email, :date_from => date_from, :date_to => date_to, :tags => tags, :senders => senders, :states => states, :api_keys => api_keys}
86
+ return @master.call 'exports/activity', _params
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,120 @@
1
+ module Mandrill
2
+ class Inbound
3
+ attr_accessor :master
4
+
5
+ def initialize(master)
6
+ @master = master
7
+ end
8
+
9
+ # List the domains that have been configured for inbound delivery
10
+ # @return [Array] the inbound domains associated with the account
11
+ # - [Hash] return[] the individual domain info
12
+ # - [String] domain the domain name that is accepting mail
13
+ # - [String] created_at the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
14
+ # - [Boolean] valid_mx true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
15
+ def domains()
16
+ _params = {}
17
+ return @master.call 'inbound/domains', _params
18
+ end
19
+
20
+ # Add an inbound domain to your account
21
+ # @param [String] domain a domain name
22
+ # @return [Hash] information about the domain
23
+ # - [String] domain the domain name that is accepting mail
24
+ # - [String] created_at the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
25
+ # - [Boolean] valid_mx true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
26
+ def add_domain(domain)
27
+ _params = {:domain => domain}
28
+ return @master.call 'inbound/add-domain', _params
29
+ end
30
+
31
+ # Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call
32
+ # @param [String] domain an existing inbound domain
33
+ # @return [Hash] information about the inbound domain
34
+ # - [String] domain the domain name that is accepting mail
35
+ # - [String] created_at the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
36
+ # - [Boolean] valid_mx true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
37
+ def check_domain(domain)
38
+ _params = {:domain => domain}
39
+ return @master.call 'inbound/check-domain', _params
40
+ end
41
+
42
+ # Delete an inbound domain from the account. All mail will stop routing for this domain immediately.
43
+ # @param [String] domain an existing inbound domain
44
+ # @return [Hash] information about the deleted domain
45
+ # - [String] domain the domain name that is accepting mail
46
+ # - [String] created_at the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
47
+ # - [Boolean] valid_mx true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
48
+ def delete_domain(domain)
49
+ _params = {:domain => domain}
50
+ return @master.call 'inbound/delete-domain', _params
51
+ end
52
+
53
+ # List the mailbox routes defined for an inbound domain
54
+ # @param [String] domain the domain to check
55
+ # @return [Array] the routes associated with the domain
56
+ # - [Hash] return[] the individual mailbox route
57
+ # - [String] id the unique identifier of the route
58
+ # - [String] pattern the search pattern that the mailbox name should match
59
+ # - [String] url the webhook URL where inbound messages will be published
60
+ def routes(domain)
61
+ _params = {:domain => domain}
62
+ return @master.call 'inbound/routes', _params
63
+ end
64
+
65
+ # Add a new mailbox route to an inbound domain
66
+ # @param [String] domain an existing inbound domain
67
+ # @param [String] pattern the search pattern that the mailbox name should match
68
+ # @param [String] url the webhook URL where the inbound messages will be published
69
+ # @return [Hash] the added mailbox route information
70
+ # - [String] id the unique identifier of the route
71
+ # - [String] pattern the search pattern that the mailbox name should match
72
+ # - [String] url the webhook URL where inbound messages will be published
73
+ def add_route(domain, pattern, url)
74
+ _params = {:domain => domain, :pattern => pattern, :url => url}
75
+ return @master.call 'inbound/add-route', _params
76
+ end
77
+
78
+ # Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.
79
+ # @param [String] id the unique identifier of an existing mailbox route
80
+ # @param [String] pattern the search pattern that the mailbox name should match
81
+ # @param [String] url the webhook URL where the inbound messages will be published
82
+ # @return [Hash] the updated mailbox route information
83
+ # - [String] id the unique identifier of the route
84
+ # - [String] pattern the search pattern that the mailbox name should match
85
+ # - [String] url the webhook URL where inbound messages will be published
86
+ def update_route(id, pattern=nil, url=nil)
87
+ _params = {:id => id, :pattern => pattern, :url => url}
88
+ return @master.call 'inbound/update-route', _params
89
+ end
90
+
91
+ # Delete an existing inbound mailbox route
92
+ # @param [String] id the unique identifier of an existing route
93
+ # @return [Hash] the deleted mailbox route information
94
+ # - [String] id the unique identifier of the route
95
+ # - [String] pattern the search pattern that the mailbox name should match
96
+ # - [String] url the webhook URL where inbound messages will be published
97
+ def delete_route(id)
98
+ _params = {:id => id}
99
+ return @master.call 'inbound/delete-route', _params
100
+ end
101
+
102
+ # Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP
103
+ # @param [String] raw_message the full MIME document of an email message
104
+ # @param [Array, nil] to optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document
105
+ # - [String] to[] the email address of the recipient
106
+ # @param [String] mail_from the address specified in the MAIL FROM stage of the SMTP conversation. Required for the SPF check.
107
+ # @param [String] helo the identification provided by the client mta in the MTA state of the SMTP conversation. Required for the SPF check.
108
+ # @param [String] client_address the remote MTA's ip address. Optional; required for the SPF check.
109
+ # @return [Array] an array of the information for each recipient in the message (usually one) that matched an inbound route
110
+ # - [Hash] return[] the individual recipient information
111
+ # - [String] email the email address of the matching recipient
112
+ # - [String] pattern the mailbox route pattern that the recipient matched
113
+ # - [String] url the webhook URL that the message was posted to
114
+ def send_raw(raw_message, to=nil, mail_from=nil, helo=nil, client_address=nil)
115
+ _params = {:raw_message => raw_message, :to => to, :mail_from => mail_from, :helo => helo, :client_address => client_address}
116
+ return @master.call 'inbound/send-raw', _params
117
+ end
118
+
119
+ end
120
+ end
@@ -0,0 +1,9 @@
1
+ module Mandrill
2
+ class Internal
3
+ attr_accessor :master
4
+
5
+ def initialize(master)
6
+ @master = master
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,246 @@
1
+ module Mandrill
2
+ class Ips
3
+ attr_accessor :master
4
+
5
+ def initialize(master)
6
+ @master = master
7
+ end
8
+
9
+ # Lists your dedicated IPs.
10
+ # @return [Array] an array of structs for each dedicated IP
11
+ # - [Hash] return[] information about a single dedicated IP
12
+ # - [String] ip the ip address
13
+ # - [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
14
+ # - [String] pool the name of the pool that this dedicated IP belongs to
15
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
16
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
17
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
18
+ # - [Boolean] valid whether the ip's custom dns is currently valid
19
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
20
+ # - [Hash] warmup information about the ip's warmup status
21
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
22
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
23
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
24
+ def list()
25
+ _params = {}
26
+ return @master.call 'ips/list', _params
27
+ end
28
+
29
+ # Retrieves information about a single dedicated ip.
30
+ # @param [String] ip a dedicated IP address
31
+ # @return [Hash] Information about the dedicated ip
32
+ # - [String] ip the ip address
33
+ # - [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
34
+ # - [String] pool the name of the pool that this dedicated IP belongs to
35
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
36
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
37
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
38
+ # - [Boolean] valid whether the ip's custom dns is currently valid
39
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
40
+ # - [Hash] warmup information about the ip's warmup status
41
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
42
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
43
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
44
+ def info(ip)
45
+ _params = {:ip => ip}
46
+ return @master.call 'ips/info', _params
47
+ end
48
+
49
+ # 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.
50
+ # @param [Boolean] warmup whether to enable warmup mode for the ip
51
+ # @param [String] pool the id of the pool to add the dedicated ip to, or null to use your account's default pool
52
+ # @return [Hash] a description of the provisioning request that was created
53
+ # - [String] requested_at the date and time that the request was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
54
+ def provision(warmup=false, pool=nil)
55
+ _params = {:warmup => warmup, :pool => pool}
56
+ return @master.call 'ips/provision', _params
57
+ end
58
+
59
+ # 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.
60
+ # @param [String] ip a dedicated ip address
61
+ # @return [Hash] Information about the dedicated IP
62
+ # - [String] ip the ip address
63
+ # - [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
64
+ # - [String] pool the name of the pool that this dedicated IP belongs to
65
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
66
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
67
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
68
+ # - [Boolean] valid whether the ip's custom dns is currently valid
69
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
70
+ # - [Hash] warmup information about the ip's warmup status
71
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
72
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
73
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
74
+ def start_warmup(ip)
75
+ _params = {:ip => ip}
76
+ return @master.call 'ips/start-warmup', _params
77
+ end
78
+
79
+ # Cancels the warmup process for a dedicated IP.
80
+ # @param [String] ip a dedicated ip address
81
+ # @return [Hash] Information about the dedicated IP
82
+ # - [String] ip the ip address
83
+ # - [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
84
+ # - [String] pool the name of the pool that this dedicated IP belongs to
85
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
86
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
87
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
88
+ # - [Boolean] valid whether the ip's custom dns is currently valid
89
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
90
+ # - [Hash] warmup information about the ip's warmup status
91
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
92
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
93
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
94
+ def cancel_warmup(ip)
95
+ _params = {:ip => ip}
96
+ return @master.call 'ips/cancel-warmup', _params
97
+ end
98
+
99
+ # Moves a dedicated IP to a different pool.
100
+ # @param [String] ip a dedicated ip address
101
+ # @param [String] pool the name of the new pool to add the dedicated ip to
102
+ # @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.
103
+ # @return [Hash] Information about the updated state of the dedicated IP
104
+ # - [String] ip the ip address
105
+ # - [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
106
+ # - [String] pool the name of the pool that this dedicated IP belongs to
107
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
108
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
109
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
110
+ # - [Boolean] valid whether the ip's custom dns is currently valid
111
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
112
+ # - [Hash] warmup information about the ip's warmup status
113
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
114
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
115
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
116
+ def set_pool(ip, pool, create_pool=false)
117
+ _params = {:ip => ip, :pool => pool, :create_pool => create_pool}
118
+ return @master.call 'ips/set-pool', _params
119
+ end
120
+
121
+ # Deletes a dedicated IP. This is permanent and cannot be undone.
122
+ # @param [String] ip the dedicated ip to remove from your account
123
+ # @return [Hash] a description of the ip that was removed from your account.
124
+ # - [String] ip the ip address
125
+ # - [String] deleted a boolean indicating whether the ip was successfully deleted
126
+ def delete(ip)
127
+ _params = {:ip => ip}
128
+ return @master.call 'ips/delete', _params
129
+ end
130
+
131
+ # Lists your dedicated IP pools.
132
+ # @return [Array] the dedicated IP pools for your account, up to a maximum of 1,000
133
+ # - [Hash] return[] information about each dedicated IP pool
134
+ # - [String] name this pool's name
135
+ # - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
136
+ # - [Array] ips the dedicated IPs in this pool
137
+ # - [Hash] ips[] information about each dedicated IP
138
+ # - [String] ip the ip address
139
+ # - [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
140
+ # - [String] pool the name of the pool that this dedicated IP belongs to
141
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
142
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
143
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
144
+ # - [Boolean] valid whether the ip's custom dns is currently valid
145
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
146
+ # - [Hash] warmup information about the ip's warmup status
147
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
148
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
149
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
150
+ def list_pools()
151
+ _params = {}
152
+ return @master.call 'ips/list-pools', _params
153
+ end
154
+
155
+ # Describes a single dedicated IP pool.
156
+ # @param [String] pool a pool name
157
+ # @return [Hash] Information about the dedicated ip pool
158
+ # - [String] name this pool's name
159
+ # - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
160
+ # - [Array] ips the dedicated IPs in this pool
161
+ # - [Hash] ips[] information about each dedicated IP
162
+ # - [String] ip the ip address
163
+ # - [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
164
+ # - [String] pool the name of the pool that this dedicated IP belongs to
165
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
166
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
167
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
168
+ # - [Boolean] valid whether the ip's custom dns is currently valid
169
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
170
+ # - [Hash] warmup information about the ip's warmup status
171
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
172
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
173
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
174
+ def pool_info(pool)
175
+ _params = {:pool => pool}
176
+ return @master.call 'ips/pool-info', _params
177
+ end
178
+
179
+ # Creates a pool and returns it. If a pool already exists with this name, no action will be performed.
180
+ # @param [String] pool the name of a pool to create
181
+ # @return [Hash] Information about the dedicated ip pool
182
+ # - [String] name this pool's name
183
+ # - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
184
+ # - [Array] ips the dedicated IPs in this pool
185
+ # - [Hash] ips[] information about each dedicated IP
186
+ # - [String] ip the ip address
187
+ # - [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
188
+ # - [String] pool the name of the pool that this dedicated IP belongs to
189
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
190
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
191
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
192
+ # - [Boolean] valid whether the ip's custom dns is currently valid
193
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
194
+ # - [Hash] warmup information about the ip's warmup status
195
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
196
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
197
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
198
+ def create_pool(pool)
199
+ _params = {:pool => pool}
200
+ return @master.call 'ips/create-pool', _params
201
+ end
202
+
203
+ # Deletes a pool. A pool must be empty before you can delete it, and you cannot delete your default pool.
204
+ # @param [String] pool the name of the pool to delete
205
+ # @return [Hash] information about the status of the pool that was deleted
206
+ # - [String] pool the name of the pool
207
+ # - [Boolean] deleted whether the pool was deleted
208
+ def delete_pool(pool)
209
+ _params = {:pool => pool}
210
+ return @master.call 'ips/delete-pool', _params
211
+ end
212
+
213
+ # Tests whether a domain name is valid for use as the custom reverse DNS for a dedicated IP.
214
+ # @param [String] ip a dedicated ip address
215
+ # @param [String] domain the domain name to test
216
+ # @return [Hash] validation results for the domain
217
+ # - [String] valid whether the domain name has a correctly-configured A record pointing to the ip address
218
+ # - [String] error if valid is false, this will contain details about why the domain's A record is incorrect
219
+ def check_custom_dns(ip, domain)
220
+ _params = {:ip => ip, :domain => domain}
221
+ return @master.call 'ips/check-custom-dns', _params
222
+ end
223
+
224
+ # Configures the custom DNS name for a dedicated IP.
225
+ # @param [String] ip a dedicated ip address
226
+ # @param [String] domain a domain name to set as the dedicated IP's custom dns name.
227
+ # @return [Hash] information about the dedicated IP's new configuration
228
+ # - [String] ip the ip address
229
+ # - [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
230
+ # - [String] pool the name of the pool that this dedicated IP belongs to
231
+ # - [String] domain the domain name (reverse dns) of this dedicated IP
232
+ # - [Hash] custom_dns information about the ip's custom dns, if it has been configured
233
+ # - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
234
+ # - [Boolean] valid whether the ip's custom dns is currently valid
235
+ # - [String] error if the ip's custom dns is invalid, this will include details about the error
236
+ # - [Hash] warmup information about the ip's warmup status
237
+ # - [Boolean] warming_up whether the ip is currently in warmup mode
238
+ # - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
239
+ # - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
240
+ def set_custom_dns(ip, domain)
241
+ _params = {:ip => ip, :domain => domain}
242
+ return @master.call 'ips/set-custom-dns', _params
243
+ end
244
+
245
+ end
246
+ end