class Io::Flow::V0::Models::ChannelTokenReference

Attributes

channel[R]
id[R]
user[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35613
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

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35626
def copy(incoming={})
  ChannelTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35630
def subtype_to_hash
  {
    :id => id,
    :channel => channel.to_hash,
    :user => user.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35622
def to_json
  JSON.dump(to_hash)
end