lib/oneaccess/api/v1_1/entitlement/research/user_requests.rb in oneaccess-1.2.0 vs lib/oneaccess/api/v1_1/entitlement/research/user_requests.rb in oneaccess-1.3.0
- old
+ new
@@ -1,37 +1,39 @@
# frozen_string_literal: true
-require_relative "../../../../response/user_requests_response"
-require_relative "../../../../response/user_entitlement_requests_response"
+require_relative '../../../../response/user_requests_response'
+require_relative '../../../../response/user_entitlement_requests_response'
module ONEAccess
module API
module V1_1
module Entitlement
module Research
class UserRequests < Base
- api_path "/entitlement/research/userRequests"
+ api_path '/entitlement/research/userRequests'
def self.create(user_id:, sell_side_org_id:, sales_contact_first_name: nil, sales_contact_last_name: nil,
- sales_contact_email: nil)
- response = send_post("create",
- UserId: user_id,
- SellSideOrgId: sell_side_org_id,
- SalesContact: {
- FirstName: sales_contact_first_name,
- LastName: sales_contact_last_name,
- Email: sales_contact_email
- }.reject { |_, value| value.nil? })
+ sales_contact_email: nil)
+ response = send_post(
+ 'create',
+ UserId: user_id,
+ SellSideOrgId: sell_side_org_id,
+ SalesContact: {
+ FirstName: sales_contact_first_name,
+ LastName: sales_contact_last_name,
+ Email: sales_contact_email,
+ }.reject { |_, value| value.nil? },
+ )
Response::UserRequestsResponse.from_json(response.body)
end
def self.get_list( # rubocop:disable Metrics/MethodLength
user_ids: [],
page_number: 0,
page_size: 20,
- sort_by: "UserEntitlementRequestId",
+ sort_by: 'UserEntitlementRequestId',
is_ascending: false,
create_date_from: nil,
create_date_to: nil,
sell_side_org_ids: nil,
entitlement_status: nil
@@ -43,13 +45,13 @@
SortBy: sort_by,
IsAscending: is_ascending,
CreateDateFrom: create_date_from,
CreateDateTo: create_date_to,
SellSideOrgIds: sell_side_org_ids,
- EntitlementStatus: entitlement_status
+ EntitlementStatus: entitlement_status,
}.reject { |_, value| value.nil? }
- response = send_get("getListWithEntitlementsStatus", Query: query.to_json)
+ response = send_get('getListWithEntitlementsStatus', Query: query.to_json)
Response::UserEntitlementRequestsResponse.from_json(response.body)
end
end
end