pepipost_gem 2.5.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,164 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# Master modal
|
8
|
+
class Send < BaseModel
|
9
|
+
# email address which recipients can reply to.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :reply_to
|
12
|
+
|
13
|
+
# Email address representing the sender of the mail
|
14
|
+
# @return [From]
|
15
|
+
attr_accessor :from
|
16
|
+
|
17
|
+
# Subject line of the email
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :subject
|
20
|
+
|
21
|
+
# ID of the template to be used for sending the mail
|
22
|
+
# @return [Long]
|
23
|
+
attr_accessor :template_id
|
24
|
+
|
25
|
+
# content in text/plain format
|
26
|
+
# @return [List of Content]
|
27
|
+
attr_accessor :content
|
28
|
+
|
29
|
+
# attachment information
|
30
|
+
# @return [List of Attachments]
|
31
|
+
attr_accessor :attachments
|
32
|
+
|
33
|
+
# to recipient with some personalized data like to address, attachments and
|
34
|
+
# attributes
|
35
|
+
# @return [List of Personalizations]
|
36
|
+
attr_accessor :personalizations
|
37
|
+
|
38
|
+
# to recipient with some personalized data like to address, attachments and
|
39
|
+
# attributes
|
40
|
+
# @return [Settings]
|
41
|
+
attr_accessor :settings
|
42
|
+
|
43
|
+
# define custom tags to organize your emails
|
44
|
+
# @return [List of String]
|
45
|
+
attr_accessor :tags
|
46
|
+
|
47
|
+
# define custom tags to organize your emails
|
48
|
+
# @return [Boolean]
|
49
|
+
attr_accessor :lint_payload
|
50
|
+
|
51
|
+
# schedule the time of email delivery
|
52
|
+
# @return [Long]
|
53
|
+
attr_accessor :schedule
|
54
|
+
|
55
|
+
# Global bcc can be defined here
|
56
|
+
# @return [List of EmailStruct]
|
57
|
+
attr_accessor :bcc
|
58
|
+
|
59
|
+
# A mapping from model property names to API property names.
|
60
|
+
def self.names
|
61
|
+
@_hash = {} if @_hash.nil?
|
62
|
+
@_hash['reply_to'] = 'reply_to'
|
63
|
+
@_hash['from'] = 'from'
|
64
|
+
@_hash['subject'] = 'subject'
|
65
|
+
@_hash['template_id'] = 'template_id'
|
66
|
+
@_hash['content'] = 'content'
|
67
|
+
@_hash['attachments'] = 'attachments'
|
68
|
+
@_hash['personalizations'] = 'personalizations'
|
69
|
+
@_hash['settings'] = 'settings'
|
70
|
+
@_hash['tags'] = 'tags'
|
71
|
+
@_hash['lint_payload'] = 'lint_payload'
|
72
|
+
@_hash['schedule'] = 'schedule'
|
73
|
+
@_hash['bcc'] = 'bcc'
|
74
|
+
@_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
def initialize(from = nil,
|
78
|
+
subject = nil,
|
79
|
+
content = nil,
|
80
|
+
personalizations = nil,
|
81
|
+
reply_to = nil,
|
82
|
+
template_id = nil,
|
83
|
+
attachments = nil,
|
84
|
+
settings = nil,
|
85
|
+
tags = nil,
|
86
|
+
lint_payload = nil,
|
87
|
+
schedule = nil,
|
88
|
+
bcc = nil)
|
89
|
+
@reply_to = reply_to
|
90
|
+
@from = from
|
91
|
+
@subject = subject
|
92
|
+
@template_id = template_id
|
93
|
+
@content = content
|
94
|
+
@attachments = attachments
|
95
|
+
@personalizations = personalizations
|
96
|
+
@settings = settings
|
97
|
+
@tags = tags
|
98
|
+
@lint_payload = lint_payload
|
99
|
+
@schedule = schedule
|
100
|
+
@bcc = bcc
|
101
|
+
end
|
102
|
+
|
103
|
+
# Creates an instance of the object from a hash.
|
104
|
+
def self.from_hash(hash)
|
105
|
+
return nil unless hash
|
106
|
+
|
107
|
+
# Extract variables from the hash.
|
108
|
+
from = From.from_hash(hash['from']) if hash['from']
|
109
|
+
subject = hash['subject']
|
110
|
+
# Parameter is an array, so we need to iterate through it
|
111
|
+
content = nil
|
112
|
+
unless hash['content'].nil?
|
113
|
+
content = []
|
114
|
+
hash['content'].each do |structure|
|
115
|
+
content << (Content.from_hash(structure) if structure)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
# Parameter is an array, so we need to iterate through it
|
119
|
+
personalizations = nil
|
120
|
+
unless hash['personalizations'].nil?
|
121
|
+
personalizations = []
|
122
|
+
hash['personalizations'].each do |structure|
|
123
|
+
personalizations << (Personalizations.from_hash(structure) if structure)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
reply_to = hash['reply_to']
|
127
|
+
template_id = hash['template_id']
|
128
|
+
# Parameter is an array, so we need to iterate through it
|
129
|
+
attachments = nil
|
130
|
+
unless hash['attachments'].nil?
|
131
|
+
attachments = []
|
132
|
+
hash['attachments'].each do |structure|
|
133
|
+
attachments << (Attachments.from_hash(structure) if structure)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
settings = Settings.from_hash(hash['settings']) if hash['settings']
|
137
|
+
tags = hash['tags']
|
138
|
+
lint_payload = hash['lint_payload']
|
139
|
+
schedule = hash['schedule']
|
140
|
+
# Parameter is an array, so we need to iterate through it
|
141
|
+
bcc = nil
|
142
|
+
unless hash['bcc'].nil?
|
143
|
+
bcc = []
|
144
|
+
hash['bcc'].each do |structure|
|
145
|
+
bcc << (EmailStruct.from_hash(structure) if structure)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Create object from extracted values.
|
150
|
+
Send.new(from,
|
151
|
+
subject,
|
152
|
+
content,
|
153
|
+
personalizations,
|
154
|
+
reply_to,
|
155
|
+
template_id,
|
156
|
+
attachments,
|
157
|
+
settings,
|
158
|
+
tags,
|
159
|
+
lint_payload,
|
160
|
+
schedule,
|
161
|
+
bcc)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
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
|
+
# Settings Model.
|
8
|
+
class Settings < BaseModel
|
9
|
+
# enable or disable footer
|
10
|
+
# @return [Boolean]
|
11
|
+
attr_accessor :footer
|
12
|
+
|
13
|
+
# enable or disable click tracking
|
14
|
+
# @return [Boolean]
|
15
|
+
attr_accessor :click_track
|
16
|
+
|
17
|
+
# enable or disable open tracking
|
18
|
+
# @return [Boolean]
|
19
|
+
attr_accessor :open_track
|
20
|
+
|
21
|
+
# enable or disable unsubscribe tracking
|
22
|
+
# @return [Boolean]
|
23
|
+
attr_accessor :unsubscribe_track
|
24
|
+
|
25
|
+
# enable or disable unsubscribe tracking
|
26
|
+
# @return [Boolean]
|
27
|
+
attr_accessor :hepf
|
28
|
+
|
29
|
+
# A mapping from model property names to API property names.
|
30
|
+
def self.names
|
31
|
+
@_hash = {} if @_hash.nil?
|
32
|
+
@_hash['footer'] = 'footer'
|
33
|
+
@_hash['click_track'] = 'click_track'
|
34
|
+
@_hash['open_track'] = 'open_track'
|
35
|
+
@_hash['unsubscribe_track'] = 'unsubscribe_track'
|
36
|
+
@_hash['hepf'] = 'hepf'
|
37
|
+
@_hash
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize(footer = nil,
|
41
|
+
click_track = nil,
|
42
|
+
open_track = nil,
|
43
|
+
unsubscribe_track = nil,
|
44
|
+
hepf = nil)
|
45
|
+
@footer = footer
|
46
|
+
@click_track = click_track
|
47
|
+
@open_track = open_track
|
48
|
+
@unsubscribe_track = unsubscribe_track
|
49
|
+
@hepf = hepf
|
50
|
+
end
|
51
|
+
|
52
|
+
# Creates an instance of the object from a hash.
|
53
|
+
def self.from_hash(hash)
|
54
|
+
return nil unless hash
|
55
|
+
|
56
|
+
# Extract variables from the hash.
|
57
|
+
footer = hash['footer']
|
58
|
+
click_track = hash['click_track']
|
59
|
+
open_track = hash['open_track']
|
60
|
+
unsubscribe_track = hash['unsubscribe_track']
|
61
|
+
hepf = hash['hepf']
|
62
|
+
|
63
|
+
# Create object from extracted values.
|
64
|
+
Settings.new(footer,
|
65
|
+
click_track,
|
66
|
+
open_track,
|
67
|
+
unsubscribe_track,
|
68
|
+
hepf)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# sort.
|
8
|
+
class SortEnum
|
9
|
+
SORT_ENUM = [
|
10
|
+
# TODO: Write general description for ASC
|
11
|
+
ASC = 'asc'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for DESC
|
14
|
+
DESC = 'desc'.freeze
|
15
|
+
].freeze
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# The periodic \n\nAllowed values \"daily\", \"weekly\", \"monhtly\"
|
8
|
+
class TimeperiodEnum
|
9
|
+
TIMEPERIOD_ENUM = [
|
10
|
+
# TODO: Write general description for DAILY
|
11
|
+
DAILY = 'daily'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for WEEKLY
|
14
|
+
WEEKLY = 'weekly'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for MONHTLY
|
17
|
+
MONHTLY = 'monhtly'.freeze
|
18
|
+
].freeze
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# Type.
|
8
|
+
class TypeEnum
|
9
|
+
TYPE_ENUM = [
|
10
|
+
# TODO: Write general description for AMP
|
11
|
+
AMP = 'amp'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for HTML
|
14
|
+
HTML = 'html'.freeze
|
15
|
+
].freeze
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# UpdateCreditaccount modal
|
8
|
+
class UpdateCredisOfSubaccount < BaseModel
|
9
|
+
# The username of the subaccount
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :username
|
12
|
+
|
13
|
+
# Indicate the action (add or subtract) to be taken.Allowed values increase,
|
14
|
+
# decrease
|
15
|
+
# @return [ActionEnum]
|
16
|
+
attr_accessor :action
|
17
|
+
|
18
|
+
# Amount of credits
|
19
|
+
# @return [Integer]
|
20
|
+
attr_accessor :amount
|
21
|
+
|
22
|
+
# A mapping from model property names to API property names.
|
23
|
+
def self.names
|
24
|
+
@_hash = {} if @_hash.nil?
|
25
|
+
@_hash['username'] = 'username'
|
26
|
+
@_hash['action'] = 'action'
|
27
|
+
@_hash['amount'] = 'amount'
|
28
|
+
@_hash
|
29
|
+
end
|
30
|
+
|
31
|
+
def initialize(username = nil,
|
32
|
+
action = nil,
|
33
|
+
amount = nil)
|
34
|
+
@username = username
|
35
|
+
@action = action
|
36
|
+
@amount = amount
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates an instance of the object from a hash.
|
40
|
+
def self.from_hash(hash)
|
41
|
+
return nil unless hash
|
42
|
+
|
43
|
+
# Extract variables from the hash.
|
44
|
+
username = hash['username']
|
45
|
+
action = hash['action']
|
46
|
+
amount = hash['amount']
|
47
|
+
|
48
|
+
# Create object from extracted values.
|
49
|
+
UpdateCredisOfSubaccount.new(username,
|
50
|
+
action,
|
51
|
+
amount)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# Setrecurringcreditddetails modal
|
8
|
+
class UpdateRecurringCredisOfSubaccount < BaseModel
|
9
|
+
# The username of the subaccount
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :username
|
12
|
+
|
13
|
+
# The amount to be added periodically
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :recurring_credit
|
16
|
+
|
17
|
+
# The periodic \n\nAllowed values \"daily\", \"weekly\", \"monhtly\"
|
18
|
+
# @return [TimeperiodEnum]
|
19
|
+
attr_accessor :timeperiod
|
20
|
+
|
21
|
+
# The date from which the credit allocation will commence
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :start_date
|
24
|
+
|
25
|
+
# The last date of credit allocation
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :end_date
|
28
|
+
|
29
|
+
# Flag to enable or disable the recurring credit allocation
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :status
|
32
|
+
|
33
|
+
# A mapping from model property names to API property names.
|
34
|
+
def self.names
|
35
|
+
@_hash = {} if @_hash.nil?
|
36
|
+
@_hash['username'] = 'username'
|
37
|
+
@_hash['recurring_credit'] = 'recurring_credit'
|
38
|
+
@_hash['timeperiod'] = 'timeperiod'
|
39
|
+
@_hash['start_date'] = 'start_date'
|
40
|
+
@_hash['end_date'] = 'end_date'
|
41
|
+
@_hash['status'] = 'status'
|
42
|
+
@_hash
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(username = nil,
|
46
|
+
recurring_credit = nil,
|
47
|
+
timeperiod = nil,
|
48
|
+
start_date = nil,
|
49
|
+
end_date = nil,
|
50
|
+
status = nil)
|
51
|
+
@username = username
|
52
|
+
@recurring_credit = recurring_credit
|
53
|
+
@timeperiod = timeperiod
|
54
|
+
@start_date = start_date
|
55
|
+
@end_date = end_date
|
56
|
+
@status = status
|
57
|
+
end
|
58
|
+
|
59
|
+
# Creates an instance of the object from a hash.
|
60
|
+
def self.from_hash(hash)
|
61
|
+
return nil unless hash
|
62
|
+
|
63
|
+
# Extract variables from the hash.
|
64
|
+
username = hash['username']
|
65
|
+
recurring_credit = hash['recurring_credit']
|
66
|
+
timeperiod = hash['timeperiod']
|
67
|
+
start_date = hash['start_date']
|
68
|
+
end_date = hash['end_date']
|
69
|
+
status = hash['status']
|
70
|
+
|
71
|
+
# Create object from extracted values.
|
72
|
+
UpdateRecurringCredisOfSubaccount.new(username,
|
73
|
+
recurring_credit,
|
74
|
+
timeperiod,
|
75
|
+
start_date,
|
76
|
+
end_date,
|
77
|
+
status)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# pepipost
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0 (
|
4
|
+
# https://apimatic.io ).
|
5
|
+
|
6
|
+
module Pepipost
|
7
|
+
# UpdateSubaccount modal
|
8
|
+
class UpdateSubaccount < BaseModel
|
9
|
+
# The username for the subaccount
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :username
|
12
|
+
|
13
|
+
# The new email address to be registered with the subaccount
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :new_email
|
16
|
+
|
17
|
+
# The new password of the subaccount
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :new_password
|
20
|
+
|
21
|
+
# reconfirm the new password for the subaccount
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :confirm_password
|
24
|
+
|
25
|
+
# Allowed values one_time_credit or unlimited by default, all subaccounts
|
26
|
+
# are created with credit type as unlimited.
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :credit_type
|
29
|
+
|
30
|
+
# A mapping from model property names to API property names.
|
31
|
+
def self.names
|
32
|
+
@_hash = {} if @_hash.nil?
|
33
|
+
@_hash['username'] = 'username'
|
34
|
+
@_hash['new_email'] = 'new_email'
|
35
|
+
@_hash['new_password'] = 'new_password'
|
36
|
+
@_hash['confirm_password'] = 'confirm_password'
|
37
|
+
@_hash['credit_type'] = 'credit_type'
|
38
|
+
@_hash
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(username = nil,
|
42
|
+
new_email = nil,
|
43
|
+
new_password = nil,
|
44
|
+
confirm_password = nil,
|
45
|
+
credit_type = nil)
|
46
|
+
@username = username
|
47
|
+
@new_email = new_email
|
48
|
+
@new_password = new_password
|
49
|
+
@confirm_password = confirm_password
|
50
|
+
@credit_type = credit_type
|
51
|
+
end
|
52
|
+
|
53
|
+
# Creates an instance of the object from a hash.
|
54
|
+
def self.from_hash(hash)
|
55
|
+
return nil unless hash
|
56
|
+
|
57
|
+
# Extract variables from the hash.
|
58
|
+
username = hash['username']
|
59
|
+
new_email = hash['new_email']
|
60
|
+
new_password = hash['new_password']
|
61
|
+
confirm_password = hash['confirm_password']
|
62
|
+
credit_type = hash['credit_type']
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
UpdateSubaccount.new(username,
|
66
|
+
new_email,
|
67
|
+
new_password,
|
68
|
+
confirm_password,
|
69
|
+
credit_type)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|