Class: Io::Flow::V0::Models::InvitationForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InvitationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InvitationForm
constructor
A new instance of InvitationForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InvitationForm
Returns a new instance of InvitationForm.
28194 28195 28196 28197 28198 28199 28200 28201 28202 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28194 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:organization, :email], 'InvitationForm') @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String) @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))) @role = (x = (x = opts.delete(:role); x.nil? ? "member" : x); x.is_a?(::Io::Flow::V0::Models::Role) ? x : ::Io::Flow::V0::Models::Role.apply(x)) @roles = (x = opts.delete(:roles); x.nil? ? nil : HttpClient::Preconditions.assert_class('roles', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::FlowRole) ? x : ::Io::Flow::V0::Models::FlowRole.from_json(x)) }) end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
28192 28193 28194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28192 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28192 28193 28194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28192 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
28192 28193 28194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28192 def organization @organization end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
28192 28193 28194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28192 def role @role end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
28192 28193 28194 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28192 def roles @roles end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28208 28209 28210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28208 def copy(incoming={}) InvitationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28212 28213 28214 28215 28216 28217 28218 28219 28220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28212 def to_hash { :organization => organization, :email => email, :name => name.nil? ? nil : name.to_hash, :role => role.value, :roles => roles.nil? ? nil : roles.map { |o| o.to_hash } } end |
#to_json ⇒ Object
28204 28205 28206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28204 def to_json JSON.dump(to_hash) end |