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.



37418
37419
37420
37421
37422
37423
37424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37418

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))
  @defaults = (x = opts.delete(:defaults); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrganizationDefaults) ? x : ::Io::Flow::V0::Models::OrganizationDefaults.new(x)))
end

Instance Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults.



37416
37417
37418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37416

def defaults
  @defaults
end

#environmentObject (readonly)

Returns the value of attribute environment.



37416
37417
37418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37416

def environment
  @environment
end

#nameObject (readonly)

Returns the value of attribute name.



37416
37417
37418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37416

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



37416
37417
37418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37416

def parent_id
  @parent_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37430
37431
37432
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37430

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

#to_hashObject



37434
37435
37436
37437
37438
37439
37440
37441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37434

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

#to_jsonObject



37426
37427
37428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37426

def to_json
  JSON.dump(to_hash)
end