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.



55253
55254
55255
55256
55257
55258
55259
55260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55253

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)))
  @status = (x = (x = opts.delete(:status); x.nil? ? "active" : x); x.is_a?(::Io::Flow::V0::Models::OrganizationStatus) ? x : ::Io::Flow::V0::Models::OrganizationStatus.apply(x))
end

Instance Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults.



55251
55252
55253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55251

def defaults
  @defaults
end

#environmentObject (readonly)

Returns the value of attribute environment.



55251
55252
55253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55251

def environment
  @environment
end

#nameObject (readonly)

Returns the value of attribute name.



55251
55252
55253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55251

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



55251
55252
55253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55251

def parent_id
  @parent_id
end

#statusObject (readonly)

Returns the value of attribute status.



55251
55252
55253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55251

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55266
55267
55268
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55266

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

#to_hashObject



55270
55271
55272
55273
55274
55275
55276
55277
55278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55270

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

#to_jsonObject



55262
55263
55264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55262

def to_json
  JSON.dump(to_hash)
end