Class: Io::Flow::V0::Models::SyncStreamForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SyncStreamForm

Returns a new instance of SyncStreamForm.



51936
51937
51938
51939
51940
51941
51942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51936

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type, :systems], 'SyncStreamForm')
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::SyncStreamType) ? x : ::Io::Flow::V0::Models::SyncStreamType.apply(x))
  @systems = HttpClient::Preconditions.assert_class('systems', opts.delete(:systems), Array).map { |v| HttpClient::Preconditions.assert_class('systems', v, String) }
  @settings = (x = opts.delete(:settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::SyncStreamSettingsForm) ? x : ::Io::Flow::V0::Models::SyncStreamSettingsForm.new(x)))
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



51934
51935
51936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51934

def settings
  @settings
end

#systemsObject (readonly)

Returns the value of attribute systems.



51934
51935
51936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51934

def systems
  @systems
end

#typeObject (readonly)

Returns the value of attribute type.



51934
51935
51936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51934

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51948
51949
51950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51948

def copy(incoming={})
  SyncStreamForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



51952
51953
51954
51955
51956
51957
51958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51952

def to_hash
  {
    :type => type.value,
    :systems => systems,
    :settings => settings.nil? ? nil : settings.to_hash
  }
end

#to_jsonObject



51944
51945
51946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51944

def to_json
  JSON.dump(to_hash)
end