GDTCORStoredEvent.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import <GoogleDataTransport/GDTCORDataFuture.h>
  18. #import <GoogleDataTransport/GDTCOREvent.h>
  19. @class GDTCOREvent;
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface GDTCORStoredEvent : NSObject <NSSecureCoding>
  22. /** The data future representing the original event's transport bytes. */
  23. @property(readonly, nonatomic) GDTCORDataFuture *dataFuture;
  24. /** The mapping identifier, to allow backends to map the transport bytes to a proto. */
  25. @property(readonly, nonatomic) NSString *mappingID;
  26. /** The identifier for the backend this event will eventually be sent to. */
  27. @property(readonly, nonatomic) NSNumber *target;
  28. /** The quality of service tier this event belongs to. */
  29. @property(readonly, nonatomic) GDTCOREventQoS qosTier;
  30. /** The clock snapshot at the time of the event. */
  31. @property(readonly, nonatomic) GDTCORClock *clockSnapshot;
  32. /** A dictionary provided to aid prioritizers by allowing the passing of arbitrary data.
  33. *
  34. * @note Ensure that custom classes in this dict implement NSSecureCoding to prevent loss of data.
  35. */
  36. @property(readonly, nullable, nonatomic) NSDictionary *customPrioritizationParams;
  37. /** Initializes a stored event with the given URL and event.
  38. *
  39. * @param event The event this stored event represents.
  40. * @param dataFuture The dataFuture this event represents.
  41. * @return An instance of this class.
  42. */
  43. - (instancetype)initWithEvent:(GDTCOREvent *)event dataFuture:(GDTCORDataFuture *)dataFuture;
  44. @end
  45. NS_ASSUME_NONNULL_END