module Eco module API class Session class Batch class Policies < Eco::API::Session::Batch::BasePolicy CORE_ATTRS = Eco::API::Session::Batch::RequestStats.core_attrs(stats: true) ACCOUNT_ATTRS = Eco::API::Session::Batch::RequestStats.account_attrs(stats: true) DETAILS_ATTRS = Eco::API::Session::Batch::RequestStats.details_attrs(stats: true) core_model = {core: CORE_ATTRS} account_model = {account: ACCOUNT_ATTRS} details_model = {details: DETAILS_ATTRS} submodel = core_model.merge(account_model).merge(details_model) TOP_MODEL = Eco::API::Session::Batch::Job.types.each_with_object({}) {|t, h| h[t] = submodel} self.model = TOP_MODEL policy_attrs *model_attrs end end end end end