react-native-iap 15.3.3 → 15.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/HybridRnIap.swift +5 -2
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +10 -6
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +59 -5
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +2 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +14 -0
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +11 -5
- package/nitrogen/generated/android/c++/JPurchase.hpp +8 -0
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +17 -1
- package/nitrogen/generated/android/c++/JRenewalCommitmentInfoIOS.hpp +75 -0
- package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +14 -1
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +8 -0
- package/nitrogen/generated/android/c++/JSubscriptionBillingPlanTypeIOS.hpp +61 -0
- package/nitrogen/generated/android/c++/JTransactionCommitmentInfoIOS.hpp +69 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_NitroRequestPurchaseIos.hpp +2 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalCommitmentInfoIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalCommitmentInfoIOS.hpp +74 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalInfoIOS.hpp +5 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TransactionCommitmentInfoIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TransactionCommitmentInfoIOS.hpp +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalCommitmentInfoIOS.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubscriptionBillingPlanTypeIOS.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/TransactionCommitmentInfoIOS.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_RenewalCommitmentInfoIOS.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_TransactionCommitmentInfoIOS.kt +53 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +112 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +24 -13
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +49 -1
- package/nitrogen/generated/ios/swift/RenewalCommitmentInfoIOS.swift +49 -0
- package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +49 -1
- package/nitrogen/generated/ios/swift/SubscriptionBillingPlanTypeIOS.swift +44 -0
- package/nitrogen/generated/ios/swift/TransactionCommitmentInfoIOS.swift +44 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_RenewalCommitmentInfoIOS.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_TransactionCommitmentInfoIOS.swift +18 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +12 -5
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +15 -1
- package/nitrogen/generated/shared/c++/RenewalCommitmentInfoIOS.hpp +101 -0
- package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +15 -2
- package/nitrogen/generated/shared/c++/SubscriptionBillingPlanTypeIOS.hpp +80 -0
- package/nitrogen/generated/shared/c++/TransactionCommitmentInfoIOS.hpp +95 -0
- package/openiap-versions.json +2 -2
- package/package.json +1 -1
- package/src/index.ts +5 -5
- package/src/specs/RnIap.nitro.ts +10 -5
- package/src/types.ts +64 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSubscriptionBillingPlanTypeIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::iap {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "SubscriptionBillingPlanTypeIOS" and the the Kotlin enum "SubscriptionBillingPlanTypeIOS".
|
|
19
|
+
*/
|
|
20
|
+
struct JSubscriptionBillingPlanTypeIOS final: public jni::JavaClass<JSubscriptionBillingPlanTypeIOS> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/SubscriptionBillingPlanTypeIOS;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum SubscriptionBillingPlanTypeIOS.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
SubscriptionBillingPlanTypeIOS toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<SubscriptionBillingPlanTypeIOS>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JSubscriptionBillingPlanTypeIOS> fromCpp(SubscriptionBillingPlanTypeIOS value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case SubscriptionBillingPlanTypeIOS::UNKNOWN:
|
|
46
|
+
static const auto fieldUNKNOWN = clazz->getStaticField<JSubscriptionBillingPlanTypeIOS>("UNKNOWN");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldUNKNOWN);
|
|
48
|
+
case SubscriptionBillingPlanTypeIOS::MONTHLY:
|
|
49
|
+
static const auto fieldMONTHLY = clazz->getStaticField<JSubscriptionBillingPlanTypeIOS>("MONTHLY");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldMONTHLY);
|
|
51
|
+
case SubscriptionBillingPlanTypeIOS::UP_FRONT:
|
|
52
|
+
static const auto fieldUP_FRONT = clazz->getStaticField<JSubscriptionBillingPlanTypeIOS>("UP_FRONT");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldUP_FRONT);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JTransactionCommitmentInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "TransactionCommitmentInfoIOS.hpp"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::iap {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "TransactionCommitmentInfoIOS" and the the Kotlin data class "TransactionCommitmentInfoIOS".
|
|
21
|
+
*/
|
|
22
|
+
struct JTransactionCommitmentInfoIOS final: public jni::JavaClass<JTransactionCommitmentInfoIOS> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/TransactionCommitmentInfoIOS;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct TransactionCommitmentInfoIOS by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
TransactionCommitmentInfoIOS toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldBillingPeriodNumber = clazz->getField<double>("billingPeriodNumber");
|
|
35
|
+
double billingPeriodNumber = this->getFieldValue(fieldBillingPeriodNumber);
|
|
36
|
+
static const auto fieldCommitmentExpiresDate = clazz->getField<double>("commitmentExpiresDate");
|
|
37
|
+
double commitmentExpiresDate = this->getFieldValue(fieldCommitmentExpiresDate);
|
|
38
|
+
static const auto fieldCommitmentPrice = clazz->getField<double>("commitmentPrice");
|
|
39
|
+
double commitmentPrice = this->getFieldValue(fieldCommitmentPrice);
|
|
40
|
+
static const auto fieldTotalBillingPeriods = clazz->getField<double>("totalBillingPeriods");
|
|
41
|
+
double totalBillingPeriods = this->getFieldValue(fieldTotalBillingPeriods);
|
|
42
|
+
return TransactionCommitmentInfoIOS(
|
|
43
|
+
billingPeriodNumber,
|
|
44
|
+
commitmentExpiresDate,
|
|
45
|
+
commitmentPrice,
|
|
46
|
+
totalBillingPeriods
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
+
*/
|
|
54
|
+
[[maybe_unused]]
|
|
55
|
+
static jni::local_ref<JTransactionCommitmentInfoIOS::javaobject> fromCpp(const TransactionCommitmentInfoIOS& value) {
|
|
56
|
+
using JSignature = JTransactionCommitmentInfoIOS(double, double, double, double);
|
|
57
|
+
static const auto clazz = javaClassStatic();
|
|
58
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
|
+
return create(
|
|
60
|
+
clazz,
|
|
61
|
+
value.billingPeriodNumber,
|
|
62
|
+
value.commitmentExpiresDate,
|
|
63
|
+
value.commitmentPrice,
|
|
64
|
+
value.totalBillingPeriods
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro::iap
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
#include "JVariant_NullType_Double.hpp"
|
|
23
23
|
#include <unordered_map>
|
|
24
24
|
#include "JVariant_NullType_Map_String__String_.hpp"
|
|
25
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
26
|
+
#include "JSubscriptionBillingPlanTypeIOS.hpp"
|
|
25
27
|
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
26
28
|
#include "JVariant_NullType_PromotionalOfferJwsInputIOS.hpp"
|
|
27
29
|
#include "JPromotionalOfferJwsInputIOS.hpp"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_RenewalCommitmentInfoIOS.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JVariant_NullType_RenewalCommitmentInfoIOS.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::iap {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JVariant_NullType_RenewalCommitmentInfoIOS to std::variant<nitro::NullType, RenewalCommitmentInfoIOS>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<nitro::NullType, RenewalCommitmentInfoIOS> JVariant_NullType_RenewalCommitmentInfoIOS::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JVariant_NullType_RenewalCommitmentInfoIOS_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `nitro::NullType`
|
|
17
|
+
auto jniValue = static_cast<const JVariant_NullType_RenewalCommitmentInfoIOS_impl::First*>(this)->getValue();
|
|
18
|
+
return nitro::null;
|
|
19
|
+
} else if (isInstanceOf(JVariant_NullType_RenewalCommitmentInfoIOS_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `RenewalCommitmentInfoIOS`
|
|
21
|
+
auto jniValue = static_cast<const JVariant_NullType_RenewalCommitmentInfoIOS_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toCpp();
|
|
23
|
+
}
|
|
24
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
25
|
+
}
|
|
26
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_RenewalCommitmentInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include <NitroModules/Null.hpp>
|
|
14
|
+
#include "RenewalCommitmentInfoIOS.hpp"
|
|
15
|
+
#include <variant>
|
|
16
|
+
#include <NitroModules/JNull.hpp>
|
|
17
|
+
#include "JRenewalCommitmentInfoIOS.hpp"
|
|
18
|
+
#include <string>
|
|
19
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
20
|
+
#include "JSubscriptionBillingPlanTypeIOS.hpp"
|
|
21
|
+
|
|
22
|
+
namespace margelo::nitro::iap {
|
|
23
|
+
|
|
24
|
+
using namespace facebook;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_NullType_RenewalCommitmentInfoIOS".
|
|
28
|
+
*/
|
|
29
|
+
class JVariant_NullType_RenewalCommitmentInfoIOS: public jni::JavaClass<JVariant_NullType_RenewalCommitmentInfoIOS> {
|
|
30
|
+
public:
|
|
31
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_RenewalCommitmentInfoIOS;";
|
|
32
|
+
|
|
33
|
+
static jni::local_ref<JVariant_NullType_RenewalCommitmentInfoIOS> create_0(jni::alias_ref<JNull> value) {
|
|
34
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_RenewalCommitmentInfoIOS(jni::alias_ref<JNull>)>("create");
|
|
35
|
+
return method(javaClassStatic(), value);
|
|
36
|
+
}
|
|
37
|
+
static jni::local_ref<JVariant_NullType_RenewalCommitmentInfoIOS> create_1(jni::alias_ref<JRenewalCommitmentInfoIOS> value) {
|
|
38
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_RenewalCommitmentInfoIOS(jni::alias_ref<JRenewalCommitmentInfoIOS>)>("create");
|
|
39
|
+
return method(javaClassStatic(), value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static jni::local_ref<JVariant_NullType_RenewalCommitmentInfoIOS> fromCpp(const std::variant<nitro::NullType, RenewalCommitmentInfoIOS>& variant) {
|
|
43
|
+
switch (variant.index()) {
|
|
44
|
+
case 0: return create_0(JNull::null());
|
|
45
|
+
case 1: return create_1(JRenewalCommitmentInfoIOS::fromCpp(std::get<1>(variant)));
|
|
46
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[[nodiscard]] std::variant<nitro::NullType, RenewalCommitmentInfoIOS> toCpp() const;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
namespace JVariant_NullType_RenewalCommitmentInfoIOS_impl {
|
|
54
|
+
class First final: public jni::JavaClass<First, JVariant_NullType_RenewalCommitmentInfoIOS> {
|
|
55
|
+
public:
|
|
56
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_RenewalCommitmentInfoIOS$First;";
|
|
57
|
+
|
|
58
|
+
[[nodiscard]] jni::local_ref<JNull> getValue() const {
|
|
59
|
+
static const auto field = javaClassStatic()->getField<JNull>("value");
|
|
60
|
+
return getFieldValue(field);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
class Second final: public jni::JavaClass<Second, JVariant_NullType_RenewalCommitmentInfoIOS> {
|
|
65
|
+
public:
|
|
66
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_RenewalCommitmentInfoIOS$Second;";
|
|
67
|
+
|
|
68
|
+
[[nodiscard]] jni::local_ref<JRenewalCommitmentInfoIOS> getValue() const {
|
|
69
|
+
static const auto field = javaClassStatic()->getField<JRenewalCommitmentInfoIOS>("value");
|
|
70
|
+
return getFieldValue(field);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
} // namespace JVariant_NullType_RenewalCommitmentInfoIOS_impl
|
|
74
|
+
} // namespace margelo::nitro::iap
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
#include <string>
|
|
19
19
|
#include <optional>
|
|
20
20
|
#include "JVariant_NullType_String.hpp"
|
|
21
|
+
#include "RenewalCommitmentInfoIOS.hpp"
|
|
22
|
+
#include "JVariant_NullType_RenewalCommitmentInfoIOS.hpp"
|
|
23
|
+
#include "JRenewalCommitmentInfoIOS.hpp"
|
|
24
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
25
|
+
#include "JSubscriptionBillingPlanTypeIOS.hpp"
|
|
21
26
|
#include "JVariant_NullType_Double.hpp"
|
|
22
27
|
#include "JVariant_NullType_Boolean.hpp"
|
|
23
28
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_TransactionCommitmentInfoIOS.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JVariant_NullType_TransactionCommitmentInfoIOS.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::iap {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JVariant_NullType_TransactionCommitmentInfoIOS to std::variant<nitro::NullType, TransactionCommitmentInfoIOS>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<nitro::NullType, TransactionCommitmentInfoIOS> JVariant_NullType_TransactionCommitmentInfoIOS::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JVariant_NullType_TransactionCommitmentInfoIOS_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `nitro::NullType`
|
|
17
|
+
auto jniValue = static_cast<const JVariant_NullType_TransactionCommitmentInfoIOS_impl::First*>(this)->getValue();
|
|
18
|
+
return nitro::null;
|
|
19
|
+
} else if (isInstanceOf(JVariant_NullType_TransactionCommitmentInfoIOS_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `TransactionCommitmentInfoIOS`
|
|
21
|
+
auto jniValue = static_cast<const JVariant_NullType_TransactionCommitmentInfoIOS_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toCpp();
|
|
23
|
+
}
|
|
24
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
25
|
+
}
|
|
26
|
+
} // namespace margelo::nitro::iap
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_NullType_TransactionCommitmentInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include <NitroModules/Null.hpp>
|
|
14
|
+
#include "TransactionCommitmentInfoIOS.hpp"
|
|
15
|
+
#include <variant>
|
|
16
|
+
#include <NitroModules/JNull.hpp>
|
|
17
|
+
#include "JTransactionCommitmentInfoIOS.hpp"
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::iap {
|
|
20
|
+
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_NullType_TransactionCommitmentInfoIOS".
|
|
25
|
+
*/
|
|
26
|
+
class JVariant_NullType_TransactionCommitmentInfoIOS: public jni::JavaClass<JVariant_NullType_TransactionCommitmentInfoIOS> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_TransactionCommitmentInfoIOS;";
|
|
29
|
+
|
|
30
|
+
static jni::local_ref<JVariant_NullType_TransactionCommitmentInfoIOS> create_0(jni::alias_ref<JNull> value) {
|
|
31
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_TransactionCommitmentInfoIOS(jni::alias_ref<JNull>)>("create");
|
|
32
|
+
return method(javaClassStatic(), value);
|
|
33
|
+
}
|
|
34
|
+
static jni::local_ref<JVariant_NullType_TransactionCommitmentInfoIOS> create_1(jni::alias_ref<JTransactionCommitmentInfoIOS> value) {
|
|
35
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_NullType_TransactionCommitmentInfoIOS(jni::alias_ref<JTransactionCommitmentInfoIOS>)>("create");
|
|
36
|
+
return method(javaClassStatic(), value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static jni::local_ref<JVariant_NullType_TransactionCommitmentInfoIOS> fromCpp(const std::variant<nitro::NullType, TransactionCommitmentInfoIOS>& variant) {
|
|
40
|
+
switch (variant.index()) {
|
|
41
|
+
case 0: return create_0(JNull::null());
|
|
42
|
+
case 1: return create_1(JTransactionCommitmentInfoIOS::fromCpp(std::get<1>(variant)));
|
|
43
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[[nodiscard]] std::variant<nitro::NullType, TransactionCommitmentInfoIOS> toCpp() const;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
namespace JVariant_NullType_TransactionCommitmentInfoIOS_impl {
|
|
51
|
+
class First final: public jni::JavaClass<First, JVariant_NullType_TransactionCommitmentInfoIOS> {
|
|
52
|
+
public:
|
|
53
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_TransactionCommitmentInfoIOS$First;";
|
|
54
|
+
|
|
55
|
+
[[nodiscard]] jni::local_ref<JNull> getValue() const {
|
|
56
|
+
static const auto field = javaClassStatic()->getField<JNull>("value");
|
|
57
|
+
return getFieldValue(field);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
class Second final: public jni::JavaClass<Second, JVariant_NullType_TransactionCommitmentInfoIOS> {
|
|
62
|
+
public:
|
|
63
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/iap/Variant_NullType_TransactionCommitmentInfoIOS$Second;";
|
|
64
|
+
|
|
65
|
+
[[nodiscard]] jni::local_ref<JTransactionCommitmentInfoIOS> getValue() const {
|
|
66
|
+
static const auto field = javaClassStatic()->getField<JTransactionCommitmentInfoIOS>("value");
|
|
67
|
+
return getFieldValue(field);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
} // namespace JVariant_NullType_TransactionCommitmentInfoIOS_impl
|
|
71
|
+
} // namespace margelo::nitro::iap
|
|
@@ -37,7 +37,10 @@ data class NitroRequestPurchaseIos(
|
|
|
37
37
|
val advancedCommerceData: Variant_NullType_String?,
|
|
38
38
|
@DoNotStrip
|
|
39
39
|
@Keep
|
|
40
|
-
val
|
|
40
|
+
val billingPlanType: SubscriptionBillingPlanTypeIOS?,
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
val compactJWS: Variant_NullType_String?,
|
|
41
44
|
@DoNotStrip
|
|
42
45
|
@Keep
|
|
43
46
|
val promotionalOfferJWS: Variant_NullType_PromotionalOfferJwsInputIOS?,
|
|
@@ -55,8 +58,8 @@ data class NitroRequestPurchaseIos(
|
|
|
55
58
|
@Keep
|
|
56
59
|
@Suppress("unused")
|
|
57
60
|
@JvmStatic
|
|
58
|
-
private fun fromCpp(sku: String, andDangerouslyFinishTransactionAutomatically: Variant_NullType_Boolean?, appAccountToken: Variant_NullType_String?, quantity: Variant_NullType_Double?, withOffer: Variant_NullType_Map_String__String_?, advancedCommerceData: Variant_NullType_String?,
|
|
59
|
-
return NitroRequestPurchaseIos(sku, andDangerouslyFinishTransactionAutomatically, appAccountToken, quantity, withOffer, advancedCommerceData,
|
|
61
|
+
private fun fromCpp(sku: String, andDangerouslyFinishTransactionAutomatically: Variant_NullType_Boolean?, appAccountToken: Variant_NullType_String?, quantity: Variant_NullType_Double?, withOffer: Variant_NullType_Map_String__String_?, advancedCommerceData: Variant_NullType_String?, billingPlanType: SubscriptionBillingPlanTypeIOS?, compactJWS: Variant_NullType_String?, promotionalOfferJWS: Variant_NullType_PromotionalOfferJwsInputIOS?, winBackOffer: Variant_NullType_WinBackOfferInputIOS?): NitroRequestPurchaseIos {
|
|
62
|
+
return NitroRequestPurchaseIos(sku, andDangerouslyFinishTransactionAutomatically, appAccountToken, quantity, withOffer, advancedCommerceData, billingPlanType, compactJWS, promotionalOfferJWS, winBackOffer)
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
}
|
|
@@ -28,6 +28,12 @@ data class PurchaseIOS(
|
|
|
28
28
|
val appBundleIdIOS: Variant_NullType_String?,
|
|
29
29
|
@DoNotStrip
|
|
30
30
|
@Keep
|
|
31
|
+
val billingPlanTypeIOS: SubscriptionBillingPlanTypeIOS?,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val commitmentInfoIOS: Variant_NullType_TransactionCommitmentInfoIOS?,
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
31
37
|
val countryCodeIOS: Variant_NullType_String?,
|
|
32
38
|
@DoNotStrip
|
|
33
39
|
@Keep
|
|
@@ -133,8 +139,8 @@ data class PurchaseIOS(
|
|
|
133
139
|
@Keep
|
|
134
140
|
@Suppress("unused")
|
|
135
141
|
@JvmStatic
|
|
136
|
-
private fun fromCpp(advancedCommerceInfoIOS: Variant_NullType_AdvancedCommerceInfoIOS?, appAccountToken: Variant_NullType_String?, appBundleIdIOS: Variant_NullType_String?, countryCodeIOS: Variant_NullType_String?, currencyCodeIOS: Variant_NullType_String?, currencySymbolIOS: Variant_NullType_String?, currentPlanId: Variant_NullType_String?, environmentIOS: Variant_NullType_String?, expirationDateIOS: Variant_NullType_Double?, id: String, ids: Variant_NullType_Array_String_?, isAutoRenewing: Boolean, isUpgradedIOS: Variant_NullType_Boolean?, offerIOS: Variant_NullType_PurchaseOfferIOS?, originalTransactionDateIOS: Variant_NullType_Double?, originalTransactionIdentifierIOS: Variant_NullType_String?, ownershipTypeIOS: Variant_NullType_String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: Variant_NullType_String?, quantity: Double, quantityIOS: Variant_NullType_Double?, reasonIOS: Variant_NullType_String?, reasonStringRepresentationIOS: Variant_NullType_String?, renewalInfoIOS: Variant_NullType_RenewalInfoIOS?, revocationDateIOS: Variant_NullType_Double?, revocationReasonIOS: Variant_NullType_String?, store: IapStore, storefrontCountryCodeIOS: Variant_NullType_String?, subscriptionGroupIdIOS: Variant_NullType_String?, transactionDate: Double, transactionId: String, transactionReasonIOS: Variant_NullType_String?, webOrderLineItemIdIOS: Variant_NullType_String?): PurchaseIOS {
|
|
137
|
-
return PurchaseIOS(advancedCommerceInfoIOS, appAccountToken, appBundleIdIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, currentPlanId, environmentIOS, expirationDateIOS, id, ids, isAutoRenewing, isUpgradedIOS, offerIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, ownershipTypeIOS, platform, productId, purchaseState, purchaseToken, quantity, quantityIOS, reasonIOS, reasonStringRepresentationIOS, renewalInfoIOS, revocationDateIOS, revocationReasonIOS, store, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionDate, transactionId, transactionReasonIOS, webOrderLineItemIdIOS)
|
|
142
|
+
private fun fromCpp(advancedCommerceInfoIOS: Variant_NullType_AdvancedCommerceInfoIOS?, appAccountToken: Variant_NullType_String?, appBundleIdIOS: Variant_NullType_String?, billingPlanTypeIOS: SubscriptionBillingPlanTypeIOS?, commitmentInfoIOS: Variant_NullType_TransactionCommitmentInfoIOS?, countryCodeIOS: Variant_NullType_String?, currencyCodeIOS: Variant_NullType_String?, currencySymbolIOS: Variant_NullType_String?, currentPlanId: Variant_NullType_String?, environmentIOS: Variant_NullType_String?, expirationDateIOS: Variant_NullType_Double?, id: String, ids: Variant_NullType_Array_String_?, isAutoRenewing: Boolean, isUpgradedIOS: Variant_NullType_Boolean?, offerIOS: Variant_NullType_PurchaseOfferIOS?, originalTransactionDateIOS: Variant_NullType_Double?, originalTransactionIdentifierIOS: Variant_NullType_String?, ownershipTypeIOS: Variant_NullType_String?, platform: IapPlatform, productId: String, purchaseState: PurchaseState, purchaseToken: Variant_NullType_String?, quantity: Double, quantityIOS: Variant_NullType_Double?, reasonIOS: Variant_NullType_String?, reasonStringRepresentationIOS: Variant_NullType_String?, renewalInfoIOS: Variant_NullType_RenewalInfoIOS?, revocationDateIOS: Variant_NullType_Double?, revocationReasonIOS: Variant_NullType_String?, store: IapStore, storefrontCountryCodeIOS: Variant_NullType_String?, subscriptionGroupIdIOS: Variant_NullType_String?, transactionDate: Double, transactionId: String, transactionReasonIOS: Variant_NullType_String?, webOrderLineItemIdIOS: Variant_NullType_String?): PurchaseIOS {
|
|
143
|
+
return PurchaseIOS(advancedCommerceInfoIOS, appAccountToken, appBundleIdIOS, billingPlanTypeIOS, commitmentInfoIOS, countryCodeIOS, currencyCodeIOS, currencySymbolIOS, currentPlanId, environmentIOS, expirationDateIOS, id, ids, isAutoRenewing, isUpgradedIOS, offerIOS, originalTransactionDateIOS, originalTransactionIdentifierIOS, ownershipTypeIOS, platform, productId, purchaseState, purchaseToken, quantity, quantityIOS, reasonIOS, reasonStringRepresentationIOS, renewalInfoIOS, revocationDateIOS, revocationReasonIOS, store, storefrontCountryCodeIOS, subscriptionGroupIdIOS, transactionDate, transactionId, transactionReasonIOS, webOrderLineItemIdIOS)
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RenewalCommitmentInfoIOS.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.iap
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "RenewalCommitmentInfoIOS".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class RenewalCommitmentInfoIOS(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val commitmentAutoRenewProductId: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val commitmentAutoRenewStatus: Boolean,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val commitmentRenewalBillingPlanType: SubscriptionBillingPlanTypeIOS,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val commitmentRenewalDate: Double,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val commitmentRenewalPrice: Double
|
|
35
|
+
) {
|
|
36
|
+
/* primary constructor */
|
|
37
|
+
|
|
38
|
+
companion object {
|
|
39
|
+
/**
|
|
40
|
+
* Constructor called from C++
|
|
41
|
+
*/
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
@Suppress("unused")
|
|
45
|
+
@JvmStatic
|
|
46
|
+
private fun fromCpp(commitmentAutoRenewProductId: String, commitmentAutoRenewStatus: Boolean, commitmentRenewalBillingPlanType: SubscriptionBillingPlanTypeIOS, commitmentRenewalDate: Double, commitmentRenewalPrice: Double): RenewalCommitmentInfoIOS {
|
|
47
|
+
return RenewalCommitmentInfoIOS(commitmentAutoRenewProductId, commitmentAutoRenewStatus, commitmentRenewalBillingPlanType, commitmentRenewalDate, commitmentRenewalPrice)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -22,6 +22,9 @@ data class RenewalInfoIOS(
|
|
|
22
22
|
val autoRenewPreference: Variant_NullType_String?,
|
|
23
23
|
@DoNotStrip
|
|
24
24
|
@Keep
|
|
25
|
+
val commitmentInfo: Variant_NullType_RenewalCommitmentInfoIOS?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
25
28
|
val expirationReason: Variant_NullType_String?,
|
|
26
29
|
@DoNotStrip
|
|
27
30
|
@Keep
|
|
@@ -40,6 +43,9 @@ data class RenewalInfoIOS(
|
|
|
40
43
|
val priceIncreaseStatus: Variant_NullType_String?,
|
|
41
44
|
@DoNotStrip
|
|
42
45
|
@Keep
|
|
46
|
+
val renewalBillingPlanType: SubscriptionBillingPlanTypeIOS?,
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
43
49
|
val renewalDate: Variant_NullType_Double?,
|
|
44
50
|
@DoNotStrip
|
|
45
51
|
@Keep
|
|
@@ -61,8 +67,8 @@ data class RenewalInfoIOS(
|
|
|
61
67
|
@Keep
|
|
62
68
|
@Suppress("unused")
|
|
63
69
|
@JvmStatic
|
|
64
|
-
private fun fromCpp(autoRenewPreference: Variant_NullType_String?, expirationReason: Variant_NullType_String?, gracePeriodExpirationDate: Variant_NullType_Double?, isInBillingRetry: Variant_NullType_Boolean?, jsonRepresentation: Variant_NullType_String?, pendingUpgradeProductId: Variant_NullType_String?, priceIncreaseStatus: Variant_NullType_String?, renewalDate: Variant_NullType_Double?, renewalOfferId: Variant_NullType_String?, renewalOfferType: Variant_NullType_String?, willAutoRenew: Boolean): RenewalInfoIOS {
|
|
65
|
-
return RenewalInfoIOS(autoRenewPreference, expirationReason, gracePeriodExpirationDate, isInBillingRetry, jsonRepresentation, pendingUpgradeProductId, priceIncreaseStatus, renewalDate, renewalOfferId, renewalOfferType, willAutoRenew)
|
|
70
|
+
private fun fromCpp(autoRenewPreference: Variant_NullType_String?, commitmentInfo: Variant_NullType_RenewalCommitmentInfoIOS?, expirationReason: Variant_NullType_String?, gracePeriodExpirationDate: Variant_NullType_Double?, isInBillingRetry: Variant_NullType_Boolean?, jsonRepresentation: Variant_NullType_String?, pendingUpgradeProductId: Variant_NullType_String?, priceIncreaseStatus: Variant_NullType_String?, renewalBillingPlanType: SubscriptionBillingPlanTypeIOS?, renewalDate: Variant_NullType_Double?, renewalOfferId: Variant_NullType_String?, renewalOfferType: Variant_NullType_String?, willAutoRenew: Boolean): RenewalInfoIOS {
|
|
71
|
+
return RenewalInfoIOS(autoRenewPreference, commitmentInfo, expirationReason, gracePeriodExpirationDate, isInBillingRetry, jsonRepresentation, pendingUpgradeProductId, priceIncreaseStatus, renewalBillingPlanType, renewalDate, renewalOfferId, renewalOfferType, willAutoRenew)
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubscriptionBillingPlanTypeIOS.kt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SubscriptionBillingPlanTypeIOS.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.iap
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "SubscriptionBillingPlanTypeIOS".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class SubscriptionBillingPlanTypeIOS(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNKNOWN(0),
|
|
20
|
+
MONTHLY(1),
|
|
21
|
+
UP_FRONT(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/TransactionCommitmentInfoIOS.kt
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TransactionCommitmentInfoIOS.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.iap
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "TransactionCommitmentInfoIOS".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class TransactionCommitmentInfoIOS(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val billingPeriodNumber: Double,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val commitmentExpiresDate: Double,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val commitmentPrice: Double,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val totalBillingPeriods: Double
|
|
32
|
+
) {
|
|
33
|
+
/* primary constructor */
|
|
34
|
+
|
|
35
|
+
companion object {
|
|
36
|
+
/**
|
|
37
|
+
* Constructor called from C++
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress("unused")
|
|
42
|
+
@JvmStatic
|
|
43
|
+
private fun fromCpp(billingPeriodNumber: Double, commitmentExpiresDate: Double, commitmentPrice: Double, totalBillingPeriods: Double): TransactionCommitmentInfoIOS {
|
|
44
|
+
return TransactionCommitmentInfoIOS(billingPeriodNumber, commitmentExpiresDate, commitmentPrice, totalBillingPeriods)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_RenewalCommitmentInfoIOS.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.iap
|
|
9
|
+
|
|
10
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
11
|
+
import com.margelo.nitro.core.NullType
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the TypeScript variant "NullType | RenewalCommitmentInfoIOS".
|
|
15
|
+
*/
|
|
16
|
+
@Suppress("ClassName")
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
sealed class Variant_NullType_RenewalCommitmentInfoIOS {
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
data class First(@DoNotStrip val value: NullType): Variant_NullType_RenewalCommitmentInfoIOS()
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
data class Second(@DoNotStrip val value: RenewalCommitmentInfoIOS): Variant_NullType_RenewalCommitmentInfoIOS()
|
|
23
|
+
|
|
24
|
+
val isFirst: Boolean
|
|
25
|
+
get() = this is First
|
|
26
|
+
val isSecond: Boolean
|
|
27
|
+
get() = this is Second
|
|
28
|
+
|
|
29
|
+
fun asFirstOrNull(): NullType? {
|
|
30
|
+
val value = (this as? First)?.value ?: return null
|
|
31
|
+
return value
|
|
32
|
+
}
|
|
33
|
+
fun asSecondOrNull(): RenewalCommitmentInfoIOS? {
|
|
34
|
+
val value = (this as? Second)?.value ?: return null
|
|
35
|
+
return value
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
inline fun <R> match(first: (NullType) -> R, second: (RenewalCommitmentInfoIOS) -> R): R {
|
|
39
|
+
return when (this) {
|
|
40
|
+
is First -> first(value)
|
|
41
|
+
is Second -> second(value)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
companion object {
|
|
46
|
+
@JvmStatic
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
fun create(value: NullType): Variant_NullType_RenewalCommitmentInfoIOS = First(value)
|
|
49
|
+
@JvmStatic
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
fun create(value: RenewalCommitmentInfoIOS): Variant_NullType_RenewalCommitmentInfoIOS = Second(value)
|
|
52
|
+
}
|
|
53
|
+
}
|