Class: Io::Flow::V0::Models::OrganizationPutForm

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

Overview

Data required to upsert an organization.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationPutForm

Returns a new instance of OrganizationPutForm.



17560
17561
17562
17563
17564
17565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17560

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
  @environment = (x = opts.delete(:environment); x.nil? ? nil : (x = 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

#environment ⇒ Object (readonly)

Returns the value of attribute environment.



17558
17559
17560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17558

def environment
  @environment
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



17558
17559
17560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17558

def name
  @name
end

#parent_id ⇒ Object (readonly)

Returns the value of attribute parent_id.



17558
17559
17560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17558

def parent_id
  @parent_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17571
17572
17573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17571

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

#to_hash ⇒ Object



17575
17576
17577
17578
17579
17580
17581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17575

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

#to_json ⇒ Object



17567
17568
17569
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17567

def to_json
  JSON.dump(to_hash)
end