Class: Files::BundleRecipientRegistration

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/bundle_recipient_registration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ BundleRecipientRegistration

Returns a new instance of BundleRecipientRegistration.



7
8
9
10
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

bundle_recipient_code (required) - string - Bundle recipient code


97
98
99
100
101
102
103
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 97

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: bundle_recipient_code must be an String") if params[:bundle_recipient_code] and !params[:bundle_recipient_code].is_a?(String)
  raise MissingParameterError.new("Parameter missing: bundle_recipient_code") unless params[:bundle_recipient_code]

  response, options = Api.send_request("/bundle_recipient_registrations", :post, params, options)
  BundleRecipientRegistration.new(response.data, options)
end

Instance Method Details

#bundle_recipient_codeObject

string - Bundle recipient code



76
77
78
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 76

def bundle_recipient_code
  @attributes[:bundle_recipient_code]
end

#bundle_recipient_code=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 80

def bundle_recipient_code=(value)
  @attributes[:bundle_recipient_code] = value
end

#bundle_registration_codeObject

string - If the recipient has already registered for this bundle, this is their registration code to get the bundle contents.



22
23
24
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 22

def bundle_registration_code
  @attributes[:bundle_registration_code]
end

#bundle_registration_code=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 26

def bundle_registration_code=(value)
  @attributes[:bundle_registration_code] = value
end

#codeObject

string - The bundle recipient registration code. Use this to register for the bundle.



13
14
15
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 13

def code
  @attributes[:code]
end

#code=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 17

def code=(value)
  @attributes[:code] = value
end

#companyObject

string - The recipient's company.



49
50
51
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 49

def company
  @attributes[:company]
end

#company=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 53

def company=(value)
  @attributes[:company] = value
end

#inbox_codeObject

string - InboxRegistration cookie code, if there is an associated InboxRegistration



67
68
69
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 67

def inbox_code
  @attributes[:inbox_code]
end

#inbox_code=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 71

def inbox_code=(value)
  @attributes[:inbox_code] = value
end

#nameObject

string - The recipient's name.



40
41
42
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 40

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 44

def name=(value)
  @attributes[:name] = value
end

#password_emailedObject

boolean - Whether a one-time password was emailed to the recipient.



58
59
60
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 58

def password_emailed
  @attributes[:password_emailed]
end

#password_emailed=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 62

def password_emailed=(value)
  @attributes[:password_emailed] = value
end

#recipientObject

string - The recipient's email address.



31
32
33
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 31

def recipient
  @attributes[:recipient]
end

#recipient=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 35

def recipient=(value)
  @attributes[:recipient] = value
end

#saveObject



84
85
86
87
88
89
90
91
92
93
# File 'lib/files.com/models/bundle_recipient_registration.rb', line 84

def save
  if @attributes[:id]
    raise NotImplementedError.new("The BundleRecipientRegistration object doesn't support updates.")
  else
    new_obj = BundleRecipientRegistration.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end