GiphyRequest.swift 409 B

1234567891011121314151617181920212223242526
  1. //
  2. // GiphyRequest.swift
  3. // LiveLikeGiphyChallenge
  4. //
  5. // Created by Arbnor Tefiki on 6.2.22.
  6. //
  7. import Foundation
  8. struct GiphyRequest {
  9. enum FetchType: String {
  10. case search
  11. case trending
  12. }
  13. let limit: Int = 20
  14. var searchTerm: String
  15. var requestType: FetchType
  16. var page: Int
  17. var offset: Int {
  18. return page * limit
  19. }
  20. var urlPath: String {
  21. return requestType.rawValue
  22. }
  23. }