Class: DocuSign_eSign::ReferralInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/docusign_esign/models/referral_information.rb

Overview

A complex type that contains the following information for entering referral and discount information. The following items are included in the referral information (all string content): enableSupport, includedSeats, saleDiscountPercent, saleDiscountAmount, saleDiscountFixedAmount, saleDiscountPeriods, saleDiscountSeatPriceOverride, planStartMonth, referralCode, referrerName, advertisementId, publisherId, shopperId, promoCode, groupMemberId, idType, and industry ###### Note: saleDiscountPercent, saleDiscountAmount, saleDiscountFixedAmount, saleDiscountPeriods, and saleDiscountSeatPriceOverride are reserved for DoucSign use only.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ReferralInformation

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/docusign_esign/models/referral_information.rb', line 122

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'advertisementId')
    self.advertisement_id = attributes[:'advertisementId']
  end

  if attributes.has_key?(:'enableSupport')
    self.enable_support = attributes[:'enableSupport']
  end

  if attributes.has_key?(:'externalOrgId')
    self.external_org_id = attributes[:'externalOrgId']
  end

  if attributes.has_key?(:'groupMemberId')
    self.group_member_id = attributes[:'groupMemberId']
  end

  if attributes.has_key?(:'idType')
    self.id_type = attributes[:'idType']
  end

  if attributes.has_key?(:'includedSeats')
    self.included_seats = attributes[:'includedSeats']
  end

  if attributes.has_key?(:'industry')
    self.industry = attributes[:'industry']
  end

  if attributes.has_key?(:'planStartMonth')
    self.plan_start_month = attributes[:'planStartMonth']
  end

  if attributes.has_key?(:'promoCode')
    self.promo_code = attributes[:'promoCode']
  end

  if attributes.has_key?(:'publisherId')
    self.publisher_id = attributes[:'publisherId']
  end

  if attributes.has_key?(:'referralCode')
    self.referral_code = attributes[:'referralCode']
  end

  if attributes.has_key?(:'referrerName')
    self.referrer_name = attributes[:'referrerName']
  end

  if attributes.has_key?(:'saleDiscountAmount')
    self.sale_discount_amount = attributes[:'saleDiscountAmount']
  end

  if attributes.has_key?(:'saleDiscountFixedAmount')
    self.sale_discount_fixed_amount = attributes[:'saleDiscountFixedAmount']
  end

  if attributes.has_key?(:'saleDiscountPercent')
    self.sale_discount_percent = attributes[:'saleDiscountPercent']
  end

  if attributes.has_key?(:'saleDiscountPeriods')
    self.sale_discount_periods = attributes[:'saleDiscountPeriods']
  end

  if attributes.has_key?(:'saleDiscountSeatPriceOverride')
    self.sale_discount_seat_price_override = attributes[:'saleDiscountSeatPriceOverride']
  end

  if attributes.has_key?(:'shopperId')
    self.shopper_id = attributes[:'shopperId']
  end

end

Instance Attribute Details

A complex type that contains the following information for entering referral and discount information. The following items are included in the referral information (all string content): enableSupport, includedSeats, saleDiscountPercent, saleDiscountAmount, saleDiscountFixedAmount, saleDiscountPeriods, saleDiscountSeatPriceOverride, planStartMonth, referralCode, referrerName, advertisementId, publisherId, shopperId, promoCode, groupMemberId, idType, and industry. ###### Note: saleDiscountPercent, saleDiscountAmount, saleDiscountFixedAmount, saleDiscountPeriods, and saleDiscountSeatPriceOverride are reserved for DoucSign use only.



18
19
20
# File 'lib/docusign_esign/models/referral_information.rb', line 18

def advertisement_id
  @advertisement_id
end

#enable_supportObject

When set to true, then customer support is provided as part of the account plan.



21
22
23
# File 'lib/docusign_esign/models/referral_information.rb', line 21

def enable_support
  @enable_support
end

#external_org_idObject

Returns the value of attribute external_org_id.



24
25
26
# File 'lib/docusign_esign/models/referral_information.rb', line 24

def external_org_id
  @external_org_id
end

#group_member_idObject

Returns the value of attribute group_member_id.



27
28
29
# File 'lib/docusign_esign/models/referral_information.rb', line 27

def group_member_id
  @group_member_id
end

#id_typeObject

Returns the value of attribute id_type.



30
31
32
# File 'lib/docusign_esign/models/referral_information.rb', line 30

def id_type
  @id_type
end

#included_seatsObject

The number of seats (users) included.



33
34
35
# File 'lib/docusign_esign/models/referral_information.rb', line 33

def included_seats
  @included_seats
end

#industryObject

Returns the value of attribute industry.



36
37
38
# File 'lib/docusign_esign/models/referral_information.rb', line 36

def industry
  @industry
end

#plan_start_monthObject

Returns the value of attribute plan_start_month.



39
40
41
# File 'lib/docusign_esign/models/referral_information.rb', line 39

def plan_start_month
  @plan_start_month
end

#promo_codeObject

Returns the value of attribute promo_code.



42
43
44
# File 'lib/docusign_esign/models/referral_information.rb', line 42

def promo_code
  @promo_code
end

#publisher_idObject

Returns the value of attribute publisher_id.



45
46
47
# File 'lib/docusign_esign/models/referral_information.rb', line 45

def publisher_id
  @publisher_id
end

#referral_codeObject

Returns the value of attribute referral_code.



48
49
50
# File 'lib/docusign_esign/models/referral_information.rb', line 48

def referral_code
  @referral_code
end

#referrer_nameObject

Returns the value of attribute referrer_name.



51
52
53
# File 'lib/docusign_esign/models/referral_information.rb', line 51

def referrer_name
  @referrer_name
end

#sale_discount_amountObject

Reserved for DocuSign use only.



54
55
56
# File 'lib/docusign_esign/models/referral_information.rb', line 54

def sale_discount_amount
  @sale_discount_amount
end

#sale_discount_fixed_amountObject

Reserved for DocuSign use only.



57
58
59
# File 'lib/docusign_esign/models/referral_information.rb', line 57

def sale_discount_fixed_amount
  @sale_discount_fixed_amount
end

#sale_discount_percentObject

Reserved for DocuSign use only.



60
61
62
# File 'lib/docusign_esign/models/referral_information.rb', line 60

def sale_discount_percent
  @sale_discount_percent
end

#sale_discount_periodsObject

Reserved for DocuSign use only.



63
64
65
# File 'lib/docusign_esign/models/referral_information.rb', line 63

def sale_discount_periods
  @sale_discount_periods
end

#sale_discount_seat_price_overrideObject

Reserved for DocuSign use only.



66
67
68
# File 'lib/docusign_esign/models/referral_information.rb', line 66

def sale_discount_seat_price_override
  @sale_discount_seat_price_override
end

#shopper_idObject

Returns the value of attribute shopper_id.



69
70
71
# File 'lib/docusign_esign/models/referral_information.rb', line 69

def shopper_id
  @shopper_id
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/docusign_esign/models/referral_information.rb', line 73

def self.attribute_map
  {
    :'advertisement_id' => :'advertisementId',
    :'enable_support' => :'enableSupport',
    :'external_org_id' => :'externalOrgId',
    :'group_member_id' => :'groupMemberId',
    :'id_type' => :'idType',
    :'included_seats' => :'includedSeats',
    :'industry' => :'industry',
    :'plan_start_month' => :'planStartMonth',
    :'promo_code' => :'promoCode',
    :'publisher_id' => :'publisherId',
    :'referral_code' => :'referralCode',
    :'referrer_name' => :'referrerName',
    :'sale_discount_amount' => :'saleDiscountAmount',
    :'sale_discount_fixed_amount' => :'saleDiscountFixedAmount',
    :'sale_discount_percent' => :'saleDiscountPercent',
    :'sale_discount_periods' => :'saleDiscountPeriods',
    :'sale_discount_seat_price_override' => :'saleDiscountSeatPriceOverride',
    :'shopper_id' => :'shopperId'
  }
end

.swagger_typesObject

Attribute type mapping.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/docusign_esign/models/referral_information.rb', line 97

def self.swagger_types
  {
    :'advertisement_id' => :'String',
    :'enable_support' => :'String',
    :'external_org_id' => :'String',
    :'group_member_id' => :'String',
    :'id_type' => :'String',
    :'included_seats' => :'String',
    :'industry' => :'String',
    :'plan_start_month' => :'String',
    :'promo_code' => :'String',
    :'publisher_id' => :'String',
    :'referral_code' => :'String',
    :'referrer_name' => :'String',
    :'sale_discount_amount' => :'String',
    :'sale_discount_fixed_amount' => :'String',
    :'sale_discount_percent' => :'String',
    :'sale_discount_periods' => :'String',
    :'sale_discount_seat_price_override' => :'String',
    :'shopper_id' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/docusign_esign/models/referral_information.rb', line 217

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      advertisement_id == o.advertisement_id &&
      enable_support == o.enable_support &&
      external_org_id == o.external_org_id &&
      group_member_id == o.group_member_id &&
      id_type == o.id_type &&
      included_seats == o.included_seats &&
      industry == o.industry &&
      plan_start_month == o.plan_start_month &&
      promo_code == o.promo_code &&
      publisher_id == o.publisher_id &&
      referral_code == o.referral_code &&
      referrer_name == o.referrer_name &&
      sale_discount_amount == o.sale_discount_amount &&
      sale_discount_fixed_amount == o.sale_discount_fixed_amount &&
      sale_discount_percent == o.sale_discount_percent &&
      sale_discount_periods == o.sale_discount_periods &&
      sale_discount_seat_price_override == o.sale_discount_seat_price_override &&
      shopper_id == o.shopper_id
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/docusign_esign/models/referral_information.rb', line 276

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = DocuSign_eSign.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/docusign_esign/models/referral_information.rb', line 342

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/docusign_esign/models/referral_information.rb', line 255

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


242
243
244
# File 'lib/docusign_esign/models/referral_information.rb', line 242

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



248
249
250
# File 'lib/docusign_esign/models/referral_information.rb', line 248

def hash
  [advertisement_id, enable_support, external_org_id, group_member_id, id_type, included_seats, industry, plan_start_month, promo_code, publisher_id, referral_code, referrer_name, sale_discount_amount, sale_discount_fixed_amount, sale_discount_percent, sale_discount_periods, sale_discount_seat_price_override, shopper_id].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



204
205
206
207
# File 'lib/docusign_esign/models/referral_information.rb', line 204

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



322
323
324
# File 'lib/docusign_esign/models/referral_information.rb', line 322

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



328
329
330
331
332
333
334
335
336
# File 'lib/docusign_esign/models/referral_information.rb', line 328

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



316
317
318
# File 'lib/docusign_esign/models/referral_information.rb', line 316

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



211
212
213
# File 'lib/docusign_esign/models/referral_information.rb', line 211

def valid?
  return true
end