Class: Io::Flow::V0::Models::OrganizationPutForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationPutForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Data required to upsert an organization.
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationPutForm
constructor
A new instance of OrganizationPutForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationPutForm
Returns a new instance of OrganizationPutForm.
51112 51113 51114 51115 51116 51117 51118 51119 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51112 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
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
51110 51111 51112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51110 def defaults @defaults end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
51110 51111 51112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51110 def environment @environment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
51110 51111 51112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51110 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
51110 51111 51112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51110 def parent_id @parent_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
51110 51111 51112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51110 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
51125 51126 51127 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51125 def copy(incoming={}) OrganizationPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
51129 51130 51131 51132 51133 51134 51135 51136 51137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51129 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_json ⇒ Object
51121 51122 51123 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51121 def to_json JSON.dump(to_hash) end |