All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.ecwid.apiclient.v3.converter.FetchedExtrafieldConfig.kt Maven / Gradle / Ivy
package com.ecwid.apiclient.v3.converter
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
import com.ecwid.apiclient.v3.dto.profile.request.UpdatedExtrafieldConfig
import com.ecwid.apiclient.v3.dto.profile.result.FetchedExtrafieldConfig
fun FetchedExtrafieldConfig.toUpdated(): UpdatedExtrafieldConfig {
return UpdatedExtrafieldConfig(
key = key,
title = title,
type = type,
textPlaceholder = textPlaceholder,
tip = tip,
options = options?.map(FetchedExtrafieldConfig.FetchedExtrafieldOptionConfig::toUpdated),
value = value,
available = available,
required = required,
checkoutDisplaySection = checkoutDisplaySection,
orderDetailsDisplaySection = orderDetailsDisplaySection,
showForCountry = showForCountry,
showForPaymentMethodIds = showForPaymentMethodIds,
showForShippingMethodIds = showForShippingMethodIds,
showInInvoice = showInInvoice,
showInNotifications = showInNotifications,
orderBy = orderBy,
surchargeType = surchargeType,
surchargeTaxable = surchargeTaxable,
showZeroSurchargeInTotal = showZeroSurchargeInTotal,
surchargeShortName = surchargeShortName?.toUpdated(),
titleTranslated = if (titleTranslated != null) LocalizedValueMap(titleTranslated) else null,
textPlaceholderTranslated = if (textPlaceholderTranslated != null) LocalizedValueMap(textPlaceholderTranslated) else null,
tipTranslated = if (tipTranslated != null) LocalizedValueMap(tipTranslated) else null,
valueTranslated = if (valueTranslated != null) LocalizedValueMap(valueTranslated) else null,
saveToCustomerProfile = saveToCustomerProfile,
)
}
fun FetchedExtrafieldConfig.FetchedExtrafieldOptionConfig.toUpdated(): UpdatedExtrafieldConfig.UpdatedExtrafieldOptionConfig {
return UpdatedExtrafieldConfig.UpdatedExtrafieldOptionConfig(
title = title,
subtitle = subtitle,
surcharge = surcharge,
titleTranslated = if (titleTranslated != null) LocalizedValueMap(titleTranslated) else null,
subtitleTranslated = if (subtitleTranslated != null) LocalizedValueMap(subtitleTranslated) else null
)
}
fun FetchedExtrafieldConfig.FetchedExtrafieldSurchargeConfig.toUpdated(): UpdatedExtrafieldConfig.UpdatedExtrafieldSurchargeConfig {
return UpdatedExtrafieldConfig.UpdatedExtrafieldSurchargeConfig(
name = name,
showSurchargePercentValue = showSurchargePercentValue,
nameTranslated = if (nameTranslated != null) LocalizedValueMap(nameTranslated) else null
)
}