class Io::Flow::V0::Models::ServiceSummary

Attributes

carrier[R]
center_code[R]
id[R]
name[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65199
def initialize(incoming={})
  super(:discriminator => ServiceDescription::Types::SERVICE_SUMMARY)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :carrier, :name], 'ServiceSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @carrier = (x = opts.delete(:carrier); x.is_a?(::Io::Flow::V0::Models::CarrierReference) ? x : ::Io::Flow::V0::Models::CarrierReference.new(x))
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @center_code = (x = opts.delete(:center_code); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_code', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65213
def copy(incoming={})
  ServiceSummary.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 65217
def subtype_to_hash
  {
    :id => id,
    :carrier => carrier.to_hash,
    :name => name,
    :center_code => center_code
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 65209
def to_json
  JSON.dump(to_hash)
end