class Io::Flow::V0::Models::Channel

Attributes

environment[R]
id[R]
name[R]
organization_id_prefix[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 34800
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name, :environment], 'Channel')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
  @organization_id_prefix = (x = opts.delete(:organization_id_prefix); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization_id_prefix', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 34813
def copy(incoming={})
  Channel.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 34817
def to_hash
  {
    :id => id,
    :name => name,
    :environment => environment.value,
    :organization_id_prefix => organization_id_prefix
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 34809
def to_json
  JSON.dump(to_hash)
end