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.



25790
25791
25792
25793
25794
25795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25790

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

#environmentObject (readonly)

Returns the value of attribute environment.



25788
25789
25790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25788

def environment
  @environment
end

#nameObject (readonly)

Returns the value of attribute name.



25788
25789
25790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25788

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



25788
25789
25790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25788

def parent_id
  @parent_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25801
25802
25803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25801

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

#to_hashObject



25805
25806
25807
25808
25809
25810
25811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25805

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

#to_jsonObject



25797
25798
25799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25797

def to_json
  JSON.dump(to_hash)
end