Class: WalmartApIs::ReportSchedulesApi
- Defined in:
- lib/walmart_ap_is/apis/report_schedules_api.rb
Overview
ReportSchedulesApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#cancel_report_schedule(report_schedule_id) ⇒ ApiResponse
TODO: type endpoint description here description here.
-
#create_report_schedule(body) ⇒ ApiResponse
TODO: type endpoint description here type description here.
-
#get_report_schedule(report_schedule_id) ⇒ ApiResponse
TODO: type endpoint description here description here.
-
#get_report_schedules(report_types: nil) ⇒ ApiResponse
TODO: type endpoint description here report type.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from WalmartApIs::BaseApi
Instance Method Details
#cancel_report_schedule(report_schedule_id) ⇒ ApiResponse
TODO: type endpoint description here description here
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/walmart_ap_is/apis/report_schedules_api.rb', line 116 def cancel_report_schedule(report_schedule_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/reports/v4/schedules/{reportScheduleId}', Server::DEFAULT1) .template_param(new_parameter(report_schedule_id, key: 'reportScheduleId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CancelReportScheduleResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#create_report_schedule(body) ⇒ ApiResponse
TODO: type endpoint description here type description here
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/walmart_ap_is/apis/report_schedules_api.rb', line 46 def create_report_schedule(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/reports/v4/schedules', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CreateReportScheduleResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_report_schedule(report_schedule_id) ⇒ ApiResponse
TODO: type endpoint description here description here
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/walmart_ap_is/apis/report_schedules_api.rb', line 80 def get_report_schedule(report_schedule_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/reports/v4/schedules/{reportScheduleId}', Server::DEFAULT1) .template_param(new_parameter(report_schedule_id, key: 'reportScheduleId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ReportSchedule.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('404', 'Not Found', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_report_schedules(report_types: nil) ⇒ ApiResponse
TODO: type endpoint description here report type. Values are Walmart Partner Reporting Platform enum names. Runtime availability is CCM-controlled; consult PRP docs for current PROD-enabled types.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/walmart_ap_is/apis/report_schedules_api.rb', line 15 def get_report_schedules(report_types: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/reports/v4/schedules', Server::DEFAULT1) .query_param(new_parameter(report_types, key: 'reportTypes')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetReportSchedulesResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |