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.



14097
14098
14099
14100
14101
14102
14103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14097

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.



14095
14096
14097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14095

def environment
  @environment
end

#idObject (readonly)

Returns the value of attribute id.



14095
14096
14097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14095

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



14095
14096
14097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14095

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



14095
14096
14097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14095

def parent_id
  @parent_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14109
14110
14111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14109

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

#to_hashObject



14113
14114
14115
14116
14117
14118
14119
14120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14113

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

#to_jsonObject



14105
14106
14107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14105

def to_json
  JSON.dump(to_hash)
end