LineSDKLoginManagerParameters.swift 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // LineSDKLoginManagerParameters.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 LineSDKLoginManagerParameters: NSObject {
  23. var _value: LoginManager.Parameters
  24. public override init() {
  25. _value = LoginManager.Parameters()
  26. }
  27. init(_ value: LoginManager.Parameters) { _value = value }
  28. public var onlyWebLogin: Bool {
  29. get { return _value.onlyWebLogin }
  30. set { _value.onlyWebLogin = newValue }
  31. }
  32. public var botPromptStyle: LineSDKLoginManagerBotPrompt? {
  33. get { return _value.botPromptStyle.map(LineSDKLoginManagerBotPrompt.init) }
  34. set { _value.botPromptStyle = newValue?._value }
  35. }
  36. public var promptBotID: String? {
  37. get { return _value.promptBotID }
  38. set { _value.promptBotID = newValue }
  39. }
  40. public var initialWebAuthenticationMethod: LineSDKLoginManagerWebAuthenticationMethod {
  41. get { return LineSDKLoginManagerWebAuthenticationMethod(_value.initialWebAuthenticationMethod) }
  42. set { _value.initialWebAuthenticationMethod = newValue._value }
  43. }
  44. public var preferredWebPageLanguage: String? {
  45. get { return _value.preferredWebPageLanguage?.rawValue }
  46. set { _value.preferredWebPageLanguage = newValue.map { .init(rawValue: $0) } }
  47. }
  48. public var IDTokenNonce: String? {
  49. get { return _value.IDTokenNonce }
  50. set { _value.IDTokenNonce = newValue }
  51. }
  52. }
  53. @objcMembers
  54. public class LineSDKLoginManagerBotPrompt: NSObject {
  55. let _value: LoginManager.BotPrompt
  56. init(_ value: LoginManager.BotPrompt) { _value = value }
  57. public static let normal = LineSDKLoginManagerBotPrompt(.normal)
  58. public static let aggressive = LineSDKLoginManagerBotPrompt(.aggressive)
  59. public var rawValue: String { return _value.rawValue }
  60. }
  61. @objcMembers
  62. public class LineSDKLoginManagerWebAuthenticationMethod: NSObject {
  63. let _value: LoginManager.WebAuthenticationMethod
  64. init(_ value: LoginManager.WebAuthenticationMethod) { _value = value }
  65. public static let email = LineSDKLoginManagerWebAuthenticationMethod(.email)
  66. public static let qrCode = LineSDKLoginManagerWebAuthenticationMethod(.qrCode)
  67. public var rawValue: String { return _value.rawValue }
  68. }