Class: Io::Flow::V0::Models::ChannelTokenReference
- Inherits:
-
TokenReference
- Object
- TokenReference
- Io::Flow::V0::Models::ChannelTokenReference
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from TokenReference
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ChannelTokenReference
constructor
A new instance of ChannelTokenReference.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TokenReference
Constructor Details
#initialize(incoming = {}) ⇒ ChannelTokenReference
Returns a new instance of ChannelTokenReference.
32624 32625 32626 32627 32628 32629 32630 32631 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32624 def initialize(incoming={}) super(:discriminator => TokenReference::Types::CHANNEL_TOKEN_REFERENCE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :channel, :user], 'ChannelTokenReference') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @channel = (x = opts.delete(:channel); x.is_a?(::Io::Flow::V0::Models::ChannelReference) ? x : ::Io::Flow::V0::Models::ChannelReference.new(x)) @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x)) end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
32622 32623 32624 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32622 def channel @channel end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
32622 32623 32624 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32622 def id @id end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
32622 32623 32624 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32622 def user @user end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32637 32638 32639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32637 def copy(incoming={}) ChannelTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
32641 32642 32643 32644 32645 32646 32647 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32641 def subtype_to_hash { :id => id, :channel => channel.to_hash, :user => user.to_hash } end |
#to_json ⇒ Object
32633 32634 32635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32633 def to_json JSON.dump(to_hash) end |