FPRSessionDetails.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. /* List of options the session cares about. */
  16. typedef NS_OPTIONS(NSUInteger, FPRSessionOptions) {
  17. FPRSessionOptionsNone = 0,
  18. FPRSessionOptionsGauges = (1 << 0),
  19. FPRSessionOptionsEvents = (1 << 1),
  20. };
  21. /* Class that contains the details of a session including the sessionId and session options. */
  22. @interface FPRSessionDetails : NSObject
  23. /* The sessionId with which the session details is initialized with. */
  24. @property(nonatomic, nonnull, readonly) NSString *sessionId;
  25. /* List of options enabled for the session. */
  26. @property(nonatomic, readonly) FPRSessionOptions options;
  27. /* Length of the session in minutes. */
  28. @property(nonatomic, readonly) NSUInteger sessionLengthInMinutes;
  29. /**
  30. * Creates an instance of FPRSessionDetails with the provided sessionId and the list of available
  31. * options.
  32. *
  33. * @param sessionId Session Id for which the object is created.
  34. * @param options Options enabled for the session.
  35. * @return Instance of the object FPRSessionDetails.
  36. */
  37. - (nonnull instancetype)initWithSessionId:(nonnull NSString *)sessionId
  38. options:(FPRSessionOptions)options NS_DESIGNATED_INITIALIZER;
  39. - (nullable instancetype)init NS_UNAVAILABLE;
  40. /**
  41. * Checks and returns if the session is verbose.
  42. *
  43. * @return Return YES if verbose, NO otherwise.
  44. */
  45. - (BOOL)isVerbose;
  46. @end