GDTCORUploader.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2018 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/GDTCORClock.h>
  18. #import <GoogleDataTransport/GDTCORLifecycle.h>
  19. #import <GoogleDataTransport/GDTCORPrioritizer.h>
  20. #import <GoogleDataTransport/GDTCORTargets.h>
  21. #import <GoogleDataTransport/GDTCORUploadPackage.h>
  22. NS_ASSUME_NONNULL_BEGIN
  23. /** This protocol defines the common interface for uploader implementations. */
  24. @protocol GDTCORUploader <NSObject, GDTCORLifecycleProtocol, GDTCORUploadPackageProtocol>
  25. @required
  26. /** Returns YES if the uploader can make an upload attempt, NO otherwise.
  27. *
  28. * @param conditions The conditions that the upload attempt is likely to occur under.
  29. * @return YES if the uploader can make an upload attempt, NO otherwise.
  30. */
  31. - (BOOL)readyToUploadWithConditions:(GDTCORUploadConditions)conditions;
  32. /** Uploads events to the backend using this specific backend's chosen format.
  33. *
  34. * @param package The event package to upload. Make sure to call -completeDelivery.
  35. */
  36. - (void)uploadPackage:(GDTCORUploadPackage *)package;
  37. @end
  38. NS_ASSUME_NONNULL_END