11package com.ecwid.apiclient.v3.dto.report.request
22
3- import com.ecwid.apiclient.v3.dto.ApiRequest
43import com.ecwid.apiclient.v3.dto.report.enums.*
54import com.ecwid.apiclient.v3.impl.RequestInfo
65import com.ecwid.apiclient.v3.responsefields.ResponseFields
76
87data class ReportRequest (
9- val reportType : ReportType = ReportType .allTraffic,
10- val startedFrom : Long? = null ,
11- val endedAt : Long? = null ,
12- val timeScaleValue : TimeScaleValue ? = null ,
13- val comparePeriod : ComparePeriod ? = null ,
14- val firstDayOfWeek : FirstDayOfWeek ? = null ,
15- val orderByMetric : String? = null ,
16- val orderDirection : String? = null ,
17- val limit : Int? = null ,
18- val offset : Int? = null ,
19- val responseFields : ResponseFields = ResponseFields .All ,
20- val storefrontPlatform : StorefrontPlatform ? = null ,
21- ) : ApiRequest {
22-
8+ override val reportType : ReportType = ReportType .allTraffic,
9+ override val startedFrom : Long? = null ,
10+ override val endedAt : Long? = null ,
11+ override val timeScaleValue : TimeScaleValue ? = null ,
12+ override val comparePeriod : ComparePeriod ? = null ,
13+ override val firstDayOfWeek : FirstDayOfWeek ? = null ,
14+ override val orderByMetric : String? = null ,
15+ override val orderDirection : String? = null ,
16+ override val limit : Int? = null ,
17+ override val offset : Int? = null ,
18+ override val responseFields : ResponseFields = ResponseFields .All ,
19+ override val storefrontPlatform : StorefrontPlatform ? = null ,
20+ ) : AbstractReportRequest() {
2321 override fun toRequestInfo () = RequestInfo .createGetRequest(
2422 pathSegments = listOf (
2523 " reports" ,
@@ -28,22 +26,4 @@ data class ReportRequest(
2826 params = toParams(),
2927 responseFields = responseFields,
3028 )
31-
32- private fun toParams (): Map <String , String > {
33- return mutableMapOf<String , String >().apply {
34- startedFrom?.let { put(" startedFrom" , it.toString()) }
35- endedAt?.let { put(" endedAt" , it.toString()) }
36- timeScaleValue?.let { put(" timeScaleValue" , it.toString()) }
37- comparePeriod?.let { put(" comparePeriod" , it.toString()) }
38- firstDayOfWeek?.let { put(" firstDayOfWeek" , it.toString()) }
39- orderByMetric?.let { put(" orderByMetric" , it) }
40- orderDirection?.let { put(" orderDirection" , it) }
41- limit?.let { put(" limit" , it.toString()) }
42- offset?.let { put(" offset" , it.toString()) }
43- storefrontPlatform?.let { put(" storefrontPlatform" , it.toString()) }
44- }.toMap()
45- }
46-
47-
48-
4929}
0 commit comments