Class: Cryptopay::ChannelUpdateParams
- Inherits:
-
Object
- Object
- Cryptopay::ChannelUpdateParams
- Defined in:
- lib/cryptopay/models/channel_update_params.rb
Class Method Summary collapse
-
.build_from_hash(data) ⇒ Cryptopay::ChannelUpdateParams
Builds the object from hash.
Instance Method Summary collapse
-
#customer_id ⇒ Object
The internal ID of your customer that the channel relates to.
-
#description ⇒ Object
Channel description.
-
#initialize(attributes = {}) ⇒ ChannelUpdateParams
constructor
Initializes the object.
- #inspect ⇒ Object
-
#invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#name ⇒ Object
Channel name.
- #status ⇒ Object
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ChannelUpdateParams
Initializes the object
36 37 38 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 36 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end |
Class Method Details
.build_from_hash(data) ⇒ Cryptopay::ChannelUpdateParams
Builds the object from hash
29 30 31 32 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 29 def self.build_from_hash(data) attributes = ENCODER.build_from_hash(data) new(attributes) end |
Instance Method Details
#customer_id ⇒ Object
The internal ID of your customer that the channel relates to
55 56 57 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 55 def customer_id @attributes[:customer_id] end |
#description ⇒ Object
Channel description
46 47 48 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 46 def description @attributes[:description] end |
#inspect ⇒ Object
83 84 85 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 83 def inspect "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash) end |
#invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
61 62 63 64 65 66 67 68 69 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 61 def invalid_properties properties = [] if !status.nil? && !%w[enabled disabled].include?(status) properties.push('invalid value for status, must be one of "enabled", "disabled"') end properties end |
#name ⇒ Object
Channel name
41 42 43 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 41 def name @attributes[:name] end |
#status ⇒ Object
50 51 52 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 50 def status @attributes[:status] end |
#to_hash ⇒ Hash
Returns the object in the form of hash
79 80 81 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 79 def to_hash ENCODER.to_hash(@attributes) end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
73 74 75 |
# File 'lib/cryptopay/models/channel_update_params.rb', line 73 def valid? invalid_properties.empty? end |