Class: AdvancedBilling::OfferSignupPage

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/offer_signup_page.rb

Overview

OfferSignupPage Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id: SKIP, nickname: SKIP, enabled: SKIP, return_url: SKIP, return_params: SKIP, url: SKIP, additional_properties: {}) ⇒ OfferSignupPage

Returns a new instance of OfferSignupPage.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 65

def initialize(id: SKIP, nickname: SKIP, enabled: SKIP, return_url: SKIP,
               return_params: SKIP, url: SKIP, additional_properties: {})
  @id = id unless id == SKIP
  @nickname = nickname unless nickname == SKIP
  @enabled = enabled unless enabled == SKIP
  @return_url = return_url unless return_url == SKIP
  @return_params = return_params unless return_params == SKIP
  @url = url unless url == SKIP

  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end
end

Instance Attribute Details

#enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 22

def enabled
  @enabled
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 14

def id
  @id
end

#nicknameString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 18

def nickname
  @nickname
end

#return_paramsString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 30

def return_params
  @return_params
end

#return_urlString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 26

def return_url
  @return_url
end

#urlString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 34

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  nickname = hash.key?('nickname') ? hash['nickname'] : SKIP
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  return_url = hash.key?('return_url') ? hash['return_url'] : SKIP
  return_params = hash.key?('return_params') ? hash['return_params'] : SKIP
  url = hash.key?('url') ? hash['url'] : SKIP

  # Clean out expected properties from Hash.
  names.each_value { |k| hash.delete(k) }

  # Create object from extracted values.
  OfferSignupPage.new(id: id,
                      nickname: nickname,
                      enabled: enabled,
                      return_url: return_url,
                      return_params: return_params,
                      url: url,
                      additional_properties: hash)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['nickname'] = 'nickname'
  @_hash['enabled'] = 'enabled'
  @_hash['return_url'] = 'return_url'
  @_hash['return_params'] = 'return_params'
  @_hash['url'] = 'url'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/advanced_billing/models/offer_signup_page.rb', line 49

def self.optionals
  %w[
    id
    nickname
    enabled
    return_url
    return_params
    url
  ]
end