ConfigParameters.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // ConfigParameters.h
  3. // CardinalEMVCoSDK
  4. //
  5. // Copyright © 2018 Cardinal Commerce. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #if TARGET_OS_TV
  9. #define PARAM_KEY_TV_OS_FIELDS @"TV_OS_FIELDS"
  10. #define PARAM_VALUE_I_FIELDS @"I_FIELDS"
  11. #define PARAM_VALUE_D_FIELDS @"D_FIELDS"
  12. #endif
  13. NS_ASSUME_NONNULL_BEGIN
  14. /**
  15. * The ConfigParameters class represent the configuration parameters that are required by the 3DS SDK for initialization.
  16. */
  17. @interface ConfigParameters : NSObject
  18. /**
  19. * The addParam method adds a configuration parameter either to the specified group.
  20. * @param group Group to which the configuration parameter is to be added.
  21. * @param paramName Name of the configuration parameter.
  22. * @param paramValue Value of the configuration parameter.
  23. * @param error Reference to NSError Object to handle exceptions.
  24. */
  25. - (BOOL) addParamToGroup: (NSString *) group
  26. withParamName: (nonnull NSString*) paramName
  27. paramValue: (NSString*) paramValue
  28. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(addParam(_:name:value:));
  29. /**
  30. * The addParam method adds a configuration parameter either to the specified group.
  31. * @param group Group to which the configuration parameter is to be added.
  32. * @param paramName Name of the configuration parameter.
  33. * @param error Reference to NSError Object to handle exceptions.
  34. */
  35. - (BOOL) addParamToGroup: (NSString *) group
  36. withParamName: (nonnull NSString*) paramName
  37. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(addParam(_:name:));
  38. /**
  39. * The addParam method adds a configuration parameter either to the default group.
  40. * @param paramName Name of the configuration parameter.
  41. * @param paramValue Value of the configuration parameter.
  42. * @param error Reference to NSError Object to handle exceptions.
  43. */
  44. - (BOOL) addParamWithParamName: (nonnull NSString*) paramName
  45. paramValue: (nonnull NSString*) paramValue
  46. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(addParam(_:value:));
  47. /**
  48. * The addParam method adds a configuration parameter either to the default group.
  49. * @param paramName Name of the configuration parameter.
  50. * @param error Reference to NSError Object to handle exceptions.
  51. */
  52. - (BOOL) addParamWithParamName: (nonnull NSString*) paramName
  53. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(addParam(_:));
  54. /**
  55. * The getParamValue method returns a configuration parameter’s value either from the specified group.
  56. * @param group Group to which the configuration parameter is added.
  57. * @param paramName Name of the configuration parameter.
  58. * @param error Reference to NSError Object to handle exceptions.
  59. * @return NSString
  60. */
  61. - (nullable NSString *) getParamValueFromGroup: (NSString*) group
  62. withParamName: (nonnull NSString*) paramName
  63. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(getParam(_:name:));
  64. /**
  65. * The getParamValue method returns a configuration parameter’s value either from default group.
  66. * @param paramName Name of the configuration parameter.
  67. * @param error Reference to NSError Object to handle exceptions.
  68. * @return NSString
  69. */
  70. - (nullable NSString *) getParamValueWithParamName: (nonnull NSString*) paramName
  71. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(getParam(_:));
  72. /**
  73. * The removeParam method returns the name of the parameter that it removed.
  74. * @param group Group to which the configuration parameter is added.
  75. * @param paramName Name of the configuration parameter.
  76. * @param error Reference to NSError Object to handle exceptions.
  77. * @return NSString
  78. */
  79. - (nullable NSString *) removeParamFromGroup: (NSString*) group
  80. withParamName: (nonnull NSString*) paramName
  81. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(removeParam(_:name:));
  82. /**
  83. * The removeParam method returns the name of the parameter that it removed.
  84. * @param paramName Name of the configuration parameter.
  85. * @param error Reference to NSError Object to handle exceptions.
  86. * @return NSString
  87. */
  88. - (nullable NSString *) removeParamWithParamName: (nonnull NSString*) paramName
  89. error: (NSError **)error __attribute__((swift_error(nonnull_error))) NS_SWIFT_NAME(removeParam(_:));
  90. @end
  91. NS_ASSUME_NONNULL_END