Class: Io::Flow::V0::Models::OrganizationForm

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

Overview

Either id or name is required.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationForm

Returns a new instance of OrganizationForm.



30828
30829
30830
30831
30832
30833
30834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30828

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @id = (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, String))
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
  @environment = (x = (x = opts.delete(:environment); x.nil? ? "production" : x); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
  @parent_id = (x = opts.delete(:parent_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent_id', x, String))
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



30826
30827
30828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30826

def environment
  @environment
end

#idObject (readonly)

Returns the value of attribute id.



30826
30827
30828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30826

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



30826
30827
30828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30826

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



30826
30827
30828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30826

def parent_id
  @parent_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30840
30841
30842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30840

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

#to_hashObject



30844
30845
30846
30847
30848
30849
30850
30851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30844

def to_hash
  {
    :id => id,
    :name => name,
    :environment => environment.value,
    :parent_id => parent_id
  }
end

#to_jsonObject



30836
30837
30838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30836

def to_json
  JSON.dump(to_hash)
end