Subscription Details¶
This scheme describes internal configuration / subscription details that SDK will request by calling /subscription_details
.
Etag
and caching
- The SDK should store the
Etag
value from the response in local storage alongside the cached data. - On subsequent requests the SDK should include cached
Etag
value in theif-none-match
header. - If the configuration hasn't changed, the server will respond with a
304
status code. Otherwise, it will return the updated configuration and a newEtag
that shoul be updated in the storage for the further requests.
Convert from snake_case
While API uses snake_case
for field names, the SDK schemes adhere to a camelCase
convention.
Scheme¶
SubscriptionDetails {
poweredBySticker: PoweredBySticker | null // (1)!
retryCounts: RetryCounts | null // (2)!
operationDelaysSequence: List<OperationDelay> | null // (3)!
}
-
Controls the behavior of the “Powered by Aiuta” label that may be present on some SDK screens (e.g. the progress animation screen).
Defaults
urlIos: null urlAndroid: null isVisible: false
-
Specifies the number of additional attempts if an error occurs on a particular action before the user is shown an error telling them that something went wrong (the user can click the try again button to restart the process).
Defaults
photoUpload: 2 operationStart: 0 operationStatus: 2 resultDownload: 2
-
Sequence of delays before requesting the generation operation status.
If the sequence does not contain a value with an
infinite
mode and ends before a successful result is obtained, the operation will fail with a timeout error, the user will be shown a "something went wrong" error.Defaults
[ { mode: recurring delay: 1 repeat: 4 }, { mode: recurring delay: 0.5 repeat: 20 }, { mode: infinite delay: 3 } ]
Powered By Sticker¶
PoweredBySticker {
urlIos: String | null // (1)!
urlAndroid: String | null // (2)!
isVisible: true | false | null // (3)!
}
-
URL for iOS to open by click on the "powered by" label. If not specified the label interaction is disabled.
Default is
null
and "powered by" label is not interactive. -
URL for Android to open by click on the "powered by" label. If not specified the label interaction is disabled.
Default is
null
and "powered by" label is not interactive. -
The only value to "powered by" label be visible is explicit
true
in the subscription details. In any other case "powered by" is hidden.Default is
false
and "powered by" label is hidden.
Retry Counts¶
RetryCounts {
photoUpload: Int | null // (1)!
operationStart: Int | null // (2)!
operationStatus: Int | null // (3)!
resultDownload: Int | null // (4)!
}
-
Number of retries for photo uploading
2
by default -
Number of network request retries to start try-on operation, has no effect if the server responds with error
0
by default -
Number of network request retries per loop to check operation status, if the server responded, the number of retries will reset in the next loop after the delay in the
operationDelaysSequence
2
by default -
Number of retries to load the generated image
2
by default
Operation Delays¶
OperationDelay {
mode: recurring // (1)!
delay: Double // (2)!
repeat: Int // (3)!
}
-
recurring
delay will be repeated a specifiedrepeat
number of times. -
Delay in seconds before next request the operation status.
-
Number of repeates for the
recurring
delay.
OperationDelay {
mode: infinite // (1)!
delay: Double // (2)!
}
-
infinite
delay will repeat infinitely. -
Delay in seconds before next request the operation status.
Timeout error
If the sequence does not contain a value with an infinite
mode and ends before a successful result is obtained, the operation will fail with a timeout error, the user will be shown a "something went wrong" error.