Class: Io::Flow::V0::Models::BehaviorAudit

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ BehaviorAudit

Returns a new instance of BehaviorAudit.



28236
28237
28238
28239
28240
28241
28242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28236

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:behavior, :authentication_techniques, :roles], 'BehaviorAudit')
  @behavior = (x = opts.delete(:behavior); x.is_a?(::Io::Flow::V0::Models::FlowBehavior) ? x : ::Io::Flow::V0::Models::FlowBehavior.apply(x))
  @authentication_techniques = HttpClient::Preconditions.assert_class('authentication_techniques', opts.delete(:authentication_techniques), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AuthenticationTechnique) ? x : ::Io::Flow::V0::Models::AuthenticationTechnique.apply(x)) }
  @roles = HttpClient::Preconditions.assert_class('roles', opts.delete(:roles), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::FlowRole) ? x : ::Io::Flow::V0::Models::FlowRole.apply(x)) }
end

Instance Attribute Details

#authentication_techniquesObject (readonly)

Returns the value of attribute authentication_techniques.



28234
28235
28236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28234

def authentication_techniques
  @authentication_techniques
end

#behaviorObject (readonly)

Returns the value of attribute behavior.



28234
28235
28236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28234

def behavior
  @behavior
end

#rolesObject (readonly)

Returns the value of attribute roles.



28234
28235
28236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28234

def roles
  @roles
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28248
28249
28250
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28248

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

#to_hashObject



28252
28253
28254
28255
28256
28257
28258
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28252

def to_hash
  {
    :behavior => behavior.value,
    :authentication_techniques => authentication_techniques.map { |o| o.value },
    :roles => roles.map { |o| o.value }
  }
end

#to_jsonObject



28244
28245
28246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28244

def to_json
  JSON.dump(to_hash)
end