LineSDKMessagingResponse.swift 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // LineSDKMessagingResponse.swift
  3. //
  4. // Copyright (c) 2016-present, LY Corporation. All rights reserved.
  5. //
  6. // You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
  7. // copy and distribute this software in source code or binary form for use
  8. // in connection with the web services and APIs provided by LY Corporation.
  9. //
  10. // As with any software that integrates with the LY Corporation platform, your use of this software
  11. // is subject to the LINE Developers Agreement [http://terms2.line.me/LINE_Developers_Agreement].
  12. // This copyright notice shall be included in all copies or substantial portions of the software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  15. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  17. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  18. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. //
  21. @objcMembers
  22. public class LineSDKMessageSendingStatus: NSObject {
  23. let _value: MessageSendingStatus
  24. init(_ value: MessageSendingStatus) { _value = value }
  25. public static let statusOK = LineSDKMessageSendingStatus(.ok)
  26. public static let statusDiscarded = LineSDKMessageSendingStatus(.discarded)
  27. public func isEqualToStatus(_ another: LineSDKMessageSendingStatus) -> Bool {
  28. return _value == another._value
  29. }
  30. public var isOK: Bool {
  31. return _value.isOK
  32. }
  33. var unwrapped: MessageSendingStatus { return _value }
  34. }
  35. @objcMembers
  36. public class LineSDKPostSendMessagesResponse: NSObject {
  37. let _value: PostSendMessagesRequest.Response
  38. init(_ value: PostSendMessagesRequest.Response) { _value = value }
  39. public var status: LineSDKMessageSendingStatus { return .init(_value.status) }
  40. }
  41. @objcMembers
  42. public class LineSDKPostMultisendMessagesResponseSendingResult: NSObject {
  43. let _value: PostMultisendMessagesRequest.Response.SendingResult
  44. init(_ value: PostMultisendMessagesRequest.Response.SendingResult) { _value = value }
  45. public var to: String { return _value.to }
  46. public var status: LineSDKMessageSendingStatus { return .init(_value.status) }
  47. }
  48. @objcMembers
  49. public class LineSDKPostMultisendMessagesResponse: NSObject {
  50. let _value: PostMultisendMessagesRequest.Response
  51. init(_ value: PostMultisendMessagesRequest.Response) { _value = value }
  52. public var result: [LineSDKPostMultisendMessagesResponseSendingResult] { return _value.results.map { .init($0) } }
  53. }