public class AuthRequestHelper extends Object
Map
s for easy usage in the Retrofit
requests.
Calls that involve server authentication or verification, need a large number of parameters to be sent and require formatting, this class makes it easier.
The available methods are to be use for the authentication, insufficient quality and unsupported phone requests.Constructor and Description |
---|
AuthRequestHelper() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
getImBytes(SimpleImage image)
Creates a JPEG image from the input image and returns its bytes.
|
Map<String,okhttp3.RequestBody> |
makeMapForAuth(QRCodeData data,
DeviceInfo deviceInfo,
AppInfo appInfo)
Same as
makeMapForAuth(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions. |
Map<String,okhttp3.RequestBody> |
makeMapForAuth(QRCodeData data,
Location location,
DeviceInfo deviceInfo,
AppInfo appInfo)
Makes a
RequestBody map for the authentication endpoint. |
Map<String,okhttp3.RequestBody> |
makeMapForInsufficientQuality(QRCodeData data,
DeviceInfo deviceInfo,
AppInfo appInfo)
Same as
makeMapForInsufficientQuality(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions. |
Map<String,okhttp3.RequestBody> |
makeMapForInsufficientQuality(QRCodeData data,
Location location,
DeviceInfo deviceInfo,
AppInfo appInfo)
Makes a
RequestBody map for the sendInsufficientQualityCode endpoint. |
Map<String,okhttp3.RequestBody> |
makeMapForUnsupportedRequest(QRCodeData data,
DeviceInfo deviceInfo,
AppInfo appInfo)
Same as
makeMapForUnsupportedRequest(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions. |
Map<String,okhttp3.RequestBody> |
makeMapForUnsupportedRequest(QRCodeData data,
Location location,
DeviceInfo deviceInfo,
AppInfo appInfo)
Makes a
RequestBody map for the sendUnsupportedRequest endpoint. |
public Map<String,okhttp3.RequestBody> makeMapForAuth(QRCodeData data, DeviceInfo deviceInfo, AppInfo appInfo)
makeMapForAuth(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions.data
- The scan data. Can't be null.deviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public Map<String,okhttp3.RequestBody> makeMapForAuth(QRCodeData data, Location location, DeviceInfo deviceInfo, AppInfo appInfo)
RequestBody
map for the authentication endpoint.data
- The scan data. Can't be null.location
- The location datadeviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public Map<String,okhttp3.RequestBody> makeMapForInsufficientQuality(QRCodeData data, DeviceInfo deviceInfo, AppInfo appInfo)
makeMapForInsufficientQuality(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions.data
- The scan data. Can't be null.deviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public Map<String,okhttp3.RequestBody> makeMapForInsufficientQuality(QRCodeData data, Location location, DeviceInfo deviceInfo, AppInfo appInfo)
RequestBody
map for the sendInsufficientQualityCode endpoint.data
- The scan data. Can't be null.location
- The location data.deviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public Map<String,okhttp3.RequestBody> makeMapForUnsupportedRequest(QRCodeData data, DeviceInfo deviceInfo, AppInfo appInfo)
makeMapForUnsupportedRequest(QRCodeData, Location, DeviceInfo, AppInfo)
but without the location data for the case when the user has disabled his location or has not granted the location permissions.data
- The scan data. Can't be null.deviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public Map<String,okhttp3.RequestBody> makeMapForUnsupportedRequest(QRCodeData data, Location location, DeviceInfo deviceInfo, AppInfo appInfo)
RequestBody
map for the sendUnsupportedRequest endpoint.data
- The scan data. Can't be null.location
- The location datadeviceInfo
- The device information. Can't be null.appInfo
- The application info. Can't be null.public static byte[] getImBytes(SimpleImage image)
image
- The simple image