Class: Files::InboxRecipientRegistration
- Inherits:
-
Object
- Object
- Files::InboxRecipientRegistration
- Defined in:
- lib/files.com/models/inbox_recipient_registration.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.create(params = {}, options = {}) ⇒ Object
Parameters: inbox_recipient_code (required) - string - Inbox recipient code.
Instance Method Summary collapse
-
#code ⇒ Object
string - The inbox recipient registration code.
- #code=(value) ⇒ Object
-
#company ⇒ Object
string - The recipient's company.
- #company=(value) ⇒ Object
-
#inbox_recipient_code ⇒ Object
string - Inbox recipient code.
- #inbox_recipient_code=(value) ⇒ Object
-
#inbox_registration_code ⇒ Object
string - If the recipient has already registered for this inbox, this is their registration code to get the inbox contents.
- #inbox_registration_code=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ InboxRecipientRegistration
constructor
A new instance of InboxRecipientRegistration.
-
#name ⇒ Object
string - The recipient's name.
- #name=(value) ⇒ Object
-
#recipient ⇒ Object
string - The recipient's email address.
- #recipient=(value) ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ InboxRecipientRegistration
Returns a new instance of InboxRecipientRegistration.
7 8 9 10 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 5 def @options end |
Class Method Details
.create(params = {}, options = {}) ⇒ Object
Parameters:
inbox_recipient_code (required) - string - Inbox recipient code
79 80 81 82 83 84 85 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 79 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: inbox_recipient_code must be an String") if params[:inbox_recipient_code] and !params[:inbox_recipient_code].is_a?(String) raise MissingParameterError.new("Parameter missing: inbox_recipient_code") unless params[:inbox_recipient_code] response, = Api.send_request("/inbox_recipient_registrations", :post, params, ) InboxRecipientRegistration.new(response.data, ) end |
Instance Method Details
#code ⇒ Object
string - The inbox recipient registration code. Use this to register for the inbox.
13 14 15 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 13 def code @attributes[:code] end |
#code=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 17 def code=(value) @attributes[:code] = value end |
#company ⇒ Object
string - The recipient's company.
49 50 51 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 49 def company @attributes[:company] end |
#company=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 53 def company=(value) @attributes[:company] = value end |
#inbox_recipient_code ⇒ Object
string - Inbox recipient code
58 59 60 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 58 def inbox_recipient_code @attributes[:inbox_recipient_code] end |
#inbox_recipient_code=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 62 def inbox_recipient_code=(value) @attributes[:inbox_recipient_code] = value end |
#inbox_registration_code ⇒ Object
string - If the recipient has already registered for this inbox, this is their registration code to get the inbox contents.
22 23 24 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 22 def inbox_registration_code @attributes[:inbox_registration_code] end |
#inbox_registration_code=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 26 def inbox_registration_code=(value) @attributes[:inbox_registration_code] = value end |
#name ⇒ Object
string - The recipient's name.
40 41 42 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 40 def name @attributes[:name] end |
#name=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 44 def name=(value) @attributes[:name] = value end |
#recipient ⇒ Object
string - The recipient's email address.
31 32 33 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 31 def recipient @attributes[:recipient] end |
#recipient=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 35 def recipient=(value) @attributes[:recipient] = value end |
#save ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/files.com/models/inbox_recipient_registration.rb', line 66 def save if @attributes[:id] raise NotImplementedError.new("The InboxRecipientRegistration object doesn't support updates.") else new_obj = InboxRecipientRegistration.create(@attributes, @options) end @attributes = new_obj.attributes true end |