mandrill-api 1.0.49 → 1.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -74,7 +74,9 @@ module Mandrill
74
74
  'Unknown_IP' => UnknownIPError,
75
75
  'Invalid_EmptyDefaultPool' => InvalidEmptyDefaultPoolError,
76
76
  'Invalid_DeleteDefaultPool' => InvalidDeleteDefaultPoolError,
77
- 'Invalid_DeleteNonEmptyPool' => InvalidDeleteNonEmptyPoolError
77
+ 'Invalid_DeleteNonEmptyPool' => InvalidDeleteNonEmptyPoolError,
78
+ 'Metadata_FieldLimit' => MetadataFieldLimitError,
79
+ 'Unknown_MetadataField' => UnknownMetadataFieldError
78
80
  }
79
81
 
80
82
  begin
@@ -134,6 +136,9 @@ module Mandrill
134
136
  def senders()
135
137
  Senders.new self
136
138
  end
139
+ def metadata()
140
+ Metadata.new self
141
+ end
137
142
  end
138
143
  end
139
144
 
@@ -1994,5 +1994,59 @@ module Mandrill
1994
1994
  end
1995
1995
 
1996
1996
  end
1997
+ class Metadata
1998
+ attr_accessor :master
1999
+
2000
+ def initialize(master)
2001
+ @master = master
2002
+ end
2003
+
2004
+ # Get the list of custom metadata fields indexed for the account.
2005
+ # @return [Array] the custom metadata fields for the account
2006
+ # - [Hash] return[] the individual custom metadata field info
2007
+ # - [String] name the unique identifier of the metadata field to update
2008
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2009
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2010
+ def list()
2011
+ _params = {}
2012
+ return @master.call 'metadata/list', _params
2013
+ end
2014
+
2015
+ # Add a new custom metadata field to be indexed for the account.
2016
+ # @param [String] name a unique identifier for the metadata field
2017
+ # @param [String] view_template optional Mustache template to control how the metadata is rendered in your activity log
2018
+ # @return [Hash] the information saved about the new metadata field
2019
+ # - [String] name the unique identifier of the metadata field to update
2020
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2021
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2022
+ def add(name, view_template=nil)
2023
+ _params = {:name => name, :view_template => view_template}
2024
+ return @master.call 'metadata/add', _params
2025
+ end
2026
+
2027
+ # Update an existing custom metadata field.
2028
+ # @param [String] name the unique identifier of the metadata field to update
2029
+ # @param [String] view_template optional Mustache template to control how the metadata is rendered in your activity log
2030
+ # @return [Hash] the information for the updated metadata field
2031
+ # - [String] name the unique identifier of the metadata field to update
2032
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2033
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2034
+ def update(name, view_template)
2035
+ _params = {:name => name, :view_template => view_template}
2036
+ return @master.call 'metadata/update', _params
2037
+ end
2038
+
2039
+ # Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
2040
+ # @param [String] name the unique identifier of the metadata field to update
2041
+ # @return [Hash] the information for the deleted metadata field
2042
+ # - [String] name the unique identifier of the metadata field to update
2043
+ # - [String] state the current state of the metadata field, one of "active", "delete", or "index"
2044
+ # - [String] view_template Mustache template to control how the metadata is rendered in your activity log
2045
+ def delete(name)
2046
+ _params = {:name => name}
2047
+ return @master.call 'metadata/delete', _params
2048
+ end
2049
+
2050
+ end
1997
2051
  end
1998
2052
 
@@ -47,5 +47,9 @@ module Mandrill
47
47
  end
48
48
  class InvalidDeleteNonEmptyPoolError < Error
49
49
  end
50
+ class MetadataFieldLimitError < Error
51
+ end
52
+ class UnknownMetadataFieldError < Error
53
+ end
50
54
  end
51
55
 
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: 117
4
+ hash: 115
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 49
10
- version: 1.0.49
9
+ - 50
10
+ version: 1.0.50
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-10-17 00:00:00 Z
18
+ date: 2014-02-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json
@@ -104,10 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements: []
105
105
 
106
106
  rubyforge_project:
107
- rubygems_version: 1.8.24
107
+ rubygems_version: 1.8.15
108
108
  signing_key:
109
109
  specification_version: 3
110
110
  summary: A Ruby API library for the Mandrill email as a service platform.
111
111
  test_files: []
112
112
 
113
- has_rdoc: