#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(uint8_t, FSRetryType) {
    // note: swift strips the leading FS_, so these are just .SESSION_REQUEST etc. there
    FS_SESSION_REQUEST,
    FS_SETTINGS_REQUEST,
    FS_SESSION_BUNDLE_UPLOAD
};

__attribute__((visibility("default")))
@interface FSRetryReason : NSObject

/**
 * Returns the type of retry that is occurring.
 *
 * See @c FSRetryType enum value.
 */
@property (nonatomic, readonly) FSRetryType type;

/**
 * The session id for this retry. If this is a session or setting request, then there will be no session id and the value will be nil.
 */
@property (nonatomic, readonly, nullable, copy) NSString *sessionId;

/**
 * Returns the retry count.
 */
@property (nonatomic, readonly) NSInteger count;

/**
 * The time elapsed since the previous attempt, in seconds.
 */
@property (nonatomic, readonly) NSInteger delay;

/**
 * Returns the http status code of the previous attempt, or -1, if an exception caused the retry.
 */
@property (nonatomic, readonly) NSInteger code;

/**
 * The NSError from the previous attempt, if there was one
 */
@property (nonatomic, readonly, nullable) NSError *error;

@end

NS_ASSUME_NONNULL_END

