class Io::Flow::V0::Models::PermissionCheck

Used to test an integration’s permissions, including identifying the authentication technique that will be used for similar requests.

Attributes

authentication_technique[R]
behaviors[R]
roles[R]
routes[R]
user[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59588
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:authentication_technique, :roles, :behaviors, :routes], 'PermissionCheck')
  @authentication_technique = (x = opts.delete(:authentication_technique); x.is_a?(::Io::Flow::V0::Models::AuthenticationTechnique) ? x : ::Io::Flow::V0::Models::AuthenticationTechnique.apply(x))
  @user = (x = opts.delete(:user); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ExpandableUser) ? x : ::Io::Flow::V0::Models::ExpandableUser.from_json(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)) }
  @behaviors = HttpClient::Preconditions.assert_class('behaviors', opts.delete(:behaviors), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::FlowBehavior) ? x : ::Io::Flow::V0::Models::FlowBehavior.apply(x)) }
  @routes = HttpClient::Preconditions.assert_class('routes', opts.delete(:routes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PermittedRoute) ? x : ::Io::Flow::V0::Models::PermittedRoute.new(x)) }
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59602
def copy(incoming={})
  PermissionCheck.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59606
def to_hash
  {
    :authentication_technique => authentication_technique.value,
    :user => user.nil? ? nil : user.to_hash,
    :roles => roles.map { |o| o.value },
    :behaviors => behaviors.map { |o| o.value },
    :routes => routes.map { |o| o.to_hash }
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59598
def to_json
  JSON.dump(to_hash)
end